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
Rotate the png with GD.
private function rotate_png_with_gd($path, $orientation) { $image = $this->rotate_gd(imagecreatefrompng($path), $orientation); imagesavealpha($image, true); imagealphablending($image, true); imagepng($image, $path, 100); imagedestroy($image); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function image_rotate_gd()\n\t{\n\t\t// Create the image handle\n\t\tif ( ! ($src_img = $this->image_create_gd()))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Set the background color\n\t\t// This won't work with transparent PNG files so we are\n\t\t// going to have to figure out how to determine the color\n\t\t// of the alpha channel in a future release.\n\n\t\t$white = imagecolorallocate($src_img, 255, 255, 255);\n\n\t\t// Rotate it!\n\t\t$dst_img = imagerotate($src_img, $this->rotation_angle, $white);\n\n\t\t// Show the image\n\t\tif ($this->dynamic_output === TRUE)\n\t\t{\n\t\t\t$this->image_display_gd($dst_img);\n\t\t}\n\t\telseif ( ! $this->image_save_gd($dst_img)) // ... or save it\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Kill the file handles\n\t\timagedestroy($dst_img);\n\t\timagedestroy($src_img);\n\n\t\tchmod($this->full_dst_path, $this->file_permissions);\n\n\t\treturn TRUE;\n\t}", "function _rotateImageGD2($file, $desfile, $degrees, $imgobj) {\r\n // GD can only handle JPG & PNG images\r\n if ($imgobj->_type !== \"jpg\" && $imgobj->_type !== \"jpeg\" && $imgobj->_type !== \"png\" && $imgobj->_type !== \"gif\") {\r\n return false;\r\n }\r\n if ($imgobj->_type == \"gif\" && !function_exists(\"imagecreatefromgif\")) {\r\n \treturn false;\r\n }\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n $src_img = @imagecreatefromjpeg($file);\r\n } else if ($imgobj->_type == \"png\") {\r\n $src_img = @imagecreatefrompng($file);\r\n \t$dst_img = imagecreatetruecolor($imgobj->_size[0],$imgobj->_size[1]);\r\n\t\t\t$img_white = imagecolorallocate($dst_img, 255, 255, 255); // set background to white\r\n\t\t\t$img_return = imagefill($dst_img, 0, 0, $img_white);\r\n\t\t\timagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $imgobj->_size[0], $imgobj->_size[1], $imgobj->_size[0], $imgobj->_size[1]);\r\n\t\t\t$src_img = $dst_img;\r\n } else {\r\n \t$src_img = @imagecreatefromgif($file);\r\n \t$dst_img = imagecreatetruecolor($imgobj->_size[0],$imgobj->_size[1]);\r\n\t\t\t$img_white = imagecolorallocate($dst_img, 255, 255, 255); // set background to white\r\n\t\t\t$img_return = imagefill($dst_img, 0, 0, $img_white);\r\n\t\t\timagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $imgobj->_size[0], $imgobj->_size[1], $imgobj->_size[0], $imgobj->_size[1]);\r\n\t\t\t$src_img = $dst_img;\r\n }\r\n if (!$src_img) {\r\n return false;\r\n }\r\n // The rotation routine...\r\n $dst_img = imagerotate($src_img, $degrees, 0);\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n imagejpeg($dst_img, $desfile, $this->_JPEG_quality);\r\n } else if ($imgobj->_type == \"png\") {\r\n imagepng($dst_img, $desfile);\r\n } else {\r\n \timagegif($dst_img, $desfile);\r\n }\r\n imagedestroy($src_img);\r\n imagedestroy($dst_img);\r\n return true;\r\n }", "function RotatedImage($file,$x,$y,$w,$h,$angle)\n{\n $this->Rotate($angle,$x,$y);\n $this->Image($file,$x,$y,$w,$h);\n $this->Rotate(0);\n}", "function _rotateImageGD1($file, $desfile, $degrees, $imgobj) {\r\n // GD can only handle JPG & PNG images\r\n if ($imgobj->_type !== \"jpg\" && $imgobj->_type !== \"jpeg\" && $imgobj->_type !== \"png\") {\r\n return false;\r\n }\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n $src_img = imagecreatefromjpeg($file);\r\n } else {\r\n $src_img = imagecreatefrompng($file);\r\n }\r\n if (!$src_img) {\r\n return false;\r\n }\r\n // The rotation routine...\r\n $dst_img = imagerotate($src_img, $degrees, 0);\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n imagejpeg($dst_img, $desfile, $this->_JPEG_quality);\r\n } else {\r\n imagepng($dst_img, $desfile);\r\n }\r\n imagedestroy($src_img);\r\n imagedestroy($dst_img);\r\n return true; \r\n }", "function image_rotate()\n\t{\n\t\t// Allowed rotation values\n\t\t\n\t\t$degs = array(90, 180, 270, 'vrt', 'hor');\t\n\t\n\t\t\tif ($this->rotation == '' OR ! in_array($this->rotation, $degs))\n\t\t\t{\n\t\t\t$this->set_error('imglib_rotation_angle_required');\n\t\t\treturn FALSE;\t\t\t\n\t\t\t}\n\t\n\t\t/** -------------------------------------\n\t\t/** Reassign the width and height\n\t\t/** -------------------------------------*/\n\t\n\t\tif ($this->rotation == 90 OR $this->rotation == 270)\n\t\t{\n\t\t\t$this->dst_width\t= $this->src_height;\n\t\t\t$this->dst_height\t= $this->src_width;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->dst_width\t= $this->src_width;\n\t\t\t$this->dst_height\t= $this->src_height;\n\t\t}\n\t\n\t\t/** -------------------------------------\n\t\t/** Choose resizing function\n\t\t/** -------------------------------------*/\n\t\t\n\t\tif ($this->resize_protocol == 'imagemagick' OR $this->resize_protocol == 'netpbm')\n\t\t{\n\t\t\t$protocol = 'image_process_'.$this->resize_protocol;\n\t\t\n\t\t\treturn $this->$protocol('rotate');\n\t\t}\n\t\t\n \t\tif ($this->rotation == 'hor' OR $this->rotation == 'vrt')\n \t\t{\n\t\t\treturn $this->image_mirror_gd();\n \t\t}\n\t\telse\n\t\t{\t\t\n\t\t\treturn $this->image_rotate_gd();\n\t\t}\n\t}", "function rotate($img_name,$rotated_image,$direction){\n\t\t$image = $img_name;\n\t\t$extParts=explode(\".\",$image);\n\t\t$ext=end($extParts);\n\t\t$filename=$rotated_image;\n\t\t//How many degrees you wish to rotate\n\t\t$degrees = 0;\n\t\tif($direction=='R'){\n\t\t\t$degrees = 90;\n\t\t}\n\t\tif($direction=='L'){\n\t\t\t$degrees = -90;\n\t\t}\n\t\t\n\t\tif($ext==\"jpg\" || $ext== \"jpeg\" || $ext==\"JPG\" || $ext== \"JPEG\"){\n\t\t\t$source = imagecreatefromjpeg($image) ;\n\t\t\t$rotate = imagerotate($source, $degrees, 0) ;\n\t\t\timagejpeg($rotate,$filename) ;\n\t\t}\n\t\t\n\t\t\n\t\tif($ext==\"GIF\" || $ext== \"gif\"){\n\t\t\t$source = imagecreatefromgif($image) ;\n\t\t\t$rotate = imagerotate($source, $degrees, 0) ;\n\t\t\timagegif($rotate,$filename) ;\n\t\t\t\n\t\t}\n\t\t\n\t\tif($ext==\"png\" || $ext== \"PNG\"){\n\t\t\t$source = imagecreatefrompng($image) ;\n\t\t\t$rotate = imagerotate($source, $degrees, 0) ;\n\t\t\timagepng($rotate,$filename) ;\n\t\t\t\n\t\t}\n\t\treturn $rotate;\t\n\t\t\n\t}", "function _rotate_image_resource($img, $angle)\n {\n }", "function RotatedImage($file,$x,$y,$w,$h,$angle) {\n\t\t$this->Rotate($angle,$x,$y);\n\t\t$this->Image($file,$x,$y,$w,$h);\n\t\t$this->Rotate(0);\n\t}", "function RotatedImage($file,$x,$y,$w,$h,$angle) {\n\t\t$this->Rotate($angle,$x,$y);\n\t\t$this->Image($file,$x,$y,$w,$h);\n\t\t$this->Rotate(0);\n\t}", "function rotateImage0($img, $imgPath, $suffix, $degrees, $quality, $save)\n{\n // Open the original image.\n $original = imagecreatefromjpeg(\"$imgPath/$img\") or die(\"Error Opening original\");\n list($width, $height, $type, $attr) = getimagesize(\"$imgPath/$img\");\n \n // Resample the image.\n $tempImg = imagecreatetruecolor($width, $height) or die(\"Cant create temp image\");\n imagecopyresized($tempImg, $original, 0, 0, 0, 0, $width, $height, $width, $height) or die(\"Cant resize copy\");\n \n // Rotate the image.\n $rotate = imagerotate($original, $degrees, 0);\n \n // Save.\n if($save)\n {\n // Create the new file name.\n $newNameE = explode(\".\", $img);\n $newName = ''. $newNameE[0] .''. $suffix .'.'. $newNameE[1] .'';\n \n // Save the image.\n imagejpeg($rotate, \"$imgPath/$newName\", $quality) or die(\"Cant save image\");\n }\n \n // Clean up.\n imagedestroy($original);\n imagedestroy($tempImg);\n return true;\n}", "public function Rotate($angle){\n\t\t\t$rgba = \\backbone\\Color::HexToRGBA(\"#FFFFFF\", 0);\n\t\t\t$color = $this->AllocateColor($rgba[0]['r'], $rgba[0]['g'], $rgba[0]['b'], $rgba[0]['alpha']);\n\n\t\t\t$img = new \\backbone\\Image();\n\t\t\t$img->handle = imagerotate($this->handle, $angle, $color);\n\t\t\treturn $img;\n\t\t}", "function rotateImage($param=array())\r\n {\r\n $img = isset($param['src']) ? $param['src'] : false;\r\n $newname= isset($param['newname']) ? $param['newname'] : $img;\r\n $degrees= isset($param['deg']) ? $param['deg'] : false;\r\n $out = false;\r\n \r\n if($img)\r\n {\r\n \r\n switch(exif_imagetype($img)){\r\n \tcase 1:\r\n \t\t//gif\r\n \t\t$destimg = imagecreatefromgif($img);\r\n \t\t$transColor = imagecolorallocatealpha($destimg, 255, 255, 255, 127);\r\n \t\t$rotatedImage = imagerotate($destimg, $degrees, $transColor);\r\n \t\timagesavealpha($rotatedImage, true);\r\n \t\timagegif($rotatedImage, $newname);\r\n \tbreak;\r\n \tcase 2:\r\n \t\t//jpg\r\n \t\t$destimg = imagecreatefromjpeg($img);\r\n \t\t$transColor = imagecolorallocatealpha($destimg, 255, 255, 255, 127);\r\n \t\t$rotatedImage = imagerotate($destimg, $degrees, $transColor);\r\n \t\timagesavealpha($rotatedImage, true);\r\n \t\timagejpeg($rotatedImage, $newname);\r\n \tbreak;\r\n \tcase 3:\r\n \t\t//png\r\n \t\t$destimg = imagecreatefrompng($img);\r\n \t\t$transColor = imagecolorallocatealpha($destimg, 255, 255, 255, 127);\r\n \t\t$rotatedImage = imagerotate($destimg, $degrees, $transColor);\r\n \t\timagesavealpha($rotatedImage, true);\r\n \t\timagepng($rotatedImage, $newname);\r\n \tbreak;\r\n }\r\n \r\n $out = $img;\r\n }\r\n \r\n return $out;\r\n }", "function rotate($src_file, $dest_file, $degrees, $img_meta) {\n if (!zmgGd1xTool::isSupportedType($img_meta['extension'], $src_file)) {\n return false;\n }\n \n if ($img_meta['extension'] == \"jpg\" || $img_meta['extension'] == \"jpeg\") {\n $src_img = imagecreatefromjpeg($src_file);\n } else {\n $src_img = imagecreatefrompng($src_file);\n }\n if (!$src_img) {\n return zmgToolboxPlugin::registerError($src_file, 'GD 1.x: Could not rotate image.');\n }\n\n // The rotation routine...\n $dst_img = imagerotate($src_img, $degrees, 0);\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\n imagejpeg($dst_img, $dest_file, $img_meta['jpeg_qty']);\n } else {\n imagepng($dst_img, $dest_file);\n }\n\n imagedestroy($src_img);\n imagedestroy($dst_img);\n return true;\n }", "function RotatedImage($file,$x,$y,$w,$h,$angle)\n\t{\n\t $this->Rotate($angle,$x,$y);\n\t $this->Image($file,$x,$y,$w,$h);\n\t $this->Rotate(0);\n\t}", "function RotatedImage($file,$x,$y,$w,$h,$angle)\n {\n $this->Rotate($angle,$x,$y);\n $this->Image($file,$x,$y,$w,$h);\n $this->Rotate(0);\n }", "public function image_mirror_gd()\n\t{\n\t\tif ( ! $src_img = $this->image_create_gd())\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t$width = $this->orig_width;\n\t\t$height = $this->orig_height;\n\n\t\tif ($this->rotation_angle === 'hor')\n\t\t{\n\t\t\tfor ($i = 0; $i < $height; $i++)\n\t\t\t{\n\t\t\t\t$left = 0;\n\t\t\t\t$right = $width - 1;\n\n\t\t\t\twhile ($left < $right)\n\t\t\t\t{\n\t\t\t\t\t$cl = imagecolorat($src_img, $left, $i);\n\t\t\t\t\t$cr = imagecolorat($src_img, $right, $i);\n\n\t\t\t\t\timagesetpixel($src_img, $left, $i, $cr);\n\t\t\t\t\timagesetpixel($src_img, $right, $i, $cl);\n\n\t\t\t\t\t$left++;\n\t\t\t\t\t$right--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfor ($i = 0; $i < $width; $i++)\n\t\t\t{\n\t\t\t\t$top = 0;\n\t\t\t\t$bottom = $height - 1;\n\n\t\t\t\twhile ($top < $bottom)\n\t\t\t\t{\n\t\t\t\t\t$ct = imagecolorat($src_img, $i, $top);\n\t\t\t\t\t$cb = imagecolorat($src_img, $i, $bottom);\n\n\t\t\t\t\timagesetpixel($src_img, $i, $top, $cb);\n\t\t\t\t\timagesetpixel($src_img, $i, $bottom, $ct);\n\n\t\t\t\t\t$top++;\n\t\t\t\t\t$bottom--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Show the image\n\t\tif ($this->dynamic_output === TRUE)\n\t\t{\n\t\t\t$this->image_display_gd($src_img);\n\t\t}\n\t\telseif ( ! $this->image_save_gd($src_img)) // ... or save it\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Kill the file handles\n\t\timagedestroy($src_img);\n\n\t\tchmod($this->full_dst_path, $this->file_permissions);\n\n\t\treturn TRUE;\n\t}", "private function rotate_gd($image, $orientation)\n {\n switch ($orientation) {\n case 2:\n $image = imagerotate($image, 180, 0);\n imageflip($image, IMG_FLIP_VERTICAL);\n break;\n\n case 3:\n $image = imagerotate($image, 180, 0);\n break;\n\n case 4:\n $image = imagerotate($image, 180, 0);\n imageflip($image, IMG_FLIP_HORIZONTAL);\n break;\n\n case 5:\n $image = imagerotate($image, -90, 0);\n imageflip($image, IMG_FLIP_HORIZONTAL);\n break;\n\n case 6:\n $image = imagerotate($image, -90, 0);\n break;\n\n case 7:\n $image = imagerotate($image, -90, 0);\n imageflip($image, IMG_FLIP_VERTICAL);\n break;\n\n case 8:\n $image = imagerotate($image, 90, 0);\n break;\n }\n\n return $image;\n }", "function acadp_exif_rotate( $file ){\n\n\tif( ! function_exists( 'exif_read_data' ) ) {\n\t\treturn $file;\n\t}\n\n\t$exif = @exif_read_data( $file['tmp_name'] );\n\t$exif_orient = isset( $exif['Orientation'] ) ? $exif['Orientation'] : 0;\n\t$rotate_image = 0;\n\n\tif( 6 == $exif_orient ) {\n\t\t$rotate_image = 90;\n\t} else if ( 3 == $exif_orient ) {\n\t\t$rotate_image = 180;\n\t} else if ( 8 == $exif_orient ) {\n\t\t$rotate_image = 270;\n\t}\n\n\tif( $rotate_image ) {\n\n\t\tif( class_exists( 'Imagick' ) ) {\n\n\t\t\t$imagick = new Imagick();\n\t\t\t$imagick_pixel = new ImagickPixel();\n\t\t\t$imagick->readImage( $file['tmp_name'] );\n\t\t\t$imagick->rotateImage( $imagick_pixel, $rotate_image );\n\t\t\t$imagick->setImageOrientation( 1 );\n\t\t\t$imagick->writeImage( $file['tmp_name'] );\n\t\t\t$imagick->clear();\n\t\t\t$imagick->destroy();\n\n\t\t} else {\n\n\t\t\t$rotate_image = -$rotate_image;\n\n\t\t\tswitch( $file['type'] ) {\n\t\t\t\tcase 'image/jpeg' :\n\t\t\t\t\tif( function_exists( 'imagecreatefromjpeg' ) ) {\n\t\t\t\t\t\t$source = imagecreatefromjpeg( $file['tmp_name'] );\n\t\t\t\t\t\t$rotate = imagerotate( $source, $rotate_image, 0 );\n\t\t\t\t\t\timagejpeg( $rotate, $file['tmp_name'] );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'image/png' :\n\t\t\t\t\tif( function_exists( 'imagecreatefrompng' ) ) {\n\t\t\t\t\t\t$source = imagecreatefrompng( $file['tmp_name'] );\n\t\t\t\t\t\t$rotate = imagerotate( $source, $rotate_image, 0 );\n\t\t\t\t\t\timagepng( $rotate, $file['tmp_name'] );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'image/gif' :\n\t\t\t\t\tif( function_exists( 'imagecreatefromgif' ) ) {\n\t\t\t\t\t\t$source = imagecreatefromgif( $file['tmp_name'] );\n\t\t\t\t\t\t$rotate = imagerotate( $source, $rotate_image, 0 );\n\t\t\t\t\t\timagegif( $rotate, $file['tmp_name'] );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\treturn $file;\n\n}", "function RotatedImage($file,$x,$y,$w,$h,$bln_rotate)\n\t{\n\t $img_size= getimagesize($file);\n\t \n\t $aspect_y=$h/$img_size[1];\n\t $aspect_x=$w/$img_size[0];\n\t \n\t if ($bln_rotate==1){\n\t\t //Check to see if the image fits better at 90 degrees\n\t\t $aspect_y2=$w/$img_size[1];\n\t\t $aspect_x2=$h/$img_size[0];\n\t\t \n\t\t if($aspect_x<$aspect_y)\n\t\t {\n\t\t \t$aspect1=$aspect_x;\n\t\t }\n\t\t else {\n\t\t \t$aspect1=$aspect_y;\n\t\t }\n\t\t \n\t\t if($aspect_x2<$aspect_y2)\n\t\t {\n\t\t \t$aspect2=$aspect_x2;\n\t\t }\n\t\t else {\n\t\t \t$aspect2=$aspect_y2;\n\t\t }\n\t\t \n\t\t if ($aspect1<$aspect2)\n\t\t {\n\t\t \t$angle=90;\n\t\t \t$y=$y+$h;\n\t\t \t$t=$h;\n\t\t \t$h=$w;\n\t\t \t$w=$t;\n\t\t \t$aspect_y=$aspect_y2;\n\t\t \t$aspect_x=$aspect_x2;\n\t\t }\n\t }\n\t \n\t \n\t \n\t \n\t \tif ($aspect_x>$aspect_y){\n\t \t\t$flt_adjust=$aspect_y;\n\t \t\t$w=$flt_adjust*$img_size[0];\n\t \t\t\n\t \t}\n\t \telse{\n\t \t\t$flt_adjust=$aspect_x;\n\t \t\t$h=$flt_adjust*$img_size[1];\n\t \t}\n\t \n\t \t\n\t \t\n\t $this->Rotate($angle,$x,$y);\n\t $this->Image($file,$x,$y,$w,$h,'JPG');\n\t $this->Rotate(0);\n\t}", "public static function change_image_type(){\n/**\n*\n*This function change the image type like convert png to jpg or bmp or gif\n*\n*/\npublic static function rotate()\n}", "function image_mirror_gd()\n\t{\t\t\n\t\tif ( ! $src_img = $this->image_create_gd())\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t$width = $this->src_width;\n\t\t$height = $this->src_height;\n\n\t\tif ($this->rotation == 'hor')\n\t\t{\n\t\t\tfor ($i = 0; $i < $height; $i++)\n\t\t\t{\t\t \n\t\t\t\t$left = 0; \n\t\t\t\t$right = $width-1; \n\t\n\t\t\t\twhile ($left < $right)\n\t\t\t\t{ \n\t\t\t\t\t$cl = imagecolorat($src_img, $left, $i); \n\t\t\t\t\t$cr = imagecolorat($src_img, $right, $i);\n\t\t\t\t\t\n\t\t\t\t\timagesetpixel($src_img, $left, $i, $cr); \n\t\t\t\t\timagesetpixel($src_img, $right, $i, $cl); \n\t\t\t\t\t\n\t\t\t\t\t$left++; \n\t\t\t\t\t$right--; \n\t\t\t\t} \n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfor ($i = 0; $i < $width; $i++)\n\t\t\t{\t\t \n\t\t\t\t$top = 0; \n\t\t\t\t$bot = $height-1; \n\t\n\t\t\t\twhile ($top < $bot)\n\t\t\t\t{ \n\t\t\t\t\t$ct = imagecolorat($src_img, $i, $top);\n\t\t\t\t\t$cb = imagecolorat($src_img, $i, $bot);\n\t\t\t\t\t\n\t\t\t\t\timagesetpixel($src_img, $i, $top, $cb); \n\t\t\t\t\timagesetpixel($src_img, $i, $bot, $ct); \n\t\t\t\t\t\n\t\t\t\t\t$top++; \n\t\t\t\t\t$bot--; \n\t\t\t\t} \n\t\t\t}\t\t\n\t\t}\n\t\t\n\t\t/** ---------------------------------\n\t\t/** Save the Image\n\t\t/** ---------------------------------*/\n\t\tif ( ! $this->image_save_gd($src_img))\n\t\t{\t\t\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t/** ---------------------------------\n\t\t/** Kill the file handles\n\t\t/** ---------------------------------*/\n\t\timagedestroy($src_img);\n\t\t\n\t\t// Set the file to 777\n\t\t@chmod($this->full_dst_path, FILE_WRITE_MODE);\t\t\t\n\t\t\n\t\treturn TRUE;\n\t}", "function AutoRotateImage($src_image, $ref = false) \n {\n # from a non-ingested image to properly rotate a preview image\n global $imagemagick_path, $camera_autorotation_ext, $camera_autorotation_gm;\n \n if (!isset($imagemagick_path)) \n {\n return false;\n # for the moment, this only works for imagemagick\n # note that it would be theoretically possible to implement this\n # with a combination of exiftool and GD image rotation functions.\n }\n\n # Locate imagemagick.\n $convert_fullpath = get_utility_path(\"im-convert\");\n if ($convert_fullpath == false) \n {\n return false;\n }\n \n $exploded_src = explode('.', $src_image);\n $ext = $exploded_src[count($exploded_src) - 1];\n $triml = strlen($src_image) - (strlen($ext) + 1);\n $noext = substr($src_image, 0, $triml);\n \n if (count($camera_autorotation_ext) > 0 && (!in_array(strtolower($ext), $camera_autorotation_ext))) \n {\n # if the autorotation extensions are set, make sure it is allowed for this extension\n return false;\n }\n\n $exiftool_fullpath = get_utility_path(\"exiftool\");\n $new_image = $noext . '-autorotated.' . $ext;\n \n if ($camera_autorotation_gm) \n {\n $orientation = get_image_orientation($src_image);\n if ($orientation != 0) \n {\n $command = $convert_fullpath . ' ' . escapeshellarg($src_image) . ' -rotate +' . $orientation . ' ' . escapeshellarg($new_image);\n run_command($command);\n }\n $command = $exiftool_fullpath . ' Orientation=1 ' . escapeshellarg($new_image);\n } \n else\n {\n if ($ref != false) \n {\n # use the original file to get the orientation info\n $extension = sql_value(\"select file_extension value from resource where ref=$ref\", '');\n $file = get_resource_path($ref, true, \"\", false, $extension, -1, 1, false, \"\", -1);\n # get the orientation\n $orientation = get_image_orientation($file);\n if ($orientation != 0) \n {\n $command = $convert_fullpath . ' -rotate +' . $orientation . ' ' . escapeshellarg($src_image) . ' ' . escapeshellarg($new_image);\n run_command($command);\n # change the orientation metadata\n $command = $exiftool_fullpath . ' Orientation=1 ' . escapeshellarg($new_image);\n }\n } \n else\n {\n $command = $convert_fullpath . ' ' . escapeshellarg($src_image) . ' -auto-orient ' . escapeshellarg($new_image);\n run_command($command);\n }\n }\n\n if (!file_exists($new_image)) \n {\n return false;\n }\n\n if (!$ref) \n {\n # preserve custom metadata fields with exiftool \n # save the new orientation\n # $new_orientation=run_command($exiftool_fullpath.' -s -s -s -orientation -n '.$new_image);\n $old_orientation = run_command($exiftool_fullpath . ' -s -s -s -orientation -n ' . escapeshellarg($src_image));\n \n $exiftool_copy_command = $exiftool_fullpath . \" -TagsFromFile \" . escapeshellarg($src_image) . \" -all:all \" . escapeshellarg($new_image);\n run_command($exiftool_copy_command);\n \n # If orientation was empty there's no telling if rotation happened, so don't assume.\n # Also, don't go through this step if the old orientation was set to normal\n if ($old_orientation != '' && $old_orientation != 1) \n {\n $fix_orientation = $exiftool_fullpath . ' Orientation=1 -n ' . escapeshellarg($new_image);\n run_command($fix_orientation);\n }\n }\n \n unlink($src_image);\n rename($new_image, $src_image);\n return true; \n }", "function RotatedImage($file, $x, $y, $w, $h, $angle) {\n\t\t$this->Rotate($angle, $x, $y);\n\t\t$this->Image($file, $x, $y, $w, $h);\n\t\t$this->Rotate(0);\n\t}", "public function rotate()\n\t{\n\t\t// Allowed rotation values\n\t\t$degs = array(90, 180, 270, 'vrt', 'hor');\n\n\t\tif ($this->rotation_angle === '' OR ! in_array($this->rotation_angle, $degs))\n\t\t{\n\t\t\t$this->set_error('imglib_rotation_angle_required');\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Reassign the width and height\n\t\tif ($this->rotation_angle === 90 OR $this->rotation_angle === 270)\n\t\t{\n\t\t\t$this->width\t= $this->orig_height;\n\t\t\t$this->height\t= $this->orig_width;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->width\t= $this->orig_width;\n\t\t\t$this->height\t= $this->orig_height;\n\t\t}\n\n\t\t// Choose resizing function\n\t\tif ($this->image_library === 'imagemagick' OR $this->image_library === 'netpbm')\n\t\t{\n\t\t\t$protocol = 'image_process_'.$this->image_library;\n\t\t\treturn $this->$protocol('rotate');\n\t\t}\n\n\t\treturn ($this->rotation_angle === 'hor' OR $this->rotation_angle === 'vrt')\n\t\t\t? $this->image_mirror_gd()\n\t\t\t: $this->image_rotate_gd();\n\t}", "public function test_rotate() {\n\n\t\t$file = DIR_TESTDATA . '/images/gradient-square.jpg';\n\n\t\t$imagick_image_editor = new WP_Image_Editor_Imagick( $file );\n\t\t$imagick_image_editor->load();\n\n\t\t$property = new ReflectionProperty( $imagick_image_editor, 'image' );\n\t\t$property->setAccessible( true );\n\n\t\t$color_top_left = $property->getValue( $imagick_image_editor )->getImagePixelColor( 1, 1 )->getColor();\n\n\t\t$imagick_image_editor->rotate( 180 );\n\n\t\t$this->assertEquals( $color_top_left, $property->getValue( $imagick_image_editor )->getImagePixelColor( 99, 99 )->getColor() );\n\t}", "function RotatedImage($file, $x, $y, $w, $h, $angle) {\n $this->Rotate($angle, $x, $y);\n $this->Image($file, $x, $y, $w, $h);\n $this->Rotate(0);\n }", "function __rotate(&$tmp, $angle, &$color) {\n\n\t\t// skip full loops\n\t\t//\n\t\tif (($angle % 360) == 0) {\n\t\t\treturn true;\n\t\t\t}\n\n\t\t// rectangular rotates are OK\n\t\t//\n\t\tif (($angle % 90) == 0) {\n\n\t\t\t// call `convert -rotate`\n\t\t\t//\n\t\t\t$cmd = $this->__command(\n\t\t\t\t'convert',\n\t\t\t\t\" -rotate {$angle} \"\n\t \t\t\t. escapeshellarg(realpath($tmp->target))\n\t \t\t\t. \" TIF:\"\n\t \t\t\t// ^ \n\t \t\t\t// GIF saving hack\n\t \t\t\t. escapeshellarg(realpath($tmp->target))\n\t \t);\n\t exec($cmd, $result, $errors);\n\t\t\tif ($errors) {\n\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t$w1 = $tmp->image_width;\n\t\t\t$h1 = $tmp->image_height;\n\t\t\t$tmp->image_width = ($angle % 180) ? $h1 : $w1;\n\t\t\t$tmp->image_height = ($angle % 180) ? $w1 : $h1;\n\t\t\treturn true;\n\t\t\t}\n\n\t\treturn false;\n\t\t}", "private function _imgRotate(){\r\n\r\n $result = new stdClass();\r\n $response = 400;\r\n\r\n\r\n if($this->hasLogin()){\r\n\r\n /*\r\n \t*\r\n \t*\r\n \t*\tCheck the method used is POST\r\n \t*\r\n \t*\r\n \t*/\r\n \tif($_SERVER['REQUEST_METHOD'] == 'POST'){\r\n\r\n $url = strtok($_POST['url'], '?');\r\n\r\n $sourcePath = ROOT.'/site/files/_tmp/'.basename($url);\r\n $webPath = WEBROOT.'/site/files/_tmp/'.basename($url);\r\n $degrees = $_POST['direction']=='CCW'?90:-90;\r\n $info = getimagesize($sourcePath);\r\n\r\n switch($info['mime']){\r\n case 'image/png':\r\n $img = imagecreatefrompng($sourcePath);\r\n $rotate = imagerotate($img, $degrees, 0);\r\n imagesavealpha($rotate, true);\r\n imagepng($rotate, $sourcePath);\r\n break;\r\n case 'image/jpeg':\r\n $img = imagecreatefromjpeg($sourcePath);\r\n $rotate = imagerotate($img, $degrees, 0);\r\n imagejpeg($rotate, $sourcePath);\r\n break;\r\n case 'image/gif':\r\n $img = imagecreatefromgif($sourcePath);\r\n $rotate = imagerotate($img, $degrees, 0);\r\n imagegif($rotate, $sourcePath);\r\n break;\r\n default:\r\n $result->error = \"Only PNG, JPEG or GIF images are allowed!\";\r\n $response = 400;\r\n exit;\r\n }\r\n\r\n if(isset($img))imagedestroy($img);\r\n if(isset($rotate))imagedestroy($rotate);\r\n\r\n $info = getimagesize($sourcePath);\r\n $result->url = $webPath;\r\n $result->size = [$info[0],$info[1]];\r\n $response = 200;\r\n } else {\r\n $response = 400;\r\n }\r\n }\r\n\r\n http_response_code($response);\r\n echo json_encode($result);\r\n exit;\r\n\r\n }", "public function rotate()\n {\n // not possible in php?\n }", "public function test_rotate() {\n\t\t$file = DIR_TESTDATA . '/images/one-blue-pixel-100x100.png';\n\n\t\t$imagick_image_editor = new WP_Image_Editor_Imagick( $file );\n\t\t$imagick_image_editor->load();\n\n\t\t$property = new ReflectionProperty( $imagick_image_editor, 'image' );\n\t\t$property->setAccessible( true );\n\n\t\t$color_top_left = $property->getValue( $imagick_image_editor )->getImagePixelColor( 0, 0 )->getColor();\n\n\t\t$imagick_image_editor->rotate( 180 );\n\n\t\t$this->assertSame( $color_top_left, $property->getValue( $imagick_image_editor )->getImagePixelColor( 99, 99 )->getColor() );\n\t}", "function rotateImage($width, $height, $rotation, $quality = 8){\n\t\tif(!is_numeric($quality)){\n\t\t\treturn false;\n\t\t}\n\t\t$quality = max(min($quality, 10), 0) * 10;\n\n\t\t$dataPath = TEMP_PATH . we_base_file::getUniqueId();\n\t\t$_resized_image = we_base_imageEdit::edit_image($this->getElement('data'), $this->getGDType(), $dataPath, $quality, $width, $height, false, true, 0, 0, -1, -1, $rotation);\n\n\t\tif(!$_resized_image[0]){\n\t\t\treturn false;\n\t\t}\n\t\t$this->setElement('data', $dataPath);\n\n\t\t$this->setElement('width', $_resized_image[1], 'attrib');\n\t\t$this->setElement('origwidth', $_resized_image[1], 'attrib');\n\n\t\t$this->setElement('height', $_resized_image[2], 'attrib');\n\t\t$this->setElement('origheight', $_resized_image[2], 'attrib');\n\n\t\t$this->DocChanged = true;\n\t\treturn true;\n\t}", "function rotateImage($width, $height, $rotation, $quality = 8) {\n\t\tif (!is_numeric($quality)) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\tif ($quality > 10) {\n\t\t\t\t$quality = 10;\n\t\t\t} else if ($quality < 0) {\n\t\t\t\t$quality = 0;\n\t\t\t}\n\n\t\t\t$quality = $quality * 10;\n\n\t\t\t$dataPath = TMP_DIR.\"/\".weFile::getUniqueId();\n\t\t\t$_resized_image = we_image_edit::edit_image($this->getElement(\"data\"), $this->getGDType(), $dataPath, $quality, $width, $height, false, true, 0, 0, -1, -1, $rotation);\n\n\t\t\t$this->setElement(\"data\", $dataPath);\n\n\t\t\t$this->setElement(\"width\", $_resized_image[1]);\n\t\t\t$this->setElement(\"origwidth\", $_resized_image[1], \"attrib\");\n\n\t\t\t$this->setElement(\"height\", $_resized_image[2]);\n\t\t\t$this->setElement(\"origheight\", $_resized_image[2], \"attrib\");\n\n\t\t\t$this->DocChanged = true;\n\t\t}\n\t}", "function autoRotateImage($image) {\n $orientation = $image->getImageOrientation();\n\n switch($orientation) {\n case imagick::ORIENTATION_BOTTOMRIGHT:\n $image->rotateimage(\"#000\", 180); // rotate 180 degrees\n break;\n\n case imagick::ORIENTATION_RIGHTTOP:\n $image->rotateimage(\"#000\", 90); // rotate 90 degrees CW\n break;\n\n case imagick::ORIENTATION_LEFTBOTTOM:\n $image->rotateimage(\"#000\", -90); // rotate 90 degrees CCW\n break;\n }\n\n // Now that it's auto-rotated, make sure the EXIF data is correct in case the EXIF gets saved with the image!\n $image->setImageOrientation(imagick::ORIENTATION_TOPLEFT);\n}", "public static function rotate($baseURL, $name, $image)\r\n {\r\n $exif = exif_read_data($image);\r\n\r\n if (array_key_exists('Orientation', $exif))\r\n {\r\n $jpg = imagecreatefromjpeg($image);\r\n $orientation = $exif['Orientation'];\r\n switch ($orientation)\r\n {\r\n case 3:\r\n $jpg = imagerotate($jpg, 180, 0);\r\n break;\r\n case 6:\r\n $jpg = imagerotate($jpg, -90, 0);\r\n break;\r\n case 8:\r\n $jpg = imagerotate($jpg, 90, 0);\r\n break;\r\n default: \t\r\n }\r\n imagejpeg($jpg, $baseURL.'computed/'.$name, 90);\r\n }\r\n\t\t else\r\n\t\t {\r\n\t\t\t copy($image, $baseURL.'computed/'.$name);\r\n\t\t }\r\n }", "public function rotate($angle = 0, $bg_color = array(255, 255, 255)) {\n\t\tif(!$this->image) {\n\t\t\ttrigger_error('The image does not exist or is not readable.', E_USER_WARNING);\n\t\t\treturn false;\n\t\t}\n\n\t\t$angle = (float) $angle;\n\t\t$bg_color = $this->normalizeColor($bg_color);\n\n\t\tif($bg_color === false) {\n\t\t\ttrigger_error('Rotate failed because background color could not be generated. Try sending an array(RRR, GGG, BBB).', E_USER_WARNING);\n\t\t\treturn false;\n\t\t}\n\n\t\t$working_image = imagerotate($this->image, $angle, imagecolorallocate($this->image, $bg_color[0], $bg_color[1], $bg_color[2]));\n\n\t\tif($working_image) {\n\t\t\t$this->image = $working_image;\n\t\t\t$this->width = imagesx($this->image);\n\t\t\t$this->height = imagesy($this->image);\n\t\t\t$this->aspect = $this->width/$this->height;\n\t\t\tif($this->aspect > 1) {\n\t\t\t\t$this->orientation = 'landscape';\n\t\t\t} else if($this->aspect < 1) {\n\t\t\t\t$this->orientation = 'portrait';\n\t\t\t} else {\n\t\t\t\t$this->orientation = 'square';\n\t\t\t}\n\t\t\treturn true;\n\t\t} else {\n\t\t\ttrigger_error('Rotate failed.', E_USER_WARNING);\n\t\t\treturn false;\n\t\t}\n\t}", "function rotate($src_file, $dest_file, $degrees, $img_meta) {\n $fileOut = $src_file . \".1\";\n @copy($src_file, $fileOut);\n \n $path = zmgNetpbmTool::getPath();\n if ($img_meta['extension'] == \"png\") {\n $cmd = $path . \"pngtopnm \" . $src_file . \" | \" . $path . \"pnmrotate \"\n . $degrees . \" | \" . $path . \"pnmtopng > \" . $fileOut;\n } else if ($img_meta['extension'] == \"jpg\" || $img_meta['extension'] == \"jpeg\") {\n $cmd = $path . \"jpegtopnm \" . $src_file . \" | \" . $path . \"pnmrotate \"\n . $degrees . \" | \" . $path . \"ppmtojpeg -quality=\" . $img_meta['jpeg_qty']\n . \" > \" . $fileOut;\n } else if ($img_meta['extension'] == \"gif\") {\n $cmd = $path . \"giftopnm \" . $src_file . \" | \" . $path . \"pnmrotate \"\n . $degrees . \" | \" . $path . \"ppmquant 256 | \" . $path . \"ppmtogif > \"\n . $fileOut;\n } else {\n return zmgToolboxPlugin::registerError($src_file, 'NetPBM: Source file is not an image or image type is not supported.');\n }\n\n $output = $retval = null;\n exec($cmd, $output, $retval);\n if ($retval) {\n return zmgToolboxPlugin::registerError($src_file, 'NetPBM: Could not rotate image: ' . $output);\n }\n $erg = @rename($fileOut, $dest_file);\n\n return true;\n }", "public function rotateBy($rotation) {}", "protected function adjustImageOrientation()\n { \n $exif = @exif_read_data($this->file);\n \n if($exif && isset($exif['Orientation'])) {\n $orientation = $exif['Orientation'];\n \n if($orientation != 1){\n $img = imagecreatefromjpeg($this->file);\n \n $mirror = false;\n $deg = 0;\n \n switch ($orientation) {\n \n case 2:\n $mirror = true;\n break;\n \n case 3:\n $deg = 180;\n break;\n \n case 4:\n $deg = 180;\n $mirror = true; \n break;\n \n case 5:\n $deg = 270;\n $mirror = true; \n break;\n \n case 6:\n $deg = 270;\n break;\n \n case 7:\n $deg = 90;\n $mirror = true; \n break;\n \n case 8:\n $deg = 90;\n break;\n }\n \n if($deg) $img = imagerotate($img, $deg, 0); \n if($mirror) $img = $this->mirrorImage($img);\n \n $this->image = str_replace('.jpg', \"-O$orientation.jpg\", $this->file); \n imagejpeg($img, $this->file, $this->quality);\n }\n }\n }", "protected function _rotateImage(&$photo, $path)\n {\n \t$exif = @exif_read_data($path);\n \t\n \tif (!empty($exif['Orientation']))\n \t\tswitch ($exif['Orientation'])\n \t\t{\n \t\t\tcase 8:\n \t\t\t\t$photo->rotateImageNDegrees(90)->save($path);\n \t\t\t\tbreak;\n \t\t\tcase 3:\n \t\t\t\t$photo->rotateImageNDegrees(180)->save($path);\n \t\t\t\tbreak;\n \t\t\tcase 6:\n \t\t\t\t$photo->rotateImageNDegrees(-90)->save($path);\n \t\t\t\tbreak;\n \t}\n }", "private function rotate_jpg_with_gd($path, $orientation)\n {\n $image = $this->rotate_gd(imagecreatefromjpeg($path), $orientation);\n imagejpeg($image, $path, 100);\n imagedestroy($image);\n }", "private function rotate_gif_with_gd($path, $orientation)\n {\n $image = $this->rotate_gd(imagecreatefromgif($path), $orientation);\n imagegif($image, $path, 100);\n imagedestroy($image);\n }", "private function imagerotate($srcImg, $angle, $bgColor, $ignoreTransparent=0) {\n\t\tfunction rotateX($x, $y, $theta) {\n\t\t\treturn $x * cos($theta) - $y * sin($theta);\n\t\t}\n\t\tfunction rotateY($x, $y, $theta) {\n\t\t\treturn $x * sin($theta) + $y * cos($theta);\n\t\t}\n\n\t\t$srcW = imagesx($srcImg);\n\t\t$srcH = imagesy($srcImg);\n\n\t\t// Normalize angle\n\t\t$angle %= 360;\n\n\t\tif ($angle == 0) {\n\t\t\tif ($ignoreTransparent == 0) {\n\t\t\t\timagesavealpha($srcImg, true);\n\t\t\t}\n\t\t\treturn $srcImg;\n\t\t}\n\n\t\t// Convert the angle to radians\n\t\t$theta = deg2rad($angle);\n\n\t\t$minX = $maxX = $minY = $maxY = 0;\n\t\t\n\t\t// Standard case of rotate\n\t\tif ((abs($angle) == 90) || (abs($angle) == 270)) {\n\t\t\t$width = $srcH;\n\t\t\t$height = $srcW;\n\t\t\tif (($angle == 90) || ($angle == -270)) {\n\t\t\t\t$minX = 0;\n\t\t\t\t$maxX = $width;\n\t\t\t\t$minY = -$height+1;\n\t\t\t\t$maxY = 1;\n\t\t\t} else if (($angle == -90) || ($angle == 270)) {\n\t\t\t\t$minX = -$width+1;\n\t\t\t\t$maxX = 1;\n\t\t\t\t$minY = 0;\n\t\t\t\t$maxY = $height;\n\t\t\t}\n\t\t} else if (abs($angle) === 180) {\n\t\t\t$width = $srcW;\n\t\t\t$height = $srcH;\n\t\t\t$minX = -$width+1;\n\t\t\t$maxX = 1;\n\t\t\t$minY = -$height+1;\n\t\t\t$maxY = 1;\n\t\t} else {\n\t\t\t// Calculate the width of the destination image\n\t\t\t$temp = array(\n\t\t\t\trotateX(0, 0, 0-$theta),\n\t\t\t\trotateX($srcW, 0, 0-$theta),\n\t\t\t\trotateX(0, $srcH, 0-$theta),\n\t\t\t\trotateX($srcW, $srcH, 0-$theta),\n\t\t\t);\n\t\t\t$minX = floor(min($temp));\n\t\t\t$maxX = ceil(max($temp));\n\t\t\t$width = $maxX - $minX;\n\n\t\t\t// Calculate the height of the destination image\n\t\t\t$temp = array(\n\t\t\t\trotateY(0, 0, 0-$theta),\n\t\t\t\trotateY($srcW, 0, 0-$theta),\n\t\t\t\trotateY(0, $srcH, 0-$theta),\n\t\t\t\trotateY($srcW, $srcH, 0-$theta),\n\t\t\t);\n\t\t\t$minY = floor(min($temp));\n\t\t\t$maxY = ceil(max($temp));\n\t\t\t$height = $maxY - $minY;\n\t\t}\n\n\t\t$destImg = imagecreatetruecolor($width, $height);\n\t\tif ($ignoreTransparent == 0) {\n\t\t\timagefill($destImg, 0, 0, imagecolorallocatealpha($destImg, 255,255, 255, 127));\n\t\t\timagesavealpha($destImg, true);\n\t\t}\n\n\t\t// Sets all pixels in the new image\n\t\tfor ($x = $minX; $x < $maxX; $x++) {\n\t\t\tfor ($y = $minY; $y < $maxY; $y++) {\n\t\t\t\t// Fetch corresponding pixel from the source image\n\t\t\t\t$srcX = round(rotateX($x, $y, $theta));\n\t\t\t\t$srcY = round(rotateY($x, $y, $theta));\n\t\t\t\tif ($srcX >= 0 && $srcX < $srcW && $srcY >= 0 && $srcY < $srcH) {\n\t\t\t\t\t$color = imagecolorat($srcImg, $srcX, $srcY);\n\t\t\t\t} else {\n\t\t\t\t\t$color = $bgColor;\n\t\t\t\t}\n\t\t\t\timagesetpixel($destImg, $x-$minX, $y-$minY, $color);\n\t\t\t}\n\t\t}\n\n\t\treturn $destImg;\n\t}", "function _rotateImageNETPBM($file, $desfile, $degrees, $imgobj) {\r\n $fileOut = \"$file.1\";\r\n $zoom->platform->copy($file, $fileOut); \r\n if (eregi(\"\\.png\", $imgobj->_filename)) {\r\n $cmd = $this->_NETPBM_path . \"pngtopnm $file | \" . $this->_NETPBM_path . \"pnmrotate $degrees | \" . $this->_NETPBM_path . \"pnmtopng > $fileOut\" ; \r\n } elseif (eregi(\"\\.(jpg|jpeg)\", $imgobj->_filename)) {\r\n $cmd = $this->_NETPBM_path . \"jpegtopnm $file | \" . $this->_NETPBM_path . \"pnmrotate $degrees | \" . $this->_NETPBM_path . \"ppmtojpeg -quality=\" . $this->_JPEG_quality . \" > $fileOut\" ;\r\n } elseif (eregi(\"\\.gif\", $imgobj->_filename)) {\r\n $cmd = $this->_NETPBM_path . \"giftopnm $file | \" . $this->_NETPBM_path . \"pnmrotate $degrees | \" . $this->_NETPBM_path . \"ppmquant 256 | \" . $this->_NETPBM_path . \"ppmtogif > $fileOut\" ; \r\n } else {\r\n return false;\r\n }\r\n $output = $retval = null;\r\n exec($cmd, $output, $retval);\r\n if ($retval) {\r\n return false;\r\n } else {\r\n $erg = $zoom->platform->rename($fileOut, $desfile); \r\n return true;\r\n }\r\n }", "public function autoRotate() {\n $this->thumb->rotateJpg();\n return $this;\n }", "public function actionRotate($imageid,$direction)\n\t{\n\t\t\n\t\t// the image object is created from the database to avoid user input\n\t\t$image = Image::model()->findByPk($imageid);\n\t\t// where to return after the operation\n\t\t$rotatedurl = Yii::app()->user->returnUrl;\n\t\t\n\t\t// temporary filename for the created rotated image\n\t\t$tempfilename = Image::FULLIMAGETEMPPATH . uniqid() . '.jpg';\n\t\t// the image variable $rotated is created based on the original JPG in the file system\n\t\t\n\t\t// if the file does not exist, the user is redirected away\n\t\tif (!file_exists($image->getImageFile('full',false,Image::FULLIMAGEPATH)))\n\t\t{\n\t\t\t$rotatedurl['rotated']='fail_file_not_found';\n\t\t\t$this->redirect($rotatedurl);\n\t\t}\n\t\t\t\t\n\t\t// the original full image is evaluated to determine if it's a JPG\n\t\t// should the file not be jpg, execution is terminated and user is presented\n\t\t// with an error\n\t\t$originalFullImage = $image->getImageFile('full',false,Image::FULLIMAGEPATH);\n\t\t// getimagesize returns information of image size, but also of type among other things\n\t\t$information = getimagesize($originalFullImage);\n\t\tif ($information['mime'] != 'image/jpeg')\n\t\t{\n\t\t\t$rotatedurl['rotated']='fail_not_jpg';\n\t\t\t$this->redirect($rotatedurl);\n\t\t}\n\n\t\t// an uncompressed image is created from the original full size image\n\t\t$rotate = imagecreatefromjpeg($originalFullImage);\n\t\t// the original full image is unset to save memory\n\t\tunset($originalFullImage);\n\t\t\n\t\t// defining the direction of the rotation\n\t\tswitch($direction) \n\t\t{\n\t\t\tcase 'clockwise':\n\t\t\t\t$angle = -90; \t\n\t\t\t\tbreak;\n\t\t\tcase 'counterclockwise':\n\t\t\t\t$angle = 90; \t\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t// creates the rotated image\n\t\t$rotated = imagerotate($rotate,$angle,0);\n\t\tunset($rotate);\n\t\t// saves the rotated image as a jpeg to the temporary file directory\n\t\timagejpeg($rotated,$tempfilename,100);\n\t\tunset($rotated);\n\t\t\n\t\t// the existance of the rotated image is evaluated before anything is deleted\n\t\tif(file_exists($tempfilename))\n\t\t{\n\t\t\t// deletes all the physical image files for the image object\n\t\t\t$image->deleteImage(array('small', 'light', 'medium', 'large','full'));\n\t\t\t\n\t\t\t// moving the generated image to it's desired location\n\t\t\trename($tempfilename,$image->getImageFile('full',false,Image::FULLIMAGEPATH));\n\t\t\t\n\t\t\t// generating thumbnails for the rotated image\n\t\t\t$image->generateThumbnails();\n\t\t}\n\n\t\t$rotatedurl['rotated']='true';\n\t\t$this->redirect($rotatedurl);\n\t\t\t\t\n\t}", "public function rotate($sourceImg, $angleDegrees) {\n\n $angle = (int)$angleDegrees;\n if(! $angle || ! abs($angle) % 360) {\n return $sourceImg;\n }\n $width = imagesx($sourceImg);\n $height = imagesy($sourceImg);\n \n /**\n * First create a new image that is large enough to hold the original image at any rotation angle.\n */\n $max = hypot($width, $height);\n $img = $this->_createImage($max, $max);\n if(false === $img) {\n return false;\n }\n /**\n * DEBUG\n */\n // $debugIndex = $this->_debugWriteToFile($img);\n \n /**\n * Copy the original image centered on the new image.\n */\n if(false === $this->_copyCentered($img, $sourceImg)) {\n return false;\n }\n \n /**\n * DEBUG\n */\n // $debugIndex = $this->_debugWriteToFile($img, $debugIndex);\n \n /**\n * Rotate the new image.\n * \n * NOTICE: negative angles to apply clock-wise rotation.\n */\n $rotatedImg = imagerotate($img, $angle, imagecolorallocatealpha($sourceImg, 0, 0, 0, 127));\n if(false === $rotatedImg) {\n return false;\n }\n \n /**\n * DEBUG\n * $debugIndex = $this->_debugWriteToFile($rotatedImg, $debugIndex);\n */\n \n /**\n * Create an image having having dimensions to fully contain the rotated image at the specified angle.\n */\n $rad = deg2rad($angle);\n $x = $height * abs(sin($rad)) + $width * abs(cos($rad));\n $y = $height * abs(cos($rad)) + $width * abs(sin($rad));\n $finalImg = $this->_createImage($x, $y);\n if(false === $finalImg) {\n return false;\n }\n $res = imagecopy(\n $finalImg, \n $rotatedImg, \n 0, \n 0, \n (imagesx($rotatedImg) - $x) / 2,\n (imagesy($rotatedImg) - $y) / 2,\n $x,\n $y);\n if(false === $res) {\n return false;\n }\n /**\n * DEBUG\n * $this->_debugWriteToFile($finalImg, $debugIndex);\n */\n return $finalImg;\n }", "public function getRotation() {}", "public function getRotation() {}", "protected function _rotate($img, $rotateDegrees, $dstWidth = null, $dstHeight = null) {\n $degrees = is_numeric($rotateDegrees) ? intval($rotateDegrees) : null;\n if(! is_int($degrees)) {\n $var = Types::getVartype($rotateDegrees);\n throw new Exception\\InvalidArgumentException(\"Invalid overlay rotate degrees value '{$var}'\", MediaConst::E_TYPE_MISMATCH);\n }\n if(abs($degrees) > 360) {\n // $var = Types::getVartype($rotateDegrees);\n // throw new Exception\\InvalidArgumentException(\"Invalid overlay value '{$var}'\", MediaConst::E_INVALID_ROTATE_PARAM);\n }\n $obj = new Rotate();\n $finalImg = $obj->rotate($img, $degrees, $dstWidth, $dstHeight);\n if(false === $finalImg) {\n // T_PHP_FUNCTION_FAILED = image function '%s' failed\n $msg = $phpErrorHandler->getErrorMsg(sprintf(MediaConst::T_PHP_FUNCTION_FAILED, \"imagecopy\"), \"cannot copy overlay image\");\n imagedestroy($img);\n // a PHP image function has failed\n throw new Exception\\RuntimeException($msg, MediaConst::E_PHP_FUNCTION_FAILED);\n }\n return $finalImg;\n }", "private function rotate_imagick($imagePath, $orientation)\n {\n $imagick = new Imagick($imagePath);\n $imagick->setImageOrientation(imagick::ORIENTATION_TOPLEFT);\n $deg = 0;\n\n switch ($orientation) {\n case 2:\n $deg = 180;\n $imagick->flipImage();\n break;\n\n case 3:\n $deg = -180;\n break;\n\n case 4:\n $deg = -180;\n $imagick->flopImage();\n break;\n\n case 5:\n $deg = -90;\n $imagick->flopImage();\n break;\n\n case 6:\n $deg = 90;\n break;\n\n case 7:\n $deg = -90;\n $imagick->flipImage();\n break;\n\n case 8:\n $deg = -90;\n break;\n }\n $imagick->rotateImage(new ImagickPixel('#00000000'), $deg);\n $imagick->writeImage($imagePath);\n $imagick->clear();\n $imagick->destroy();\n }", "public function setRotation($rotation) {}", "public function setRotation($rotation) {}", "function __rotate(&$tmp, $angle, $color) {\r\r\n\t\tasido::trigger_abstract_error(\r\r\n\t\t\t__CLASS__,\r\r\n\t\t\t__FUNCTION__\r\r\n\t\t\t);\r\r\n\t\t}", "abstract public function rotate($amount);", "function rotateImage($file, $desfile, $degrees, $imgobj) {\r\n $degrees = intval($degrees);\r\n switch ($this->_conversiontype){\r\n //Imagemagick\r\n case 1:\r\n if($this->_rotateImageIM($file, $desfile, $degrees))\r\n return true;\r\n else\r\n return false;\r\n break;\r\n //NetPBM\r\n case 2:\r\n if($this->_rotateImageNETPBM($file, $desfile, $degrees, $imgobj))\r\n return true;\r\n else\r\n return false;\r\n break;\r\n //GD1\r\n case 3:\r\n if($this->_rotateImageGD1($file, $desfile, $degrees, $imgobj))\r\n return true;\r\n else\r\n return false;\r\n break;\r\n //GD2\r\n case 4:\r\n if($this->_rotateImageGD2($file, $desfile, $degrees, $imgobj))\r\n return true;\r\n else\r\n return false;\r\n break;\r\n }\r\n return true;\r\n }", "public function rotate($value='random', $bgColor='ffffff')\n\t{\n\t\t$this->checkImage();\n\t\tif ($value == 'random') {\n\t\t\t$value = mt_rand(-6, 6);\n\t\t} else {\n\t\t\t$value = max(-360, min($value, 360));\n\t\t}\n\t\tif ($value < 0) {\n\t\t\t$value = 360 + $value;\n\t\t}\n\n\t\tif ($bgColor == 'alpha' && function_exists('imagerotate')) {\n\t\t\t// Experimental. GD2 imagerotate seems to be quite buggy with alpha transparency.\n\t\t\timagealphablending($this->imageResized, false);\n\t\t\t$color = imagecolorallocatealpha($this->imageResized, 255, 255, 255, 127);\n\t\t\timagecolortransparent($this->imageResized, $color);\n\t\t\t$this->imageResized = imagerotate($this->imageResized, $value, $color);\n\t\t\timagesavealpha($this->imageResized, true);\n\t\t} else {\n\t\t\t$bgColor = str_replace('#', '', strtoupper(trim($bgColor)));\n\t\t\t$color = hexdec($bgColor);\n\t\t\tif (function_exists('imagerotate')) {\n\t\t\t\t$this->imageResized = imagerotate($this->imageResized, $value, $color);\n\t\t\t} else {\n\t\t\t\t$this->imageResized = $this->imagerotate($this->imageResized, $value, $color);\n\t\t\t}\n\t\t}\n\n\t\treturn $this;\n\t}", "function rotate(&$tmp, $angle, $color=null) {\r\r\n\t\t\r\r\n\t\t// color ?\r\r\n\t\t//\r\r\n\t\tif (!is_a($color, 'Asido_Color')) {\r\r\n\t\t\t$color = new Asido_Color;\r\r\n\t\t\t$color->set(255, 255, 255);\r\r\n\t\t\t}\r\r\n\t\t\r\r\n\t\treturn $this->__rotate($tmp, $angle, $color);\r\r\n\t\t}", "public function rotate($angle)\n {\n $this->setForceAlpha(true);\n $this\n ->addConvertOption('background', 'none')\n ->addConvertOption('alpha', 'set')\n ->addConvertOption('rotate', $angle);\n\n //an image size has changed after the rotate action, it's required to save it and reinit resource\n $this->saveIfRequired('after_rotate');\n $this->resource = null;\n $this->initResource();\n\n return $this;\n }", "function setImageOrientation()\n\t{\n\n\t\tif ($this->width < $this->height) {\n\t\t\t$this->orientation = 'portrait';\n\t\t}\n\n\t\tif ($this->width > $this->height) {\n\t\t\t$this->orientation = 'landscape';\n\t\t}\n\n\t\tif ($this->width == $this->height) {\n\t\t\t$this->orientation = 'square';\n\t\t}\n\t}", "public function rotate($x, $y, $angle) {}", "public function rotate($x, $y, $angle) {}", "public function rotate($x, $y, $angle) {}", "public function rotate(int $rotations);", "function _rotateImageIM($file, $desfile, $degrees) {\r\n $cmd = $this->_IM_path.\"convert -rotate $degrees \\\"$file\\\" \\\"$desfile\\\"\";\r\n $output = $retval = null;\r\n exec($cmd, $output, $retval);\r\n if($retval) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }", "public function toGDImage() {}", "function setRotation( $r ) {\n\n // only 0,90,180,270\n if ( $r > 270 ) return;\n if ( $r % 90 != 0 ) return;\n\n $this->rotate = $r;\n $this->vertical = ( $r == 90 or $r == 270 );\n}", "public function rotate($degrees);", "public function test_remove_orientation_data_on_rotate() {\n\t\t$file = DIR_TESTDATA . '/images/test-image-upside-down.jpg';\n\t\t$data = wp_read_image_metadata( $file );\n\n\t\t// The orientation value 3 is equivalent to rotated upside down (180 degrees).\n\t\t$this->assertSame( 3, intval( $data['orientation'] ), 'Orientation value read from does not match image file Exif data: ' . $file );\n\n\t\t$temp_file = wp_tempnam( $file );\n\t\t$image = wp_get_image_editor( $file );\n\n\t\t// Test a value that would not lead back to 1, as WP is resetting the value to 1 manually.\n\t\t$image->rotate( 90 );\n\t\t$ret = $image->save( $temp_file, 'image/jpeg' );\n\n\t\t$data = wp_read_image_metadata( $ret['path'] );\n\n\t\t// Make sure the image is no longer in The Upside Down Exif orientation.\n\t\t$this->assertSame( 1, intval( $data['orientation'] ), 'Orientation Exif data was not updated after rotating image: ' . $file );\n\n\t\t// Remove both the generated file ending in .tmp and tmp.jpg due to wp_tempnam().\n\t\tunlink( $temp_file );\n\t\tunlink( $ret['path'] );\n\t}", "public function rotateClockwise($angle = 0, $bg_color = array(255, 255, 255)) {\n\t\tif(!$this->image) {\n\t\t\ttrigger_error('The image does not exist or is not readable.', E_USER_WARNING);\n\t\t\treturn false;\n\t\t}\n\t\t$angle = 0 - (float) $angle;\n\t\treturn $this->rotate($angle, $bg_color);\n\t}", "public function createImage2(){\n $this->createCircle(100, 100, 50, 50, 0, 360);\n $this->createCircle(400, 100, 50, 50, 0, 360);\n $this->createCircle(110, 200, 50, 50, 0, 360);\n $this->createCircle(250, 300, 50, 50, 0, 360);\n $this->createCircle(390, 200, 50, 50, 0, 360);\n $this->createLine(125, 100, 375, 100);\n $this->createLine(100, 125, 100, 175);\n $this->createLine(400, 125, 400, 175);\n $this->createLine(125, 220, 225, 300);\n $this->createLine(275, 300, 375, 220);\n $this->generateImage();\n }", "function image_fix_orientation($path){\n\t\t$exif = exif_read_data($path);\n\n\t\t//fix the Orientation if EXIF data exist\n\t\tif(!empty($exif['Orientation'])) {\n\t\t switch($exif['Orientation']) {\n\t\t case 8:\n\t\t $createdImage = imagerotate($image,90,0);\n\t\t break;\n\t\t case 3:\n\t\t $createdImage = imagerotate($image,180,0);\n\t\t break;\n\t\t case 6:\n\t\t $createdImage = imagerotate($image,-90,0);\n\t\t break;\n\t\t }\n\t\t}\n\t}", "public function rotate(int $degrees): Image\n\t{\n\t\t$this->processor->rotate($degrees);\n\n\t\treturn $this;\n\t}", "function fix_orientation($fileandpath) { if(!file_exists($fileandpath))\n return false;\n try {\n @$exif = read_exif_data($fileandpath, 'IFD0');\n }\n catch (Exception $exp) {\n $exif = false;\n }\n // Get all the exif data from the file\n // If we dont get any exif data at all, then we may as well stop now\n if(!$exif || !is_array($exif))\n return false;\n\n // I hate case juggling, so we're using loweercase throughout just in case\n $exif = array_change_key_case($exif, CASE_LOWER);\n\n // If theres no orientation key, then we can give up, the camera hasn't told us the\n // orientation of itself when taking the image, and i'm not writing a script to guess at it!\n if(!array_key_exists('orientation', $exif))\n return false;\n\n // Gets the GD image resource for loaded image\n $img_res = $this->get_image_resource($fileandpath);\n\n // If it failed to load a resource, give up\n if(is_null($img_res))\n return false;\n\n // The meat of the script really, the orientation is supplied as an integer,\n // so we just rotate/flip it back to the correct orientation based on what we\n // are told it currently is\n\n switch($exif['orientation']) {\n\n // Standard/Normal Orientation (no need to do anything, we'll return true as in theory, it was successful)\n case 1: return true; break;\n\n // Correct orientation, but flipped on the horizontal axis (might do it at some point in the future)\n case 2:\n $final_img = $this->imageflip($img_res, IMG_FLIP_HORIZONTAL);\n break;\n\n // Upside-Down\n case 3:\n $final_img = $this->imageflip($img_res, IMG_FLIP_VERTICAL);\n break;\n\n // Upside-Down & Flipped along horizontal axis\n case 4:\n $final_img = $this->imageflip($img_res, IMG_FLIP_BOTH);\n break;\n\n // Turned 90 deg to the left and flipped\n case 5:\n $final_img = imagerotate($img_res, -90, 0);\n $final_img = $this->imageflip($img_res, IMG_FLIP_HORIZONTAL);\n break;\n\n // Turned 90 deg to the left\n case 6:\n $final_img = imagerotate($img_res, -90, 0);\n break;\n\n // Turned 90 deg to the right and flipped\n case 7:\n $final_img = imagerotate($img_res, 90, 0);\n $final_img = $this->imageflip($img_res,IMG_FLIP_HORIZONTAL);\n break;\n\n // Turned 90 deg to the right\n case 8:\n $final_img = imagerotate($img_res, 90, 0);\n break;\n\n }\n if(!isset($final_img))\n return false;\n if (!is_writable($fileandpath)) {\n chmod($fileandpath, 0777);\n }\n unlink($fileandpath);\n\n // Save it and the return the result (true or false)\n $done = $this->save_image_resource($final_img,$fileandpath);\n\n return $done;\n }", "public function createRotateFlippedImage($request)\n {\n $returnType = '\\SplFileObject';\n $isBinary = true;\n $hasReturnType = true;\n $request = $this->getHttpRequest($request, 'POST');\n $options = $this->createHttpClientOptions();\n \n try {\n $response = $this->client->send($request, $options);\n return $this->processResponse($request, $response, $hasReturnType, $returnType, $isBinary);\n } catch (RequestException $e) {\n $this->processException($e);\n }\n }", "function fixImageOrientation($filename) \n{\n\t$exif = @exif_read_data($filename);\n\t \n\tif($exif) \n\t{ \n\t\t//fix the Orientation if EXIF data exists\n\t\tif(!empty($exif['Orientation'])) \n\t\t{\n\t\t\tswitch($exif['Orientation']) \n\t\t\t{\n\t\t\t\tcase 3:\n\t\t\t\t$createdImage = imagerotate($filename,180,0);\n\t\t\t\tbreak;\n\t\t\t\tcase 6:\n\t\t\t\t$createdImage = imagerotate($filename,-90,0);\n\t\t\t\tbreak;\n\t\t\t\tcase 8:\n\t\t\t\t$createdImage = imagerotate($filename,90,0);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t} \n}", "protected function fix_image_orientation( $filename, $filecontent ) {\r\n\t\t\t$data = exif_read_data( $filename );\r\n\t\t\tif ( !empty( $data['Orientation'] ) ) {\r\n\t\t\t\tswitch( $data['Orientation'] ) {\r\n\t\t\t\t\tcase 3: { $newAngle = 180; } break;\r\n\t\t\t\t\tcase 6: { $newAngle = -90; } break;\r\n\t\t\t\t\tcase 8: { $newAngle = 90; } break;\r\n\t\t\t\t\tdefault: $newAngle = false;\r\n\t\t\t\t}\r\n\t\t\t\tif ( $newAngle ) {\r\n\t\t\t\t\t$image = imagecreatefromstring( $filecontent );\r\n\t\t\t\t\t$image = imagerotate( $image, $newAngle, 0 );\r\n\t\t\t\t\t$this->save_image( $image, $filename );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "public function rotateRight();", "private function recortarImagen()\n\t{\n\t\t$ImgTemporal=\"temporal_clase_Imagen.\".strtolower($this->extencion);\n\n\t\t$CoefAncho\t\t= $this->propiedadesImagen[0]/$this->anchoDestino;\n\t\t$CoefAlto\t\t= $this->propiedadesImagen[1]/$this->altoDestino;\n\t\t$Coeficiente=0;\n\t\tif ($CoefAncho>1 && $CoefAlto>1)\n\t\t{ if($CoefAncho>$CoefAlto){ $Coeficiente=$CoefAlto; } else {$Coeficiente=$CoefAncho;} }\n\n\t\tif ($Coeficiente!=0)\n\t\t{\n\t\t\t$anchoTmp\t= ceil($this->propiedadesImagen[0]/$Coeficiente);\n\t\t\t$altoTmp\t= ceil($this->propiedadesImagen[1]/$Coeficiente);\n\n\t\t\t$ImgMediana = imagecreatetruecolor($anchoTmp,$altoTmp);\n\t\t\timagecopyresampled($ImgMediana,$this->punteroImagen,0,0,0,0,$anchoTmp,$altoTmp,$this->propiedadesImagen[0],$this->propiedadesImagen[1]);\n\t\t\t\n\t\t\t// Tengo que desagregar la funcion de image para crear para reUtilizarla\n\t\t\t//imagejpeg($ImgMediana,$ImgTemporal,97);\n\t\t\t$this->crearArchivoDeImagen($ImgMediana,$ImgTemporal);\n\t\t}\n\n\t\t$fila\t\t\t= floor($this->recorte['centrado']/$this->recorte['columnas']);\n\t\t$columna\t\t= $this->recorte['centrado'] - ($fila*$this->recorte[\"columnas\"]);\n\t\t\n\t\t$centroX \t= floor(($anchoTmp / $this->recorte[\"columnas\"])/2)+$columna*floor($anchoTmp / $this->recorte[\"columnas\"]);\n\t\t$centroY \t= floor(($altoTmp / $this->recorte[\"filas\"])/2)+$fila*floor($altoTmp / $this->recorte[\"filas\"]);\n\n\t\t$centroX\t-= floor($this->anchoDestino/2);\n\t\t$centroY \t-= floor($this->altoDestino/2);\n\n\t\tif ($centroX<0) {$centroX = 0;}\n\t\tif ($centroY<0) {$centroY = 0;}\n\n\t\tif (($centroX+$this->anchoDestino)>$anchoTmp) {$centroX = $anchoTmp-$this->anchoDestino;}\n\t\tif (($centroY+$this->altoDestino)>$altoTmp) {$centroY = $altoTmp-$this->altoDestino;}\n\n\t\t$ImgRecortada = imagecreatetruecolor($this->anchoDestino,$this->altoDestino);\n\t\timagecopymerge ( $ImgRecortada,$ImgMediana,0,0,$centroX, $centroY, $this->anchoDestino, $this->altoDestino,100);\n\n\t\t//imagejpeg($ImgRecortada,$this->imagenDestino,97);\n\t\t$this->crearArchivoDeImagen($ImgRecortada,$this->imagenDestino);\n\t\timagedestroy($ImgRecortada);\n\t\tunlink($ImgTemporal);\n\t}", "public function outputAsJPG(){\n header('Content-Type: image/jpeg');\n\t\theader (\"Cache-Control: must-revalidate\");\n\t\t$offset = 7 * 24 * 60 * 60;//expires one week\n\t\t$expire = \"Expires: \" . gmdate (\"D, d M Y H:i:s\", time() + $offset) . \" GMT\";\n\t\theader ($expire);\n imagejpeg($this->gd_image);\n }", "function RotatedText($x,$y,$txt,$angle)\n{\n $this->Rotate($angle,$x,$y);\n $this->Text($x,$y,$txt);\n $this->Rotate(0);\n}", "function RotatedText($x,$y,$txt,$angle)\n{\n $this->Rotate($angle,$x,$y);\n $this->Text($x,$y,$txt);\n $this->Rotate(0);\n}", "public static function rotate($image = NULL, $degrees = NULL, $backgroundColorRed = 0, $backgroundColorGreen = 0, $backgroundColorBlue = 0, $backgroundColorAlpha = 0)\n\t{\n\n\t\tif (!($image instanceof Default_Model_MediaImage)) {\n\t\t\tthrow new Default_Model_MediaImage_Exception('Image needs to be an instance of Default_Model_MediaImage.');\n\t\t}\n\n\t\tif ($degrees &&\n\t\t\t!is_int($degrees)) {\n\n\t\t\tthrow new Default_Model_MediaImage_Exception('Degrees needs to be an integer, if specified.');\n\t\t}\n\n\t\tif (!is_int($backgroundColorRed) &&\n\t\t\t($backgroundColorRed < 0 || $backgroundColorRed > 255)) {\n\n\t\t\tthrow new Default_Model_MediaImage_Exception('BackgroundColor Red needs to be specified between 0 and 255.');\n\t\t}\n\n\t\tif (!is_int($backgroundColorGreen) &&\n\t\t\t($backgroundColorGreen < 0 || $backgroundColorGreen > 255)) {\n\n\t\t\tthrow new Default_Model_MediaImage_Exception('BackgroundColor Green needs to be specified between 0 and 255.');\n\t\t}\n\n\t\tif (!is_int($backgroundColorBlue) &&\n\t\t\t($backgroundColorBlue < 0 || $backgroundColorBlue > 255)) {\n\n\t\t\tthrow new Default_Model_MediaImage_Exception('BackgroundColor Blue needs to be specified between 0 and 255.');\n\t\t}\n\n\t\tif (!is_int($backgroundColorAlpha) &&\n\t\t\t($backgroundColorAlpha < 0 || $backgroundColorAlpha > 255)) {\n\n\t\t\tthrow new Default_Model_MediaImage_Exception('BackgroundColor Alpha needs to be specified between 0 and 255.');\n\t\t}\n\n\t\t$rotatedImage = Default_Service_MediaImage::fromMediaImage($image);\n\t\t$rotatedImage->width = 0;\n\t\t$rotatedImage->height = 0;\n\t\t$rotatedImage->file_size = 0;\n\t\t$rotatedImage->role_id = $image->role_id;\n\t\tif (isset($image['entity_id'])) {\n\t\t\t$rotatedImage->entity_id = $image->entity_id;\n\t\t} else\n\t\tif (Zend_Auth::getInstance()->hasIdentity()) {\n\t\t\t$rotatedImage->entity_id = Zend_Auth::getInstance()->getIdentity()->id;\n\t\t}\n\t\t$rotatedImage->short = Default_Service_Media::getShort($image->short, $rotatedImage->width, $rotatedImage->height, $rotatedImage->file_size);\n\t\t$rotatedImage->save();\n\n\n\t\t/**\n\t\t * imageinstance file does not exist yet and needs to be created\n\t\t */\n\t\tif (!file_exists($rotatedImage->getStoredFilePath())) {\n\n\t\t\t/**\n\t\t\t * use Imagick for rotating the image ?\n\t\t\t */\n\t\t\tif (Zend_Registry::get('Imagick')) {\n\n\t\t\t\t/**\n\t\t\t\t * Imagick\n\t\t\t\t */\n\t\t\t\t$imagickError = NULL;\n\t\t\t\ttry {\n\t\t\t\t\t$colorStringFormat = '%1$02s%2$02s%3$02s%4$02s';\n\t\t\t\t\t$colorString = sprintf($colorStringFormat, dechex($backgroundColorRed), dechex($backgroundColorGreen), dechex($backgroundColorBlue), dechex($backgroundColorAlpha));\n\t\t\t\t\t$imagickBackgoundColor = new ImagickPixel('#' . $colorString);\n\n\t\t\t\t\t$imagickObj = new Imagick($image->getStoredFilePath());\n\t\t\t\t\t$imagickRotateResult = $imagickObj->rotateImage($imagickBackgoundColor, $degrees);\n\t\t\t\t\tif ($imagickRotateResult) {\n\t\t\t\t\t\t$imagickObj->writeimage($rotatedImage->getStoredFilePath());\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * retrieve image infos\n\t\t\t\t\t\t */\n\t\t\t\t\t\t$rotatedImage->file_size = $imagickObj->getImageLength();\n\t\t\t\t\t\t$imagickDimensions = $imagickObj->getImageGeometry();\n\t\t\t\t\t\t$rotatedImage->width = $imagickDimensions['width'];\n\t\t\t\t\t\t$rotatedImage->height = $imagickDimensions['height'];\n\t\t\t\t\t\t$rotatedImage->short = Default_Service_Media::getShort($image->short, $rotatedImage->width, $rotatedImage->height, $rotatedImage->file_size);\n\t\t\t\t\t\t$rotatedImage->save();\n\t\t\t\t\t}\n\t\t\t\t} catch (ImagickException $imagickError) {\n\n\t\t\t\t}\n\n\t\t\t\tif ($imagickError ||\n\t\t\t\t\t!$imagickRotateResult) {\n\n\t\t\t\t\t$rotatedImage->hardDelete();\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\t$imageFile = L8M_Image::fromFile($image->getStoredFilePath());\n\n\t\t\t\tif ($imageFile instanceof L8M_Image_Abstract) {\n\n\t\t\t\t\t$imageFile\n\t\t\t\t\t\t->rotate($degrees, $backgroundColorRed, $backgroundColorGreen, $backgroundColorBlue, $backgroundColorAlpha)\n\t\t\t\t\t\t->save($rotatedImage->getStoredFilePath(), TRUE)\n\t\t\t\t\t;\n\n\t\t\t\t\t/**\n\t\t\t\t\t * retrieve image infos\n\t\t\t\t\t */\n\t\t\t\t\t$rotatedImage->file_size = $imageFile->getFilesize();\n\t\t\t\t\t$rotatedImage->width = $imageFile->getWidth();\n\t\t\t\t\t$rotatedImage->height = $imageFile->getHeight();\n\t\t\t\t\t$rotatedImage->short = Default_Service_Media::getShort($image->short, $rotatedImage->width, $rotatedImage->height, $rotatedImage->file_size);\n\n\t\t\t\t\t/**\n\t\t\t\t\t * save\n\t\t\t\t\t */\n\t\t\t\t\tif (!$imageFile->isErrorOccured()) {\n\t\t\t\t\t\t$rotatedImage->save();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$rotatedImage->hardDelete();\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\treturn $rotatedImage;\n\t}", "public function ImgCropToFile(){\r\n $imgUrl = $_POST['imgUrl'];\r\n// original sizes\r\n $imgInitW = $_POST['imgInitW'];\r\n $imgInitH = $_POST['imgInitH'];\r\n// resized sizes\r\n $imgW = $_POST['imgW'];\r\n $imgH = $_POST['imgH'];\r\n// offsets\r\n $imgY1 = $_POST['imgY1'];\r\n $imgX1 = $_POST['imgX1'];\r\n// crop box\r\n $cropW = $_POST['cropW'];\r\n $cropH = $_POST['cropH'];\r\n// rotation angle\r\n $angle = $_POST['rotation'];\r\n\r\n $jpeg_quality = 100;\r\n\r\n $what = new \\Think\\Image();\r\n $name = './'.$this::getPath($imgUrl).$this::getFileName($imgUrl);\r\n $c_name = './'.$this::getPath($imgUrl).'c_'.$this::getFileName($imgUrl);\r\n $p_name = './'.$this::getPath($imgUrl).'p_'.$this::getFileName($imgUrl);\r\n $what ->open($name);\r\n $what ->thumb($imgW, $imgH)->save($c_name);\r\n $what ->open($c_name);\r\n $what ->crop(($cropW),($cropH),$imgX1,$imgY1)->save($p_name);\r\n unlink($c_name);\r\n unlink($name);\r\n\r\n $m = M('img_mapping');\r\n $data = array();\r\n $data['user'] = $_SESSION['current_user']['id'];\r\n $data['img'] = './'.$this::getPath($p_name).$this::getFileName($p_name);\r\n $m->data($data)->add();\r\n\r\n $response = Array(\r\n \"status\" => 'success',\r\n \"url\" => __ROOT__.'/'.$this::getPath($p_name).$this::getFileName($p_name)\r\n );\r\n print json_encode($response);\r\n }", "function frameImage($inside = 0, $imagesPath = array(), $imgHeight = 600, $imagesWidth = array(), $imagesAngles = array(), $poleColor = null, $poleWidth = 1, $poleHeight = 1)\n{ \n $rowImagick = new Imagick();\n \n foreach($imagesPath as $imgIndex => $imgPath) {\n $imagick = new Imagick(realpath($imgPath));\n\n $imagick->getImageGeometry();\n $imgGeo = $imagick->getImageGeometry();\n $imgOrgWidth = $imgGeo['width'];\n $imgOrgHeight = $imgGeo['height'];\n $imgWidth = $imagesWidth[$imgIndex];\n\n if(isset($imagesAngles[$imgIndex])) {\n $angleX = ($imagesAngles[$imgIndex]) == 90 ? - ($imagesAngles[$imgIndex] - 10) : - $imagesAngles[$imgIndex];\n } else {\n $angleX = -100;\n }\n $angleY = 0;\n $thetX = deg2rad ($angleX);\n $thetY = deg2rad ($angleY);\n\n $s_x1y1 = array(0, 0); // LEFT BOTTOM\n $s_x2y1 = array($imgWidth, 0); // RIGHT BOTTOM\n $s_x1y2 = array(0, $imgHeight); // LEFT TOP\n $s_x2y2 = array($imgWidth, $imgHeight); // RIGHT TOP\n\n $d_x1y1 = array(\n $s_x1y1[0] * cos($thetX) - $s_x1y1[1] * sin($thetY),\n $s_x1y1[0] * sin($thetX) + $s_x1y1[1] * cos($thetY)\n );\n $d_x2y1 = array(\n $s_x2y1[0] * cos($thetX) - $s_x2y1[1] * sin($thetY),\n $s_x2y1[0] * sin($thetX) + $s_x2y1[1] * cos($thetY)\n );\n $d_x1y2 = array(\n $s_x1y2[0] * cos($thetX) - $s_x1y2[1] * sin($thetY),\n $s_x1y2[0] * sin($thetX) + $s_x1y2[1] * cos($thetY)\n );\n $d_x2y2 = array(\n $s_x2y2[0] * cos($thetX) - $s_x2y2[1] * sin($thetY),\n $s_x2y2[0] * sin($thetX) + $s_x2y2[1] * cos($thetY)\n );\n\n $imageprops = $imagick->getImageGeometry();\n $imagick->setImageBackgroundColor(new ImagickPixel('transparent'));\n $imagick->resizeimage($imgWidth, $imgHeight, \\Imagick::FILTER_LANCZOS, 0, true); \n if($poleColor) {\n $imagick->borderImage($poleColor, $poleWidth, $poleHeight);\n }\n\n $points = array(\n $s_x1y2[0], $s_x1y2[1], # Source Top Left\n $d_x1y2[0], $d_x1y2[1], # Destination Top Left\n $s_x1y1[0], $s_x1y1[1], # Source Bottom Left \n $d_x1y1[0], $d_x1y1[1], # Destination Bottom Left \n $s_x2y1[0], $s_x2y1[1], # Source Bottom Right \n $d_x2y1[0], $d_x2y1[1], # Destination Bottom Right \n $s_x2y2[0], $s_x2y2[1], # Source Top Right \n $d_x2y2[0], $d_x2y2[1] # Destination Top Right \n );\n //echo '<pre>'; print_r($points); die;\n\n $imagick->setImageVirtualPixelMethod(\\Imagick::VIRTUALPIXELMETHOD_BACKGROUND);\n $imagick->distortImage(\\Imagick::DISTORTION_PERSPECTIVE, $points, true);\n //$imagick->scaleImage($imgWidth, $imgHeight, false);\n $rowImagick->addImage($imagick); \n }\n\n $rowImagick->resetIterator();\n $combinedRow = $rowImagick->appendImages(false);\n\n $canvas = generateFinalImage($combinedRow);\n header(\"Content-Type: image/png\");\n echo $canvas->getImageBlob();\n}", "public function fixOrientation($file, $return = 'file') {\n\t\t \t\n\t\t$mime = \\FileManager::getFileMimeType($file);\n \n\t\t$save_name = \\Tools::generateRandomString().uniqid(). $this -> getExtension($mime);\n\t \n\t if(!\\Validator::check('gif_file', $mime)) {\n\t $image = new \\Imagick($file);\n\t $orientation = $image -> getImageOrientation();\n\t \n\t switch($orientation) {\n\t case \\imagick::ORIENTATION_BOTTOMRIGHT: \n\t $image -> rotateimage(\"#000\", 180); // rotate 180 degrees\n\t break;\n\t \n\t case \\imagick::ORIENTATION_RIGHTTOP:\n\t $image -> rotateimage(\"#000\", 90); // rotate 90 degrees CW\n\t break;\n\t \n\t case \\imagick::ORIENTATION_LEFTBOTTOM: \n\t $image -> rotateimage(\"#000\", -90); // rotate 90 degrees CCW\n\t break;\n\t }\n\t \n\t $image -> setImageOrientation (\\Imagick::ORIENTATION_TOPLEFT);\n\t \n\t $location = SITE_PATH.'tmp'.DS.$save_name;\n\t\t \n\t\t file_put_contents($location, $image -> getImageBlob());\n\t\t \n\t\t return $location;\n\t \n\t } else {\n\t \n\t \treturn $file;\n\t \n\t }\n\t}", "function RotatedText($x, $y, $txt, $angle)\n{\n $this->Rotate($angle,$x,$y);\n $this->Text($x,$y,$txt);\n $this->Rotate(0);\n}", "function RotatedText($x, $y, $txt, $angle){\r $this->Rotate($angle,$x,$y);\r $this->Text($x,$y,$txt);\r $this->Rotate(0);\r }", "protected function writeGifAndPng() {}", "public function backImage()\r\n {\r\n $wrapper = imagecreatetruecolor(16 * $this->ratio(), 32 * $this->ratio());\r\n $background = imagecolorallocatealpha($wrapper, 255, 255, 255, 127);\r\n imagefill($wrapper, 0, 0, $background);\r\n\r\n imagecopy($wrapper, $this->image, 4 * $this->ratio(), 8 * $this->ratio(), 32 * $this->ratio(),\r\n 20 * $this->ratio(), 8 * $this->ratio(), 12 * $this->ratio());\r\n // Head back\r\n imagecopy($wrapper, $this->image, 4 * $this->ratio(), 0 * $this->ratio(), 24 * $this->ratio(),\r\n 8 * $this->ratio(), 8 * $this->ratio(), 8 * $this->ratio());\r\n // Arms back\r\n $this->imageflip($wrapper, $this->image, 0 * $this->ratio(), 8 * $this->ratio(), 52 * $this->ratio(),\r\n 20 * $this->ratio(), 4 * $this->ratio(), 12 * $this->ratio());\r\n imagecopy($wrapper, $this->image, 12 * $this->ratio(), 8 * $this->ratio(), 52 * $this->ratio(),\r\n 20 * $this->ratio(), 4 * $this->ratio(), 12 * $this->ratio());\r\n // Legs back\r\n $this->imageflip($wrapper, $this->image, 4 * $this->ratio(), 20 * $this->ratio(), 12 * $this->ratio(),\r\n 20 * $this->ratio(), 4 * $this->ratio(), 12 * $this->ratio());\r\n imagecopy($wrapper, $this->image, 8 * $this->ratio(), 20 * $this->ratio(), 12 * $this->ratio(),\r\n 20 * $this->ratio(), 4 * $this->ratio(), 12 * $this->ratio());\r\n // Hat back\r\n imagecopy($wrapper, $this->image, 4 * $this->ratio(), 0 * $this->ratio(), 56 * $this->ratio(),\r\n 8 * $this->ratio(), 8 * $this->ratio(), 8 * $this->ratio());\r\n\r\n return $wrapper;\r\n }", "public function getRotateControl()\n {\n return $this->rotateControl;\n }", "public function rotateLeft();", "function mergereagentandarrow($filename_x, $filename_y, $filename_result) {\n\n list($width_x, $height_x) = getimagesize($filename_x);\n list($width_y, $height_y) = getimagesize($filename_y);\n\n // Create new image with desired dimensions\n\n $image = imagecreatetruecolor($width_y, $height_x + $height_y);\n$white = imagecolorallocate($image, 255, 255, 255);\nimagefill($image, 0, 0, $white);\n\n\n // Load images and then copy to destination image\n\n $image_x = imagecreatefromgif($filename_x);\n $image_y = imagecreatefromgif($filename_y);\n\n imagecopy($image, $image_x, ($width_y-$width_x)/2, 0, 0, 0, $width_x, $height_x);\n imagecopy($image, $image_y, 0, $height_x, 0, 0, $width_y, $height_y);\n\n // Save the resulting image to disk (as JPEG)\n\n imagegif($image, $filename_result);\n\n\n\n\n // Clean up\n\n imagedestroy($image);\n imagedestroy($image_x);\n imagedestroy($image_y);\n\n}", "public function rotate(?callable $copy = null): void;", "public function frontImage()\r\n {\r\n $wrapper = imagecreatetruecolor(16 * $this->ratio(), 32 * $this->ratio());\r\n $background = imagecolorallocatealpha($wrapper, 255, 255, 255, 127);\r\n imagefill($wrapper, 0, 0, $background);\r\n\r\n imagecopy($wrapper, $this->image, 4 * $this->ratio(), 0 * $this->ratio(), 8 * $this->ratio(),\r\n 8 * $this->ratio(), 8 * $this->ratio(), 8 * $this->ratio());\r\n //arms\r\n imagecopy($wrapper, $this->image, 0 * $this->ratio(), 8 * $this->ratio(), 44 * $this->ratio(),\r\n 20 * $this->ratio(), 4 * $this->ratio(), 12 * $this->ratio());\r\n $this->imageflip($wrapper, $this->image, 12 * $this->ratio(), 8 * $this->ratio(), 44 * $this->ratio(),\r\n 20 * $this->ratio(), 4 * $this->ratio(), 12 * $this->ratio());\r\n //chest\r\n imagecopy($wrapper, $this->image, 4 * $this->ratio(), 8 * $this->ratio(), 20 * $this->ratio(),\r\n 20 * $this->ratio(), 8 * $this->ratio(), 12 * $this->ratio());\r\n //legs\r\n imagecopy($wrapper, $this->image, 4 * $this->ratio(), 20 * $this->ratio(), 4 * $this->ratio(),\r\n 20 * $this->ratio(), 4 * $this->ratio(), 12 * $this->ratio());\r\n $this->imageflip($wrapper, $this->image, 8 * $this->ratio(), 20 * $this->ratio(), 4 * $this->ratio(),\r\n 20 * $this->ratio(), 4 * $this->ratio(), 12 * $this->ratio());\r\n //hat\r\n imagecopy($wrapper, $this->image, 4 * $this->ratio(), 0 * $this->ratio(), 40 * $this->ratio(),\r\n 8 * $this->ratio(), 8 * $this->ratio(), 8 * $this->ratio());\r\n\r\n return $wrapper;\r\n }", "public function rotate($degrees, Color\\ColorInterface $bgColor = null)\n {\n $this->resource->rotateImage($this->createColor($bgColor), $degrees);\n $this->width = $this->resource->getImageWidth();\n $this->height = $this->resource->getImageHeight();\n return $this;\n }", "public function createImage1(){\n $this->createHexagon(150,75, 50, 200, 150, 325, 275, 325, 350,200, 275, 75);\n $this->createCircle(200, 200, 200, 200, 0, 360);\n $this->createLine(200, 125, 125, 200);\n $this->createLine(200, 125, 275, 200);\n $this->createLine(125, 200, 200, 275);\n $this->createLine(275, 200, 200, 275);\n $this->generateImage();\n }", "function redim($ruta1,$ruta2,$ancho,$alto)\n {\n $datos=getimagesize ($ruta1);\n \n $ancho_orig = $datos[0]; # Anchura de la imagen original\n $alto_orig = $datos[1]; # Altura de la imagen original\n $tipo = $datos[2];\n \n if ($tipo==1){ # GIF\n if (function_exists(\"imagecreatefromgif\")){\n $img = imagecreatefromgif($ruta1);\n echo \"<script>\n\t\t\t\talert('entro a gif');\n\t\t\t\t</script>\";\n }else{\n return false;\n }\n }\n else if ($tipo==2){ # JPG\n if (function_exists(\"imagecreatefromjpeg\")){\n $img = imagecreatefromjpeg($ruta1);\n\n }else{\n return false;\n }\n }\n else if ($tipo==3){ # PNG\n if (function_exists(\"imagecreatefrompng\")){\n $img = imagecreatefrompng($ruta1);\n \n }else{\n return false;\n }\n }\n \n # Se calculan las nuevas dimensiones de la imagen\n if ($ancho_orig>$alto_orig)\n {\n $ancho_dest=$ancho;\n $alto_dest=($ancho_dest/$ancho_orig)*$alto_orig;\n }\n else\n {\n $alto_dest=$alto;\n $ancho_dest=($alto_dest/$alto_orig)*$ancho_orig;\n }\n\n // imagecreatetruecolor, solo estan en G.D. 2.0.1 con PHP 4.0.6+\n $img2=@imagecreatetruecolor($ancho_dest,$alto_dest) or $img2=imagecreate($ancho_dest,$alto_dest);\n\n // Redimensionar\n // imagecopyresampled, solo estan en G.D. 2.0.1 con PHP 4.0.6+\n @imagecopyresampled($img2,$img,0,0,0,0,$ancho_dest,$alto_dest,$ancho_orig,$alto_orig) or imagecopyresized($img2,$img,0,0,0,0,$ancho_dest,$alto_dest,$ancho_orig,$alto_orig);\n\n // Crear fichero nuevo, según extensión.\n if ($tipo==1) // GIF\n if (function_exists(\"imagegif\"))\n imagegif($img2, $ruta2);\n else\n return false;\n\n if ($tipo==2) // JPG\n if (function_exists(\"imagejpeg\"))\n imagejpeg($img2, $ruta2);\n else\n return false;\n\n if ($tipo==3) // PNG\n if (function_exists(\"imagepng\"))\n imagepng($img2, $ruta2);\n else\n return false;\n \n return true;\n }", "private function generateThumbnailImagick(){\n\t}", "public function rotateCounterclockwise($angle = 0, $bg_color = array(255, 255, 255)) {\n\t\tif(!$this->image) {\n\t\t\ttrigger_error('The image does not exist or is not readable.', E_USER_WARNING);\n\t\t\treturn false;\n\t\t}\n\t\treturn $this->rotate($angle, $bg_color);\n\t}", "public function getRotation()\n {\n return self::accessPgArray($this->rotation);\n }" ]
[ "0.74800676", "0.70266724", "0.69540966", "0.6877532", "0.6846565", "0.66865224", "0.66659325", "0.6545799", "0.6545799", "0.65330976", "0.652733", "0.652139", "0.65017194", "0.6486562", "0.64536506", "0.6447685", "0.64385647", "0.6410986", "0.63770795", "0.6323427", "0.6317846", "0.62711066", "0.6254593", "0.6250979", "0.6227321", "0.62242687", "0.62008214", "0.61994374", "0.61969364", "0.61923546", "0.6166374", "0.61537373", "0.6151725", "0.60097504", "0.59782887", "0.5976494", "0.5965522", "0.5829295", "0.5774393", "0.5720335", "0.57187396", "0.57187325", "0.571346", "0.5704452", "0.56929755", "0.563063", "0.5592678", "0.55915356", "0.5577885", "0.5534183", "0.5530064", "0.5527596", "0.55076", "0.5475255", "0.53699946", "0.53674215", "0.53331363", "0.5264167", "0.5228505", "0.52153283", "0.52153283", "0.52153283", "0.5210702", "0.51796615", "0.51674795", "0.515216", "0.5140539", "0.51355606", "0.51345587", "0.5134231", "0.50891113", "0.50854796", "0.50669307", "0.5035269", "0.5015521", "0.49907744", "0.49114364", "0.49044877", "0.48927322", "0.4879133", "0.4879133", "0.48691073", "0.48677772", "0.48488382", "0.48460698", "0.48422027", "0.48406836", "0.483066", "0.48273173", "0.48227394", "0.4802049", "0.47839445", "0.47814494", "0.4779683", "0.47680616", "0.4758401", "0.47525924", "0.4746984", "0.47334173", "0.47196782" ]
0.64309704
17
Rotate the image with GD.
private function rotate_gd($image, $orientation) { switch ($orientation) { case 2: $image = imagerotate($image, 180, 0); imageflip($image, IMG_FLIP_VERTICAL); break; case 3: $image = imagerotate($image, 180, 0); break; case 4: $image = imagerotate($image, 180, 0); imageflip($image, IMG_FLIP_HORIZONTAL); break; case 5: $image = imagerotate($image, -90, 0); imageflip($image, IMG_FLIP_HORIZONTAL); break; case 6: $image = imagerotate($image, -90, 0); break; case 7: $image = imagerotate($image, -90, 0); imageflip($image, IMG_FLIP_VERTICAL); break; case 8: $image = imagerotate($image, 90, 0); break; } return $image; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function image_rotate_gd()\n\t{\n\t\t// Create the image handle\n\t\tif ( ! ($src_img = $this->image_create_gd()))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Set the background color\n\t\t// This won't work with transparent PNG files so we are\n\t\t// going to have to figure out how to determine the color\n\t\t// of the alpha channel in a future release.\n\n\t\t$white = imagecolorallocate($src_img, 255, 255, 255);\n\n\t\t// Rotate it!\n\t\t$dst_img = imagerotate($src_img, $this->rotation_angle, $white);\n\n\t\t// Show the image\n\t\tif ($this->dynamic_output === TRUE)\n\t\t{\n\t\t\t$this->image_display_gd($dst_img);\n\t\t}\n\t\telseif ( ! $this->image_save_gd($dst_img)) // ... or save it\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Kill the file handles\n\t\timagedestroy($dst_img);\n\t\timagedestroy($src_img);\n\n\t\tchmod($this->full_dst_path, $this->file_permissions);\n\n\t\treturn TRUE;\n\t}", "function image_rotate()\n\t{\n\t\t// Allowed rotation values\n\t\t\n\t\t$degs = array(90, 180, 270, 'vrt', 'hor');\t\n\t\n\t\t\tif ($this->rotation == '' OR ! in_array($this->rotation, $degs))\n\t\t\t{\n\t\t\t$this->set_error('imglib_rotation_angle_required');\n\t\t\treturn FALSE;\t\t\t\n\t\t\t}\n\t\n\t\t/** -------------------------------------\n\t\t/** Reassign the width and height\n\t\t/** -------------------------------------*/\n\t\n\t\tif ($this->rotation == 90 OR $this->rotation == 270)\n\t\t{\n\t\t\t$this->dst_width\t= $this->src_height;\n\t\t\t$this->dst_height\t= $this->src_width;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->dst_width\t= $this->src_width;\n\t\t\t$this->dst_height\t= $this->src_height;\n\t\t}\n\t\n\t\t/** -------------------------------------\n\t\t/** Choose resizing function\n\t\t/** -------------------------------------*/\n\t\t\n\t\tif ($this->resize_protocol == 'imagemagick' OR $this->resize_protocol == 'netpbm')\n\t\t{\n\t\t\t$protocol = 'image_process_'.$this->resize_protocol;\n\t\t\n\t\t\treturn $this->$protocol('rotate');\n\t\t}\n\t\t\n \t\tif ($this->rotation == 'hor' OR $this->rotation == 'vrt')\n \t\t{\n\t\t\treturn $this->image_mirror_gd();\n \t\t}\n\t\telse\n\t\t{\t\t\n\t\t\treturn $this->image_rotate_gd();\n\t\t}\n\t}", "function _rotateImageGD2($file, $desfile, $degrees, $imgobj) {\r\n // GD can only handle JPG & PNG images\r\n if ($imgobj->_type !== \"jpg\" && $imgobj->_type !== \"jpeg\" && $imgobj->_type !== \"png\" && $imgobj->_type !== \"gif\") {\r\n return false;\r\n }\r\n if ($imgobj->_type == \"gif\" && !function_exists(\"imagecreatefromgif\")) {\r\n \treturn false;\r\n }\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n $src_img = @imagecreatefromjpeg($file);\r\n } else if ($imgobj->_type == \"png\") {\r\n $src_img = @imagecreatefrompng($file);\r\n \t$dst_img = imagecreatetruecolor($imgobj->_size[0],$imgobj->_size[1]);\r\n\t\t\t$img_white = imagecolorallocate($dst_img, 255, 255, 255); // set background to white\r\n\t\t\t$img_return = imagefill($dst_img, 0, 0, $img_white);\r\n\t\t\timagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $imgobj->_size[0], $imgobj->_size[1], $imgobj->_size[0], $imgobj->_size[1]);\r\n\t\t\t$src_img = $dst_img;\r\n } else {\r\n \t$src_img = @imagecreatefromgif($file);\r\n \t$dst_img = imagecreatetruecolor($imgobj->_size[0],$imgobj->_size[1]);\r\n\t\t\t$img_white = imagecolorallocate($dst_img, 255, 255, 255); // set background to white\r\n\t\t\t$img_return = imagefill($dst_img, 0, 0, $img_white);\r\n\t\t\timagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $imgobj->_size[0], $imgobj->_size[1], $imgobj->_size[0], $imgobj->_size[1]);\r\n\t\t\t$src_img = $dst_img;\r\n }\r\n if (!$src_img) {\r\n return false;\r\n }\r\n // The rotation routine...\r\n $dst_img = imagerotate($src_img, $degrees, 0);\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n imagejpeg($dst_img, $desfile, $this->_JPEG_quality);\r\n } else if ($imgobj->_type == \"png\") {\r\n imagepng($dst_img, $desfile);\r\n } else {\r\n \timagegif($dst_img, $desfile);\r\n }\r\n imagedestroy($src_img);\r\n imagedestroy($dst_img);\r\n return true;\r\n }", "function RotatedImage($file,$x,$y,$w,$h,$angle)\n{\n $this->Rotate($angle,$x,$y);\n $this->Image($file,$x,$y,$w,$h);\n $this->Rotate(0);\n}", "function _rotateImageGD1($file, $desfile, $degrees, $imgobj) {\r\n // GD can only handle JPG & PNG images\r\n if ($imgobj->_type !== \"jpg\" && $imgobj->_type !== \"jpeg\" && $imgobj->_type !== \"png\") {\r\n return false;\r\n }\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n $src_img = imagecreatefromjpeg($file);\r\n } else {\r\n $src_img = imagecreatefrompng($file);\r\n }\r\n if (!$src_img) {\r\n return false;\r\n }\r\n // The rotation routine...\r\n $dst_img = imagerotate($src_img, $degrees, 0);\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n imagejpeg($dst_img, $desfile, $this->_JPEG_quality);\r\n } else {\r\n imagepng($dst_img, $desfile);\r\n }\r\n imagedestroy($src_img);\r\n imagedestroy($dst_img);\r\n return true; \r\n }", "function rotate($img_name,$rotated_image,$direction){\n\t\t$image = $img_name;\n\t\t$extParts=explode(\".\",$image);\n\t\t$ext=end($extParts);\n\t\t$filename=$rotated_image;\n\t\t//How many degrees you wish to rotate\n\t\t$degrees = 0;\n\t\tif($direction=='R'){\n\t\t\t$degrees = 90;\n\t\t}\n\t\tif($direction=='L'){\n\t\t\t$degrees = -90;\n\t\t}\n\t\t\n\t\tif($ext==\"jpg\" || $ext== \"jpeg\" || $ext==\"JPG\" || $ext== \"JPEG\"){\n\t\t\t$source = imagecreatefromjpeg($image) ;\n\t\t\t$rotate = imagerotate($source, $degrees, 0) ;\n\t\t\timagejpeg($rotate,$filename) ;\n\t\t}\n\t\t\n\t\t\n\t\tif($ext==\"GIF\" || $ext== \"gif\"){\n\t\t\t$source = imagecreatefromgif($image) ;\n\t\t\t$rotate = imagerotate($source, $degrees, 0) ;\n\t\t\timagegif($rotate,$filename) ;\n\t\t\t\n\t\t}\n\t\t\n\t\tif($ext==\"png\" || $ext== \"PNG\"){\n\t\t\t$source = imagecreatefrompng($image) ;\n\t\t\t$rotate = imagerotate($source, $degrees, 0) ;\n\t\t\timagepng($rotate,$filename) ;\n\t\t\t\n\t\t}\n\t\treturn $rotate;\t\n\t\t\n\t}", "function acadp_exif_rotate( $file ){\n\n\tif( ! function_exists( 'exif_read_data' ) ) {\n\t\treturn $file;\n\t}\n\n\t$exif = @exif_read_data( $file['tmp_name'] );\n\t$exif_orient = isset( $exif['Orientation'] ) ? $exif['Orientation'] : 0;\n\t$rotate_image = 0;\n\n\tif( 6 == $exif_orient ) {\n\t\t$rotate_image = 90;\n\t} else if ( 3 == $exif_orient ) {\n\t\t$rotate_image = 180;\n\t} else if ( 8 == $exif_orient ) {\n\t\t$rotate_image = 270;\n\t}\n\n\tif( $rotate_image ) {\n\n\t\tif( class_exists( 'Imagick' ) ) {\n\n\t\t\t$imagick = new Imagick();\n\t\t\t$imagick_pixel = new ImagickPixel();\n\t\t\t$imagick->readImage( $file['tmp_name'] );\n\t\t\t$imagick->rotateImage( $imagick_pixel, $rotate_image );\n\t\t\t$imagick->setImageOrientation( 1 );\n\t\t\t$imagick->writeImage( $file['tmp_name'] );\n\t\t\t$imagick->clear();\n\t\t\t$imagick->destroy();\n\n\t\t} else {\n\n\t\t\t$rotate_image = -$rotate_image;\n\n\t\t\tswitch( $file['type'] ) {\n\t\t\t\tcase 'image/jpeg' :\n\t\t\t\t\tif( function_exists( 'imagecreatefromjpeg' ) ) {\n\t\t\t\t\t\t$source = imagecreatefromjpeg( $file['tmp_name'] );\n\t\t\t\t\t\t$rotate = imagerotate( $source, $rotate_image, 0 );\n\t\t\t\t\t\timagejpeg( $rotate, $file['tmp_name'] );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'image/png' :\n\t\t\t\t\tif( function_exists( 'imagecreatefrompng' ) ) {\n\t\t\t\t\t\t$source = imagecreatefrompng( $file['tmp_name'] );\n\t\t\t\t\t\t$rotate = imagerotate( $source, $rotate_image, 0 );\n\t\t\t\t\t\timagepng( $rotate, $file['tmp_name'] );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'image/gif' :\n\t\t\t\t\tif( function_exists( 'imagecreatefromgif' ) ) {\n\t\t\t\t\t\t$source = imagecreatefromgif( $file['tmp_name'] );\n\t\t\t\t\t\t$rotate = imagerotate( $source, $rotate_image, 0 );\n\t\t\t\t\t\timagegif( $rotate, $file['tmp_name'] );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\treturn $file;\n\n}", "function _rotate_image_resource($img, $angle)\n {\n }", "function rotate($src_file, $dest_file, $degrees, $img_meta) {\n if (!zmgGd1xTool::isSupportedType($img_meta['extension'], $src_file)) {\n return false;\n }\n \n if ($img_meta['extension'] == \"jpg\" || $img_meta['extension'] == \"jpeg\") {\n $src_img = imagecreatefromjpeg($src_file);\n } else {\n $src_img = imagecreatefrompng($src_file);\n }\n if (!$src_img) {\n return zmgToolboxPlugin::registerError($src_file, 'GD 1.x: Could not rotate image.');\n }\n\n // The rotation routine...\n $dst_img = imagerotate($src_img, $degrees, 0);\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\n imagejpeg($dst_img, $dest_file, $img_meta['jpeg_qty']);\n } else {\n imagepng($dst_img, $dest_file);\n }\n\n imagedestroy($src_img);\n imagedestroy($dst_img);\n return true;\n }", "function rotateImage($param=array())\r\n {\r\n $img = isset($param['src']) ? $param['src'] : false;\r\n $newname= isset($param['newname']) ? $param['newname'] : $img;\r\n $degrees= isset($param['deg']) ? $param['deg'] : false;\r\n $out = false;\r\n \r\n if($img)\r\n {\r\n \r\n switch(exif_imagetype($img)){\r\n \tcase 1:\r\n \t\t//gif\r\n \t\t$destimg = imagecreatefromgif($img);\r\n \t\t$transColor = imagecolorallocatealpha($destimg, 255, 255, 255, 127);\r\n \t\t$rotatedImage = imagerotate($destimg, $degrees, $transColor);\r\n \t\timagesavealpha($rotatedImage, true);\r\n \t\timagegif($rotatedImage, $newname);\r\n \tbreak;\r\n \tcase 2:\r\n \t\t//jpg\r\n \t\t$destimg = imagecreatefromjpeg($img);\r\n \t\t$transColor = imagecolorallocatealpha($destimg, 255, 255, 255, 127);\r\n \t\t$rotatedImage = imagerotate($destimg, $degrees, $transColor);\r\n \t\timagesavealpha($rotatedImage, true);\r\n \t\timagejpeg($rotatedImage, $newname);\r\n \tbreak;\r\n \tcase 3:\r\n \t\t//png\r\n \t\t$destimg = imagecreatefrompng($img);\r\n \t\t$transColor = imagecolorallocatealpha($destimg, 255, 255, 255, 127);\r\n \t\t$rotatedImage = imagerotate($destimg, $degrees, $transColor);\r\n \t\timagesavealpha($rotatedImage, true);\r\n \t\timagepng($rotatedImage, $newname);\r\n \tbreak;\r\n }\r\n \r\n $out = $img;\r\n }\r\n \r\n return $out;\r\n }", "function RotatedImage($file,$x,$y,$w,$h,$angle) {\n\t\t$this->Rotate($angle,$x,$y);\n\t\t$this->Image($file,$x,$y,$w,$h);\n\t\t$this->Rotate(0);\n\t}", "function RotatedImage($file,$x,$y,$w,$h,$angle) {\n\t\t$this->Rotate($angle,$x,$y);\n\t\t$this->Image($file,$x,$y,$w,$h);\n\t\t$this->Rotate(0);\n\t}", "function RotatedImage($file,$x,$y,$w,$h,$angle)\n\t{\n\t $this->Rotate($angle,$x,$y);\n\t $this->Image($file,$x,$y,$w,$h);\n\t $this->Rotate(0);\n\t}", "public function rotate()\n\t{\n\t\t// Allowed rotation values\n\t\t$degs = array(90, 180, 270, 'vrt', 'hor');\n\n\t\tif ($this->rotation_angle === '' OR ! in_array($this->rotation_angle, $degs))\n\t\t{\n\t\t\t$this->set_error('imglib_rotation_angle_required');\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Reassign the width and height\n\t\tif ($this->rotation_angle === 90 OR $this->rotation_angle === 270)\n\t\t{\n\t\t\t$this->width\t= $this->orig_height;\n\t\t\t$this->height\t= $this->orig_width;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->width\t= $this->orig_width;\n\t\t\t$this->height\t= $this->orig_height;\n\t\t}\n\n\t\t// Choose resizing function\n\t\tif ($this->image_library === 'imagemagick' OR $this->image_library === 'netpbm')\n\t\t{\n\t\t\t$protocol = 'image_process_'.$this->image_library;\n\t\t\treturn $this->$protocol('rotate');\n\t\t}\n\n\t\treturn ($this->rotation_angle === 'hor' OR $this->rotation_angle === 'vrt')\n\t\t\t? $this->image_mirror_gd()\n\t\t\t: $this->image_rotate_gd();\n\t}", "function RotatedImage($file,$x,$y,$w,$h,$bln_rotate)\n\t{\n\t $img_size= getimagesize($file);\n\t \n\t $aspect_y=$h/$img_size[1];\n\t $aspect_x=$w/$img_size[0];\n\t \n\t if ($bln_rotate==1){\n\t\t //Check to see if the image fits better at 90 degrees\n\t\t $aspect_y2=$w/$img_size[1];\n\t\t $aspect_x2=$h/$img_size[0];\n\t\t \n\t\t if($aspect_x<$aspect_y)\n\t\t {\n\t\t \t$aspect1=$aspect_x;\n\t\t }\n\t\t else {\n\t\t \t$aspect1=$aspect_y;\n\t\t }\n\t\t \n\t\t if($aspect_x2<$aspect_y2)\n\t\t {\n\t\t \t$aspect2=$aspect_x2;\n\t\t }\n\t\t else {\n\t\t \t$aspect2=$aspect_y2;\n\t\t }\n\t\t \n\t\t if ($aspect1<$aspect2)\n\t\t {\n\t\t \t$angle=90;\n\t\t \t$y=$y+$h;\n\t\t \t$t=$h;\n\t\t \t$h=$w;\n\t\t \t$w=$t;\n\t\t \t$aspect_y=$aspect_y2;\n\t\t \t$aspect_x=$aspect_x2;\n\t\t }\n\t }\n\t \n\t \n\t \n\t \n\t \tif ($aspect_x>$aspect_y){\n\t \t\t$flt_adjust=$aspect_y;\n\t \t\t$w=$flt_adjust*$img_size[0];\n\t \t\t\n\t \t}\n\t \telse{\n\t \t\t$flt_adjust=$aspect_x;\n\t \t\t$h=$flt_adjust*$img_size[1];\n\t \t}\n\t \n\t \t\n\t \t\n\t $this->Rotate($angle,$x,$y);\n\t $this->Image($file,$x,$y,$w,$h,'JPG');\n\t $this->Rotate(0);\n\t}", "public function Rotate($angle){\n\t\t\t$rgba = \\backbone\\Color::HexToRGBA(\"#FFFFFF\", 0);\n\t\t\t$color = $this->AllocateColor($rgba[0]['r'], $rgba[0]['g'], $rgba[0]['b'], $rgba[0]['alpha']);\n\n\t\t\t$img = new \\backbone\\Image();\n\t\t\t$img->handle = imagerotate($this->handle, $angle, $color);\n\t\t\treturn $img;\n\t\t}", "function autoRotateImage($image) {\n $orientation = $image->getImageOrientation();\n\n switch($orientation) {\n case imagick::ORIENTATION_BOTTOMRIGHT:\n $image->rotateimage(\"#000\", 180); // rotate 180 degrees\n break;\n\n case imagick::ORIENTATION_RIGHTTOP:\n $image->rotateimage(\"#000\", 90); // rotate 90 degrees CW\n break;\n\n case imagick::ORIENTATION_LEFTBOTTOM:\n $image->rotateimage(\"#000\", -90); // rotate 90 degrees CCW\n break;\n }\n\n // Now that it's auto-rotated, make sure the EXIF data is correct in case the EXIF gets saved with the image!\n $image->setImageOrientation(imagick::ORIENTATION_TOPLEFT);\n}", "function RotatedImage($file,$x,$y,$w,$h,$angle)\n {\n $this->Rotate($angle,$x,$y);\n $this->Image($file,$x,$y,$w,$h);\n $this->Rotate(0);\n }", "function AutoRotateImage($src_image, $ref = false) \n {\n # from a non-ingested image to properly rotate a preview image\n global $imagemagick_path, $camera_autorotation_ext, $camera_autorotation_gm;\n \n if (!isset($imagemagick_path)) \n {\n return false;\n # for the moment, this only works for imagemagick\n # note that it would be theoretically possible to implement this\n # with a combination of exiftool and GD image rotation functions.\n }\n\n # Locate imagemagick.\n $convert_fullpath = get_utility_path(\"im-convert\");\n if ($convert_fullpath == false) \n {\n return false;\n }\n \n $exploded_src = explode('.', $src_image);\n $ext = $exploded_src[count($exploded_src) - 1];\n $triml = strlen($src_image) - (strlen($ext) + 1);\n $noext = substr($src_image, 0, $triml);\n \n if (count($camera_autorotation_ext) > 0 && (!in_array(strtolower($ext), $camera_autorotation_ext))) \n {\n # if the autorotation extensions are set, make sure it is allowed for this extension\n return false;\n }\n\n $exiftool_fullpath = get_utility_path(\"exiftool\");\n $new_image = $noext . '-autorotated.' . $ext;\n \n if ($camera_autorotation_gm) \n {\n $orientation = get_image_orientation($src_image);\n if ($orientation != 0) \n {\n $command = $convert_fullpath . ' ' . escapeshellarg($src_image) . ' -rotate +' . $orientation . ' ' . escapeshellarg($new_image);\n run_command($command);\n }\n $command = $exiftool_fullpath . ' Orientation=1 ' . escapeshellarg($new_image);\n } \n else\n {\n if ($ref != false) \n {\n # use the original file to get the orientation info\n $extension = sql_value(\"select file_extension value from resource where ref=$ref\", '');\n $file = get_resource_path($ref, true, \"\", false, $extension, -1, 1, false, \"\", -1);\n # get the orientation\n $orientation = get_image_orientation($file);\n if ($orientation != 0) \n {\n $command = $convert_fullpath . ' -rotate +' . $orientation . ' ' . escapeshellarg($src_image) . ' ' . escapeshellarg($new_image);\n run_command($command);\n # change the orientation metadata\n $command = $exiftool_fullpath . ' Orientation=1 ' . escapeshellarg($new_image);\n }\n } \n else\n {\n $command = $convert_fullpath . ' ' . escapeshellarg($src_image) . ' -auto-orient ' . escapeshellarg($new_image);\n run_command($command);\n }\n }\n\n if (!file_exists($new_image)) \n {\n return false;\n }\n\n if (!$ref) \n {\n # preserve custom metadata fields with exiftool \n # save the new orientation\n # $new_orientation=run_command($exiftool_fullpath.' -s -s -s -orientation -n '.$new_image);\n $old_orientation = run_command($exiftool_fullpath . ' -s -s -s -orientation -n ' . escapeshellarg($src_image));\n \n $exiftool_copy_command = $exiftool_fullpath . \" -TagsFromFile \" . escapeshellarg($src_image) . \" -all:all \" . escapeshellarg($new_image);\n run_command($exiftool_copy_command);\n \n # If orientation was empty there's no telling if rotation happened, so don't assume.\n # Also, don't go through this step if the old orientation was set to normal\n if ($old_orientation != '' && $old_orientation != 1) \n {\n $fix_orientation = $exiftool_fullpath . ' Orientation=1 -n ' . escapeshellarg($new_image);\n run_command($fix_orientation);\n }\n }\n \n unlink($src_image);\n rename($new_image, $src_image);\n return true; \n }", "public static function rotate($baseURL, $name, $image)\r\n {\r\n $exif = exif_read_data($image);\r\n\r\n if (array_key_exists('Orientation', $exif))\r\n {\r\n $jpg = imagecreatefromjpeg($image);\r\n $orientation = $exif['Orientation'];\r\n switch ($orientation)\r\n {\r\n case 3:\r\n $jpg = imagerotate($jpg, 180, 0);\r\n break;\r\n case 6:\r\n $jpg = imagerotate($jpg, -90, 0);\r\n break;\r\n case 8:\r\n $jpg = imagerotate($jpg, 90, 0);\r\n break;\r\n default: \t\r\n }\r\n imagejpeg($jpg, $baseURL.'computed/'.$name, 90);\r\n }\r\n\t\t else\r\n\t\t {\r\n\t\t\t copy($image, $baseURL.'computed/'.$name);\r\n\t\t }\r\n }", "private function _imgRotate(){\r\n\r\n $result = new stdClass();\r\n $response = 400;\r\n\r\n\r\n if($this->hasLogin()){\r\n\r\n /*\r\n \t*\r\n \t*\r\n \t*\tCheck the method used is POST\r\n \t*\r\n \t*\r\n \t*/\r\n \tif($_SERVER['REQUEST_METHOD'] == 'POST'){\r\n\r\n $url = strtok($_POST['url'], '?');\r\n\r\n $sourcePath = ROOT.'/site/files/_tmp/'.basename($url);\r\n $webPath = WEBROOT.'/site/files/_tmp/'.basename($url);\r\n $degrees = $_POST['direction']=='CCW'?90:-90;\r\n $info = getimagesize($sourcePath);\r\n\r\n switch($info['mime']){\r\n case 'image/png':\r\n $img = imagecreatefrompng($sourcePath);\r\n $rotate = imagerotate($img, $degrees, 0);\r\n imagesavealpha($rotate, true);\r\n imagepng($rotate, $sourcePath);\r\n break;\r\n case 'image/jpeg':\r\n $img = imagecreatefromjpeg($sourcePath);\r\n $rotate = imagerotate($img, $degrees, 0);\r\n imagejpeg($rotate, $sourcePath);\r\n break;\r\n case 'image/gif':\r\n $img = imagecreatefromgif($sourcePath);\r\n $rotate = imagerotate($img, $degrees, 0);\r\n imagegif($rotate, $sourcePath);\r\n break;\r\n default:\r\n $result->error = \"Only PNG, JPEG or GIF images are allowed!\";\r\n $response = 400;\r\n exit;\r\n }\r\n\r\n if(isset($img))imagedestroy($img);\r\n if(isset($rotate))imagedestroy($rotate);\r\n\r\n $info = getimagesize($sourcePath);\r\n $result->url = $webPath;\r\n $result->size = [$info[0],$info[1]];\r\n $response = 200;\r\n } else {\r\n $response = 400;\r\n }\r\n }\r\n\r\n http_response_code($response);\r\n echo json_encode($result);\r\n exit;\r\n\r\n }", "function rotateImage0($img, $imgPath, $suffix, $degrees, $quality, $save)\n{\n // Open the original image.\n $original = imagecreatefromjpeg(\"$imgPath/$img\") or die(\"Error Opening original\");\n list($width, $height, $type, $attr) = getimagesize(\"$imgPath/$img\");\n \n // Resample the image.\n $tempImg = imagecreatetruecolor($width, $height) or die(\"Cant create temp image\");\n imagecopyresized($tempImg, $original, 0, 0, 0, 0, $width, $height, $width, $height) or die(\"Cant resize copy\");\n \n // Rotate the image.\n $rotate = imagerotate($original, $degrees, 0);\n \n // Save.\n if($save)\n {\n // Create the new file name.\n $newNameE = explode(\".\", $img);\n $newName = ''. $newNameE[0] .''. $suffix .'.'. $newNameE[1] .'';\n \n // Save the image.\n imagejpeg($rotate, \"$imgPath/$newName\", $quality) or die(\"Cant save image\");\n }\n \n // Clean up.\n imagedestroy($original);\n imagedestroy($tempImg);\n return true;\n}", "public function image_mirror_gd()\n\t{\n\t\tif ( ! $src_img = $this->image_create_gd())\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t$width = $this->orig_width;\n\t\t$height = $this->orig_height;\n\n\t\tif ($this->rotation_angle === 'hor')\n\t\t{\n\t\t\tfor ($i = 0; $i < $height; $i++)\n\t\t\t{\n\t\t\t\t$left = 0;\n\t\t\t\t$right = $width - 1;\n\n\t\t\t\twhile ($left < $right)\n\t\t\t\t{\n\t\t\t\t\t$cl = imagecolorat($src_img, $left, $i);\n\t\t\t\t\t$cr = imagecolorat($src_img, $right, $i);\n\n\t\t\t\t\timagesetpixel($src_img, $left, $i, $cr);\n\t\t\t\t\timagesetpixel($src_img, $right, $i, $cl);\n\n\t\t\t\t\t$left++;\n\t\t\t\t\t$right--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfor ($i = 0; $i < $width; $i++)\n\t\t\t{\n\t\t\t\t$top = 0;\n\t\t\t\t$bottom = $height - 1;\n\n\t\t\t\twhile ($top < $bottom)\n\t\t\t\t{\n\t\t\t\t\t$ct = imagecolorat($src_img, $i, $top);\n\t\t\t\t\t$cb = imagecolorat($src_img, $i, $bottom);\n\n\t\t\t\t\timagesetpixel($src_img, $i, $top, $cb);\n\t\t\t\t\timagesetpixel($src_img, $i, $bottom, $ct);\n\n\t\t\t\t\t$top++;\n\t\t\t\t\t$bottom--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Show the image\n\t\tif ($this->dynamic_output === TRUE)\n\t\t{\n\t\t\t$this->image_display_gd($src_img);\n\t\t}\n\t\telseif ( ! $this->image_save_gd($src_img)) // ... or save it\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Kill the file handles\n\t\timagedestroy($src_img);\n\n\t\tchmod($this->full_dst_path, $this->file_permissions);\n\n\t\treturn TRUE;\n\t}", "public function rotate()\n {\n // not possible in php?\n }", "public function actionRotate($imageid,$direction)\n\t{\n\t\t\n\t\t// the image object is created from the database to avoid user input\n\t\t$image = Image::model()->findByPk($imageid);\n\t\t// where to return after the operation\n\t\t$rotatedurl = Yii::app()->user->returnUrl;\n\t\t\n\t\t// temporary filename for the created rotated image\n\t\t$tempfilename = Image::FULLIMAGETEMPPATH . uniqid() . '.jpg';\n\t\t// the image variable $rotated is created based on the original JPG in the file system\n\t\t\n\t\t// if the file does not exist, the user is redirected away\n\t\tif (!file_exists($image->getImageFile('full',false,Image::FULLIMAGEPATH)))\n\t\t{\n\t\t\t$rotatedurl['rotated']='fail_file_not_found';\n\t\t\t$this->redirect($rotatedurl);\n\t\t}\n\t\t\t\t\n\t\t// the original full image is evaluated to determine if it's a JPG\n\t\t// should the file not be jpg, execution is terminated and user is presented\n\t\t// with an error\n\t\t$originalFullImage = $image->getImageFile('full',false,Image::FULLIMAGEPATH);\n\t\t// getimagesize returns information of image size, but also of type among other things\n\t\t$information = getimagesize($originalFullImage);\n\t\tif ($information['mime'] != 'image/jpeg')\n\t\t{\n\t\t\t$rotatedurl['rotated']='fail_not_jpg';\n\t\t\t$this->redirect($rotatedurl);\n\t\t}\n\n\t\t// an uncompressed image is created from the original full size image\n\t\t$rotate = imagecreatefromjpeg($originalFullImage);\n\t\t// the original full image is unset to save memory\n\t\tunset($originalFullImage);\n\t\t\n\t\t// defining the direction of the rotation\n\t\tswitch($direction) \n\t\t{\n\t\t\tcase 'clockwise':\n\t\t\t\t$angle = -90; \t\n\t\t\t\tbreak;\n\t\t\tcase 'counterclockwise':\n\t\t\t\t$angle = 90; \t\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t// creates the rotated image\n\t\t$rotated = imagerotate($rotate,$angle,0);\n\t\tunset($rotate);\n\t\t// saves the rotated image as a jpeg to the temporary file directory\n\t\timagejpeg($rotated,$tempfilename,100);\n\t\tunset($rotated);\n\t\t\n\t\t// the existance of the rotated image is evaluated before anything is deleted\n\t\tif(file_exists($tempfilename))\n\t\t{\n\t\t\t// deletes all the physical image files for the image object\n\t\t\t$image->deleteImage(array('small', 'light', 'medium', 'large','full'));\n\t\t\t\n\t\t\t// moving the generated image to it's desired location\n\t\t\trename($tempfilename,$image->getImageFile('full',false,Image::FULLIMAGEPATH));\n\t\t\t\n\t\t\t// generating thumbnails for the rotated image\n\t\t\t$image->generateThumbnails();\n\t\t}\n\n\t\t$rotatedurl['rotated']='true';\n\t\t$this->redirect($rotatedurl);\n\t\t\t\t\n\t}", "protected function _rotateImage(&$photo, $path)\n {\n \t$exif = @exif_read_data($path);\n \t\n \tif (!empty($exif['Orientation']))\n \t\tswitch ($exif['Orientation'])\n \t\t{\n \t\t\tcase 8:\n \t\t\t\t$photo->rotateImageNDegrees(90)->save($path);\n \t\t\t\tbreak;\n \t\t\tcase 3:\n \t\t\t\t$photo->rotateImageNDegrees(180)->save($path);\n \t\t\t\tbreak;\n \t\t\tcase 6:\n \t\t\t\t$photo->rotateImageNDegrees(-90)->save($path);\n \t\t\t\tbreak;\n \t}\n }", "function RotatedImage($file, $x, $y, $w, $h, $angle) {\n\t\t$this->Rotate($angle, $x, $y);\n\t\t$this->Image($file, $x, $y, $w, $h);\n\t\t$this->Rotate(0);\n\t}", "public static function change_image_type(){\n/**\n*\n*This function change the image type like convert png to jpg or bmp or gif\n*\n*/\npublic static function rotate()\n}", "protected function adjustImageOrientation()\n { \n $exif = @exif_read_data($this->file);\n \n if($exif && isset($exif['Orientation'])) {\n $orientation = $exif['Orientation'];\n \n if($orientation != 1){\n $img = imagecreatefromjpeg($this->file);\n \n $mirror = false;\n $deg = 0;\n \n switch ($orientation) {\n \n case 2:\n $mirror = true;\n break;\n \n case 3:\n $deg = 180;\n break;\n \n case 4:\n $deg = 180;\n $mirror = true; \n break;\n \n case 5:\n $deg = 270;\n $mirror = true; \n break;\n \n case 6:\n $deg = 270;\n break;\n \n case 7:\n $deg = 90;\n $mirror = true; \n break;\n \n case 8:\n $deg = 90;\n break;\n }\n \n if($deg) $img = imagerotate($img, $deg, 0); \n if($mirror) $img = $this->mirrorImage($img);\n \n $this->image = str_replace('.jpg', \"-O$orientation.jpg\", $this->file); \n imagejpeg($img, $this->file, $this->quality);\n }\n }\n }", "function RotatedImage($file, $x, $y, $w, $h, $angle) {\n $this->Rotate($angle, $x, $y);\n $this->Image($file, $x, $y, $w, $h);\n $this->Rotate(0);\n }", "public function test_rotate() {\n\n\t\t$file = DIR_TESTDATA . '/images/gradient-square.jpg';\n\n\t\t$imagick_image_editor = new WP_Image_Editor_Imagick( $file );\n\t\t$imagick_image_editor->load();\n\n\t\t$property = new ReflectionProperty( $imagick_image_editor, 'image' );\n\t\t$property->setAccessible( true );\n\n\t\t$color_top_left = $property->getValue( $imagick_image_editor )->getImagePixelColor( 1, 1 )->getColor();\n\n\t\t$imagick_image_editor->rotate( 180 );\n\n\t\t$this->assertEquals( $color_top_left, $property->getValue( $imagick_image_editor )->getImagePixelColor( 99, 99 )->getColor() );\n\t}", "function image_mirror_gd()\n\t{\t\t\n\t\tif ( ! $src_img = $this->image_create_gd())\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t$width = $this->src_width;\n\t\t$height = $this->src_height;\n\n\t\tif ($this->rotation == 'hor')\n\t\t{\n\t\t\tfor ($i = 0; $i < $height; $i++)\n\t\t\t{\t\t \n\t\t\t\t$left = 0; \n\t\t\t\t$right = $width-1; \n\t\n\t\t\t\twhile ($left < $right)\n\t\t\t\t{ \n\t\t\t\t\t$cl = imagecolorat($src_img, $left, $i); \n\t\t\t\t\t$cr = imagecolorat($src_img, $right, $i);\n\t\t\t\t\t\n\t\t\t\t\timagesetpixel($src_img, $left, $i, $cr); \n\t\t\t\t\timagesetpixel($src_img, $right, $i, $cl); \n\t\t\t\t\t\n\t\t\t\t\t$left++; \n\t\t\t\t\t$right--; \n\t\t\t\t} \n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfor ($i = 0; $i < $width; $i++)\n\t\t\t{\t\t \n\t\t\t\t$top = 0; \n\t\t\t\t$bot = $height-1; \n\t\n\t\t\t\twhile ($top < $bot)\n\t\t\t\t{ \n\t\t\t\t\t$ct = imagecolorat($src_img, $i, $top);\n\t\t\t\t\t$cb = imagecolorat($src_img, $i, $bot);\n\t\t\t\t\t\n\t\t\t\t\timagesetpixel($src_img, $i, $top, $cb); \n\t\t\t\t\timagesetpixel($src_img, $i, $bot, $ct); \n\t\t\t\t\t\n\t\t\t\t\t$top++; \n\t\t\t\t\t$bot--; \n\t\t\t\t} \n\t\t\t}\t\t\n\t\t}\n\t\t\n\t\t/** ---------------------------------\n\t\t/** Save the Image\n\t\t/** ---------------------------------*/\n\t\tif ( ! $this->image_save_gd($src_img))\n\t\t{\t\t\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t/** ---------------------------------\n\t\t/** Kill the file handles\n\t\t/** ---------------------------------*/\n\t\timagedestroy($src_img);\n\t\t\n\t\t// Set the file to 777\n\t\t@chmod($this->full_dst_path, FILE_WRITE_MODE);\t\t\t\n\t\t\n\t\treturn TRUE;\n\t}", "public function test_rotate() {\n\t\t$file = DIR_TESTDATA . '/images/one-blue-pixel-100x100.png';\n\n\t\t$imagick_image_editor = new WP_Image_Editor_Imagick( $file );\n\t\t$imagick_image_editor->load();\n\n\t\t$property = new ReflectionProperty( $imagick_image_editor, 'image' );\n\t\t$property->setAccessible( true );\n\n\t\t$color_top_left = $property->getValue( $imagick_image_editor )->getImagePixelColor( 0, 0 )->getColor();\n\n\t\t$imagick_image_editor->rotate( 180 );\n\n\t\t$this->assertSame( $color_top_left, $property->getValue( $imagick_image_editor )->getImagePixelColor( 99, 99 )->getColor() );\n\t}", "function __rotate(&$tmp, $angle, &$color) {\n\n\t\t// skip full loops\n\t\t//\n\t\tif (($angle % 360) == 0) {\n\t\t\treturn true;\n\t\t\t}\n\n\t\t// rectangular rotates are OK\n\t\t//\n\t\tif (($angle % 90) == 0) {\n\n\t\t\t// call `convert -rotate`\n\t\t\t//\n\t\t\t$cmd = $this->__command(\n\t\t\t\t'convert',\n\t\t\t\t\" -rotate {$angle} \"\n\t \t\t\t. escapeshellarg(realpath($tmp->target))\n\t \t\t\t. \" TIF:\"\n\t \t\t\t// ^ \n\t \t\t\t// GIF saving hack\n\t \t\t\t. escapeshellarg(realpath($tmp->target))\n\t \t);\n\t exec($cmd, $result, $errors);\n\t\t\tif ($errors) {\n\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t$w1 = $tmp->image_width;\n\t\t\t$h1 = $tmp->image_height;\n\t\t\t$tmp->image_width = ($angle % 180) ? $h1 : $w1;\n\t\t\t$tmp->image_height = ($angle % 180) ? $w1 : $h1;\n\t\t\treturn true;\n\t\t\t}\n\n\t\treturn false;\n\t\t}", "function rotateImage($width, $height, $rotation, $quality = 8){\n\t\tif(!is_numeric($quality)){\n\t\t\treturn false;\n\t\t}\n\t\t$quality = max(min($quality, 10), 0) * 10;\n\n\t\t$dataPath = TEMP_PATH . we_base_file::getUniqueId();\n\t\t$_resized_image = we_base_imageEdit::edit_image($this->getElement('data'), $this->getGDType(), $dataPath, $quality, $width, $height, false, true, 0, 0, -1, -1, $rotation);\n\n\t\tif(!$_resized_image[0]){\n\t\t\treturn false;\n\t\t}\n\t\t$this->setElement('data', $dataPath);\n\n\t\t$this->setElement('width', $_resized_image[1], 'attrib');\n\t\t$this->setElement('origwidth', $_resized_image[1], 'attrib');\n\n\t\t$this->setElement('height', $_resized_image[2], 'attrib');\n\t\t$this->setElement('origheight', $_resized_image[2], 'attrib');\n\n\t\t$this->DocChanged = true;\n\t\treturn true;\n\t}", "private function rotate_jpg_with_gd($path, $orientation)\n {\n $image = $this->rotate_gd(imagecreatefromjpeg($path), $orientation);\n imagejpeg($image, $path, 100);\n imagedestroy($image);\n }", "function rotateImage($width, $height, $rotation, $quality = 8) {\n\t\tif (!is_numeric($quality)) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\tif ($quality > 10) {\n\t\t\t\t$quality = 10;\n\t\t\t} else if ($quality < 0) {\n\t\t\t\t$quality = 0;\n\t\t\t}\n\n\t\t\t$quality = $quality * 10;\n\n\t\t\t$dataPath = TMP_DIR.\"/\".weFile::getUniqueId();\n\t\t\t$_resized_image = we_image_edit::edit_image($this->getElement(\"data\"), $this->getGDType(), $dataPath, $quality, $width, $height, false, true, 0, 0, -1, -1, $rotation);\n\n\t\t\t$this->setElement(\"data\", $dataPath);\n\n\t\t\t$this->setElement(\"width\", $_resized_image[1]);\n\t\t\t$this->setElement(\"origwidth\", $_resized_image[1], \"attrib\");\n\n\t\t\t$this->setElement(\"height\", $_resized_image[2]);\n\t\t\t$this->setElement(\"origheight\", $_resized_image[2], \"attrib\");\n\n\t\t\t$this->DocChanged = true;\n\t\t}\n\t}", "public function rotate($angle = 0, $bg_color = array(255, 255, 255)) {\n\t\tif(!$this->image) {\n\t\t\ttrigger_error('The image does not exist or is not readable.', E_USER_WARNING);\n\t\t\treturn false;\n\t\t}\n\n\t\t$angle = (float) $angle;\n\t\t$bg_color = $this->normalizeColor($bg_color);\n\n\t\tif($bg_color === false) {\n\t\t\ttrigger_error('Rotate failed because background color could not be generated. Try sending an array(RRR, GGG, BBB).', E_USER_WARNING);\n\t\t\treturn false;\n\t\t}\n\n\t\t$working_image = imagerotate($this->image, $angle, imagecolorallocate($this->image, $bg_color[0], $bg_color[1], $bg_color[2]));\n\n\t\tif($working_image) {\n\t\t\t$this->image = $working_image;\n\t\t\t$this->width = imagesx($this->image);\n\t\t\t$this->height = imagesy($this->image);\n\t\t\t$this->aspect = $this->width/$this->height;\n\t\t\tif($this->aspect > 1) {\n\t\t\t\t$this->orientation = 'landscape';\n\t\t\t} else if($this->aspect < 1) {\n\t\t\t\t$this->orientation = 'portrait';\n\t\t\t} else {\n\t\t\t\t$this->orientation = 'square';\n\t\t\t}\n\t\t\treturn true;\n\t\t} else {\n\t\t\ttrigger_error('Rotate failed.', E_USER_WARNING);\n\t\t\treturn false;\n\t\t}\n\t}", "private function rotate_png_with_gd($path, $orientation)\n {\n $image = $this->rotate_gd(imagecreatefrompng($path), $orientation);\n imagesavealpha($image, true);\n imagealphablending($image, true);\n imagepng($image, $path, 100);\n imagedestroy($image);\n }", "public function rotateBy($rotation) {}", "private function rotate_imagick($imagePath, $orientation)\n {\n $imagick = new Imagick($imagePath);\n $imagick->setImageOrientation(imagick::ORIENTATION_TOPLEFT);\n $deg = 0;\n\n switch ($orientation) {\n case 2:\n $deg = 180;\n $imagick->flipImage();\n break;\n\n case 3:\n $deg = -180;\n break;\n\n case 4:\n $deg = -180;\n $imagick->flopImage();\n break;\n\n case 5:\n $deg = -90;\n $imagick->flopImage();\n break;\n\n case 6:\n $deg = 90;\n break;\n\n case 7:\n $deg = -90;\n $imagick->flipImage();\n break;\n\n case 8:\n $deg = -90;\n break;\n }\n $imagick->rotateImage(new ImagickPixel('#00000000'), $deg);\n $imagick->writeImage($imagePath);\n $imagick->clear();\n $imagick->destroy();\n }", "public function rotate($sourceImg, $angleDegrees) {\n\n $angle = (int)$angleDegrees;\n if(! $angle || ! abs($angle) % 360) {\n return $sourceImg;\n }\n $width = imagesx($sourceImg);\n $height = imagesy($sourceImg);\n \n /**\n * First create a new image that is large enough to hold the original image at any rotation angle.\n */\n $max = hypot($width, $height);\n $img = $this->_createImage($max, $max);\n if(false === $img) {\n return false;\n }\n /**\n * DEBUG\n */\n // $debugIndex = $this->_debugWriteToFile($img);\n \n /**\n * Copy the original image centered on the new image.\n */\n if(false === $this->_copyCentered($img, $sourceImg)) {\n return false;\n }\n \n /**\n * DEBUG\n */\n // $debugIndex = $this->_debugWriteToFile($img, $debugIndex);\n \n /**\n * Rotate the new image.\n * \n * NOTICE: negative angles to apply clock-wise rotation.\n */\n $rotatedImg = imagerotate($img, $angle, imagecolorallocatealpha($sourceImg, 0, 0, 0, 127));\n if(false === $rotatedImg) {\n return false;\n }\n \n /**\n * DEBUG\n * $debugIndex = $this->_debugWriteToFile($rotatedImg, $debugIndex);\n */\n \n /**\n * Create an image having having dimensions to fully contain the rotated image at the specified angle.\n */\n $rad = deg2rad($angle);\n $x = $height * abs(sin($rad)) + $width * abs(cos($rad));\n $y = $height * abs(cos($rad)) + $width * abs(sin($rad));\n $finalImg = $this->_createImage($x, $y);\n if(false === $finalImg) {\n return false;\n }\n $res = imagecopy(\n $finalImg, \n $rotatedImg, \n 0, \n 0, \n (imagesx($rotatedImg) - $x) / 2,\n (imagesy($rotatedImg) - $y) / 2,\n $x,\n $y);\n if(false === $res) {\n return false;\n }\n /**\n * DEBUG\n * $this->_debugWriteToFile($finalImg, $debugIndex);\n */\n return $finalImg;\n }", "public function autoRotate() {\n $this->thumb->rotateJpg();\n return $this;\n }", "function rotate($src_file, $dest_file, $degrees, $img_meta) {\n $fileOut = $src_file . \".1\";\n @copy($src_file, $fileOut);\n \n $path = zmgNetpbmTool::getPath();\n if ($img_meta['extension'] == \"png\") {\n $cmd = $path . \"pngtopnm \" . $src_file . \" | \" . $path . \"pnmrotate \"\n . $degrees . \" | \" . $path . \"pnmtopng > \" . $fileOut;\n } else if ($img_meta['extension'] == \"jpg\" || $img_meta['extension'] == \"jpeg\") {\n $cmd = $path . \"jpegtopnm \" . $src_file . \" | \" . $path . \"pnmrotate \"\n . $degrees . \" | \" . $path . \"ppmtojpeg -quality=\" . $img_meta['jpeg_qty']\n . \" > \" . $fileOut;\n } else if ($img_meta['extension'] == \"gif\") {\n $cmd = $path . \"giftopnm \" . $src_file . \" | \" . $path . \"pnmrotate \"\n . $degrees . \" | \" . $path . \"ppmquant 256 | \" . $path . \"ppmtogif > \"\n . $fileOut;\n } else {\n return zmgToolboxPlugin::registerError($src_file, 'NetPBM: Source file is not an image or image type is not supported.');\n }\n\n $output = $retval = null;\n exec($cmd, $output, $retval);\n if ($retval) {\n return zmgToolboxPlugin::registerError($src_file, 'NetPBM: Could not rotate image: ' . $output);\n }\n $erg = @rename($fileOut, $dest_file);\n\n return true;\n }", "private function rotate_gif_with_gd($path, $orientation)\n {\n $image = $this->rotate_gd(imagecreatefromgif($path), $orientation);\n imagegif($image, $path, 100);\n imagedestroy($image);\n }", "protected function _rotate($img, $rotateDegrees, $dstWidth = null, $dstHeight = null) {\n $degrees = is_numeric($rotateDegrees) ? intval($rotateDegrees) : null;\n if(! is_int($degrees)) {\n $var = Types::getVartype($rotateDegrees);\n throw new Exception\\InvalidArgumentException(\"Invalid overlay rotate degrees value '{$var}'\", MediaConst::E_TYPE_MISMATCH);\n }\n if(abs($degrees) > 360) {\n // $var = Types::getVartype($rotateDegrees);\n // throw new Exception\\InvalidArgumentException(\"Invalid overlay value '{$var}'\", MediaConst::E_INVALID_ROTATE_PARAM);\n }\n $obj = new Rotate();\n $finalImg = $obj->rotate($img, $degrees, $dstWidth, $dstHeight);\n if(false === $finalImg) {\n // T_PHP_FUNCTION_FAILED = image function '%s' failed\n $msg = $phpErrorHandler->getErrorMsg(sprintf(MediaConst::T_PHP_FUNCTION_FAILED, \"imagecopy\"), \"cannot copy overlay image\");\n imagedestroy($img);\n // a PHP image function has failed\n throw new Exception\\RuntimeException($msg, MediaConst::E_PHP_FUNCTION_FAILED);\n }\n return $finalImg;\n }", "private function imagerotate($srcImg, $angle, $bgColor, $ignoreTransparent=0) {\n\t\tfunction rotateX($x, $y, $theta) {\n\t\t\treturn $x * cos($theta) - $y * sin($theta);\n\t\t}\n\t\tfunction rotateY($x, $y, $theta) {\n\t\t\treturn $x * sin($theta) + $y * cos($theta);\n\t\t}\n\n\t\t$srcW = imagesx($srcImg);\n\t\t$srcH = imagesy($srcImg);\n\n\t\t// Normalize angle\n\t\t$angle %= 360;\n\n\t\tif ($angle == 0) {\n\t\t\tif ($ignoreTransparent == 0) {\n\t\t\t\timagesavealpha($srcImg, true);\n\t\t\t}\n\t\t\treturn $srcImg;\n\t\t}\n\n\t\t// Convert the angle to radians\n\t\t$theta = deg2rad($angle);\n\n\t\t$minX = $maxX = $minY = $maxY = 0;\n\t\t\n\t\t// Standard case of rotate\n\t\tif ((abs($angle) == 90) || (abs($angle) == 270)) {\n\t\t\t$width = $srcH;\n\t\t\t$height = $srcW;\n\t\t\tif (($angle == 90) || ($angle == -270)) {\n\t\t\t\t$minX = 0;\n\t\t\t\t$maxX = $width;\n\t\t\t\t$minY = -$height+1;\n\t\t\t\t$maxY = 1;\n\t\t\t} else if (($angle == -90) || ($angle == 270)) {\n\t\t\t\t$minX = -$width+1;\n\t\t\t\t$maxX = 1;\n\t\t\t\t$minY = 0;\n\t\t\t\t$maxY = $height;\n\t\t\t}\n\t\t} else if (abs($angle) === 180) {\n\t\t\t$width = $srcW;\n\t\t\t$height = $srcH;\n\t\t\t$minX = -$width+1;\n\t\t\t$maxX = 1;\n\t\t\t$minY = -$height+1;\n\t\t\t$maxY = 1;\n\t\t} else {\n\t\t\t// Calculate the width of the destination image\n\t\t\t$temp = array(\n\t\t\t\trotateX(0, 0, 0-$theta),\n\t\t\t\trotateX($srcW, 0, 0-$theta),\n\t\t\t\trotateX(0, $srcH, 0-$theta),\n\t\t\t\trotateX($srcW, $srcH, 0-$theta),\n\t\t\t);\n\t\t\t$minX = floor(min($temp));\n\t\t\t$maxX = ceil(max($temp));\n\t\t\t$width = $maxX - $minX;\n\n\t\t\t// Calculate the height of the destination image\n\t\t\t$temp = array(\n\t\t\t\trotateY(0, 0, 0-$theta),\n\t\t\t\trotateY($srcW, 0, 0-$theta),\n\t\t\t\trotateY(0, $srcH, 0-$theta),\n\t\t\t\trotateY($srcW, $srcH, 0-$theta),\n\t\t\t);\n\t\t\t$minY = floor(min($temp));\n\t\t\t$maxY = ceil(max($temp));\n\t\t\t$height = $maxY - $minY;\n\t\t}\n\n\t\t$destImg = imagecreatetruecolor($width, $height);\n\t\tif ($ignoreTransparent == 0) {\n\t\t\timagefill($destImg, 0, 0, imagecolorallocatealpha($destImg, 255,255, 255, 127));\n\t\t\timagesavealpha($destImg, true);\n\t\t}\n\n\t\t// Sets all pixels in the new image\n\t\tfor ($x = $minX; $x < $maxX; $x++) {\n\t\t\tfor ($y = $minY; $y < $maxY; $y++) {\n\t\t\t\t// Fetch corresponding pixel from the source image\n\t\t\t\t$srcX = round(rotateX($x, $y, $theta));\n\t\t\t\t$srcY = round(rotateY($x, $y, $theta));\n\t\t\t\tif ($srcX >= 0 && $srcX < $srcW && $srcY >= 0 && $srcY < $srcH) {\n\t\t\t\t\t$color = imagecolorat($srcImg, $srcX, $srcY);\n\t\t\t\t} else {\n\t\t\t\t\t$color = $bgColor;\n\t\t\t\t}\n\t\t\t\timagesetpixel($destImg, $x-$minX, $y-$minY, $color);\n\t\t\t}\n\t\t}\n\n\t\treturn $destImg;\n\t}", "function _rotateImageNETPBM($file, $desfile, $degrees, $imgobj) {\r\n $fileOut = \"$file.1\";\r\n $zoom->platform->copy($file, $fileOut); \r\n if (eregi(\"\\.png\", $imgobj->_filename)) {\r\n $cmd = $this->_NETPBM_path . \"pngtopnm $file | \" . $this->_NETPBM_path . \"pnmrotate $degrees | \" . $this->_NETPBM_path . \"pnmtopng > $fileOut\" ; \r\n } elseif (eregi(\"\\.(jpg|jpeg)\", $imgobj->_filename)) {\r\n $cmd = $this->_NETPBM_path . \"jpegtopnm $file | \" . $this->_NETPBM_path . \"pnmrotate $degrees | \" . $this->_NETPBM_path . \"ppmtojpeg -quality=\" . $this->_JPEG_quality . \" > $fileOut\" ;\r\n } elseif (eregi(\"\\.gif\", $imgobj->_filename)) {\r\n $cmd = $this->_NETPBM_path . \"giftopnm $file | \" . $this->_NETPBM_path . \"pnmrotate $degrees | \" . $this->_NETPBM_path . \"ppmquant 256 | \" . $this->_NETPBM_path . \"ppmtogif > $fileOut\" ; \r\n } else {\r\n return false;\r\n }\r\n $output = $retval = null;\r\n exec($cmd, $output, $retval);\r\n if ($retval) {\r\n return false;\r\n } else {\r\n $erg = $zoom->platform->rename($fileOut, $desfile); \r\n return true;\r\n }\r\n }", "function rotateImage($file, $desfile, $degrees, $imgobj) {\r\n $degrees = intval($degrees);\r\n switch ($this->_conversiontype){\r\n //Imagemagick\r\n case 1:\r\n if($this->_rotateImageIM($file, $desfile, $degrees))\r\n return true;\r\n else\r\n return false;\r\n break;\r\n //NetPBM\r\n case 2:\r\n if($this->_rotateImageNETPBM($file, $desfile, $degrees, $imgobj))\r\n return true;\r\n else\r\n return false;\r\n break;\r\n //GD1\r\n case 3:\r\n if($this->_rotateImageGD1($file, $desfile, $degrees, $imgobj))\r\n return true;\r\n else\r\n return false;\r\n break;\r\n //GD2\r\n case 4:\r\n if($this->_rotateImageGD2($file, $desfile, $degrees, $imgobj))\r\n return true;\r\n else\r\n return false;\r\n break;\r\n }\r\n return true;\r\n }", "function setImageOrientation()\n\t{\n\n\t\tif ($this->width < $this->height) {\n\t\t\t$this->orientation = 'portrait';\n\t\t}\n\n\t\tif ($this->width > $this->height) {\n\t\t\t$this->orientation = 'landscape';\n\t\t}\n\n\t\tif ($this->width == $this->height) {\n\t\t\t$this->orientation = 'square';\n\t\t}\n\t}", "public function getRotation() {}", "public function getRotation() {}", "function __rotate(&$tmp, $angle, $color) {\r\r\n\t\tasido::trigger_abstract_error(\r\r\n\t\t\t__CLASS__,\r\r\n\t\t\t__FUNCTION__\r\r\n\t\t\t);\r\r\n\t\t}", "abstract public function rotate($amount);", "function fix_orientation($fileandpath) { if(!file_exists($fileandpath))\n return false;\n try {\n @$exif = read_exif_data($fileandpath, 'IFD0');\n }\n catch (Exception $exp) {\n $exif = false;\n }\n // Get all the exif data from the file\n // If we dont get any exif data at all, then we may as well stop now\n if(!$exif || !is_array($exif))\n return false;\n\n // I hate case juggling, so we're using loweercase throughout just in case\n $exif = array_change_key_case($exif, CASE_LOWER);\n\n // If theres no orientation key, then we can give up, the camera hasn't told us the\n // orientation of itself when taking the image, and i'm not writing a script to guess at it!\n if(!array_key_exists('orientation', $exif))\n return false;\n\n // Gets the GD image resource for loaded image\n $img_res = $this->get_image_resource($fileandpath);\n\n // If it failed to load a resource, give up\n if(is_null($img_res))\n return false;\n\n // The meat of the script really, the orientation is supplied as an integer,\n // so we just rotate/flip it back to the correct orientation based on what we\n // are told it currently is\n\n switch($exif['orientation']) {\n\n // Standard/Normal Orientation (no need to do anything, we'll return true as in theory, it was successful)\n case 1: return true; break;\n\n // Correct orientation, but flipped on the horizontal axis (might do it at some point in the future)\n case 2:\n $final_img = $this->imageflip($img_res, IMG_FLIP_HORIZONTAL);\n break;\n\n // Upside-Down\n case 3:\n $final_img = $this->imageflip($img_res, IMG_FLIP_VERTICAL);\n break;\n\n // Upside-Down & Flipped along horizontal axis\n case 4:\n $final_img = $this->imageflip($img_res, IMG_FLIP_BOTH);\n break;\n\n // Turned 90 deg to the left and flipped\n case 5:\n $final_img = imagerotate($img_res, -90, 0);\n $final_img = $this->imageflip($img_res, IMG_FLIP_HORIZONTAL);\n break;\n\n // Turned 90 deg to the left\n case 6:\n $final_img = imagerotate($img_res, -90, 0);\n break;\n\n // Turned 90 deg to the right and flipped\n case 7:\n $final_img = imagerotate($img_res, 90, 0);\n $final_img = $this->imageflip($img_res,IMG_FLIP_HORIZONTAL);\n break;\n\n // Turned 90 deg to the right\n case 8:\n $final_img = imagerotate($img_res, 90, 0);\n break;\n\n }\n if(!isset($final_img))\n return false;\n if (!is_writable($fileandpath)) {\n chmod($fileandpath, 0777);\n }\n unlink($fileandpath);\n\n // Save it and the return the result (true or false)\n $done = $this->save_image_resource($final_img,$fileandpath);\n\n return $done;\n }", "public function test_remove_orientation_data_on_rotate() {\n\t\t$file = DIR_TESTDATA . '/images/test-image-upside-down.jpg';\n\t\t$data = wp_read_image_metadata( $file );\n\n\t\t// The orientation value 3 is equivalent to rotated upside down (180 degrees).\n\t\t$this->assertSame( 3, intval( $data['orientation'] ), 'Orientation value read from does not match image file Exif data: ' . $file );\n\n\t\t$temp_file = wp_tempnam( $file );\n\t\t$image = wp_get_image_editor( $file );\n\n\t\t// Test a value that would not lead back to 1, as WP is resetting the value to 1 manually.\n\t\t$image->rotate( 90 );\n\t\t$ret = $image->save( $temp_file, 'image/jpeg' );\n\n\t\t$data = wp_read_image_metadata( $ret['path'] );\n\n\t\t// Make sure the image is no longer in The Upside Down Exif orientation.\n\t\t$this->assertSame( 1, intval( $data['orientation'] ), 'Orientation Exif data was not updated after rotating image: ' . $file );\n\n\t\t// Remove both the generated file ending in .tmp and tmp.jpg due to wp_tempnam().\n\t\tunlink( $temp_file );\n\t\tunlink( $ret['path'] );\n\t}", "public function rotate($angle)\n {\n $this->setForceAlpha(true);\n $this\n ->addConvertOption('background', 'none')\n ->addConvertOption('alpha', 'set')\n ->addConvertOption('rotate', $angle);\n\n //an image size has changed after the rotate action, it's required to save it and reinit resource\n $this->saveIfRequired('after_rotate');\n $this->resource = null;\n $this->initResource();\n\n return $this;\n }", "function image_fix_orientation($path){\n\t\t$exif = exif_read_data($path);\n\n\t\t//fix the Orientation if EXIF data exist\n\t\tif(!empty($exif['Orientation'])) {\n\t\t switch($exif['Orientation']) {\n\t\t case 8:\n\t\t $createdImage = imagerotate($image,90,0);\n\t\t break;\n\t\t case 3:\n\t\t $createdImage = imagerotate($image,180,0);\n\t\t break;\n\t\t case 6:\n\t\t $createdImage = imagerotate($image,-90,0);\n\t\t break;\n\t\t }\n\t\t}\n\t}", "public function setRotation($rotation) {}", "public function setRotation($rotation) {}", "protected function fix_image_orientation( $filename, $filecontent ) {\r\n\t\t\t$data = exif_read_data( $filename );\r\n\t\t\tif ( !empty( $data['Orientation'] ) ) {\r\n\t\t\t\tswitch( $data['Orientation'] ) {\r\n\t\t\t\t\tcase 3: { $newAngle = 180; } break;\r\n\t\t\t\t\tcase 6: { $newAngle = -90; } break;\r\n\t\t\t\t\tcase 8: { $newAngle = 90; } break;\r\n\t\t\t\t\tdefault: $newAngle = false;\r\n\t\t\t\t}\r\n\t\t\t\tif ( $newAngle ) {\r\n\t\t\t\t\t$image = imagecreatefromstring( $filecontent );\r\n\t\t\t\t\t$image = imagerotate( $image, $newAngle, 0 );\r\n\t\t\t\t\t$this->save_image( $image, $filename );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "public function rotate($value='random', $bgColor='ffffff')\n\t{\n\t\t$this->checkImage();\n\t\tif ($value == 'random') {\n\t\t\t$value = mt_rand(-6, 6);\n\t\t} else {\n\t\t\t$value = max(-360, min($value, 360));\n\t\t}\n\t\tif ($value < 0) {\n\t\t\t$value = 360 + $value;\n\t\t}\n\n\t\tif ($bgColor == 'alpha' && function_exists('imagerotate')) {\n\t\t\t// Experimental. GD2 imagerotate seems to be quite buggy with alpha transparency.\n\t\t\timagealphablending($this->imageResized, false);\n\t\t\t$color = imagecolorallocatealpha($this->imageResized, 255, 255, 255, 127);\n\t\t\timagecolortransparent($this->imageResized, $color);\n\t\t\t$this->imageResized = imagerotate($this->imageResized, $value, $color);\n\t\t\timagesavealpha($this->imageResized, true);\n\t\t} else {\n\t\t\t$bgColor = str_replace('#', '', strtoupper(trim($bgColor)));\n\t\t\t$color = hexdec($bgColor);\n\t\t\tif (function_exists('imagerotate')) {\n\t\t\t\t$this->imageResized = imagerotate($this->imageResized, $value, $color);\n\t\t\t} else {\n\t\t\t\t$this->imageResized = $this->imagerotate($this->imageResized, $value, $color);\n\t\t\t}\n\t\t}\n\n\t\treturn $this;\n\t}", "function fixImageOrientation($filename) \n{\n\t$exif = @exif_read_data($filename);\n\t \n\tif($exif) \n\t{ \n\t\t//fix the Orientation if EXIF data exists\n\t\tif(!empty($exif['Orientation'])) \n\t\t{\n\t\t\tswitch($exif['Orientation']) \n\t\t\t{\n\t\t\t\tcase 3:\n\t\t\t\t$createdImage = imagerotate($filename,180,0);\n\t\t\t\tbreak;\n\t\t\t\tcase 6:\n\t\t\t\t$createdImage = imagerotate($filename,-90,0);\n\t\t\t\tbreak;\n\t\t\t\tcase 8:\n\t\t\t\t$createdImage = imagerotate($filename,90,0);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t} \n}", "public function rotate(int $degrees): Image\n\t{\n\t\t$this->processor->rotate($degrees);\n\n\t\treturn $this;\n\t}", "function _rotateImageIM($file, $desfile, $degrees) {\r\n $cmd = $this->_IM_path.\"convert -rotate $degrees \\\"$file\\\" \\\"$desfile\\\"\";\r\n $output = $retval = null;\r\n exec($cmd, $output, $retval);\r\n if($retval) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }", "public function rotate($x, $y, $angle) {}", "public function rotate($x, $y, $angle) {}", "public function rotate($x, $y, $angle) {}", "public function rotate(int $rotations);", "public function rotate($degrees);", "public function rotateClockwise($angle = 0, $bg_color = array(255, 255, 255)) {\n\t\tif(!$this->image) {\n\t\t\ttrigger_error('The image does not exist or is not readable.', E_USER_WARNING);\n\t\t\treturn false;\n\t\t}\n\t\t$angle = 0 - (float) $angle;\n\t\treturn $this->rotate($angle, $bg_color);\n\t}", "function rotate(&$tmp, $angle, $color=null) {\r\r\n\t\t\r\r\n\t\t// color ?\r\r\n\t\t//\r\r\n\t\tif (!is_a($color, 'Asido_Color')) {\r\r\n\t\t\t$color = new Asido_Color;\r\r\n\t\t\t$color->set(255, 255, 255);\r\r\n\t\t\t}\r\r\n\t\t\r\r\n\t\treturn $this->__rotate($tmp, $angle, $color);\r\r\n\t\t}", "public static function rotate($image = NULL, $degrees = NULL, $backgroundColorRed = 0, $backgroundColorGreen = 0, $backgroundColorBlue = 0, $backgroundColorAlpha = 0)\n\t{\n\n\t\tif (!($image instanceof Default_Model_MediaImage)) {\n\t\t\tthrow new Default_Model_MediaImage_Exception('Image needs to be an instance of Default_Model_MediaImage.');\n\t\t}\n\n\t\tif ($degrees &&\n\t\t\t!is_int($degrees)) {\n\n\t\t\tthrow new Default_Model_MediaImage_Exception('Degrees needs to be an integer, if specified.');\n\t\t}\n\n\t\tif (!is_int($backgroundColorRed) &&\n\t\t\t($backgroundColorRed < 0 || $backgroundColorRed > 255)) {\n\n\t\t\tthrow new Default_Model_MediaImage_Exception('BackgroundColor Red needs to be specified between 0 and 255.');\n\t\t}\n\n\t\tif (!is_int($backgroundColorGreen) &&\n\t\t\t($backgroundColorGreen < 0 || $backgroundColorGreen > 255)) {\n\n\t\t\tthrow new Default_Model_MediaImage_Exception('BackgroundColor Green needs to be specified between 0 and 255.');\n\t\t}\n\n\t\tif (!is_int($backgroundColorBlue) &&\n\t\t\t($backgroundColorBlue < 0 || $backgroundColorBlue > 255)) {\n\n\t\t\tthrow new Default_Model_MediaImage_Exception('BackgroundColor Blue needs to be specified between 0 and 255.');\n\t\t}\n\n\t\tif (!is_int($backgroundColorAlpha) &&\n\t\t\t($backgroundColorAlpha < 0 || $backgroundColorAlpha > 255)) {\n\n\t\t\tthrow new Default_Model_MediaImage_Exception('BackgroundColor Alpha needs to be specified between 0 and 255.');\n\t\t}\n\n\t\t$rotatedImage = Default_Service_MediaImage::fromMediaImage($image);\n\t\t$rotatedImage->width = 0;\n\t\t$rotatedImage->height = 0;\n\t\t$rotatedImage->file_size = 0;\n\t\t$rotatedImage->role_id = $image->role_id;\n\t\tif (isset($image['entity_id'])) {\n\t\t\t$rotatedImage->entity_id = $image->entity_id;\n\t\t} else\n\t\tif (Zend_Auth::getInstance()->hasIdentity()) {\n\t\t\t$rotatedImage->entity_id = Zend_Auth::getInstance()->getIdentity()->id;\n\t\t}\n\t\t$rotatedImage->short = Default_Service_Media::getShort($image->short, $rotatedImage->width, $rotatedImage->height, $rotatedImage->file_size);\n\t\t$rotatedImage->save();\n\n\n\t\t/**\n\t\t * imageinstance file does not exist yet and needs to be created\n\t\t */\n\t\tif (!file_exists($rotatedImage->getStoredFilePath())) {\n\n\t\t\t/**\n\t\t\t * use Imagick for rotating the image ?\n\t\t\t */\n\t\t\tif (Zend_Registry::get('Imagick')) {\n\n\t\t\t\t/**\n\t\t\t\t * Imagick\n\t\t\t\t */\n\t\t\t\t$imagickError = NULL;\n\t\t\t\ttry {\n\t\t\t\t\t$colorStringFormat = '%1$02s%2$02s%3$02s%4$02s';\n\t\t\t\t\t$colorString = sprintf($colorStringFormat, dechex($backgroundColorRed), dechex($backgroundColorGreen), dechex($backgroundColorBlue), dechex($backgroundColorAlpha));\n\t\t\t\t\t$imagickBackgoundColor = new ImagickPixel('#' . $colorString);\n\n\t\t\t\t\t$imagickObj = new Imagick($image->getStoredFilePath());\n\t\t\t\t\t$imagickRotateResult = $imagickObj->rotateImage($imagickBackgoundColor, $degrees);\n\t\t\t\t\tif ($imagickRotateResult) {\n\t\t\t\t\t\t$imagickObj->writeimage($rotatedImage->getStoredFilePath());\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * retrieve image infos\n\t\t\t\t\t\t */\n\t\t\t\t\t\t$rotatedImage->file_size = $imagickObj->getImageLength();\n\t\t\t\t\t\t$imagickDimensions = $imagickObj->getImageGeometry();\n\t\t\t\t\t\t$rotatedImage->width = $imagickDimensions['width'];\n\t\t\t\t\t\t$rotatedImage->height = $imagickDimensions['height'];\n\t\t\t\t\t\t$rotatedImage->short = Default_Service_Media::getShort($image->short, $rotatedImage->width, $rotatedImage->height, $rotatedImage->file_size);\n\t\t\t\t\t\t$rotatedImage->save();\n\t\t\t\t\t}\n\t\t\t\t} catch (ImagickException $imagickError) {\n\n\t\t\t\t}\n\n\t\t\t\tif ($imagickError ||\n\t\t\t\t\t!$imagickRotateResult) {\n\n\t\t\t\t\t$rotatedImage->hardDelete();\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\t$imageFile = L8M_Image::fromFile($image->getStoredFilePath());\n\n\t\t\t\tif ($imageFile instanceof L8M_Image_Abstract) {\n\n\t\t\t\t\t$imageFile\n\t\t\t\t\t\t->rotate($degrees, $backgroundColorRed, $backgroundColorGreen, $backgroundColorBlue, $backgroundColorAlpha)\n\t\t\t\t\t\t->save($rotatedImage->getStoredFilePath(), TRUE)\n\t\t\t\t\t;\n\n\t\t\t\t\t/**\n\t\t\t\t\t * retrieve image infos\n\t\t\t\t\t */\n\t\t\t\t\t$rotatedImage->file_size = $imageFile->getFilesize();\n\t\t\t\t\t$rotatedImage->width = $imageFile->getWidth();\n\t\t\t\t\t$rotatedImage->height = $imageFile->getHeight();\n\t\t\t\t\t$rotatedImage->short = Default_Service_Media::getShort($image->short, $rotatedImage->width, $rotatedImage->height, $rotatedImage->file_size);\n\n\t\t\t\t\t/**\n\t\t\t\t\t * save\n\t\t\t\t\t */\n\t\t\t\t\tif (!$imageFile->isErrorOccured()) {\n\t\t\t\t\t\t$rotatedImage->save();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$rotatedImage->hardDelete();\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\treturn $rotatedImage;\n\t}", "public function createRotateFlippedImage($request)\n {\n $returnType = '\\SplFileObject';\n $isBinary = true;\n $hasReturnType = true;\n $request = $this->getHttpRequest($request, 'POST');\n $options = $this->createHttpClientOptions();\n \n try {\n $response = $this->client->send($request, $options);\n return $this->processResponse($request, $response, $hasReturnType, $returnType, $isBinary);\n } catch (RequestException $e) {\n $this->processException($e);\n }\n }", "public function ImgCropToFile(){\r\n $imgUrl = $_POST['imgUrl'];\r\n// original sizes\r\n $imgInitW = $_POST['imgInitW'];\r\n $imgInitH = $_POST['imgInitH'];\r\n// resized sizes\r\n $imgW = $_POST['imgW'];\r\n $imgH = $_POST['imgH'];\r\n// offsets\r\n $imgY1 = $_POST['imgY1'];\r\n $imgX1 = $_POST['imgX1'];\r\n// crop box\r\n $cropW = $_POST['cropW'];\r\n $cropH = $_POST['cropH'];\r\n// rotation angle\r\n $angle = $_POST['rotation'];\r\n\r\n $jpeg_quality = 100;\r\n\r\n $what = new \\Think\\Image();\r\n $name = './'.$this::getPath($imgUrl).$this::getFileName($imgUrl);\r\n $c_name = './'.$this::getPath($imgUrl).'c_'.$this::getFileName($imgUrl);\r\n $p_name = './'.$this::getPath($imgUrl).'p_'.$this::getFileName($imgUrl);\r\n $what ->open($name);\r\n $what ->thumb($imgW, $imgH)->save($c_name);\r\n $what ->open($c_name);\r\n $what ->crop(($cropW),($cropH),$imgX1,$imgY1)->save($p_name);\r\n unlink($c_name);\r\n unlink($name);\r\n\r\n $m = M('img_mapping');\r\n $data = array();\r\n $data['user'] = $_SESSION['current_user']['id'];\r\n $data['img'] = './'.$this::getPath($p_name).$this::getFileName($p_name);\r\n $m->data($data)->add();\r\n\r\n $response = Array(\r\n \"status\" => 'success',\r\n \"url\" => __ROOT__.'/'.$this::getPath($p_name).$this::getFileName($p_name)\r\n );\r\n print json_encode($response);\r\n }", "public function ieditor_rotate ($sImagePath) {\n\n\t\t\t/**\n\t\t\t * UMIRU CUSTOM - START\n\t\t\t */\n\t\t\ttry {\n\t\t\t\t$oImagemagic = $this->getImageMagic();\n\t\t\t\tif (!$oImagemagic->rotate($sImagePath)) {\n\t\t\t\t\tthrow new Exception('Failed to rotate image by ImageMagic');\n\t\t\t\t}\n\t\t\t\t$this->deleteOriginalImages($sImagePath);\n\t\t\t\treturn str_replace(CURRENT_WORKING_DIR, '', $sImagePath);\n\t\t\t} catch (Exception $e) {}\n\t\t\t/**\n\t\t\t * UMIRU CUSTOM - END\n\t\t\t */\n\n\t\t\t$oImage = new umiImageFile($sImagePath);\n\t\t\ttry {\n\t\t\t\t$oImage->rotate();\n\t\t\t\t$this->deleteOriginalImages($sImagePath);\n\t\t\t} catch (coreException $e) {\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t\treturn $oImage->getFilePath(true);\n\t\t}", "public function __invoke($sourceImg = null, $angle = null) {\n if(null !== $sourceImg) {\n return $this->rotate($sourceImg, $angle);\n }\n return $this;\n }", "public function rotateLeft();", "function setRotation( $r ) {\n\n // only 0,90,180,270\n if ( $r > 270 ) return;\n if ( $r % 90 != 0 ) return;\n\n $this->rotate = $r;\n $this->vertical = ( $r == 90 or $r == 270 );\n}", "function orientation_check($file_path, $prefs)\n\t{\n\t\tif ( ! function_exists('exif_read_data'))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// Not all images are supported\n\t\t$exif = @exif_read_data($file_path);\n\n\t\tif ( ! $exif OR ! isset($exif['Orientation']))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$orientation = $exif['Orientation'];\n\n\t\tif ($orientation == 1)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// Image is rotated, let's see by how much\n\t\t$deg = 0;\n\n\t\tswitch ($orientation) {\n\t\t\tcase 3:\n\t\t\t\t$deg = 180;\n\t\t\t\tbreak;\n\t\t\tcase 6:\n\t\t\t\t$deg = 270;\n\t\t\t\tbreak;\n\t\t\tcase 8:\n\t\t\t\t$deg = 90;\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif ($deg)\n\t\t{\n\t\t\tee()->load->library('image_lib');\n\n\t\t\tee()->image_lib->clear();\n\n\t\t\t// Set required memory\n\t\t\ttry\n\t\t\t{\n\t\t\t\tee('Memory')->setMemoryForImageManipulation($file_path);\n\t\t\t}\n\t\t\tcatch (\\Exception $e)\n\t\t\t{\n\t\t\t\tlog_message('error', $e->getMessage().': '.$file_path);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$config = array(\n\t\t\t\t'rotation_angle'\t=> $deg,\n\t\t\t\t'library_path'\t\t=> ee()->config->item('image_library_path'),\n\t\t\t\t'image_library'\t\t=> ee()->config->item('image_resize_protocol'),\n\t\t\t\t'source_image'\t\t=> $file_path\n\t\t\t);\n\n\t\t\tee()->image_lib->initialize($config);\n\n\t\t\tif ( ! ee()->image_lib->rotate())\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$new_image = ee()->image_lib->get_image_properties('', TRUE);\n\t\t\tee()->image_lib->clear();\n\n\t\t\t// We need to reset some prefs\n\t\t\tif ($new_image)\n\t\t\t{\n\t\t\t\tee()->load->helper('number');\n\t\t\t\t$f_size = get_file_info($file_path);\n\t\t\t\t$prefs['file_height'] = $new_image['height'];\n\t\t\t\t$prefs['file_width'] = $new_image['width'];\n\t\t\t\t$prefs['file_hw_original'] = $new_image['height'].' '.$new_image['width'];\n\t\t\t\t$prefs['height'] = $new_image['height'];\n\t\t\t\t$prefs['width'] = $new_image['width'];\n\t\t\t}\n\n\t\t\treturn $prefs;\n\t\t}\n\t}", "public function getRotateControl()\n {\n return $this->rotateControl;\n }", "public function rotateFlipImage($request)\n {\n $returnType = '\\SplFileObject';\n $isBinary = true;\n $hasReturnType = true;\n $request = $this->getHttpRequest($request, 'GET');\n $options = $this->createHttpClientOptions();\n \n try {\n $response = $this->client->send($request, $options);\n return $this->processResponse($request, $response, $hasReturnType, $returnType, $isBinary);\n } catch (RequestException $e) {\n $this->processException($e);\n }\n }", "public function fixOrientation($file, $return = 'file') {\n\t\t \t\n\t\t$mime = \\FileManager::getFileMimeType($file);\n \n\t\t$save_name = \\Tools::generateRandomString().uniqid(). $this -> getExtension($mime);\n\t \n\t if(!\\Validator::check('gif_file', $mime)) {\n\t $image = new \\Imagick($file);\n\t $orientation = $image -> getImageOrientation();\n\t \n\t switch($orientation) {\n\t case \\imagick::ORIENTATION_BOTTOMRIGHT: \n\t $image -> rotateimage(\"#000\", 180); // rotate 180 degrees\n\t break;\n\t \n\t case \\imagick::ORIENTATION_RIGHTTOP:\n\t $image -> rotateimage(\"#000\", 90); // rotate 90 degrees CW\n\t break;\n\t \n\t case \\imagick::ORIENTATION_LEFTBOTTOM: \n\t $image -> rotateimage(\"#000\", -90); // rotate 90 degrees CCW\n\t break;\n\t }\n\t \n\t $image -> setImageOrientation (\\Imagick::ORIENTATION_TOPLEFT);\n\t \n\t $location = SITE_PATH.'tmp'.DS.$save_name;\n\t\t \n\t\t file_put_contents($location, $image -> getImageBlob());\n\t\t \n\t\t return $location;\n\t \n\t } else {\n\t \n\t \treturn $file;\n\t \n\t }\n\t}", "public function rotateRight();", "public function getRotation()\n {\n return self::accessPgArray($this->rotation);\n }", "private function recortarImagen()\n\t{\n\t\t$ImgTemporal=\"temporal_clase_Imagen.\".strtolower($this->extencion);\n\n\t\t$CoefAncho\t\t= $this->propiedadesImagen[0]/$this->anchoDestino;\n\t\t$CoefAlto\t\t= $this->propiedadesImagen[1]/$this->altoDestino;\n\t\t$Coeficiente=0;\n\t\tif ($CoefAncho>1 && $CoefAlto>1)\n\t\t{ if($CoefAncho>$CoefAlto){ $Coeficiente=$CoefAlto; } else {$Coeficiente=$CoefAncho;} }\n\n\t\tif ($Coeficiente!=0)\n\t\t{\n\t\t\t$anchoTmp\t= ceil($this->propiedadesImagen[0]/$Coeficiente);\n\t\t\t$altoTmp\t= ceil($this->propiedadesImagen[1]/$Coeficiente);\n\n\t\t\t$ImgMediana = imagecreatetruecolor($anchoTmp,$altoTmp);\n\t\t\timagecopyresampled($ImgMediana,$this->punteroImagen,0,0,0,0,$anchoTmp,$altoTmp,$this->propiedadesImagen[0],$this->propiedadesImagen[1]);\n\t\t\t\n\t\t\t// Tengo que desagregar la funcion de image para crear para reUtilizarla\n\t\t\t//imagejpeg($ImgMediana,$ImgTemporal,97);\n\t\t\t$this->crearArchivoDeImagen($ImgMediana,$ImgTemporal);\n\t\t}\n\n\t\t$fila\t\t\t= floor($this->recorte['centrado']/$this->recorte['columnas']);\n\t\t$columna\t\t= $this->recorte['centrado'] - ($fila*$this->recorte[\"columnas\"]);\n\t\t\n\t\t$centroX \t= floor(($anchoTmp / $this->recorte[\"columnas\"])/2)+$columna*floor($anchoTmp / $this->recorte[\"columnas\"]);\n\t\t$centroY \t= floor(($altoTmp / $this->recorte[\"filas\"])/2)+$fila*floor($altoTmp / $this->recorte[\"filas\"]);\n\n\t\t$centroX\t-= floor($this->anchoDestino/2);\n\t\t$centroY \t-= floor($this->altoDestino/2);\n\n\t\tif ($centroX<0) {$centroX = 0;}\n\t\tif ($centroY<0) {$centroY = 0;}\n\n\t\tif (($centroX+$this->anchoDestino)>$anchoTmp) {$centroX = $anchoTmp-$this->anchoDestino;}\n\t\tif (($centroY+$this->altoDestino)>$altoTmp) {$centroY = $altoTmp-$this->altoDestino;}\n\n\t\t$ImgRecortada = imagecreatetruecolor($this->anchoDestino,$this->altoDestino);\n\t\timagecopymerge ( $ImgRecortada,$ImgMediana,0,0,$centroX, $centroY, $this->anchoDestino, $this->altoDestino,100);\n\n\t\t//imagejpeg($ImgRecortada,$this->imagenDestino,97);\n\t\t$this->crearArchivoDeImagen($ImgRecortada,$this->imagenDestino);\n\t\timagedestroy($ImgRecortada);\n\t\tunlink($ImgTemporal);\n\t}", "public function rotate($theta_)\n\t{\n\t\t$x = $this->x*cos($theta_) - $this->y*sin($theta_);\n\t\t$y = $this->x*sin($theta_) + $this->y*cos($theta_);\n\t\t\n\t\t$this->setX($x);\n\t\t$this->setY($y);\n\t}", "public function rotateCounterclockwise($angle = 0, $bg_color = array(255, 255, 255)) {\n\t\tif(!$this->image) {\n\t\t\ttrigger_error('The image does not exist or is not readable.', E_USER_WARNING);\n\t\t\treturn false;\n\t\t}\n\t\treturn $this->rotate($angle, $bg_color);\n\t}", "public function toGDImage() {}", "public function rotate($angle) {\n\t\t$this->angle = $angle;\n\t\tparent::rotate($angle);\n\t}", "public function rotatePageImage($pageId, $rotate)\n {\n # PUT /accounts/{accountId}/envelopes/{envelopeId}/documents/{documentId}/pages/{pageId}/page_image\n }", "public function cropAvatarAction()\n {\n // TODO: swap web dir to product path\n //$imgRealPath = '/Users/leonqiu/www/choumei.me/Symfony/web/' . $_POST['imageSource'];\n $imgRealPath = dirname(__FILE__) . '/../../../../web/' . $_POST['imageSource'];\n list($width, $height) = getimagesize($imgRealPath);\n \n $viewPortW = $_POST[\"viewPortW\"];\n\t $viewPortH = $_POST[\"viewPortH\"];\n $pWidth = $_POST[\"imageW\"];\n $pHeight = $_POST[\"imageH\"];\n $tmp = explode(\".\",$_POST[\"imageSource\"]);\n $ext = end(&$tmp);\n $function = $this->returnCorrectFunction($ext);\n //$image = $function($_POST[\"imageSource\"]);\n $image = $function($imgRealPath);\n $width = imagesx($image);\n $height = imagesy($image);\n \n // Resample\n $image_p = imagecreatetruecolor($pWidth, $pHeight);\n $this->setTransparency($image,$image_p,$ext);\n\t\timagecopyresampled($image_p, $image, 0, 0, 0, 0, $pWidth, $pHeight, $width, $height);\n\t\timagedestroy($image);\n\t\t$widthR = imagesx($image_p);\n\t\t$hegihtR = imagesy($image_p);\n\t\t\n\t\t$selectorX = $_POST[\"selectorX\"];\n\t\t$selectorY = $_POST[\"selectorY\"];\n\t\t\n\t\tif($_POST[\"imageRotate\"]){\n\t\t $angle = 360 - $_POST[\"imageRotate\"];\n\t\t $image_p = imagerotate($image_p,$angle,0);\n\t\t \n\t\t $pWidth = imagesx($image_p);\n\t\t $pHeight = imagesy($image_p);\n\t\t \n\t\t //print $pWidth.\"---\".$pHeight;\n\t\t\n\t\t $diffW = abs($pWidth - $widthR) / 2;\n\t\t $diffH = abs($pHeight - $hegihtR) / 2;\n\t\t \n\t\t $_POST[\"imageX\"] = ($pWidth > $widthR ? $_POST[\"imageX\"] - $diffW : $_POST[\"imageX\"] + $diffW);\n\t\t $_POST[\"imageY\"] = ($pHeight > $hegihtR ? $_POST[\"imageY\"] - $diffH : $_POST[\"imageY\"] + $diffH);\n\t\t\n\t\t \n\t\t}\n\t\t\n\t\t$dst_x = $src_x = $dst_y = $dst_x = 0;\n\t\t\n\t\tif($_POST[\"imageX\"] > 0){\n\t\t $dst_x = abs($_POST[\"imageX\"]);\n\t\t}else{\n\t\t $src_x = abs($_POST[\"imageX\"]);\n\t\t}\n\t\tif($_POST[\"imageY\"] > 0){\n\t\t $dst_y = abs($_POST[\"imageY\"]);\n\t\t}else{\n\t\t $src_y = abs($_POST[\"imageY\"]);\n\t\t}\n\t\t\n\t\t\n\t\t$viewport = imagecreatetruecolor($_POST[\"viewPortW\"],$_POST[\"viewPortH\"]);\n\t\t$this->setTransparency($image_p,$viewport,$ext);\n\t\t\n\t\timagecopy($viewport, $image_p, $dst_x, $dst_y, $src_x, $src_y, $pWidth, $pHeight);\n\t\timagedestroy($image_p);\n\t\t\n\t\t\n\t\t$selector = imagecreatetruecolor($_POST[\"selectorW\"],$_POST[\"selectorH\"]);\n\t\t$this->setTransparency($viewport,$selector,$ext);\n\t\timagecopy($selector, $viewport, 0, 0, $selectorX, $selectorY,$_POST[\"viewPortW\"],$_POST[\"viewPortH\"]);\n\t\t\n\t\t//$file = \"tmp/test\".time().\".\".$ext;\n\t\t// TODO: generate file name\n\t\t$fileName = uniqid() . \".\" . $ext;\n\t\t$user = $this->get('security.context')->getToken()->getUser();\n\t\t$avatarFile = dirname(__FILE__).'/../../../../web/uploads/avatar/'.$user->getId(). '/' .$fileName;\n\t\t$avatarUrl = '/uploads/avatar/'. $user->getId() . '/' . $fileName;\n\t\t$this->parseImage($ext,$selector,$avatarFile);\n\t\timagedestroy($viewport);\n\t\t//Return value\n\t\t//update avatar\n $em = $this->getDoctrine()->getEntityManager();\n $user->setAvatar($avatarUrl);\n $em->persist($user);\n $em->flush();\n\t\techo $avatarUrl;\n\t\texit;\n }", "public function rotation($value) {\n return $this->setProperty('rotation', $value);\n }", "public function rotate_bitmap($bitmap,$width,$height,$degree) \r\n { \r\n $c=cos(deg2rad($degree)); \r\n $s=sin(deg2rad($degree)); \r\n\r\n $newHeight=round($width*$s+$height*$c); \r\n $newWidth=round($width*$c + $height*$s); \r\n $x0 = $width/2 - $c*$newWidth/2 - $s*$newHeight/2; \r\n $y0 = $height/2 - $c*$newHeight/2 + $s*$newWidth/2; \r\n $result=array(); \r\n for ($j=0;$j<$newHeight;++$j) \r\n for ($i=0;$i<$newWidth;++$i) \r\n { \r\n $y=-$s*$i+$c*$j+$y0; \r\n $x=$c*$i+$s*$j+$x0; \r\n if (isset($bitmap[$y][$x])) \r\n $result[$j][$i]=$bitmap[$y][$x]; \r\n } \r\n return array($result,$newWidth,$newHeight); \r\n }", "public function outputAsJPG(){\n header('Content-Type: image/jpeg');\n\t\theader (\"Cache-Control: must-revalidate\");\n\t\t$offset = 7 * 24 * 60 * 60;//expires one week\n\t\t$expire = \"Expires: \" . gmdate (\"D, d M Y H:i:s\", time() + $offset) . \" GMT\";\n\t\theader ($expire);\n imagejpeg($this->gd_image);\n }", "public function rotate($degrees, Color\\ColorInterface $bgColor = null)\n {\n $this->resource->rotateImage($this->createColor($bgColor), $degrees);\n $this->width = $this->resource->getImageWidth();\n $this->height = $this->resource->getImageHeight();\n return $this;\n }", "public function frontImage()\r\n {\r\n $wrapper = imagecreatetruecolor(16 * $this->ratio(), 32 * $this->ratio());\r\n $background = imagecolorallocatealpha($wrapper, 255, 255, 255, 127);\r\n imagefill($wrapper, 0, 0, $background);\r\n\r\n imagecopy($wrapper, $this->image, 4 * $this->ratio(), 0 * $this->ratio(), 8 * $this->ratio(),\r\n 8 * $this->ratio(), 8 * $this->ratio(), 8 * $this->ratio());\r\n //arms\r\n imagecopy($wrapper, $this->image, 0 * $this->ratio(), 8 * $this->ratio(), 44 * $this->ratio(),\r\n 20 * $this->ratio(), 4 * $this->ratio(), 12 * $this->ratio());\r\n $this->imageflip($wrapper, $this->image, 12 * $this->ratio(), 8 * $this->ratio(), 44 * $this->ratio(),\r\n 20 * $this->ratio(), 4 * $this->ratio(), 12 * $this->ratio());\r\n //chest\r\n imagecopy($wrapper, $this->image, 4 * $this->ratio(), 8 * $this->ratio(), 20 * $this->ratio(),\r\n 20 * $this->ratio(), 8 * $this->ratio(), 12 * $this->ratio());\r\n //legs\r\n imagecopy($wrapper, $this->image, 4 * $this->ratio(), 20 * $this->ratio(), 4 * $this->ratio(),\r\n 20 * $this->ratio(), 4 * $this->ratio(), 12 * $this->ratio());\r\n $this->imageflip($wrapper, $this->image, 8 * $this->ratio(), 20 * $this->ratio(), 4 * $this->ratio(),\r\n 20 * $this->ratio(), 4 * $this->ratio(), 12 * $this->ratio());\r\n //hat\r\n imagecopy($wrapper, $this->image, 4 * $this->ratio(), 0 * $this->ratio(), 40 * $this->ratio(),\r\n 8 * $this->ratio(), 8 * $this->ratio(), 8 * $this->ratio());\r\n\r\n return $wrapper;\r\n }", "public function rotate() : Tetris {\n // rotate the block\n $rotatedBlock = $this->block->rotate();\n\n // calculate the x-difference so that the block appears to be roated in-place (i.e. centric)\n $diffX = ($this->block->getWidth() - $rotatedBlock->getWidth()) / 2;\n $diffX = $diffX < 0 ? floor($diffX) : ceil($diffX);\n\n // calculate the y-difference so that the block appears to be roated in-place (i.e. centric)\n $diffY = ($this->block->getHeight() - $rotatedBlock->getHeight()) / 2;\n $diffY = $diffY < 0 ? floor($diffY) : ceil($diffY);\n\n // calculate the rotated block's x-coordinate\n $x = $this->block->getX() + $diffX;\n // calculate the roated block's y-coordinate\n $y = $this->block->getY() - $diffY;\n\n // clear the block\n $this->block->clear();\n\n // check if there is enough space for the rotated block\n if ($this->map->canHave($rotatedBlock, $x, $y)) {\n // position the rotated block\n $rotatedBlock->setX($x);\n $rotatedBlock->setY($y);\n\n // replace the currently moving block with the rotated block\n $this->block = $rotatedBlock;\n\n // paint the rotated block\n $this->block->paint();\n } else {\n // re-paint the not-rotated block as-was\n $this->block->paint();\n }\n\n // return the game for chained method calling\n return $this;\n }", "function processImage($image, $filename, $filetype, $keywords, $name, $descr, $rotate, $degrees = 0, $ignoresizes = 0) {\r\n global $mosConfig_absolute_path, $zoom;\r\n // reset script execution time limit (as set in MAX_EXECUTION_TIME ini directive)...\r\n // requires SAFE MODE to be OFF!\r\n if (ini_get('safe_mode') != 1 ) {\r\n set_time_limit(0);\r\n }\r\n $imagepath = $zoom->_CONFIG['imagepath'];\r\n $catdir = $zoom->_gallery->getDir();\r\n $filename = urldecode($filename);\r\n\t\t// replace every space-character with a single \"_\"\r\n\t\t$filename = ereg_replace(\" \", \"_\", $filename);\r\n\t\t$filename = stripslashes($filename);\r\n $filename = ereg_replace(\"'\", \"_\", $filename);\r\n // Get rid of extra underscores\r\n $filename = ereg_replace(\"_+\", \"_\", $filename);\r\n $filename = ereg_replace(\"(^_|_$)\", \"\", $filename);\r\n $zoom->checkDuplicate($filename, 'filename');\r\n $filename = $zoom->_tempname;\r\n // replace space-characters in combination with a comma with 'air'...or nothing!\r\n $keywords = $zoom->cleanString($keywords);\r\n //$keywords = $zoom->htmlnumericentities($keywords);\r\n\t\t$name = $zoom->cleanString($name);\r\n //$name = $zoom->htmlnumericentities($name);\r\n //$descr = $zoom->cleanString($descr);\r\n //$descr = $zoom->htmlnumericentities($descr);\r\n if (empty($name)) {\r\n $name = $zoom->_CONFIG['tempName'];\r\n }\r\n $imgobj = new image(0); //create a new image object with a foo imgid\r\n $imgobj->setImgInfo($filename, $name, $keywords, $descr, $zoom->_gallery->_id, $zoom->currUID, 1, 1);\r\n $imgobj->getMimeType($filetype, $image);\r\n unset($filename, $name, $keywords, $descr); //clear memory, just in case...\r\n if (!$zoom->acceptableSize($image)) {\r\n \t// the file is simply too big, register this...\r\n $this->_err_num++;\r\n $this->_err_names[$this->_err_num] = $imgobj->_filename;\r\n $this->_err_types[$this->_err_num] = sprintf(_ZOOM_ALERT_TOOBIG, $zoom->_CONFIG['maxsizekb'].'kB');\r\n return false;\r\n }\r\n /* IMPORTANT CHEATSHEET:\r\n\t * If we don't get useful data from that or its a type we don't\r\n\t * recognize, take a swing at it using the file name.\r\n\t if ($mimeType == 'application/octet-stream' ||\r\n\t\t $mimeType == 'application/unknown' ||\r\n\t\t GalleryCoreApi::convertMimeToExtension($mimeType) == null) {\r\n\t\t$extension = GalleryUtilities::getFileExtension($file['name']);\r\n\t\t$mimeType = GalleryCoreApi::convertExtensionToMime($extension);\r\n\t }\r\n\t */\r\n if ($zoom->acceptableFormat($imgobj->getMimeType(), true)) {\r\n // File is an image/ movie/ document...\r\n $file = \"$mosConfig_absolute_path/$imagepath$catdir/\".$imgobj->_filename;\r\n $desfile = \"$mosConfig_absolute_path/$imagepath$catdir/thumbs/\".$imgobj->_filename;\r\n if (is_uploaded_file($image)) {\r\n if (!move_uploaded_file(\"$image\", $file)) {\r\n // some error occured while moving file, register this...\r\n $this->_err_num++;\r\n $this->_err_names[$this->_err_num] = $imgobj->_filename;\r\n $this->_err_types[$this->_err_num] = _ZOOM_ALERT_MOVEFAILURE;\r\n return false;\r\n }\r\n } elseif (!$zoom->platform->copy(\"$image\", $file) && !$zoom->platform->file_exists($file)) {\r\n // some error occured while moving file, register this...\r\n $this->_err_num++;\r\n $this->_err_names[$this->_err_num] = $imgobj->_filename;\r\n $this->_err_types[$this->_err_num] = _ZOOM_ALERT_MOVEFAILURE;\r\n return false;\r\n }\r\n @$zoom->platform->chmod($file, '0777');\r\n $viewsize = $mosConfig_absolute_path.\"/\".$imagepath.$catdir.\"/viewsize/\".$imgobj->_filename;\r\n if ($zoom->acceptableFormat($imgobj->getMimeType(), true)) {\r\n\t if ($zoom->isImage($imgobj->getMimeType(), true)) {\r\n\t\t\t\t\t$imgobj->_size = $zoom->platform->getimagesize($file);\r\n\t // get image EXIF & IPTC data from file to save it in viewsize image and get a thumbnail...\r\n\t if ($zoom->_CONFIG['readEXIF'] && ($imgobj->_type === \"jpg\" || $imgobj->_type === \"jpeg\") && !(bool)ini_get('safe_mode')) {\r\n\t // Retreive the EXIF, XMP and Photoshop IRB information from\r\n\t // the existing file, so that it can be updated later on...\r\n\t $jpeg_header_data = get_jpeg_header_data($file);\r\n\t $EXIF_data = get_EXIF_JPEG($file);\r\n\t $XMP_data = read_XMP_array_from_text( get_XMP_text( $jpeg_header_data ) );\r\n\t $IRB_data = get_Photoshop_IRB( $jpeg_header_data );\r\n\t $new_ps_file_info = get_photoshop_file_info($EXIF_data, $XMP_data, $IRB_data);\r\n\t // Check if there is a default for the date defined\r\n\t if ((!array_key_exists('date', $new_ps_file_info)) || ((array_key_exists('date', $new_ps_file_info)) && ($new_ps_file_info['date'] == ''))) {\r\n\t // No default for the date defined\r\n\t // figure out a default from the file\r\n\t // Check if there is a EXIF Tag 36867 \"Date and Time of Original\"\r\n\t if (($EXIF_data != FALSE) && (array_key_exists(0, $EXIF_data)) && (array_key_exists(34665, $EXIF_data[0])) && (array_key_exists(0, $EXIF_data[0][34665])) && (array_key_exists(36867, $EXIF_data[0][34665][0]))) {\r\n\t // Tag \"Date and Time of Original\" found - use it for the default date\r\n\t $new_ps_file_info['date'] = $EXIF_data[0][34665][0][36867]['Data'][0];\r\n\t $new_ps_file_info['date'] = preg_replace( \"/(\\d\\d\\d\\d):(\\d\\d):(\\d\\d)( \\d\\d:\\d\\d:\\d\\d)/\", \"$1-$2-$3\", $new_ps_file_info['date'] );\r\n\t } elseif (($EXIF_data != FALSE) && (array_key_exists(0, $EXIF_data)) && (array_key_exists(34665, $EXIF_data[0])) && (array_key_exists(0, $EXIF_data[0][34665])) && (array_key_exists(36868, $EXIF_data[0][34665][0]))) {\r\n\t // Check if there is a EXIF Tag 36868 \"Date and Time when Digitized\"\r\n\t // Tag \"Date and Time when Digitized\" found - use it for the default date\r\n\t $new_ps_file_info['date'] = $EXIF_data[0][34665][0][36868]['Data'][0];\r\n\t $new_ps_file_info['date'] = preg_replace( \"/(\\d\\d\\d\\d):(\\d\\d):(\\d\\d)( \\d\\d:\\d\\d:\\d\\d)/\", \"$1-$2-$3\", $new_ps_file_info['date'] );\r\n\t } else if ( ( $EXIF_data != FALSE ) && (array_key_exists(0, $EXIF_data)) && (array_key_exists(306, $EXIF_data[0]))) {\r\n\t // Check if there is a EXIF Tag 306 \"Date and Time\"\r\n\t // Tag \"Date and Time\" found - use it for the default date\r\n\t $new_ps_file_info['date'] = $EXIF_data[0][306]['Data'][0];\r\n\t $new_ps_file_info['date'] = preg_replace( \"/(\\d\\d\\d\\d):(\\d\\d):(\\d\\d)( \\d\\d:\\d\\d:\\d\\d)/\", \"$1-$2-$3\", $new_ps_file_info['date'] );\r\n\t } else {\r\n\t // Couldn't find an EXIF date in the image\r\n\t // Set default date as creation date of file\r\n\t $new_ps_file_info['date'] = date (\"Y-m-d\", filectime( $file ));\r\n\t }\r\n\t }\r\n\t }\r\n\t // First, rotate the image (if that's mentioned in the 'job description')...\r\n\t\t if ($rotate) {\r\n\t\t\t\t\t\t$tmpdir = $mosConfig_absolute_path.\"/\".$zoom->createTempDir();\r\n\t\t\t\t\t\t$new_source = $tmpdir.\"/\".$imgobj->_filename;\r\n\t\t\t\t\t\tif (!$this->rotateImage($file, $new_source, $degrees, $imgobj)) {\r\n\t $this->_err_num++;\r\n\t $this->_err_names[$this->_err_num] = $imgobj->_filename;\r\n\t $this->_err_types[$this->_err_num] = \"Error rotating image\";\r\n\t return false;\r\n\t } else {\r\n\t\t\t\t\t\t\t@$zoom->platform->unlink($file);\r\n\t\t\t\t\t\t\tif ($zoom->platform->copy($new_source, $file)) {\r\n\t\t\t\t\t\t\t\t$imgobj->_size = $zoom->platform->getimagesize($file);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t }\r\n\t // resize to thumbnail...\r\n\t // 1-31-2006: fix #0000151\r\n\t if (!$zoom->platform->file_exists($desfile)) {\r\n\t \tif (!$this->resizeImage($file, $desfile, $zoom->_CONFIG['size'], $imgobj)) {\r\n\t\t $this->_err_num++;\r\n\t\t $this->_err_names[$this->_err_num] = $imgobj->_filename;\r\n\t\t $this->_err_types[$this->_err_num] = _ZOOM_ALERT_IMGERROR;\r\n\t\t return false;\r\n\t\t }\r\n\t }\r\n\t \r\n\t // if the image size is greater than the given maximum: resize it!\r\n\t if (!$zoom->platform->file_exists($viewsize)) {\r\n\t\t //If the image is larger than the max size\r\n\t\t\t\t\t\tif (($imgobj->_size[0] > $zoom->_CONFIG['maxsize'] || $imgobj->_size[1] > $zoom->_CONFIG['maxsize']) && !$ignoresizes) {\r\n\t\t //Resizes the file. If successful, continue\r\n\t\t\t\t\t\t\tif ($this->resizeImage($file, $viewsize, $zoom->_CONFIG['maxsize'], $imgobj)) {\r\n\t\t\t\t\t\t\t\t//Watermark?\r\n\t\t\t\t\t\t\t\tif ((bool)$zoom->_CONFIG['wm_apply']) {\r\n\t\t\t\t\t\t\t\t\t//Watermark. Return errors if not successuful\r\n\t\t\t\t\t\t\t\t\tif (!$this->watermarkImage($viewsize, $viewsize, $imgobj)) {\r\n\t\t\t\t\t\t\t\t\t\t$this->_err_num++;\r\n\t\t\t\t\t\t\t\t\t\t$this->_err_names[$this->_err_num] = $imgobj->_filename;\r\n\t\t\t\t\t\t\t\t\t\t$this->_err_types[$this->_err_num] = _ZOOM_ALERT_WATERMARKERROR;\r\n\t\t\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t } else {\r\n\t\t $this->_err_num++;\r\n\t\t $this->_err_names[$this->_err_num] = $imgobj->_filename;\r\n\t\t $this->_err_types[$this->_err_num] = _ZOOM_ALERT_IMGERROR;\r\n\t\t return false;\r\n\t\t }\r\n\t\t } else {\r\n\t\t //Watermark?\r\n\t\t\t\t\t\t\tif ((bool)$zoom->_CONFIG['wm_apply']) {\r\n\t\t\t\t\t\t\t\t//Watermark. Return errors if not successuful\r\n\t\t\t\t\t\t\t\tif (!$this->watermarkImage($file, $file, $imgobj)) {\r\n\t\t\t\t\t\t\t\t\t$this->_err_num++;\r\n\t\t\t\t\t\t\t\t\t$this->_err_names[$this->_err_num] = $imgobj->_filename;\r\n\t\t\t\t\t\t\t\t\t$this->_err_types[$this->_err_num] = _ZOOM_ALERT_WATERMARKERROR;\r\n\t\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t }\r\n\t }\r\n\t } elseif ($zoom->isDocument($imgobj->getMimeType(), true)) {\r\n\t if ($zoom->isIndexable($imgobj->getMimeType(), true) && $this->_use_PDF) {\r\n\t if (!$this->indexDocument($file, $imgobj->_filename)) {\r\n\t $this->_err_num++;\r\n\t $this->_err_names[$this->_err_num] = $imgobj->_filename;\r\n\t $this->_err_types[$this->_err_num] = _ZOOM_ALERT_INDEXERROR;\r\n\t return false;\r\n\t }\r\n\t } else {\r\n\t \tif($zoom->platform->copy($file, $viewsize)) {\r\n\t \t\tif ((bool)$zoom->_CONFIG['wm_apply']) {\r\n\t\t\t\t\t\t\t\t// put a watermark on the source image...\r\n\t\t\t\t\t\t\t\tif (!$this->watermarkImage($viewsize, $viewsize, $imgobj)) {\r\n\t\t\t\t\t\t\t\t\t$this->_err_num++;\r\n\t\t\t\t\t\t\t\t\t\t$this->_err_names[$this->_err_num] = $imgobj->_filename;\r\n\t\t\t\t\t\t\t\t\t\t$this->_err_types[$this->_err_num] = _ZOOM_ALERT_WATERMARKERROR;\r\n\t\t\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t \t} else {\r\n\t\t\t\t\t\t\t// some error occured while moving file, register this...\r\n\t\t\t\t\t\t\t$this->_err_num++;\r\n\t\t\t\t\t\t\t$this->_err_names[$this->_err_num] = $imgobj->_filename;\r\n\t\t\t\t\t\t\t$this->_err_types[$this->_err_num] = _ZOOM_ALERT_MOVEFAILURE;\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t \t}\r\n\t } elseif ($zoom->isMovie($imgobj->getMimeType(), true)) {\r\n\t //if movie is 'thumbnailable' -> make a thumbnail then!\r\n\t if ($zoom->isThumbnailable($imgobj->_type) && $this->_use_FFMPEG) {\r\n\t if (!$this->createMovieThumb($file, $zoom->_CONFIG['size'], $imgobj->_filename)) {\r\n\t $this->_err_num++;\r\n\t $this->_err_names[$this->_err_num] = $imgobj->_filename;\r\n\t $this->_err_types[$this->_err_num] = _ZOOM_ALERT_IMGERROR;\r\n\t return false;\r\n\t }\r\n\t }\r\n\t } elseif ($zoom->isAudio($imgobj->getMimeType(), true)) {\r\n\t // TODO: indexing audio files (mp3-files, etc.) properties, e.g. id3vX tags...\r\n\t }\r\n\t if (!$imgobj->save()) {\r\n\t $this->_err_num++;\r\n\t $this->_err_names[$this->_err_num] = $imgobj->_filename;\r\n\t $this->_err_types[$this->_err_num] = \"Database failure\";\r\n\t }\r\n\t }\r\n } else {\r\n //Not the right format, register this...\r\n $this->_err_num++;\r\n $this->_err_names[$this->_err_num] = $imgobj->_filename;\r\n $this->_err_types[$this->_err_num] = _ZOOM_ALERT_WRONGFORMAT_MULT;\r\n return false;\r\n }\r\n return true;\r\n }", "public function image();" ]
[ "0.7597557", "0.72338593", "0.7168493", "0.71593565", "0.7148519", "0.70090455", "0.68493223", "0.6800517", "0.67095655", "0.67083746", "0.6692325", "0.6692325", "0.66710556", "0.6669614", "0.6666071", "0.6631611", "0.66129637", "0.66081756", "0.6592158", "0.65849173", "0.6559549", "0.65236986", "0.6485475", "0.6438484", "0.6438113", "0.64205843", "0.6392034", "0.6378958", "0.63689774", "0.636746", "0.6310491", "0.6288894", "0.62404585", "0.6219932", "0.61968464", "0.619416", "0.6133509", "0.609838", "0.60638577", "0.60213786", "0.6017358", "0.5995974", "0.5976621", "0.58891183", "0.5834146", "0.5799931", "0.564007", "0.56279945", "0.56079483", "0.5601536", "0.5597687", "0.55967027", "0.55544806", "0.5539114", "0.54918236", "0.54737794", "0.5469545", "0.5460804", "0.5436916", "0.5434515", "0.54321814", "0.5424737", "0.5355636", "0.5340413", "0.5329197", "0.5319059", "0.5319059", "0.5319059", "0.5300806", "0.52633023", "0.5237827", "0.5232967", "0.5213749", "0.52076596", "0.5133598", "0.51323754", "0.51321083", "0.51245874", "0.5061853", "0.505061", "0.5046528", "0.5013694", "0.49961984", "0.49774027", "0.49314547", "0.49282476", "0.4927208", "0.49007493", "0.48902228", "0.48707289", "0.483428", "0.48222402", "0.48109382", "0.48090446", "0.47813186", "0.4776677", "0.47494632", "0.47485554", "0.47444203", "0.4742805" ]
0.7022079
5
Display a listing of the resource.
public function index() { return view('backend/Qa.indexboard'); }
{ "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) { $Productdescition = QaanswersModel::create([ "details" => $request->details, "qa_id" => $request->qa_id, ]); return response()->json([ 'msg_return' => 'บันทึกสำเร็จ', 'code_return' => 1, ]); }
{ "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) { $datas = []; $datas['topic'] = QatopicModel::find($id); $datas['user'] = User::find($datas['topic']->user_id); $datas['admin'] = Auth::guard('admin')->user()->email; $datas['answer'] = []; $relat = QarelatModel::where('topic_id', $datas['topic']->id)->firstOrFail(); $datas['id'] = $relat->id; $answers = $relat->replys; $count = 0; if($answers && $answers->count() > 0){ foreach ($answers as $key => $answerss) { $datas['answer'][$count]['id'] = $answerss->id; $datas['answer'][$count]['details'] = $answerss->details; $datas['answer'][$count]['created_at'] = $answerss->created_at->format('d-m-Y'); $count++; } } return view('backend/Qa.viewboard')->with($datas); }
{ "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
array untuk membuat data produk
public function tambah_produk() { $dataInputan = array( 'nama' => $this->input->post('nama'), 'deskripsi' => $this->input->post('deskripsi'), 'harga' => $this->input->post('harga'), 'stok' => $this->input->post('stok'), 'gambar' => $this->modelToko->_uploadImage('gambar'), ); $this->modelToko->masukkan('product', $dataInputan); redirect(base_url()."index.php/admin"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDataArray(){\n return array($this->item_id,$this->name,$this->count,$this->price);\n }", "private function getData() {\n $arr = \\Yii::$app->session->get('arr');\n if(isset($arr['pkd']) && $arr['pkd'] !== '0'){\n $pkd = \\app\\models\\Rujukan::find()->where(['kod' => $arr['pkd'], 'kat' => 'pkd'])->one();\n } else {\n $pkd = new \\app\\models\\Rujukan();\n }\n\n if(isset($arr['pks']) && $arr['pks'] !== '0'){\n $klinik = \\app\\models\\Klinik::find()->where(['id' => $arr['pks']])->one();\n } else {\n $klinik = new \\app\\models\\Klinik();\n }\n\n if(isset($arr['sekolah']) && $arr['sekolah'] !== '0'){\n $sekolah = \\app\\models\\Sekolah::find()->where(['id' => $arr['sekolah']])->one();\n } else {\n $sekolah = new \\app\\models\\Sekolah();\n }\n //\\var_dump($arr);exit;\n return ['pkd' => $pkd, 'klinik' => $klinik, 'sekolah' => $sekolah, 'ym_dari' => $arr['ym_dari'], 'ym_hingga' => $arr['ym_hingga']];\n }", "public function dataProviderVOData(): array\n {\n $data1 = [\n 'name' => '张三',\n 'age' => 30,\n ];\n return [\n [$data1],\n ];\n }", "protected static function setData(){\n\n self::$data = \n array (\n 0 => \n array (\n 'id' => 1,\n 'nombre' => 'AMOR MAYOR',\n 'estatus' => 'A',\n ),\n 1 => \n array (\n 'id' => 2,\n 'nombre' => 'CHE GUEVARA',\n 'estatus' => 'A',\n ),\n 2 => \n array (\n 'id' => 3,\n 'nombre' => 'CULTURA',\n 'estatus' => 'A',\n ),\n 3 => \n array (\n 'id' => 4,\n 'nombre' => 'HIJOS DE VENEZUELA',\n 'estatus' => 'A',\n ),\n 4 => \n array (\n 'id' => 5,\n 'nombre' => 'JOVENES DE LA PATRIA',\n 'estatus' => 'A',\n ),\n 5 => \n array (\n 'id' => 6,\n 'nombre' => 'MADRES DEL BARRIO',\n 'estatus' => 'A',\n ),\n 6 => \n array (\n 'id' => 12,\n 'nombre' => 'NEGRA HIPOLITA',\n 'estatus' => 'A',\n ),\n 7 => \n array (\n 'id' => 7,\n 'nombre' => 'PIAR',\n 'estatus' => 'A',\n ),\n 8 => \n array (\n 'id' => 8,\n 'nombre' => 'RIBAS',\n 'estatus' => 'A',\n ),\n 9 => \n array (\n 'id' => 9,\n 'nombre' => 'SABER Y TRABAJO',\n 'estatus' => 'A',\n ),\n 10 => \n array (\n 'id' => 10,\n 'nombre' => 'SONRISA',\n 'estatus' => 'A',\n ),\n 11 => \n array (\n 'id' => 11,\n 'nombre' => 'SUCRE',\n 'estatus' => 'A',\n ),\n)\t\t; \n\n \t}", "function get_data(){\n $data[] = array(\n 'id' => 1,\n 'titulo' => 'Atividade 1', \n 'conteudo' => 'Esta é uma Atividade de 60 minutos', \n 'tempo' => 60\n );\n $data[] = array(\n 'id' => 2,\n 'titulo' => 'Atividade 2', \n 'conteudo' => 'Esta é uma Atividade de 120 minutos', \n 'tempo' => 120\n );\n $data[] = array(\n 'id' => 3,\n 'titulo' => 'Atividade 3', \n 'conteudo' => 'Esta é uma Atividade de 180 minutos', \n 'tempo' => 180\n );\n $data[] = array(\n 'id' => 4,\n 'titulo' => 'Atividade 4', \n 'conteudo' => 'Esta é uma Atividade de 240 minutos', \n 'tempo' => 240\n );\n\n\n return $data;\n }", "public function tampil_data(){\n $sql= \"Select * From penjualan Order By id_penjualan DESC\";\n $data=$this->konek->query($sql);\n while ($row=mysqli_fetch_array($data)) {\n $hasil[]=$row;\n }\n return $hasil;\n }", "public static function arrDatos() {\r\n return array(\r\n array(\r\n array(\r\n 'html' => '<table width=\"88%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\"><tbody><tr><td width=\"13\" height=\"58\" valign=\"top\" background=\"http://www.estafeta.com/imagenes/lineageneralizquierda.png\">&nbsp;</td><td width=\"664\" valign=\"middle\" background=\"http://www.estafeta.com/imagenes/medioazulgeneral.png\"><div align=\"right\"><img src=\"http://www.estafeta.com/imagenes/herramientas.png\" width=\"333\" height=\"31\"></div></td><td width=\"11\" valign=\"top\" background=\"http://www.estafeta.com/imagenes/derechaazulgeneral.png\">&nbsp;</td></tr><tr><td height=\"33\" colspan=\"3\" valign=\"top\" background=\"http://www.estafeta.com/imagenes/separaseccroja.jpg\"><div align=\"left\"><img src=\"http://www.estafeta.com/imagenes/rastreotitulo.png\" width=\"258\" height=\"27\"></div></td></tr><tr><td colspan=\"3\" valign=\"top\"><p align=\"right\"><font color=\"#000000\" face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"><a href=\"http://www.estafeta.com/herramientas/rastreo.aspx\">Nueva consulta</a></font></p><div align=\"left\"><form><table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tbody><tr><td><table width=\"100%\" border=\"0\" cellpadding=\"1\" cellspacing=\"1\"><tbody><tr><td width=\"16%\" height=\"30\" bgcolor=\"#d6d6d6\" class=\"titulos\"><div align=\"left\" class=\"titulos\">Número de guía</div></td><td width=\"30%\" colspan=\"2\" bgcolor=\"#edf0e9\" class=\"respuestas\"><div align=\"left\" class=\"respuestas\"> 6058277365651709009524</div></td><td width=\"16%\" bgcolor=\"#d6d6d6\" class=\"titulos\"><div align=\"left\" class=\"titulos\">Código de rastreo</div></td><td width=\"35%\" colspan=\"3\" bgcolor=\"#edf0e9\" class=\"respuestas\"><div align=\"left\" class=\"respuestas\">0738266367</div></td></tr></tbody></table></td></tr><tr><td><table width=\"100%\" border=\"0\" cellpadding=\"1\" cellspacing=\"1\"><tbody><tr><td width=\"16%\" bgcolor=\"#d6e3f5\" class=\"titulos\"><div align=\"left\">Origen</div></td><td width=\"30%\" bgcolor=\"#edf0e9\" class=\"respuestas\"><div align=\"left\">MEXICO D.F.</div></td><td width=\"16%\" bgcolor=\"#d6e3f5\" class=\"titulos\"><div align=\"left\" class=\"titulos\">Destino</div></td><td width=\"35%\" colspan=\"3\" class=\"respuestas\"><table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tbody><tr><td height=\"30\" width=\"50%\" bgcolor=\"#edf0e9\"><div align=\"left\" class=\"respuestas\">Estación Aérea MEX</div></td><td height=\"30\" width=\"30%\" bgcolor=\"#d6e3f5\" class=\"titulos\">CP Destino</td><td height=\"30\" width=\"20%\" bgcolor=\"#edf0e9\" class=\"respuestas\" align=\"left\">&nbsp;55230</td></tr></tbody></table></td></tr></tbody></table></td></tr><tr><td><table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\"><tbody><tr><td width=\"16%\" bgcolor=\"#d6d6d6\" class=\"titulos\"><div align=\"left\">Estatus del servicio</div></td><td width=\"10%\" bgcolor=\"#edf0e9\" class=\"respuestasazul\"><div align=\"left\"><img src=\"images/palomita.png\" border=\"0\" width=\"50\" height=\"50\"></div></td><td width=\"20%\" bgcolor=\"#edf0e9\" class=\"respuestasazul\"><div align=\"left\">Entregado</div></td><td width=\"16%\" height=\"20\" bgcolor=\"#d6d6d6\"><div class=\"titulos\" align=\"left\">Recibió</div></td><td width=\"25%\" colspan=\"1\" bgcolor=\"#edf0e9\"><div class=\"respuestasazul3\" align=\"left\">PDV2:LASCAREZ MARTINEZ ENRIQUE </div></td><td width=\"10%\" bgcolor=\"#edf0e9\" class=\"style1\"><div align=\"center\"></div></td></tr></tbody></table></td></tr><tr><td align=\"center\" bgcolor=\"edf0e9\"><div class=\"msg_list\"><p style=\"display: none;\" id=\"6058277365651709009524FIR\" class=\"style1 msg_head \"></p><div class=\"msg_body\"></div></div></td></tr><tr><td><table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\"><tbody><tr><td width=\"16%\" height=\"30\" bgcolor=\"#d6e3f5\" class=\"titulos\"><div align=\"left\" class=\"titulos\">Servicio</div></td><td width=\"30%\" colspan=\"2\" bgcolor=\"#edf0e9\" class=\"respuestas\"><div align=\"left\" class=\"respuestas\">Entrega garantizada de 2 a 5 días hábiles (según distancia)</div></td><td width=\"16%\" height=\"30\" bgcolor=\"#d6e3f5\" class=\"titulos\"><div align=\"left\" class=\"titulos\">Fecha y hora de entrega</div></td><td width=\"35%\" colspan=\"3\" bgcolor=\"#edf0e9\" class=\"style1\"><div align=\"left\" class=\"respuestas\">28/11/2013 02:30 PM</div></td></tr></tbody></table></td></tr><tr><td><table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\"><tbody><tr><td width=\"16%\" height=\"30\" bgcolor=\"#d6d6d6\" class=\"titulos\"><div align=\"left\"><span class=\"titulos\">Tipo de envío</span></div></td><td width=\"30%\" colspan=\"2\" bgcolor=\"#edf0e9\" class=\"respuestas\"><div align=\"left\"><span class=\"respuestas\">PAQUETE</span></div></td><td width=\"16%\" bgcolor=\"#d6d6d6\" height=\"30\" class=\"titulos\"><div align=\"left\" class=\"titulos\">Fecha programada <br>de entrega</div></td><td width=\"35%\" colspan=\"3\" bgcolor=\"#edf0e9\" class=\"respuestas\"><div align=\"left\" class=\"respuestas\">Ocurre. El destinatario cuenta con 10 días hábiles para recoger su envío, una vez que este haya sido entregado en la plaza destino.</div></td></tr></tbody></table></td></tr><tr><td><table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\"><tbody><tr><td width=\"16%\" height=\"30\" bgcolor=\"#d6e3f5\" class=\"titulos\"><div align=\"left\"><span class=\"titulos\">Número de orden de recolección</span></div></td><td width=\"30%\" colspan=\"2\" bgcolor=\"#edf0e9\" class=\"respuestas\"><div align=\"left\"><span class=\"respuestas\"><a href=\"http://rastreo2.estafeta.com/ShipmentPickUpWeb/actions/pickUpOrder.do?method=doGetPickUpOrder&amp;forward=toPickUpInfo&amp;idioma=es&amp;pickUpId=8058829\" class=\"cuerpo\" target=\"_blank\">8058829</a></span></div></td><td width=\"16%\" height=\"40\" bgcolor=\"#d6e3f5\" class=\"titulos\"><div align=\"left\" class=\"titulos\">Fecha de recolección</div></td><td width=\"35%\" colspan=\"3\" bgcolor=\"#edf0e9\" class=\"respuestas\"><div align=\"left\" class=\"respuestas\"> 21/11/2013 05:32 PM</div></td></tr></tbody></table></td></tr><tr><td><table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\"><tbody><tr><td width=\"16%\" height=\"30\" bgcolor=\"#d6d6d6\" class=\"titulos\"><div align=\"left\"><span class=\"titulos\">Orden de rastreo*</span></div></td><td width=\"81%\" colspan=\"6\" height=\"30\" bgcolor=\"#edf0e9\" class=\"respuestas\"><div align=\"left\"><span class=\"respuestas\">8111262177</span></div></td></tr><tr><td width=\"16%\" height=\"30\" bgcolor=\"#d6e3f5\" class=\"titulos\"><div align=\"left\"><span class=\"titulos\">Motivo*</span></div></td><td width=\"81%\" colspan=\"6\" height=\"30\" bgcolor=\"#edf0e9\" class=\"respuestas\"><div align=\"left\"><span class=\"respuestas\">Coordinar a oficina Estafeta</span></div></td></tr><tr><td width=\"16%\" height=\"30\" bgcolor=\"#d6d6d6\" class=\"titulos\"><div align=\"left\"><span class=\"titulos\">Estatus*</span></div></td><td width=\"81%\" colspan=\"6\" height=\"30\" bgcolor=\"#edf0e9\" class=\"respuestas\"><div align=\"left\"><span class=\"respuestas\">Concluidos</span></div></td></tr><tr><td width=\"16%\" height=\"30\" bgcolor=\"#d6e3f5\" class=\"titulos\"><div align=\"left\"><span class=\"titulos\">Resultado*</span></div></td><td width=\"81%\" colspan=\"6\" height=\"30\" bgcolor=\"#edf0e9\" class=\"respuestas\"><div align=\"left\"><span class=\"respuestas\">Envio disponible en oficina Estafeta</span></div></td></tr></tbody></table></td></tr><tr><td><table width=\"690\" align=\"center\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\"><tbody><tr><td class=\"pies\"><div align=\"left\"><span class=\"pies\">*Aclaraciones acerca de su envío</span></div></td></tr></tbody></table></td></tr><tr><td>&nbsp;</td></tr><tr><td><table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\"><tbody><tr><td width=\"33%\" rowspan=\"2\" bgcolor=\"#d6d6d6\" class=\"titulos\"><div align=\"center\"><span class=\"titulos\">Guías envíos múltiples</span></div></td><td width=\"33%\" bgcolor=\"#d6e3f5\" class=\"titulos\"><div align=\"center\"><span class=\"titulos\">Guía documento de retorno</span></div></td><td width=\"33%\" bgcolor=\"#d6d6d6\" class=\"titulos\"><div align=\"center\"><span class=\"titulos\">Guía internacional</span></div></td></tr></tbody></table><table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\"><tbody><tr><td width=\"33%\" bgcolor=\"#edf0e9\" class=\"style1\"><div align=\"center\">&nbsp;</div></td><td width=\"33%\" bgcolor=\"#edf0e9\" class=\"style1\"><div align=\"center\">&nbsp;</div></td><td width=\"33%\" bgcolor=\"#edf0e9\" class=\"repuestas\"><div align=\"center\">&nbsp;</div></td></tr></tbody></table></td></tr><tr><td>&nbsp;</td></tr><tr><td><table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\"><tbody><tr><td width=\"20%\" rowspan=\"3\" bgcolor=\"#d6e3f5\" class=\"titulos\"><div align=\"center\"><span class=\"titulos\">Características del envío</span><br><img onclick=\"darClick(\\'6058277365651709009524CAR\\')\" src=\"images/caracter_envio.png\" style=\"cursor:pointer;\" border=\"0\" width=\"75\" height=\"75\"></div></td><td width=\"20%\" rowspan=\"3\" bgcolor=\"#d6e3f5\" class=\"titulos\"><div align=\"center\"><span class=\"titulos\">Historia</span><br><img onclick=\"darClick(\\'6058277365651709009524HIS\\')\" src=\"images/historia.png\" style=\"cursor:pointer;\" border=\"0\" width=\"75\" height=\"75\"></div></td><td width=\"20%\" rowspan=\"3\" bgcolor=\"#d6e3f5\" class=\"titulos\"><div align=\"center\"><span class=\"titulos\">Preguntas frecuentes</span><br><a target=\"_blank\" href=\"http://www.estafeta.com/herramientas/ayuda.aspx\"><img src=\"images/preguntas.png\" border=\"0\" width=\"75\" height=\"75\"></a></div></td><td width=\"20%\" rowspan=\"3\" bgcolor=\"#d6e3f5\" class=\"titulos\"><div align=\"center\"><span class=\"titulos\">Comprobante de entrega</span><br><a target=\"_blank\" href=\"/RastreoWebInternet/consultaEnvio.do?dispatch=doComprobanteEntrega&amp;guiaEst=6058277365651709009524\"><img src=\"images/comprobante.png\" border=\"0\" width=\"75\" height=\"75\"></a></div></td></tr></tbody></table></td></tr><tr><td><div class=\"msg_list\"><p style=\"display: none;\" id=\"6058277365651709009524CAR\" class=\"style1 msg_head \"></p><div class=\"msg_body\"><table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\"><tbody><tr><td width=\"20%\" rowspan=\"3\" bgcolor=\"#d6d6d6\" class=\"style1\"><div align=\"center\"><span class=\"titulos\">Características </span></div></td></tr></tbody></table><table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\"><tbody><tr><td width=\"16%\" height=\"20\" bgcolor=\"#d6e3f5\" class=\"titulos\"><div align=\"left\"><span class=\"titulos\">Tipo de envío</span></div></td><td width=\"30%\" bgcolor=\"#edf0e9\" class=\"respuestas\"><div align=\"left\"><span class=\"respuestas\">PAQUETE</span></div></td><td width=\"20%\" bgcolor=\"#d6e3f5\" class=\"style1\"><div align=\"left\"><span class=\"titulos\">Dimensiones cm</span></div></td><td width=\"30%\" bgcolor=\"#edf0e9\" class=\"style1\"><div align=\"left\"><span class=\"respuestas\">0x0x0</span></div></td></tr><tr><td width=\"20%\" bgcolor=\"#d6d6d6\" class=\"style1\"><div align=\"left\"><span class=\"titulos\">Peso kg</span></div></td><td width=\"30%\" bgcolor=\"#edf0e9\" class=\"style1\"><div align=\"left\"><span class=\"respuestas\">0.2</span></div></td><td width=\"20%\" bgcolor=\"#d6d6d6\" class=\"style1\"><div align=\"left\"><span class=\"titulos\">Peso volumétrico kg</span></div></td><td width=\"30%\" bgcolor=\"#edf0e9\" class=\"style1\"><div align=\"left\"><span class=\"respuestas\">0.0</span></div></td></tr><tr><td width=\"20%\" bgcolor=\"#d6e3f5\" class=\"style1\"><div align=\"left\"><span class=\"titulos\">Referencia cliente</span></div></td><td colspan=\"3\" width=\"80%\" bgcolor=\"#edf0e9\" class=\"style1\"><div align=\"center\">&nbsp;</div></td></tr></tbody></table></div></div></td></tr><tr><td><div class=\"msg_list\"><p style=\"display: none;\" id=\"6058277365651709009524HIS\" class=\"style1 msg_head \"></p><div class=\"msg_body\"><table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\"><tbody><tr><td width=\"20%\" rowspan=\"3\" bgcolor=\"#d6d6d6\" class=\"style1\"><div align=\"center\"><span class=\"titulos\">Historia </span></div></td></tr></tbody></table><table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\"><tbody><tr><td width=\"22%\" height=\"23\" bgcolor=\"#d6d6d6\" class=\"titulos\"><div align=\"center\">Fecha - Hora</div></td><td width=\"31%\" height=\"23\" bgcolor=\"#d6d6d6\" class=\"titulos\"><div align=\"center\">Lugar - Movimiento</div></td><td width=\"20%\" height=\"23\" bgcolor=\"#d6d6d6\" class=\"titulos\"><div align=\"center\">Comentarios</div></td></tr><tr><td bgcolor=\"#e3e3e3\" class=\"style1\"><div class=\"respuestasNormal\" align=\"left\">28/11/2013 02:30 PM</div></td><td bgcolor=\"#e3e3e3\" class=\"respuestasNormal\"><div align=\"left\"> Recolección en oficina por ruta local</div></td><td bgcolor=\"#e3e3e3\" class=\"style1\"><div align=\"left\" class=\"respuestasNormal\">&nbsp;</div></td></tr><tr><td bgcolor=\"#d6e3f5\" class=\"style1\"><div class=\"respuestasNormal\" align=\"left\">28/11/2013 12:19 PM</div></td><td bgcolor=\"#d6e3f5\" class=\"respuestasNormal\"><div align=\"left\"> Envío recibido en oficina</div></td><td bgcolor=\"#d6e3f5\" class=\"style1\"><div align=\"left\" class=\"respuestasNormal\">Envío ocurre direccionado a oficina </div></td></tr><tr><td bgcolor=\"#e3e3e3\" class=\"style1\"><div class=\"respuestasNormal\" align=\"left\">27/11/2013 07:18 PM</div></td><td bgcolor=\"#e3e3e3\" class=\"respuestasNormal\"><div align=\"left\"> Carga Aerea AER Aclaración en proceso</div></td><td bgcolor=\"#e3e3e3\" class=\"style1\"><div align=\"left\" class=\"respuestasNormal\">Comunicarse al 01800 3782 338 </div></td></tr><tr><td bgcolor=\"#d6e3f5\" class=\"style1\"><div class=\"respuestasNormal\" align=\"left\">27/11/2013 04:18 PM</div></td><td bgcolor=\"#d6e3f5\" class=\"respuestasNormal\"><div align=\"left\"> Envío recibido en oficina</div></td><td bgcolor=\"#d6e3f5\" class=\"style1\"><div align=\"left\" class=\"respuestasNormal\">Envío ocurre direccionado a oficina </div></td></tr><tr><td bgcolor=\"#e3e3e3\" class=\"style1\"><div class=\"respuestasNormal\" align=\"left\">27/11/2013 09:19 AM</div></td><td bgcolor=\"#e3e3e3\" class=\"respuestasNormal\"><div align=\"left\"> Estación Aérea MEX En proceso de entrega Av Central 161 Impulsora Popular Avicola Nezahualcoyotl</div></td><td bgcolor=\"#e3e3e3\" class=\"style1\"><div align=\"left\" class=\"respuestasNormal\">Envío ocurre direccionado a oficina </div></td></tr><tr><td bgcolor=\"#d6e3f5\" class=\"style1\"><div class=\"respuestasNormal\" align=\"left\">27/11/2013 07:24 AM</div></td><td bgcolor=\"#d6e3f5\" class=\"respuestasNormal\"><div align=\"left\"> Estación Aérea MEX Llegada a centro de distribución AMX Estación Aérea MEX</div></td><td bgcolor=\"#d6e3f5\" class=\"style1\"><div align=\"left\" class=\"respuestasNormal\">&nbsp;</div></td></tr><tr><td bgcolor=\"#e3e3e3\" class=\"style1\"><div class=\"respuestasNormal\" align=\"left\">26/11/2013 07:05 PM</div></td><td bgcolor=\"#e3e3e3\" class=\"respuestasNormal\"><div align=\"left\"> MEXICO D.F. En ruta foránea hacia MX2-México (zona 2)</div></td><td bgcolor=\"#e3e3e3\" class=\"style1\"><div align=\"left\" class=\"respuestasNormal\">&nbsp;</div></td></tr><tr><td bgcolor=\"#d6e3f5\" class=\"style1\"><div class=\"respuestasNormal\" align=\"left\">26/11/2013 07:03 PM</div></td><td bgcolor=\"#d6e3f5\" class=\"respuestasNormal\"><div align=\"left\"> MEXICO D.F. Llegada a centro de distribución MEX MEXICO D.F.</div></td><td bgcolor=\"#d6e3f5\" class=\"style1\"><div align=\"left\" class=\"respuestasNormal\">&nbsp;</div></td></tr><tr><td bgcolor=\"#e3e3e3\" class=\"style1\"><div class=\"respuestasNormal\" align=\"left\">26/11/2013 06:55 PM</div></td><td bgcolor=\"#e3e3e3\" class=\"respuestasNormal\"><div align=\"left\"> MEXICO D.F. Movimiento en centro de distribución</div></td><td bgcolor=\"#e3e3e3\" class=\"style1\"><div align=\"left\" class=\"respuestasNormal\">Envío en proceso de entrega </div></td></tr><tr><td bgcolor=\"#d6e3f5\" class=\"style1\"><div class=\"respuestasNormal\" align=\"left\">26/11/2013 06:55 PM</div></td><td bgcolor=\"#d6e3f5\" class=\"respuestasNormal\"><div align=\"left\"> MEXICO D.F. Movimiento en centro de distribución</div></td><td bgcolor=\"#d6e3f5\" class=\"style1\"><div align=\"left\" class=\"respuestasNormal\">Recibe el área de Operaciones </div></td></tr><tr><td bgcolor=\"#e3e3e3\" class=\"style1\"><div class=\"respuestasNormal\" align=\"left\">26/11/2013 03:17 PM</div></td><td bgcolor=\"#e3e3e3\" class=\"respuestasNormal\"><div align=\"left\"> MEXICO D.F. Aclaración en proceso</div></td><td bgcolor=\"#e3e3e3\" class=\"style1\"><div align=\"left\" class=\"respuestasNormal\">Reporte generado por el cliente </div></td></tr><tr><td bgcolor=\"#d6e3f5\" class=\"style1\"><div class=\"respuestasNormal\" align=\"left\">23/11/2013 10:42 AM</div></td><td bgcolor=\"#d6e3f5\" class=\"respuestasNormal\"><div align=\"left\"> MEXICO D.F. Movimiento Local</div></td><td bgcolor=\"#d6e3f5\" class=\"style1\"><div align=\"left\" class=\"respuestasNormal\">Auditoria a ruta local </div></td></tr><tr><td bgcolor=\"#e3e3e3\" class=\"style1\"><div class=\"respuestasNormal\" align=\"left\">22/11/2013 12:00 PM</div></td><td bgcolor=\"#e3e3e3\" class=\"respuestasNormal\"><div align=\"left\"> MEXICO D.F. Movimiento en centro de distribución</div></td><td bgcolor=\"#e3e3e3\" class=\"style1\"><div align=\"left\" class=\"respuestasNormal\">Entrada a Control de Envíos </div></td></tr><tr><td bgcolor=\"#d6e3f5\" class=\"style1\"><div class=\"respuestasNormal\" align=\"left\">22/11/2013 11:33 AM</div></td><td bgcolor=\"#d6e3f5\" class=\"respuestasNormal\"><div align=\"left\"> MEXICO D.F. Movimiento Local</div></td><td bgcolor=\"#d6e3f5\" class=\"style1\"><div align=\"left\" class=\"respuestasNormal\">Entrega en Zona de Alto Riesgo y/o de difícil acceso </div></td></tr><tr><td bgcolor=\"#e3e3e3\" class=\"style1\"><div class=\"respuestasNormal\" align=\"left\">22/11/2013 11:05 AM</div></td><td bgcolor=\"#e3e3e3\" class=\"respuestasNormal\"><div align=\"left\"> MEXICO D.F. Movimiento en centro de distribución</div></td><td bgcolor=\"#e3e3e3\" class=\"style1\"><div align=\"left\" class=\"respuestasNormal\">Posible demora en la entrega por mal empaque </div></td></tr><tr><td bgcolor=\"#d6e3f5\" class=\"style1\"><div class=\"respuestasNormal\" align=\"left\">22/11/2013 10:58 AM</div></td><td bgcolor=\"#d6e3f5\" class=\"respuestasNormal\"><div align=\"left\"> MEXICO D.F. Movimiento Local</div></td><td bgcolor=\"#d6e3f5\" class=\"style1\"><div align=\"left\" class=\"respuestasNormal\">Entrega en Zona de Alto Riesgo y/o de difícil acceso </div></td></tr><tr><td bgcolor=\"#e3e3e3\" class=\"style1\"><div class=\"respuestasNormal\" align=\"left\">21/11/2013 07:00 PM</div></td><td bgcolor=\"#e3e3e3\" class=\"respuestasNormal\"><div align=\"left\"> MEXICO D.F. Movimiento en centro de distribución</div></td><td bgcolor=\"#e3e3e3\" class=\"style1\"><div align=\"left\" class=\"respuestasNormal\">Envío pendiente de salida a ruta local </div></td></tr><tr><td bgcolor=\"#d6e3f5\" class=\"style1\"><div class=\"respuestasNormal\" align=\"left\">21/11/2013 06:56 PM</div></td><td bgcolor=\"#d6e3f5\" class=\"respuestasNormal\"><div align=\"left\"> MEXICO D.F. Llegada a centro de distribución MEX MEXICO D.F.</div></td><td bgcolor=\"#d6e3f5\" class=\"style1\"><div align=\"left\" class=\"respuestasNormal\">&nbsp;</div></td></tr></tbody></table></div></div></td></tr></tbody></table><br><hr color=\"red\" width=\"688px\"><br><input type=\"hidden\" name=\"tipoGuia\" value=\"ESTAFETA&quot;\"></form><font color=\"#000000\" face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"> Versión 4.0 </font></div></td></tr></tbody></table>',\r\n 'numero_guia' => '6058277365651709009524',\r\n 'codigo_rastreo' => '0738266367',\r\n 'servicio' => 'Entrega garantizada de 2 a 5 días hábiles (según distancia)',\r\n 'fecha_programada' => 'Ocurre. El destinatario cuenta con 10 días hábiles para recoger su envío, una vez que este haya sido entregado en la plaza destino.',\r\n 'origen' => 'MEXICO D.F.',\r\n 'cp_destino' => '55230',\r\n 'fecha_recoleccion' => '21/11/2013 05:32 PM',\r\n 'destino' => 'Estación Aérea MEX',\r\n 'estatus' => 'Entregado',\r\n 'fecha_entrega' => '28/11/2013 02:30 PM',\r\n 'tipo_envio' => 'PAQUETE',\r\n 'recibio' => 'PDV2:LASCAREZ MARTINEZ ENRIQUE',\r\n 'firma_recibido' => '',\r\n 'peso' => '0.2',\r\n 'peso_vol' => '0.0',\r\n 'historial' => array(\r\n array('fecha' => '28/11/2013 02:30 PM', 'lugar_movimiento' => 'Recolección en oficina por ruta local', 'comentarios' => ''),\r\n array('fecha' => '28/11/2013 12:19 PM', 'lugar_movimiento' => 'Envío recibido en oficina', 'comentarios' => 'Envío ocurre direccionado a oficina'),\r\n array('fecha' => '27/11/2013 07:18 PM', 'lugar_movimiento' => 'Carga Aerea AER Aclaración en proceso', 'comentarios' => 'Comunicarse al 01800 3782 338'),\r\n array('fecha' => '27/11/2013 04:18 PM', 'lugar_movimiento' => 'Envío recibido en oficina', 'comentarios' => 'Envío ocurre direccionado a oficina'),\r\n array('fecha' => '27/11/2013 09:19 AM', 'lugar_movimiento' => 'Estación Aérea MEX En proceso de entrega Av Central 161 Impulsora Popular Avicola Nezahualcoyotl', 'comentarios' => 'Envío ocurre direccionado a oficina'),\r\n array('fecha' => '27/11/2013 07:24 AM', 'lugar_movimiento' => 'Estación Aérea MEX Llegada a centro de distribución AMX Estación Aérea MEX', 'comentarios' => ''),\r\n array('fecha' => '26/11/2013 07:05 PM', 'lugar_movimiento' => 'MEXICO D.F. En ruta foránea hacia MX2-México (zona 2)', 'comentarios' => ''),\r\n array('fecha' => '26/11/2013 07:03 PM', 'lugar_movimiento' => 'MEXICO D.F. Llegada a centro de distribución MEX MEXICO D.F.', 'comentarios' => ''),\r\n array('fecha' => '26/11/2013 06:55 PM', 'lugar_movimiento' => 'MEXICO D.F. Movimiento en centro de distribución', 'comentarios' => 'Envío en proceso de entrega'),\r\n array('fecha' => '26/11/2013 06:55 PM', 'lugar_movimiento' => 'MEXICO D.F. Movimiento en centro de distribución', 'comentarios' => 'Recibe el área de Operaciones'),\r\n array('fecha' => '26/11/2013 03:17 PM', 'lugar_movimiento' => 'MEXICO D.F. Aclaración en proceso', 'comentarios' => 'Reporte generado por el cliente'),\r\n array('fecha' => '23/11/2013 10:42 AM', 'lugar_movimiento' => 'MEXICO D.F. Movimiento Local', 'comentarios' => 'Auditoria a ruta local'),\r\n array('fecha' => '22/11/2013 12:00 PM', 'lugar_movimiento' => 'MEXICO D.F. Movimiento en centro de distribución', 'comentarios' => 'Entrada a Control de Envíos'),\r\n array('fecha' => '22/11/2013 11:33 AM', 'lugar_movimiento' => 'MEXICO D.F. Movimiento Local', 'comentarios' => 'Entrega en Zona de Alto Riesgo y/o de difícil acceso'),\r\n array('fecha' => '22/11/2013 11:05 AM', 'lugar_movimiento' => 'MEXICO D.F. Movimiento en centro de distribución', 'comentarios' => 'Posible demora en la entrega por mal empaque'),\r\n array('fecha' => '22/11/2013 10:58 AM', 'lugar_movimiento' => 'MEXICO D.F. Movimiento Local', 'comentarios' => 'Entrega en Zona de Alto Riesgo y/o de difícil acceso'),\r\n array('fecha' => '21/11/2013 07:00 PM', 'lugar_movimiento' => 'MEXICO D.F. Movimiento en centro de distribución', 'comentarios' => 'Envío pendiente de salida a ruta local'),\r\n array('fecha' => '21/11/2013 06:56 PM', 'lugar_movimiento' => 'MEXICO D.F. Llegada a centro de distribución MEX MEXICO D.F.', 'comentarios' => ''),\r\n )\r\n )\r\n ),\r\n array(\r\n array(\r\n 'html' => '<table width=\"88%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\"><tbody><tr><td width=\"13\" height=\"58\" valign=\"top\" background=\"http://www.estafeta.com/imagenes/lineageneralizquierda.png\">&nbsp;</td><td width=\"664\" valign=\"middle\" background=\"http://www.estafeta.com/imagenes/medioazulgeneral.png\"><div align=\"right\"><img src=\"http://www.estafeta.com/imagenes/herramientas.png\" width=\"333\" height=\"31\"></div></td><td width=\"11\" valign=\"top\" background=\"http://www.estafeta.com/imagenes/derechaazulgeneral.png\">&nbsp;</td></tr><tr><td height=\"33\" colspan=\"3\" valign=\"top\" background=\"http://www.estafeta.com/imagenes/separaseccroja.jpg\"><div align=\"left\"><img src=\"http://www.estafeta.com/imagenes/rastreotitulo.png\" width=\"258\" height=\"27\"></div></td></tr><tr><td colspan=\"3\" valign=\"top\"><p align=\"right\"><font color=\"#000000\" face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"><a href=\"http://www.estafeta.com/herramientas/rastreo.aspx\">Nueva consulta</a></font></p><div align=\"left\"><form><table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tbody><tr><td><table width=\"100%\" border=\"0\" cellpadding=\"1\" cellspacing=\"1\"><tbody><tr><td width=\"16%\" height=\"30\" bgcolor=\"#d6d6d6\" class=\"titulos\"><div align=\"left\" class=\"titulos\">Número de guía</div></td><td width=\"30%\" colspan=\"2\" bgcolor=\"#edf0e9\" class=\"respuestas\"><div align=\"left\" class=\"respuestas\"> 8055241528464720115088</div></td><td width=\"16%\" bgcolor=\"#d6d6d6\" class=\"titulos\"><div align=\"left\" class=\"titulos\">Código de rastreo</div></td><td width=\"35%\" colspan=\"3\" bgcolor=\"#edf0e9\" class=\"respuestas\"><div align=\"left\" class=\"respuestas\">2715597604</div></td></tr></tbody></table></td></tr><tr><td><table width=\"100%\" border=\"0\" cellpadding=\"1\" cellspacing=\"1\"><tbody><tr><td width=\"16%\" bgcolor=\"#d6e3f5\" class=\"titulos\"><div align=\"left\">Origen</div></td><td width=\"30%\" bgcolor=\"#edf0e9\" class=\"respuestas\"><div align=\"left\">México (zona 2)</div></td><td width=\"16%\" bgcolor=\"#d6e3f5\" class=\"titulos\"><div align=\"left\" class=\"titulos\">Destino</div></td><td width=\"35%\" colspan=\"3\" class=\"respuestas\"><table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tbody><tr><td height=\"30\" width=\"50%\" bgcolor=\"#edf0e9\"><div align=\"left\" class=\"respuestas\">MEXICO D.F.</div></td><td height=\"30\" width=\"30%\" bgcolor=\"#d6e3f5\" class=\"titulos\">CP Destino</td><td height=\"30\" width=\"20%\" bgcolor=\"#edf0e9\" class=\"respuestas\" align=\"left\">&nbsp;01210</td></tr></tbody></table></td></tr></tbody></table></td></tr><tr><td><table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\"><tbody><tr><td width=\"16%\" bgcolor=\"#d6d6d6\" class=\"titulos\"><div align=\"left\">Estatus del servicio</div></td><td width=\"10%\" bgcolor=\"#edf0e9\" class=\"respuestasazul\"><div align=\"left\"><img src=\"images/palomita.png\" border=\"0\" width=\"50\" height=\"50\"></div></td><td width=\"20%\" bgcolor=\"#edf0e9\" class=\"respuestasazul\"><div align=\"left\">Entregado</div></td><td width=\"16%\" height=\"20\" bgcolor=\"#d6d6d6\" class=\"titulos\"><div align=\"left\"><span class=\"titulos\">Recibió</span></div></td><td width=\"25%\" colspan=\"1\" bgcolor=\"#edf0e9\"><div class=\"respuestasazul2\" align=\"left\">SDR:RAUL MARTIN </div></td><td width=\"10%\" bgcolor=\"#edf0e9\" class=\"style1\"><div align=\"center\"><img src=\"images/firma.png\" onclick=\"darClick(\\2715597604FIR\\)\" style=\"cursor:pointer;\" width=\"50\" height=\"50\"></div></td></tr></tbody></table></td></tr><tr><td align=\"center\" bgcolor=\"edf0e9\"><div class=\"msg_list\"><p style=\"display: none;\" id=\"2715597604FIR\" class=\"style1 msg_head \"></p><div class=\"msg_body\"><table width=\"30%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tbody><tr><td height=\"3\"></td></tr><tr><td width=\"14%\" height=\"16\" bgcolor=\"CC0000\" class=\"style1\"><div align=\"left\"><span class=\"style5\">Firma de Recibido</span></div></td></tr><tr><td><img src=\"/RastreoWebInternet/firmaServlet?guia=8055241528464720115088&amp;idioma=es\" width=\"224\" height=\"120\"></td></tr><tr><td height=\"3\"></td></tr></tbody></table></div></div></td></tr><tr><td><table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\"><tbody><tr><td width=\"16%\" height=\"30\" bgcolor=\"#d6e3f5\" class=\"titulos\"><div align=\"left\" class=\"titulos\">Servicio</div></td><td width=\"30%\" colspan=\"2\" bgcolor=\"#edf0e9\" class=\"respuestas\"><div align=\"left\" class=\"respuestas\">Entrega garantizada al tercer día hábil</div></td><td width=\"16%\" height=\"30\" bgcolor=\"#d6e3f5\" class=\"titulos\"><div align=\"left\" class=\"titulos\">Fecha y hora de entrega</div></td><td width=\"35%\" colspan=\"3\" bgcolor=\"#edf0e9\" class=\"style1\"><div align=\"left\" class=\"respuestas\">31/10/2013 12:13 PM</div></td></tr></tbody></table></td></tr><tr><td><table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\"><tbody><tr><td width=\"16%\" height=\"30\" bgcolor=\"#d6d6d6\" class=\"titulos\"><div align=\"left\"><span class=\"titulos\">Tipo de envío</span></div></td><td width=\"30%\" colspan=\"2\" bgcolor=\"#edf0e9\" class=\"respuestas\"><div align=\"left\"><span class=\"respuestas\">PAQUETE</span></div></td><td width=\"16%\" bgcolor=\"#d6d6d6\" height=\"30\" class=\"titulos\"><div align=\"left\" class=\"titulos\">Fecha programada <br>de entrega</div></td><td width=\"35%\" colspan=\"3\" bgcolor=\"#edf0e9\" class=\"respuestas\"><div align=\"left\" class=\"respuestas\">04/11/2013<br></div></td></tr></tbody></table></td></tr><tr><td><table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\"><tbody><tr><td width=\"16%\" height=\"30\" bgcolor=\"#d6e3f5\" class=\"titulos\"><div align=\"left\"><span class=\"titulos\">Número de orden de recolección</span></div></td><td width=\"30%\" colspan=\"2\" bgcolor=\"#edf0e9\" class=\"respuestas\"><div align=\"center\">&nbsp;</div></td><td width=\"16%\" height=\"40\" bgcolor=\"#d6e3f5\" class=\"titulos\"><div align=\"left\" class=\"titulos\">Fecha de recolección</div></td><td width=\"35%\" colspan=\"3\" bgcolor=\"#edf0e9\" class=\"respuestas\"><div align=\"left\" class=\"respuestas\"> 30/10/2013 02:00 PM</div></td></tr></tbody></table></td></tr><tr><td><table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\"><tbody><tr><td width=\"16%\" height=\"30\" bgcolor=\"#d6d6d6\" class=\"titulos\"><div align=\"left\"><span class=\"titulos\">Orden de rastreo*</span></div></td><td width=\"81%\" colspan=\"6\" height=\"30\" bgcolor=\"#edf0e9\" class=\"respuestas\"><div align=\"left\"><span class=\"respuestas\">8111261466</span></div></td></tr><tr><td width=\"16%\" height=\"30\" bgcolor=\"#d6e3f5\" class=\"titulos\"><div align=\"left\"><span class=\"titulos\">Motivo*</span></div></td><td width=\"81%\" colspan=\"6\" height=\"30\" bgcolor=\"#edf0e9\" class=\"respuestas\"><div align=\"left\"><span class=\"respuestas\">Verificacion de domicilio</span></div></td></tr><tr><td width=\"16%\" height=\"30\" bgcolor=\"#d6d6d6\" class=\"titulos\"><div align=\"left\"><span class=\"titulos\">Estatus*</span></div></td><td width=\"81%\" colspan=\"6\" height=\"30\" bgcolor=\"#edf0e9\" class=\"respuestas\"><div align=\"left\"><span class=\"respuestas\">Concluidos</span></div></td></tr><tr><td width=\"16%\" height=\"30\" bgcolor=\"#d6e3f5\" class=\"titulos\"><div align=\"left\"><span class=\"titulos\">Resultado*</span></div></td><td width=\"81%\" colspan=\"6\" height=\"30\" bgcolor=\"#edf0e9\" class=\"respuestas\"><div align=\"left\"><span class=\"respuestas\">Falta de datos para contactar al cliente</span></div></td></tr></tbody></table></td></tr><tr><td><table width=\"690\" align=\"center\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\"><tbody><tr><td class=\"pies\"><div align=\"left\"><span class=\"pies\">*Aclaraciones acerca de su envío</span></div></td></tr></tbody></table></td></tr><tr><td>&nbsp;</td></tr><tr><td><table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\"><tbody><tr><td width=\"33%\" rowspan=\"2\" bgcolor=\"#d6d6d6\" class=\"titulos\"><div align=\"center\"><span class=\"titulos\">Guías envíos múltiples</span></div></td><td width=\"33%\" bgcolor=\"#d6e3f5\" class=\"titulos\"><div align=\"center\"><span class=\"titulos\">Guía documento de retorno</span></div></td><td width=\"33%\" bgcolor=\"#d6d6d6\" class=\"titulos\"><div align=\"center\"><span class=\"titulos\">Guía internacional</span></div></td></tr></tbody></table><table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\"><tbody><tr><td width=\"33%\" bgcolor=\"#edf0e9\" class=\"style1\"><div align=\"center\">&nbsp;</div></td><td width=\"33%\" bgcolor=\"#edf0e9\" class=\"style1\"><div align=\"center\">&nbsp;</div></td><td width=\"33%\" bgcolor=\"#edf0e9\" class=\"repuestas\"><div align=\"center\">&nbsp;</div></td></tr></tbody></table></td></tr><tr><td>&nbsp;</td></tr><tr><td><table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\"><tbody><tr><td width=\"20%\" rowspan=\"3\" bgcolor=\"#d6e3f5\" class=\"titulos\"><div align=\"center\"><span class=\"titulos\">Características del envío</span><br><img onclick=\"darClick(\\2715597604CAR\\)\" src=\"images/caracter_envio.png\" style=\"cursor:pointer;\" border=\"0\" width=\"75\" height=\"75\"></div></td><td width=\"20%\" rowspan=\"3\" bgcolor=\"#d6e3f5\" class=\"titulos\"><div align=\"center\"><span class=\"titulos\">Historia</span><br><img onclick=\"darClick(\\2715597604HIS\\)\" src=\"images/historia.png\" style=\"cursor:pointer;\" border=\"0\" width=\"75\" height=\"75\"></div></td><td width=\"20%\" rowspan=\"3\" bgcolor=\"#d6e3f5\" class=\"titulos\"><div align=\"center\"><span class=\"titulos\">Preguntas frecuentes</span><br><a target=\"_blank\" href=\"http://www.estafeta.com/herramientas/ayuda.aspx\"><img src=\"images/preguntas.png\" border=\"0\" width=\"75\" height=\"75\"></a></div></td><td width=\"20%\" rowspan=\"3\" bgcolor=\"#d6e3f5\" class=\"titulos\"><div align=\"center\"><span class=\"titulos\">Comprobante de entrega</span><br><a target=\"_blank\" href=\"/RastreoWebInternet/consultaEnvio.do?dispatch=doComprobanteEntrega&amp;guiaEst=8055241528464720115088\"><img src=\"images/comprobante.png\" border=\"0\" width=\"75\" height=\"75\"></a></div></td></tr></tbody></table></td></tr><tr><td><div class=\"msg_list\"><p style=\"display: none;\" id=\"2715597604CAR\" class=\"style1 msg_head \"></p><div class=\"msg_body\"><table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\"><tbody><tr><td width=\"20%\" rowspan=\"3\" bgcolor=\"#d6d6d6\" class=\"style1\"><div align=\"center\"><span class=\"titulos\">Características </span></div></td></tr></tbody></table><table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\"><tbody><tr><td width=\"16%\" height=\"20\" bgcolor=\"#d6e3f5\" class=\"titulos\"><div align=\"left\"><span class=\"titulos\">Tipo de envío</span></div></td><td width=\"30%\" bgcolor=\"#edf0e9\" class=\"respuestas\"><div align=\"left\"><span class=\"respuestas\">PAQUETE</span></div></td><td width=\"20%\" bgcolor=\"#d6e3f5\" class=\"style1\"><div align=\"left\"><span class=\"titulos\">Dimensiones cm</span></div></td><td width=\"30%\" bgcolor=\"#edf0e9\" class=\"style1\"><div align=\"left\"><span class=\"respuestas\">50x14x14</span></div></td></tr><tr><td width=\"20%\" bgcolor=\"#d6d6d6\" class=\"style1\"><div align=\"left\"><span class=\"titulos\">Peso kg</span></div></td><td width=\"30%\" bgcolor=\"#edf0e9\" class=\"style1\"><div align=\"left\"><span class=\"respuestas\">0.7</span></div></td><td width=\"20%\" bgcolor=\"#d6d6d6\" class=\"style1\"><div align=\"left\"><span class=\"titulos\">Peso volumétrico kg</span></div></td><td width=\"30%\" bgcolor=\"#edf0e9\" class=\"style1\"><div align=\"left\"><span class=\"respuestas\">1.9</span></div></td></tr><tr><td width=\"20%\" bgcolor=\"#d6e3f5\" class=\"style1\"><div align=\"left\"><span class=\"titulos\">Referencia cliente</span></div></td><td colspan=\"3\" width=\"80%\" bgcolor=\"#edf0e9\" class=\"style1\"><div align=\"center\">&nbsp;</div></td></tr></tbody></table></div></div></td></tr><tr><td><div class=\"msg_list\"><p style=\"display: none;\" id=\"2715597604HIS\" class=\"style1 msg_head \"></p><div class=\"msg_body\"><table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\"><tbody><tr><td width=\"20%\" rowspan=\"3\" bgcolor=\"#d6d6d6\" class=\"style1\"><div align=\"center\"><span class=\"titulos\">Historia </span></div></td></tr></tbody></table><table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\"><tbody><tr><td width=\"22%\" height=\"23\" bgcolor=\"#d6d6d6\" class=\"titulos\"><div align=\"center\">Fecha - Hora</div></td><td width=\"31%\" height=\"23\" bgcolor=\"#d6d6d6\" class=\"titulos\"><div align=\"center\">Lugar - Movimiento</div></td><td width=\"20%\" height=\"23\" bgcolor=\"#d6d6d6\" class=\"titulos\"><div align=\"center\">Comentarios</div></td></tr><tr><td bgcolor=\"#e3e3e3\" class=\"style1\"><div class=\"respuestasNormal\" align=\"left\">26/11/2013 02:31 PM</div></td><td bgcolor=\"#e3e3e3\" class=\"respuestasNormal\"><div align=\"left\"> MEXICO D.F. Aclaración en proceso</div></td><td bgcolor=\"#e3e3e3\" class=\"style1\"><div align=\"left\" class=\"respuestasNormal\">Comunicarse al 01800 3782 338 </div></td></tr><tr><td bgcolor=\"#d6e3f5\" class=\"style1\"><div class=\"respuestasNormal\" align=\"left\">26/11/2013 10:49 AM</div></td><td bgcolor=\"#d6e3f5\" class=\"respuestasNormal\"><div align=\"left\"> MEXICO D.F. Aclaración en proceso</div></td><td bgcolor=\"#d6e3f5\" class=\"style1\"><div align=\"left\" class=\"respuestasNormal\">Reporte generado por el cliente </div></td></tr><tr><td bgcolor=\"#e3e3e3\" class=\"style1\"><div class=\"respuestasNormal\" align=\"left\">31/10/2013 10:04 AM</div></td><td bgcolor=\"#e3e3e3\" class=\"respuestasNormal\"><div align=\"left\"> Recolección en oficina por ruta local</div></td><td bgcolor=\"#e3e3e3\" class=\"style1\"><div align=\"left\" class=\"respuestasNormal\">&nbsp;</div></td></tr><tr><td bgcolor=\"#d6e3f5\" class=\"style1\"><div class=\"respuestasNormal\" align=\"left\">31/10/2013 09:12 AM</div></td><td bgcolor=\"#d6e3f5\" class=\"respuestasNormal\"><div align=\"left\"> MEXICO D.F. En proceso de entrega MEX MEXICO D.F.</div></td><td bgcolor=\"#d6e3f5\" class=\"style1\"><div align=\"left\" class=\"respuestasNormal\">&nbsp;</div></td></tr><tr><td bgcolor=\"#e3e3e3\" class=\"style1\"><div class=\"respuestasNormal\" align=\"left\">30/10/2013 08:39 PM</div></td><td bgcolor=\"#e3e3e3\" class=\"respuestasNormal\"><div align=\"left\"> MEXICO D.F. Movimiento en centro de distribución</div></td><td bgcolor=\"#e3e3e3\" class=\"style1\"><div align=\"left\" class=\"respuestasNormal\">Envío con manejo especial </div></td></tr><tr><td bgcolor=\"#d6e3f5\" class=\"style1\"><div class=\"respuestasNormal\" align=\"left\">30/10/2013 07:52 PM</div></td><td bgcolor=\"#d6e3f5\" class=\"respuestasNormal\"><div align=\"left\"> MEXICO D.F. Llegada a centro de distribución MEX MEXICO D.F.</div></td><td bgcolor=\"#d6e3f5\" class=\"style1\"><div align=\"left\" class=\"respuestasNormal\">&nbsp;</div></td></tr><tr><td bgcolor=\"#e3e3e3\" class=\"style1\"><div class=\"respuestasNormal\" align=\"left\">30/10/2013 06:06 PM</div></td><td bgcolor=\"#e3e3e3\" class=\"respuestasNormal\"><div align=\"left\"> Recolección en oficina por ruta local</div></td><td bgcolor=\"#e3e3e3\" class=\"style1\"><div align=\"left\" class=\"respuestasNormal\">&nbsp;</div></td></tr><tr><td bgcolor=\"#d6e3f5\" class=\"style1\"><div class=\"respuestasNormal\" align=\"left\">30/10/2013 06:02 PM</div></td><td bgcolor=\"#d6e3f5\" class=\"respuestasNormal\"><div align=\"left\"> Envío recibido en oficina</div></td><td bgcolor=\"#d6e3f5\" class=\"style1\"><div align=\"left\" class=\"respuestasNormal\">Envío recibido en oficina de Estafeta fuera del horario de recolección </div></td></tr><tr><td bgcolor=\"#e3e3e3\" class=\"style1\"><div class=\"respuestasNormal\" align=\"left\">30/10/2013 02:00 PM</div></td><td bgcolor=\"#e3e3e3\" class=\"respuestasNormal\"><div align=\"left\"> Envio recibido en oficina Av Adolfo Lopez Mateos 22 Local 4 Puente de Vigas Tlalnepantla</div></td><td bgcolor=\"#e3e3e3\" class=\"style1\"><div align=\"left\" class=\"respuestasNormal\">&nbsp;</div></td></tr></tbody></table></div></div></td></tr></tbody></table><br><hr color=\"red\" width=\"688px\"><br><input type=\"hidden\" name=\"tipoGuia\" value=\"REFERENCE&quot;\"></form><font color=\"#000000\" face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"> Versión 4.0 </font></div></td></tr></tbody></table>',\r\n 'numero_guia' => '8055241528464720115088',\r\n 'codigo_rastreo' => '2715597604',\r\n 'servicio' => 'Entrega garantizada al tercer día hábil',\r\n 'fecha_programada' => '04/11/2013',\r\n 'origen' => 'México (zona 2)',\r\n 'cp_destino' => '01210',\r\n 'fecha_recoleccion' => '30/10/2013 02:00 PM',\r\n 'destino' => 'MEXICO D.F.',\r\n 'estatus' => 'Entregado',\r\n 'fecha_entrega' => '31/10/2013 12:13 PM',\r\n 'tipo_envio' => 'PAQUETE',\r\n 'recibio' => 'SDR:RAUL MARTIN',\r\n 'firma_recibido' => '/RastreoWebInternet/firmaServlet?guia=8055241528464720115088&idioma=es',\r\n 'peso' => '0.7',\r\n 'peso_vol' => '1.9',\r\n 'historial' => array(\r\n array('fecha' => '26/11/2013 02:31 PM', 'lugar_movimiento' => 'MEXICO D.F. Aclaración en proceso', 'comentarios' => 'Comunicarse al 01800 3782 338'),\r\n array('fecha' => '26/11/2013 10:49 AM', 'lugar_movimiento' => 'MEXICO D.F. Aclaración en proceso', 'comentarios' => 'Reporte generado por el cliente'),\r\n array('fecha' => '31/10/2013 10:04 AM', 'lugar_movimiento' => 'Recolección en oficina por ruta local', 'comentarios' => ''),\r\n array('fecha' => '31/10/2013 09:12 AM', 'lugar_movimiento' => 'MEXICO D.F. En proceso de entrega MEX MEXICO D.F.', 'comentarios' => ''),\r\n array('fecha' => '30/10/2013 08:39 PM', 'lugar_movimiento' => 'MEXICO D.F. Movimiento en centro de distribución', 'comentarios' => 'Envío con manejo especial'),\r\n array('fecha' => '30/10/2013 07:52 PM', 'lugar_movimiento' => 'MEXICO D.F. Llegada a centro de distribución MEX MEXICO D.F.', 'comentarios' => ''),\r\n array('fecha' => '30/10/2013 06:06 PM', 'lugar_movimiento' => 'Recolección en oficina por ruta local', 'comentarios' => ''),\r\n array('fecha' => '30/10/2013 06:02 PM', 'lugar_movimiento' => 'Envío recibido en oficina', 'comentarios' => 'Envío recibido en oficina de Estafeta fuera del horario de recolección'),\r\n array('fecha' => '30/10/2013 02:00 PM', 'lugar_movimiento' => 'Envio recibido en oficina Av Adolfo Lopez Mateos 22 Local 4 Puente de Vigas Tlalnepantla', 'comentarios' => ''),\r\n ),\r\n )\r\n ),\r\n array(\r\n array(\r\n 'html' => '<table width=\"88%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\"> <tbody><tr> <td width=\"13\" height=\"58\" valign=\"top\" background=\"http://www.estafeta.com/imagenes/lineageneralizquierda.png\">&nbsp;</td> <td width=\"664\" valign=\"middle\" background=\"http://www.estafeta.com/imagenes/medioazulgeneral.png\"><div align=\"right\"><img src=\"http://www.estafeta.com/imagenes/herramientas.png\" width=\"333\" height=\"31\"></div></td> <td width=\"11\" valign=\"top\" background=\"http://www.estafeta.com/imagenes/derechaazulgeneral.png\">&nbsp;</td> </tr> <tr> <td height=\"33\" colspan=\"3\" valign=\"top\" background=\"http://www.estafeta.com/imagenes/separaseccroja.jpg\"><div align=\"left\"><img src=\"http://www.estafeta.com/imagenes/rastreotitulo.png\" width=\"258\" height=\"27\"></div></td> </tr> <tr> <td colspan=\"3\" valign=\"top\"> <!-- #BeginEditable \"contenido\" --> <p align=\"right\"><font color=\"#000000\" face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"><a href=\"http://www.estafeta.com/herramientas/rastreo.aspx\">Nueva consulta</a></font></p> <div align=\"left\"> <form> <table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tbody><tr> <td> <table width=\"100%\" border=\"0\" cellpadding=\"1\" cellspacing=\"1\"> <tbody><tr> <td width=\"16%\" height=\"30\" bgcolor=\"#d6d6d6\" class=\"titulos\"><div align=\"left\" class=\"titulos\">Número de guía</div></td> <td width=\"30%\" colspan=\"2\" bgcolor=\"#edf0e9\" class=\"respuestas\"><div align=\"left\" class=\"respuestas\"> 3208544064715720055515</div></td> <td width=\"16%\" bgcolor=\"#d6d6d6\" class=\"titulos\"><div align=\"left\" class=\"titulos\">Código de rastreo</div></td> <td width=\"35%\" colspan=\"3\" bgcolor=\"#edf0e9\" class=\"respuestas\"><div align=\"left\" class=\"respuestas\">3563581975</div></td> </tr> </tbody></table></td></tr><tr> <td> <table width=\"100%\" border=\"0\" cellpadding=\"1\" cellspacing=\"1\"> <tbody><tr> <td width=\"16%\" bgco',\r\n 'numero_guia' => '3208544064715720055515',\r\n 'codigo_rastreo' => '3563581975',\r\n 'servicio' => 'Entrega garantizada al sexto día hábil',\r\n 'fecha_programada' => '17/02/2014',\r\n 'origen' => 'Tijuana',\r\n 'cp_destino' => '01210',\r\n 'fecha_recoleccion' => '07/02/2014 04:43 PM',\r\n 'destino' => 'MEXICO D.F.',\r\n 'estatus' => 'Entregado',\r\n 'fecha_entrega' => '12/02/2014 01:01 PM',\r\n 'tipo_envio' => 'PAQUETE',\r\n 'recibio' => 'SDR:JOSE BOLA?OS', # (sic) Estafeta\r\n 'firma_recibido' => '/RastreoWebInternet/firmaServlet?guia=3208544064715720055515&idioma=es',\r\n 'peso' => '11.8',\r\n 'peso_vol' => '4.7',\r\n 'historial' => array(\r\n array('fecha' => '12/02/2014 09:14 AM', 'lugar_movimiento' => 'MEXICO D.F. En proceso de entrega MEX MEXICO D.F.', 'comentarios' => ''),\r\n array('fecha' => '12/02/2014 08:27 AM', 'lugar_movimiento' => 'MEXICO D.F. Llegada a centro de distribución', 'comentarios' => 'Envío en proceso de entrega'),\r\n array('fecha' => '11/02/2014 11:43 PM', 'lugar_movimiento' => 'Centro de Int. SLP En ruta foránea hacia MEX-MEXICO D.F.', 'comentarios' => ''),\r\n array('fecha' => '08/02/2014 12:49 PM', 'lugar_movimiento' => 'Recolección en oficina por ruta local', 'comentarios' => ''),\r\n array('fecha' => '07/02/2014 06:26 PM', 'lugar_movimiento' => 'Tijuana En ruta foránea hacia MEX-MEXICO D.F.', 'comentarios' => ''),\r\n array('fecha' => '07/02/2014 05:04 PM', 'lugar_movimiento' => 'Envío recibido en oficina', 'comentarios' => 'Envío recibido en oficina de Estafeta fuera del horario de recolección'),\r\n array('fecha' => '07/02/2014 04:58 PM', 'lugar_movimiento' => 'Recolección en oficina por ruta local', 'comentarios' => ''),\r\n array('fecha' => '07/02/2014 04:43 PM', 'lugar_movimiento' => 'Envio recibido en oficina CARRETERA AL AEROPUERTO AEROPUERTO TIJUANA BC', 'comentarios' => '')\r\n ),\r\n )\r\n )\r\n );\r\n }", "function data_prosesan()\n{\n //$jadual['medan'][]='*';\n /*$jadual['medan'][]='newss,ssm,nama,tel,fax,responden,' .\n '(SELECT keterangan FROM msic WHERE msic=msic2000 LIMIT 1,1) as keterangan,' .\n 'msic2000,msicB2000,fe';*/\n $sama='j1.newss,concat(j1.tahun_rujukan,\"-\",j1.siri_kekerapan) as blnthn, ';\n $sama2='j2.newss,concat(j2.tahun_rujukan,\"-\",j2.siri_kekerapan) as blnthn, ';\n //$jadual['medan'][]=$sama . 'ssm, nama, operator, sv, kekerapan_sv'; \n //$jadual['medan'][]=$sama . 'ng, po, data_anggaran, cara_maklum_balas, cara_terima, sumber_pertubuhan, kategori_sample';\n //$jadual['medan'][]=$sama . 'status_operasi, status_lain_pbb, bil_bulan_bco, siasatan_bermula, siasatan_berakhir';\n //$jadual['medan'][]=$sama . 'no_jln_bgn, tmn_kg, bandar_kawasan, poskod, negeri, daerah, catatan';\n //$jadual['medan'][]=$sama . 'responden, jawatan, email, notel, lamanweb, tarikh';\n //$jadual['medan'][]=$sama . 'responden2, jawatan2, email2, notel2, nofax2';\n //$jadual['medan'][]=$sama . '`no_jln_bgn-lokasi`, `tmn_kg-lokasi`, `bandar_kawasan-lokasi`, ' .\n //'`poskod-lokasi`, `negeri-lokasi` ng, `daerah-lokasi` dp';\n $jadual['medan'][]='j1.newss,j1.ssm,j1.nama,concat(j1.tahun_rujukan,\"-\",j1.siri_kekerapan) as blnthn ';\n $jadual['medan'][]=$sama . \"\\r\" . 'msic_lama, (SELECT keterangan FROM msic WHERE msic=msic_lama LIMIT 1,1) as keterangan,' . \n 'msic_baru, utama '; \n //$jadual['medan'][]=$sama . \"\\r\\t\" . 'F3001, F3002, catatan_soalan3, ' . 'F5001, F5002, F5003, F5104, catatan_soalan5';\n $jadual['medan'][]=$sama . 'F6001, F6002, F6003, F6004, F6005, F6101, F6102, F6103, F6104, F6105, catatan_soalan6';\n $jadual['medan'][]=$sama . 'F7001, F7002, F7003, catatan_soalan7, ' .\n 'F8001, catatan_soalan8, F9001, catatan_soalan9';\n //$jadual['medan'][]=$sama . 'cara_anggaran, bulan_terakhir_data_sebenar, bil_bulan_data_telah_dianggar';\n\n //$jadual['medan'][]=$sama . 'Deskripsi_Produk_Oleh_Responden, Produk_Tetap, Deskripsi_Produk_Tetap,\n //Produk_Tambahan, Deskripsi_Produk_Tambahan, UnitKuantitiAsal, UnitKuantitiLain'; \n $produk='Deskripsi_Produk_Tetap Nama, Produk_Tetap Kod, ';\n $jadual['medan'][]=$sama . $produk . 'KuantitiPengeluaran, KuantitiJualan, NilaiJualan, ' .\n 'format(NilaiJualan/KuantitiJualan,2) as HargaUnit, UnitKuantitiKini';\n //$jadual['medan'][]=$sama . $produk . 'ProsesanKuantitiPengeluaran, ProsesanKuantitiJualan, ProsesanNilaiJualan, AUP';\n $jadual['medan'][]=$sama . $produk . 'F2497, F2498, F2499, Catatan';\n $jadual['medan'][]=$sama . \"\\r\\t\" . \n 'F3001, F3002, catatan_soalan3, ' .\n 'F5001, F5002, F5003, F5104, catatan_soalan5';\n\n //$jadual['medan'][]=$sama . 'catatan';\n $jadual['medan'][]=$sama . 'F4001, F4002, F4003, F4004';\n $jadual['medan'][]=$sama . 'F4101, F4102, F4103, F4104';\n $jadual['medan'][]=$sama . 'F4201, F4202, F4203, F4204';\n $jadual['medan'][]=$sama . 'catatan \"Nota \", F4302, F4303, F4304';\n\n // bulanan\n //$bulan=($_GET['bln']==null)? '':'AND siri_kekerapan=\"'.bersih($_GET['bln']).'\"';\n $bulan_penuh = array('Januari', 'Februari', 'Mac', 'April', \n 'Mei', 'Jun', 'Julai', 'Ogos', \n 'September', 'Oktober', 'November', 'Disember');\n //$kerap='\"'.$bulan_penuh[0].'\",\"'.$bulan_penuh[1].'\",\"'.$bulan_penuh[2].'\"';\n //$bulan=($_GET['bln']==null)? '':'AND j1.siri_kekerapan in ('.$kerap.')';\n //$myJadual=array('mm_rangka','mm_rangka');\n for($z=1;$z <= 4;$z++) { $jadual['nama'][]='prosesmm_info'; } // bil medan = 15\n for($z=1;$z <= 2;$z++) { $jadual['nama'][]='prosesmm_jualan'; }\n $jadual['nama'][]='prosesmm_info';\n for($z=1;$z <= 4;$z++) { $jadual['nama'][]='prosesmm_gajistaf'; }\n $join1='prosesmm_info';\n $join2='prosesmm_jualan';\n $join3='prosesmm_gajistaf';\n \n return $jadual;\n}", "function arrayColaEstudiantes (){\n\t\t\t$host = \"localhost\";\n\t\t\t$usuario = \"root\";\n\t\t\t$password = \"\";\n\t\t\t$BaseDatos = \"pide_turno\";\n\n\t $link=mysql_connect($host,$usuario,$password);\n\n\t\t\tmysql_select_db($BaseDatos,$link);\n\t\t\t$retorno = array();\n\t\t\t$consultaSQL = \"SELECT turnos.codigo, turnos.nombre, turnos.carrera FROM turnos WHERE turnos.estado='No atendido' ORDER BY guia;\";\n\t\t\tmysql_query(\"SET NAMES utf8\");\n\t\t\t$result = mysql_query($consultaSQL);\n\t\t\tfor($i=0;$fila= mysql_fetch_assoc($result); $i++) {\n\t\t\t\tfor($a= 0;$a<mysql_num_fields($result);$a++){\n\t\t\t\t\t$campo = mysql_field_name($result,$a);\n\t\t\t\t\t$retorno[$i][$campo] = $fila[$campo];\n\t\t\t\t}\n\t\t\t};\n\t\t\tmysql_close($link);\n\n\t\t\treturn $retorno;\n\t\t}", "public function getData(){\n\n //Connetto al database\n $conn = $this->connection->sqlConnection();\n\n $sql = $conn->prepare(\"SELECT * FROM compra\");\n\n //Eseguo la query\n $sql->execute();\n\n $dataArray = array();\n //Se ci sono dei valori\n if($sql->rowCount() > 1) {\n\n // Ciclo tutti i valori\n while ($row = $sql->fetch()) {\n array_push($dataArray, $row);\n }\n //Se c'è un solo valore lo inserisco\n }else if($sql->rowCount() == 1) {\n $dataArray = $sql->fetch();\n }\n $conn = null;\n return $dataArray;\n }", "public function semuaData(){ \n return Mata_Kuliah::find(3)->Mahasiswa()->detach(); //gausah diisi arraynya\n }", "function list_kelas_pertemuan_get()\n {\n $query = $this->M_kelas_pertemuan->tampil_data('kelas_pertemuan');\n\n // variable array\n $result = array();\n $result['kelas_pertemuan'] = array();\n\n if ($query->num_rows() > 0) {\n\n // mengeluarkan data dari database\n foreach ($query->result_array() as $row) {\n\n // ambil detail data db\n $data = array(\n 'id_kelas_p' => $row[\"id_kelas_p\"],\n 'id_pengajar' => $row[\"id_pengajar\"],\n 'id_mata_pelajaran' => $row[\"id_mata_pelajaran\"],\n 'hari' => $row[\"hari\"],\n 'jam_mulai' => $row[\"jam_mulai\"],\n 'jam_berakhir' => $row[\"jam_berakhir\"],\n 'harga_fee' => $row[\"harga_fee\"],\n 'harga_spp' => $row[\"harga_spp\"],\n 'id_sharing' => $row[\"id_sharing\"],\n 'nama_sharing' => $row[\"nama_sharing\"],\n );\n\n array_push($result['kelas_pertemuan'], $data);\n\n // membuat array untuk di transfer\n $result[\"success\"] = \"1\";\n $result[\"message\"] = \"success berhasil mengambil data\";\n $this->response($result, 200);\n }\n } else {\n // membuat array untuk di transfer ke API\n $result[\"success\"] = \"0\";\n $result[\"message\"] = \"error data tidak ada\";\n $this->response($result, 200);\n }\n }", "public function tampilDataGalang(){\n\t\t\n\t}", "function liste_array()\n {\n global $conf,$langs;\n\n $projets = array();\n\n $sql = \"SELECT rowid, libelle\";\n $sql.= \" FROM \".MAIN_DB_PREFIX.\"adherent_type\";\n $sql.= \" WHERE entity = \".$conf->entity;\n\n $resql=$this->db->query($sql);\n if ($resql)\n {\n $nump = $this->db->num_rows($resql);\n\n if ($nump)\n {\n $i = 0;\n while ($i < $nump)\n {\n $obj = $this->db->fetch_object($resql);\n\n $projets[$obj->rowid] = $langs->trans($obj->libelle);\n $i++;\n }\n }\n }\n else\n {\n print $this->db->error();\n }\n\n return $projets;\n }", "public function exchanegArray($_data)\n {\n $this->page_no = (int) gv('page_no', $_data);\n $this->category_no = (int) gv('category_no', $_data);\n $this->controller_no = (int) gv('controller_no', $_data);\n $this->page_title = (string) gv('page_title', $_data);\n $this->page_uri = (string) gv('page_uri', $_data);\n $this->page_description = (string) gv('page_description', $_data);\n $this->icon = (string) gv('icon', $_data);\n $this->order_no = (int) gv('order_no', $_data);\n $this->use_mobile = (int) gv('use_mobile', $_data);\n $this->update_time = (string) gv('update_time', $_data);\n }", "private function ajoutProduits() {\n $em = $this->getDoctrine()->getManager();\n $produis = $em->getRepository('VentesBundle:Produit')->findAll();\n $produitArray = array();\n foreach ($produis as $p) {\n $id = $p->getId();\n $libelle = $p->getLibelle();\n $produitArray[$id] = $libelle;\n }\n return $produitArray;\n }", "protected function _get_array()\r\n {\r\n $result = $this->db->get()->result_array();\r\n\r\n //untuk ganti kode sediaan di obat_jadi. \r\n $this->load->model('obat_jadi/Report_model');\r\n\r\n if (count($result) > 0) {\r\n foreach ($result as $key => $data) {\r\n \r\n //untuk ganti kode sediaan di obat_jadi.\r\n if (isset($data['sediaan']) && array_key_exists($data['sediaan'], Report_model::$static_bentuk_sediaan) === TRUE) {\r\n $result[$key]['sediaan_name'] = Report_model::$static_bentuk_sediaan[$data['sediaan']];\r\n } else {\r\n $result[$key]['sediaan_name'] = \"Bentuk Sediaan TIdak Ditemukan.\";\r\n }\r\n }\r\n }\r\n\r\n //execute extends in child class.\r\n $result = $this->_extend_get_array($result);\r\n\r\n return $result;\r\n }", "private function inicializa_propiedades(): array\n {\n $identificador = \"cat_sat_tipo_producto_id\";\n $propiedades = array(\"label\" => \"SAT - Tipo\");\n $pr = $this->asignar_propiedad(identificador:$identificador, propiedades: $propiedades);\n if(errores::$error){\n return $this->errores->error(mensaje: 'Error al inicializa',data: $pr);\n }\n\n $identificador = \"cat_sat_division_producto_id\";\n $propiedades = array(\"label\" => \"SAT - División\", \"con_registros\" => false);\n $pr =$this->asignar_propiedad(identificador:$identificador, propiedades: $propiedades);\n if(errores::$error){\n return $this->errores->error(mensaje: 'Error al inicializa',data: $pr);\n }\n\n\n $identificador = \"cat_sat_grupo_producto_id\";\n $propiedades = array(\"label\" => \"SAT - Grupo\", \"con_registros\" => false);\n $pr =$this->asignar_propiedad(identificador:$identificador, propiedades: $propiedades);\n if(errores::$error){\n return $this->errores->error(mensaje: 'Error al inicializa',data: $pr);\n }\n\n $identificador = \"cat_sat_clase_producto_id\";\n $propiedades = array(\"label\" => \"SAT - Clase\", \"con_registros\" => false);\n $pr =$this->asignar_propiedad(identificador:$identificador, propiedades: $propiedades);\n if(errores::$error){\n return $this->errores->error(mensaje: 'Error al inicializa',data: $pr);\n }\n\n $identificador = \"cat_sat_producto_id\";\n $propiedades = array(\"label\" => \"SAT - Producto\", \"con_registros\" => false, \"cols\" => 12);\n $pr =$this->asignar_propiedad(identificador:$identificador, propiedades: $propiedades);\n if(errores::$error){\n return $this->errores->error(mensaje: 'Error al inicializa',data: $pr);\n }\n\n $identificador = \"cat_sat_unidad_id\";\n $propiedades = array(\"label\" => \"SAT - Unidad\", \"cols\" => 6);\n $pr =$this->asignar_propiedad(identificador:$identificador, propiedades: $propiedades);\n if(errores::$error){\n return $this->errores->error(mensaje: 'Error al inicializa',data: $pr);\n }\n\n $identificador = \"cat_sat_obj_imp_id\";\n $propiedades = array(\"label\" => \"Objeto del Impuesto\", \"cols\" => 6);\n $pr =$this->asignar_propiedad(identificador:$identificador, propiedades: $propiedades);\n if(errores::$error){\n return $this->errores->error(mensaje: 'Error al inicializa',data: $pr);\n }\n\n $identificador = \"com_tipo_producto_id\";\n $propiedades = array(\"label\" => \"Tipo Producto\", \"cols\" => 6);\n $pr =$this->asignar_propiedad(identificador:$identificador, propiedades: $propiedades);\n if(errores::$error){\n return $this->errores->error(mensaje: 'Error al inicializa',data: $pr);\n }\n\n $identificador = \"cat_sat_conf_imps_id\";\n $propiedades = array(\"label\" => \"Conf Impuestos\", \"cols\" => 12);\n $pr =$this->asignar_propiedad(identificador:$identificador, propiedades: $propiedades);\n if(errores::$error){\n return $this->errores->error(mensaje: 'Error al inicializa',data: $pr);\n }\n\n $identificador = \"codigo\";\n $propiedades = array(\"place_holder\" => \"Código\", \"cols\" => 6);\n $pr =$this->asignar_propiedad(identificador:$identificador, propiedades: $propiedades);\n if(errores::$error){\n return $this->errores->error(mensaje: 'Error al inicializa',data: $pr);\n }\n\n $identificador = \"descripcion\";\n $propiedades = array(\"place_holder\" => \"Producto\", \"cols\" => 12);\n $pr =$this->asignar_propiedad(identificador:$identificador, propiedades: $propiedades);\n if(errores::$error){\n return $this->errores->error(mensaje: 'Error al inicializa',data: $pr);\n }\n\n $identificador = \"precio\";\n $propiedades = array(\"place_holder\" => \"Precio\", \"cols\" => 6);\n $pr =$this->asignar_propiedad(identificador:$identificador, propiedades: $propiedades);\n if(errores::$error){\n return $this->errores->error(mensaje: 'Error al inicializa',data: $pr);\n }\n\n return $this->keys_selects;\n }", "public function store_det_pemesanan()\n { \n $data= [];\n foreach ($this->cart->contents() as $key => $value) {\n $data[]= [\n 'id_pemesanan'=> $this->post['id_pemesanan'],\n 'nama_produk'=> $value['name'],\n 'kategori'=> $value['options']['category'],\n 'harga'=> $value['price'],\n 'berat'=> $value['options']['weight'],\n 'gambar'=> $value['options']['image'],\n 'jumlah'=> $value['qty'],\n 'ukuran'=> (!empty($value['options']['size'])? $value['options']['size'] : NULL ),\n ];\n }\n return $this->db->insert_batch('det_pemesanan', $data);\n // return $data;\n }", "public static function accueilDatas(){\n return ['title'=>'Notre page d\\'accueil',\n 'h1'=>'Bienvenue',\n 'h2'=>'sur notre site',\n 'content' => [\"premier paragraphe\",\"Deuxieme paragraphe\",\"Paragraphe final\"]\n\n ];\n }", "function prepare_array() {\n\n\t\t$obj['name'] = $this->name->value;\n\t\t$obj['url'] = $this->url->value;\n\t\t$obj['image'] = $this->image->value;\n\t\t$obj['description'] = $this->description->value;\n\t\t/*\n\t\tforeach($this as $key => $value) {\n\n\t\t\t$obj[$key] = $value;\n\n\t\t}\n\t*/\n\t\treturn $obj;\n\t}", "public function valoracionToArray(){\n\t\t\t$this->arrayValor = array(\n\t\t\t\t\"user\"=> $this->user,\n\t\t\t\t\"object\"=> $this->object,\n\t\t\t\t\"valor\"=>$this->valor\n\t\t\t\t);\n\t\t}", "public function ambildata_perusahaan(){\n\t\t$query=$this->db->query(\"SELECT * FROM tb_perusahaan\");\n\t\treturn $query->result_array();\n\t}", "protected function data()\n {\n $row = array('id' => 0, 'name' => '', 'age' => 0, 'gender' => '');\n\n $rougin = $angel = $royce = $roilo = $rouine = $row;\n\n $rougin['id'] = 1;\n $rougin['name'] = 'rougin';\n $rougin['age'] = 18;\n $rougin['gender'] = 'male';\n\n $angel['id'] = 2;\n $angel['name'] = 'angel';\n $angel['age'] = 19;\n $angel['gender'] = 'female';\n\n $royce['id'] = 3;\n $royce['name'] = 'royce';\n $royce['age'] = 15;\n $royce['gender'] = 'male';\n\n $roilo['id'] = 4;\n $roilo['name'] = 'roilo';\n $roilo['age'] = 17;\n $roilo['gender'] = 'male';\n\n $rouine['id'] = 5;\n $rouine['name'] = 'rouine';\n $rouine['age'] = 12;\n $rouine['gender'] = 'male';\n\n return array($rougin, $angel, $royce, $roilo, $rouine);\n }", "public function exibir(){\n\t\treturn array(\n\t\t\t\"modelo\" => $this->getModelo(),\n\t\t\t\"motor\" => $this->getMotor(), \n\t\t\t\"ano\" => $this->getAno()\n\t\t);\n\t}", "function tampil_data()\r\n\t{\r\n\t$data = mysql_query(\"select * from item order by Nama_Item\");\r\n\twhile($d = mysql_fetch_array($data))\r\n\t\t{\r\n\t\t\t$hasil[] = $d;\r\n\t\t}\r\n\treturn $hasil;\r\n\t}", "public function getDataArr(){\n\t\treturn $this->data_arr;\n\t}", "public function actionMuestraArrayPuntos(){ \n $data=array(); \n $d=0;\n $date=\"\";\n $dateTime=date(\"Y-m-d H:i:s\"); \n $mt = explode(' ', microtime());\n \n for($i=-20;$i<=0;$i++){\n $d=mt_rand(0,30); \n // +5 segundos\n //$time = $mt[1] * 1000 + round($mt[0]+($i * 1000));\n \n $time=strtotime ( date(\"Y-m-d H:i:s\") )*1000+($i*1000);\n $data[]=array(\"temp\"=>$d,\"time\"=>$time);\n $i++;\n } \n echo CJSON::encode($data); \n }", "private function generarArrayEnvio($data){\n\t\t//echo \"<pre>\".print_r($data,true).\"</pre>\";\n\t\t$conexion = $GLOBALS['conexion'];\n\t\t$resultado = array();\n\t\t$cont=0;\t\n\t\twhile($filas=$conexion->fetch_array($data)){\n\t\t\t/*$estado = \"\";\n\t\t\tswitch ($filas['estado']) {\n\t\t\t\tcase '_PENDIENTE': $estado = \"aviso\";break;\n\t\t\t\tcase '_PROCESADO': $estado = \"aceptar\";break;\n\t\t\t\tcase '_ERROR': \t $estado = \"cancelar\";break;\t\t\t\t\n\t\t\t\tdefault:break;\n\t\t\t}*/\t\t\t\n\t\t\t$resultado[$cont]['datos'] = array('id'\t\t\t\t=>$filas['id'],\n\t\t\t\t\t\t\t\t\t\t \t 'nombre'\t\t\t=>$filas['nombre'],\n\t\t\t\t\t\t\t\t\t\t \t 'apellidos'\t\t=>$filas['apellidos'],\n\t\t\t\t\t\t\t\t\t\t 'email'\t\t\t=>$filas['email'],\n\t\t\t\t\t\t\t\t\t\t \t 'telefono_fijo'\t=>$filas['telefono_fijo'],\n\t\t\t\t\t\t\t\t\t\t 'telefono_movil'\t=>$filas['telefono_movil'],\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t 'presentacion'\t=>$filas['presentacion'],\n\t\t\t\t\t\t\t\t\t\t 'estado_procesado'=>$filas['estado_procesado'],\n\t\t\t\t\t\t\t\t\t\t\t 'estado'\t\t\t=>$filas['estado']);\n\t\t\t$codigos = $this->getCodes($filas['id']);//se consulta los códigos\n\t\t\tif($codigos->num_rows>0){\t\t\t\t\n\t\t\t\twhile($row=$conexion->fetch_array($codigos)){\n\t\t\t\t\t$value = $row['code'];\n\t\t\t\t\t$resultado[$cont]['codigos'][substr($value,1,1)][] = $this->getValueShowCode($value);\n\t\t\t\t}\t\t\t\t\n\t\t\t\t//for para verificar que no se envien valores repetidos.\t\t\t\n\t\t\t\tfor($j=0;$j<=6;$j++){\n\t\t\t\t\tif(isset($resultado[$cont]['codigos'][$j])){\n\t\t\t\t\t\t$resultado[$cont]['codigos'][$j] = array_unique($resultado[$cont]['codigos'][$j]);\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$resultado[$cont]['codigos'][$j]=array();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tksort($resultado[$cont]['codigos']);//se ordena el array.\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\t//$resultado[$cont]['codigos'][] = array();\n\t\t\t\t// se envia un array de arrays vacios\n\t\t\t\t$resultado[$cont]['codigos']= array(array(),array(),array(),array(), array(),array(), array());\n\t\t\t}\t\t\t\t\t\n\t\t\t//proceso para obtener las areas\n\t\t\t$area = new Area();\n\t\t\t$dataAreas = $area->getAreasForIdPersona($filas['id']);\n\t\t\tif(count($dataAreas)>0){\n\t\t\t\tforeach ($dataAreas as $fila) {\n\t\t\t\t\t$resultado[$cont]['areas'][] = array('codigo_area'=>$fila['id'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'descripcion'=>$fila['desc']);\n\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$resultado[$cont]['areas'][] = array();\n\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t$cont++;\n\t\t}\t\t\n\t\treturn $resultado;\n\t}", "public function getData() {\r\n\r\n\t\t$sodexo_domain = 'http://www.sodexo.fi/';\r\n\t\t$path = 'ruokalistat/output/daily_json/';\r\n\r\n\t\tforeach ($this->id_arr as $key => $value) {\r\n\r\n\t\t\t$json_data = file_get_contents($sodexo_domain . $path . $value . '/' . $this->pvm .'/fi');\r\n\r\n\t\t\t$course_info = $this->toObjectArray($json_data);\r\n\t\t\t\r\n\t\t\t$this->id_arr[$key] = $course_info;\r\n\t\t}\r\n\t}", "private function _getData():array {\n\n # Set result\n $result = [];\n\n # Return result\n return $result;\n\n }", "public function getMultipleData();", "public function getAllProduk()\n {\n return $this->db->get('data_tanaman')->result_array();\n }", "private function table_data()\n {\n $data = array();\n $args = array( \n 'post_type' => 'sutabu_ppdb',\n 'post_status' => 'publish',\n 'orderby' => 'title', \n 'order' => 'ASC', \n );\n\n $the_query = new WP_Query( $args );\n\n if($the_query->have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post();\n $data[] = array(\n 'id' => $dt->ID,\n 'perusahaan' => the_title(),\n 'total_ken' => the_content(),\n 'total_pen' => 'ok',\n 'tanggal' => 'ok'\n ); \n endwhile; endif;\n wp_reset_postdata();\n\n return $data;\n }", "public function getPacientePrestadoraArray(){\n $query = new Query;\n $query->select(['Paciente_prestadora.id, CONCAT(Paciente.nro_documento,\" (\",Paciente.nombre,\") \", Prestadoras.descripcion ) descripcion']) \n ->from( 'Prestadoras')\n ->join(\t'join', \n 'Paciente_prestadora',\n 'Prestadoras.id=Paciente_prestadora.prestadoras_id'\n ) \n ->join(\t'join', \n 'Paciente',\n 'Paciente.id=Paciente_prestadora.paciente_id'\n ) \n ->where([\"Paciente_prestadora.id\"=>$this->Paciente_prestadora_id]);\n \n $command = $query->createCommand();\n $data = $command->queryAll();\t\n $arrayData=array();\n if( !empty($data) and is_array($data) ){ //and array_key_exists('detallepedidopieza',$data) and array_key_exists('detalle_pedido_id',$data)){\n foreach ($data as $key => $arrayPacientePrestadora) {\n $arrayData[$arrayPacientePrestadora['id']]=$arrayPacientePrestadora['descripcion']; \n }\n }\n //todas los pacientes prestadoras\n $query = new Query;\n $query->select(['Paciente_prestadora.id, CONCAT(Paciente.nro_documento,\" (\",Paciente.nombre,\") \", Prestadoras.descripcion ) descripcion']) \n ->from( 'Prestadoras')\n ->join(\t'join', \n 'Paciente_prestadora',\n 'Prestadoras.id=Paciente_prestadora.prestadoras_id'\n ) \n ->join(\t'join', \n 'Paciente',\n 'Paciente.id=Paciente_prestadora.paciente_id'\n );\n \n $command = $query->createCommand();\n $data = $command->queryAll();\t\n if( !empty($data) and is_array($data) ){ //and array_key_exists('detallepedidopieza',$data) and array_key_exists('detalle_pedido_id',$data)){\n foreach ($data as $key => $arrayPacientePrestadora) {\n $arrayData[$arrayPacientePrestadora['id']]=$arrayPacientePrestadora['descripcion']; \n }\n } \n\n return $arrayData;\n }", "public function get_pembeli_darat() {\r\n $nama = $this->input->get('term'); //variabel kunci yang di bawa dari input text id kode\r\n $tipe = \"darat\";\r\n $query = $this->master->get_pembeli($tipe,$nama); //query model\r\n\r\n if($query == TRUE){\r\n $pelanggan = array();\r\n foreach ($query as $data) {\r\n $pelanggan[] = array(\r\n 'label' => $data->nama_pengguna_jasa, //variabel array yg dibawa ke label ketikan kunci\r\n 'id' => $data->id_pengguna_jasa,\r\n 'nama' => $data->nama_pengguna_jasa , //variabel yg dibawa ke id nama\r\n 'alamat' => $data->alamat, //variabel yang dibawa ke id alamat\r\n 'no_telp' => $data->no_telp, //variabel yang dibawa ke id no telp\r\n 'pengguna'=> $data->pengguna_jasa_id_tarif, //variabel yang dibawa ke id pengguna jasa\r\n );\r\n }\r\n }\r\n\r\n echo json_encode($pelanggan); //data array yang telah kota deklarasikan dibawa menggunakan json\r\n }", "public function getAllProduk()\n {\n return $this->db->get('barang')->result_array();\n }", "public function get_data_produk()\n\t {\n\t\t$this->db->where('prod_hide_status','no');\n\t\t $query = $this->db->get('tbb_product');\n\t\t return $query->result_array();\n\t }", "public function get_data(): array;", "public function get_data(): array;", "function get(){\n $array = array();\n foreach($this as $atributo => $valor){\n $array[$atributo] = $valor;\n }\n return $array;\n }", "public function exchanegArray($_data)\n {\n $this->branch_no = (int) gv('branch_no', $_data);\n $this->branch_name = (string) gv('branch_name', $_data);\n $this->abbr_name = (string) gv('abbr_name', $_data);\n $this->timezone = (string) gv('timezone', $_data);\n $this->phone = (string) gv('phone', $_data);\n $this->address = (string) gv('address', $_data);\n $this->update_time = (string) gv('update_time', $_data);\n }", "public function prepareData(): array\n {\n return [];\n }", "function crearArrayGestionActividad()\n{\n\t$this->conexionBD();\n\t$form=array();\n\n\t$query=\"SELECT * FROM Gestion_actividad\"; //WHERE `id_Actividad` = '$actividadId'\";\n\t$mysqli=$this->conexionBD();\n\t$resultado=$mysqli->query($query);\n\n\tif(mysqli_num_rows($resultado)){\n\t\t\t//$fila =$resultado->fetch_array(MYSQLI_ASSOC);\n\t\twhile($fila = $resultado->fetch_array())\n\t\t{\n\t\t\t$filas[] = $fila;\n\t\t}\n\t\tforeach($filas as $fila)\n\t\t{\n\t\t\t$entrenadorId=$fila['Entrenador_id_Usuario'];\n\t\t\t$actividadId=$fila['Actividad_id_Actividad'];\n\t\t\t$alumnoId=$fila['identificador_deportista'];\n\t\t\t$fecha=$fila['fecha'];\n\n\t\t\t$fila_array=array(\"entrenadorId\"=>$entrenadorId,\"actividadId\"=>$actividadId,\"alumnoId\"=>$alumnoId,\"fecha\"=>$fecha);\n\t\t\tarray_push($form,$fila_array);\n\t\t}\n\t}\t\t\t \n\t$resultado->free();\n\t$mysqli->close();\n\treturn $form;\n}", "function tampil_data(){\n\t\t//query select user\n\t\t$data = mysqli_query($this->conn, \"SELECT * FROM table_1\");\n\t\twhile($d = mysqli_fetch_array($data)){\n\t\t\t$hasil[] = $d;\n\t\t}\n\t\treturn $hasil;\n\n\t}", "public function inicializacionBusqueda()\r\n {\r\n $dataEmpCli = array();\r\n $filterEmpCli = array();\r\n\r\n try {\r\n\r\n foreach ($this->getEmpresaTable()->getEmpresaProvReport() as $empresa) {\r\n $dataEmpCli[$empresa->id] = $empresa->NombreComercial.' - '.$empresa->RazonSocial.' - '.$empresa->Ruc;\r\n $filterEmpCli[$empresa->id] = [$empresa->id];\r\n }\r\n\r\n } catch (\\Exception $ex) {\r\n $dataEmpCli = array();\r\n }\r\n\r\n $formulario['prov'] = $dataEmpCli;\r\n $filtro['prov'] = array_keys($filterEmpCli);\r\n return array($formulario, $filtro);\r\n }", "function tampil_paket_catering() \n {\n $this->db->order_by('id_paket_catering', 'DESC');\n $ambil = $this->db->get('paket_catering');\n $data = $ambil->result_array();\n\n $semua = array();\n foreach ($data as $key => $value) {\n $this->db->where('id_paket_catering', $value['id_paket_catering']);\n $ambil1 = $this->db->get('sub_paket_catering');\n $data1 = $ambil1->result_array();\n $value['sub_paket'] = $data1;\n\n foreach ($data1 as $key2 => $value2) {\n $this->db->where('id_sub_paket', $value2['id_sub_paket']);\n $ambil2 = $this->db->get('foto_sub_paket');\n $data2 = $ambil2->result_array();\n $value['sub_paket'][$key2]['foto_sub'] = $data2;\n }\n\n $semua[] = $value;\n }\n\n return $semua;\n }", "public function creataTypeArray()\n\t{\n\t\t$this->db->creataTypeArray();\n\t}", "function criaArrayModeloDeCompra()\n{\n $compra = array(\n 'id' => null,\n 'id_colaborador' => '',\n 'id_produto' => '',\n 'data_compra' => '',\n 'horario_compra' => '',\n 'email' => '',\n 'envio_email' => '',\n 'quantidade' => null\n );\n\n return $compra;\n\n}", "protected function loadData(){\n\t\t//SELECT from \".self::TABLE_NAME.\"_data WHERE \".self::TABLE_NAME.\"_id=\".$this->id.\"\n\t\t\n\t\t//return the data\n\t\treturn array();\n\t}", "public function generateArray()\r\n\t{\t\r\n\t\t$data = array('logID'=>$this->logID,'text'=>$this->Text,'timestamp'=>$this->timestamp, 'textid'=>$this->textID);\r\n\t\tif($this->user!=null)\r\n\t\t\t$data['user'] = $this->user->generateArray();\r\n\t\tif($this->building!=null)\r\n\t\t\t$data['building'] = $this->building->generateArray('normal');\r\n\t\tif($this->card!=null)\r\n\t\t\t$data['card']=$this->card->generateArray();\r\n\t\tif($this->location!=null)\r\n\t\t\t$data['location']=$this->location->generateArray();\r\n\t\tif($this->icon!=null)\r\n\t\t\t$data['icon']=$this->icon;\r\n\t\tif($this->game!=null)\r\n\t\t\t$data['game']=$this->game;\r\n\t\treturn $data;\r\n\t\r\n\t}", "public function data_paket($tahun){\n\t\t$data[\"baris_data\"] = array();\n\t\t$data[\"total_data\"] = array();\n\t\t$no \t= 1;\n\n\n\t\t$result_data\t\t= $this->model->data_paket($tahun);\n\t\tforeach ($result_data->result() as $rows_data) {\n\t\t\t$data[\"baris_data\"][] = array(\n\t\t\t\t\t\t\t\t\t\t\t\"no\"\t\t\t\t\t\t=> $no++,\n \"id_paket\"\t\t\t\t\t=> $rows_data->lls_id,\n \"nama_paket\"\t\t\t\t=>\n \"<b>Nama Paket : </b>\".$rows_data->pkt_nama.\"<br>\".\n \"<b>Kode SiRUP : </b>\".$rows_data->rup_id.\"<br>\".\n \"<b>Tahun : </b>\".$rows_data->tahun.\"<br>\",\n\t\t\t\t\t\t\t\t\t\t\t\"nama_opd\"\t\t\t\t\t=> $rows_data->stk_nama,\n \"nama_ppk\" => $rows_data->peg_nama,\n\t\t\t\t\t\t\t\t\t\t\t\"total_pagu\"\t\t\t\t=> number_format($rows_data->pkt_pagu),\n\t\t\t\t\t\t\t\t\t\t\t\"pemenang\"\t\t\t\t\t=> $rows_data->nama_rekanan_gabung,\n\t\t\t\t\t\t\t\t\t\t\t\"total_realisasi\"\t\t\t=> number_format($rows_data->rsk_nilai)\n\t\t\t\t\t\t\t\t\t);\n\t\t}\n\t\techo json_encode($data);\n }", "public function permisos(){\n extract($_POST);\n $db=new clasedb();\n $conex=$db->conectar();\n\n $sql=\"SELECT empleado.nombres, empleado.cedula, permisos.status, permisos.cantidad_dias, permisos.motivo, permisos.inicio_permiso FROM permisos, empleado WHERE empleado.id=permisos.id_empleado\";\n\n $resul=mysqli_query($conex,$sql);\n $filas=mysqli_num_rows($resul);\n $campos=mysqli_num_fields($resul);\n $permisos[]=array();\n $i=0;\n if ($res=mysqli_query($conex,$sql)) {\n while ($data=mysqli_fetch_array($resul)) {\n for ($j=0; $j < $campos ; $j++) { \n $permisos[$i][$j]=$data[$j];\n }\n $i++; \n }\n\n header(\"Location:permisos.php?filas=\".$filas.\"&campos=\".$campos.\"&data=\".serialize($permisos));\n \n } else {\n ?>\n <script type=\"text/javascript\">\n alert(\"Error en la conexion!\");\n window.location=\"ControlA.php?operacion=index\";\n </script>\n <?php\n }\n\n}", "public function tabel_pengantaran(){\r\n $result = $this->darat->get_tabel_transaksi();\r\n $data = array();\r\n $no = 1;\r\n\r\n if (is_array($result) || is_object($result)){\r\n foreach ($result as $row){\r\n $aksi = \"\";\r\n \r\n if($row->waktu_mulai_pengantaran == NULL){\r\n $aksi = '&nbsp;<a class=\"btn btn-sm btn-info glyphicon glyphicon-road\" href=\"javascript:void(0)\" title=\"Pengantaran\" onclick=\"pengantaran('.\"'\".$row->id_transaksi.\"'\".');\"></a>';\r\n }else if($row->waktu_selesai_pengantaran != NULL){\r\n $aksi = \"\";\r\n }else{\r\n $aksi = '&nbsp;<a class=\"btn btn-sm btn-primary glyphicon glyphicon-ok\" href=\"javascript:void(0)\" title=\"Realisasi\" onclick=\"realisasi('.\"'\".$row->id_transaksi.\"'\".')\"></a>';\r\n }\r\n $format_tgl = date('d-m-Y H:i', strtotime($row->tgl_transaksi ));\r\n $format_tgl_pengantaran = date('d-m-Y H:i', strtotime($row->tgl_perm_pengantaran ));\r\n \r\n if($row->status_delivery == 1){\r\n $status_pengantaran = \"Sudah Diantar\";\r\n }else if($row->waktu_mulai_pengantaran != NULL){\r\n $status_pengantaran = \"Sedang Dalam Pengantaran\";\r\n }else{\r\n $status_pengantaran = \"Belum Diantar\";\r\n }\r\n \r\n if(($row->status_pembayaran == 1 || $row->status_invoice == 1) && $row->status_delivery == 0 && $row->batal_nota == 0 && $row->batal_kwitansi == 0){\r\n $data[] = array(\r\n 'no' => $no,\r\n 'nama' => $row->nama_pemohon,\r\n 'alamat' => $row->alamat,\r\n 'no_telp' => $row->no_telp,\r\n 'tanggal' => $format_tgl,\r\n 'tanggal_permintaan' => $format_tgl_pengantaran,\r\n 'total_pengisian' => $row->total_permintaan,\r\n 'status_pengantaran' => $status_pengantaran,\r\n 'aksi' => $aksi\r\n );\r\n $no++;\r\n }\r\n }\r\n }\r\n \r\n echo json_encode($data);\r\n }", "private function muatObjekFileMasukan()\n {\necho \"<br/><br/>**********MEMUAT UNIT STRING SESUAI UNIT STRING PILIHAN*********<br/><br/>\";\n for($i=0; $i < count($this->array_nama_file_masukan); $i++)\n {\n $objek = new Unit($this->array_nama_file_masukan[$i], $this->folderMasukan,$this->penanda_unit_string,$this->penanda_filter_token_entity);\n array_push($this->array_objek_unit, $objek);\n }\n }", "function data_mhs(){\r\n\t\t\techo \"KodeMataKuliah : \".$this->KodeMataKuliah.\"<br />\";\r\n\t\t\techo \"SKS : \".$this->SKS.\"<br />\";\r\n\t\t\techo \"Daftar matakuliah yang diambil:<br />\";\r\n\t\t\t\r\n\t\t\t$i = 0; // nomor urut daftar SKS matakuliah yang diambil\r\n\t\t\tforeach($this->NamaMataKuliah as $mk){\r\n\t\t\t\techo ++$i.\". \".$mk.\"<br />\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Cuma buat ganti baris aja kok :-)\r\n\t\t\techo \"<br />\";\r\n\t\t}", "public function agrega_detalle_compra(){\n\n \n\t//echo json_encode($_POST['arrayCompra']);\n\t$str = '';\n\t$detalles = array();\n\t$detalles = json_decode($_POST['arrayCompra']);\n\n\n \n\t $conectar=parent::conexion();\n\n\n\tforeach ($detalles as $k => $v) {\n\t\n\t\t//IMPORTANTE:estas variables son del array detalles\n\t\t$cantidad = $v->cantidad;\n\t\t$codProd = $v->codProd;\n //$codCat = $v->codCat;\n\t\t$modelo = $v->modelo;\n\t\t$marca = $v->marca;\n\t\t$color = $v->color; \n\n\t $numero_compra = $_POST[\"numero_compra\"];\n $categoria = $_POST[\"categoria\"];\n\n $id_usuario = $_POST[\"id_usuario\"];\n //$id_proveedor = $_POST[\"id_proveedor\"];\n\n $sql=\"insert into detalle_compras\n values(null,?,?,?,?,null,?,?);\";\n\n\n $sql=$conectar->prepare($sql);\n\n\n $sql->bindValue(1,$numero_compra);\n $sql->bindValue(2,$codProd);\n $sql->bindValue(3,$modelo);\n $sql->bindValue(4,$cantidad);\n $sql->bindValue(5,$id_usuario);\n $sql->bindValue(6,$categoria);\n\n \n $sql->execute();\n\n \n $sql3=\"select * from producto where id_producto=?;\";\n\n //echo $sql3;\n \n $sql3=$conectar->prepare($sql3);\n\n $sql3->bindValue(1,$codProd);\n $sql3->execute();\n\n $resultado = $sql3->fetchAll(PDO::FETCH_ASSOC);\n\n foreach($resultado as $b=>$row){\n\n \t$re[\"existencia\"] = $row[\"stock\"];\n\n }\n\n //la cantidad total es la suma de la cantidad más la cantidad actual\n $cantidad_total = $cantidad + $row[\"stock\"];\n\n \n //si existe el producto entonces actualiza el stock en producto\n \n if(is_array($resultado)==true and count($resultado)>0) {\n \n //actualiza el stock en la tabla producto\n\n \t $sql4 = \"update producto set \n \n stock=?\n where \n id_producto=?\n \t \";\n\n\n \t $sql4 = $conectar->prepare($sql4);\n \t $sql4->bindValue(1,$cantidad_total);\n \t $sql4->bindValue(2,$codProd);\n \t $sql4->execute();\n\n } //cierre la condicional\n\n\n\t }//cierre del foreach\n\n\n\n /*$sql2=\"insert into compras \n values(null,now(),?,?,?,?,?,?,?,?,?,?,?,?);\";\n\n\n $sql2=$conectar->prepare($sql2);\n \n \n $sql2->bindValue(1,$numero_compra);\n $sql2->bindValue(2,$proveedor);\n $sql2->bindValue(3,$cedula_proveedor);\n $sql2->bindValue(4,$comprador);\n $sql2->bindValue(5,$moneda);\n $sql2->bindValue(6,$subtotal);\n $sql2->bindValue(7,$total_iva);\n $sql2->bindValue(8,$total);\n $sql2->bindValue(9,$tipo_pago);\n $sql2->bindValue(10,$estado);\n $sql2->bindValue(11,$id_usuario);\n $sql2->bindValue(12,$id_proveedor);\n \n $sql2->execute();*/\n\n\n\n \t }", "function recuperaDatos(){\n if($this->data['folio']!=\"\"){\n $tmp=explode('-',$this->data['folio']);\n if( ($tmp[0] + 0)>0)\n $this->arrayDatos = $this->regresaDatosProyecto($tmp[0]); \n }\n \n }", "public function kosongkanDataBarang() {\n $this->daftar_barang = [];\n $this->editData();\n }", "public function __construct() {\n\n\t\t$this->contenuto=array();\n\t\t$this->quantita=array();\n }", "public function getDistribusiData()\n {\n $pendapatan = $this->getRekeningPendapatan();\n $rekening_tabungan = $this->getRekening(\"TABUNGAN\");\n $rekening_deposito = $this->getRekening(\"DEPOSITO\");\n \n $data_rekening = array();\n $total_rata_rata = array();\n\n\n foreach($rekening_tabungan as $tab)\n {\n $rata_rata_product_tabungan = 0.0;\n $tabungan = $this->tabunganReporsitory->getTabungan($tab->nama_rekening);\n foreach($tabungan as $user_tabungan) {\n $temporarySaldo = $this->getSaldoAverageTabunganAnggota($user_tabungan->id_user, $user_tabungan->id);\n $rata_rata_product_tabungan = $rata_rata_product_tabungan + $temporarySaldo;\n }\n Session::put($user_tabungan->jenis_tabungan, $rata_rata_product_tabungan);\n array_push($total_rata_rata, $rata_rata_product_tabungan);\n }\n\n foreach($rekening_deposito as $dep)\n {\n $rata_rata_product_deposito = 0.0;\n $deposito = $this->depositoReporsitory->getDepositoDistribusi($dep->nama_rekening);\n foreach($deposito as $user_deposito) {\n if ($user_deposito->type == 'jatuhtempo'){\n $tanggal = $user_deposito->tempo;\n }\n else if($user_deposito->type == 'pencairanawal')\n {\n $tanggal = $user_deposito->tanggal_pencairan;\n }\n else if($user_deposito->type == 'active')\n {\n $tanggal = Carbon::parse('first day of January 1970');\n }\n $temporarySaldo = $this->getSaldoAverageDepositoAnggota($user_deposito->id_user, $user_deposito->id, $tanggal);\n $rata_rata_product_deposito = $rata_rata_product_deposito + $temporarySaldo ;\n }\n Session::put($dep->nama_rekening, $rata_rata_product_deposito);\n array_push($total_rata_rata, $rata_rata_product_deposito);\n }\n\n $total_rata_rata = $this->getTotalProductAverage($total_rata_rata);\n Session::put(\"total_rata_rata\", $total_rata_rata);\n $total_pendapatan = $this->getRekeningPendapatan(\"saldo\");\n $total_pendapatan_product = 0;\n\n $total_porsi_anggota = 0;\n $total_porsi_bmt = 0;\n\n\n foreach($rekening_tabungan as $tab)\n {\n $rata_rata = Session::get($tab->nama_rekening);\n $nisbah_anggota = json_decode($tab->detail)->nisbah_anggota;\n $nisbah_bmt = 100 - json_decode($tab->detail)->nisbah_anggota;\n $pendapatan_product = $this->getPendapatanProduk($rata_rata, $total_rata_rata, $total_pendapatan);\n\n $total_porsi_anggota += $this->getPorsiPendapatanProduct($nisbah_anggota, $pendapatan_product);\n $total_porsi_bmt += $this->getPorsiPendapatanProduct($nisbah_bmt, $pendapatan_product);\n\n }\n\n foreach($rekening_deposito as $dep)\n {\n $rata_rata = Session::get($dep->nama_rekening);\n $nisbah_anggota = json_decode($dep->detail)->nisbah_anggota;\n $nisbah_bmt = 100 - json_decode($dep->detail)->nisbah_anggota;\n $pendapatan_product = $this->getPendapatanProduk($rata_rata, $total_rata_rata, $total_pendapatan);\n\n $total_porsi_anggota += $this->getPorsiPendapatanProduct($nisbah_anggota, $pendapatan_product);\n $total_porsi_bmt += $this->getPorsiPendapatanProduct($nisbah_bmt, $pendapatan_product);\n }\n\n $shuBerjalan = BMT::where('nama', 'SHU BERJALAN')->select('saldo')->first();\n $selisihBMTAnggota = $shuBerjalan->saldo - $total_porsi_anggota;\n\n\n foreach($rekening_tabungan as $tab)\n {\n $tabungan = $this->tabunganReporsitory->getTabungan($tab->nama_rekening);\n $rata_rata = Session::get($tab->nama_rekening);\n $nisbah_anggota = json_decode($tab->detail)->nisbah_anggota;\n $nisbah_bmt = 100 - json_decode($tab->detail)->nisbah_anggota;\n $pendapatan_product = $this->getPendapatanProduk($rata_rata, $total_rata_rata, $total_pendapatan);\n\n $total_pendapatan_product += $pendapatan_product;\n\n if ($total_porsi_bmt == 0)\n {\n $porsi_bmt = 0;\n }\n else\n {\n// $porsi_bmt = $this->getPorsiPendapatanProduct($nisbah_bmt, $pendapatan_product) / $total_porsi_bmt * $selisihBMTAnggota;\n $porsi_bmt = $this->getPorsiPendapatanProduct($nisbah_bmt, $pendapatan_product);\n\n }\n\n array_push($data_rekening, [ \n \"jenis_rekening\" => $tab->nama_rekening,\n \"jumlah\" => count($tabungan),\n \"rata_rata\" => $rata_rata,\n \"nisbah_anggota\" => $nisbah_anggota,\n \"nisbah_bmt\" => $nisbah_bmt,\n \"total_rata_rata\" => $total_rata_rata,\n \"total_pendapatan\" => $total_pendapatan,\n \"pendapatan_product\" => $pendapatan_product,\n \"porsi_anggota\" => $this->getPorsiPendapatanProduct($nisbah_anggota, $pendapatan_product),\n \"porsi_bmt\" => $porsi_bmt,\n \"percentage_anggota\" => $total_pendapatan > 0 ?$this->getPorsiPendapatanProduct($nisbah_anggota, $pendapatan_product) / $total_pendapatan : 0\n ]);\n }\n\n foreach($rekening_deposito as $dep)\n {\n $deposito = $this->depositoReporsitory->getDepositoDistribusi($dep->nama_rekening);\n $rata_rata = Session::get($dep->nama_rekening);\n $nisbah_anggota = json_decode($dep->detail)->nisbah_anggota;\n $nisbah_bmt = 100 - json_decode($dep->detail)->nisbah_anggota;\n $pendapatan_product = $this->getPendapatanProduk($rata_rata, $total_rata_rata, $total_pendapatan);\n\n $total_pendapatan_product += $pendapatan_product;\n if ($total_porsi_bmt == 0)\n {\n $porsi_bmt = 0;\n }\n else\n {\n// $porsi_bmt = $this->getPorsiPendapatanProduct($nisbah_bmt, $pendapatan_product) / $total_porsi_bmt * $selisihBMTAnggota;\n $porsi_bmt = $this->getPorsiPendapatanProduct($nisbah_bmt, $pendapatan_product);\n\n }\n array_push($data_rekening, [\n \"jenis_rekening\" => $dep->nama_rekening,\n \"jumlah\" => count($deposito),\n \"rata_rata\" => $rata_rata,\n \"nisbah_anggota\" => $nisbah_anggota,\n \"nisbah_bmt\" => $nisbah_bmt,\n \"total_rata_rata\" => $total_rata_rata,\n \"total_pendapatan\" => $total_pendapatan,\n \"pendapatan_product\" => $pendapatan_product,\n \"porsi_anggota\" => $this->getPorsiPendapatanProduct($nisbah_anggota, $pendapatan_product),\n \"porsi_bmt\" => $porsi_bmt\n ]);\n }\n\n return $data_rekening;\n }", "public function getArray() {\n return array(\n \"id\" => $this->id, \n \"nombreDepartamento\" => $this->nombre, \n //\"idap\" => $this->idap, \n );\n }", "private function _fill_insert_data() {\n $data = array();\n $data['numero_ticket'] = $this->_generate_numero_ticket();\n $data['descripcion'] = $this->post('descripcion');\n $data['soporte_categoria_id'] = $this->post('soporte_categoria_id');\n $data['persona_id'] = get_persona_id();\n $data['created_at'] = date('Y-m-d H:i:s');\n $data['status'] = 1;\n return $data;\n }", "public function traer_empresas()\n {\n $empresas=array();\n $query=$this->db->get('empresas');\n if($query->num_rows()>0)\n {\n foreach ($query->result() as $row)\n {\n $empresas[$row->id]['id']=$row->id;\n $empresas[$row->id]['nit']=$row->nit;\n $empresas[$row->id]['razon_social']=$row->razon_social;\n $empresas[$row->id]['telefono']=$row->telefono;\n $empresas[$row->id]['extension']=$row->extension;\n $empresas[$row->id]['contacto']=$row->contacto;\n $empresas[$row->id]['direccion']=$row->direccion;\n $empresas[$row->id]['rol']=$row->rol;\n } \n }\n \n return $empresas;\n }", "public function setData(Array $data);", "public function getArray() {\n return array(\n \"id\" => $this->id, \n \"nombreGrupo\" => $this->nombre, \n //\"idag\" => $this->idap, \n );\n }", "function arrayProgramas (){\n\t\t$host = \"localhost\";\n\t\t$usuario = \"root\";\n\t\t$password = \"\";\n\t\t$BaseDatos = \"pide_turno\";\n\n $link=mysql_connect($host,$usuario,$password);\n\n\t\tmysql_select_db($BaseDatos,$link);\n\n\t\t$consultaSQL = \"SELECT estado_programas.codigo, estado_programas.estado, estado_programas.programa, estado_programas.user, estado_programas.pass, estado_programas.comentarios FROM estado_programas;\";\n\t\t$retorno =array();\n\t\tmysql_query(\"SET NAMES utf8\");\n\t\t$result = mysql_query($consultaSQL);\n\t\tfor($i=0;$fila= mysql_fetch_assoc($result); $i++) {\n\t\t\tfor($a= 0;$a<mysql_num_fields($result);$a++){\n\t\t\t\t$campo = mysql_field_name($result,$a);\n\t\t\t\t$retorno[$i][$campo] = $fila[$campo];\n\t\t\t}\n\t\t};\n\t\tmysql_close($link);\n\n\t\treturn $retorno;\n\t}", "public function datatable($id_cabang,$id_warehouse=null){\n $data = $this->join_builder($id_cabang,$id_warehouse);\n $format = '%d %s ';\n $stok = [];\n $this->dataisi = [];\n foreach ($data as $d) {\n $id = $d->produk_id;\n $jumlah = $d->jumlah;\n $capital_price = $d->capital_price;\n $harga = $d->capital_price;\n $proses = DB::table('tbl_unit')->where('produk_id',$id)\n ->join('tbl_satuan','tbl_unit.maximum_unit_name','=','tbl_satuan.id_satuan')\n ->select('id_unit','nama_satuan as unit','default_value')\n ->orderBy('id_unit','ASC')\n ->get();\n $hasilbagi=0;\n $stokquantity=[];\n foreach ($proses as $index => $list) {\n $banyak = sizeof($proses);\n if($index == 0 ){\n $sisa = $jumlah % $list->default_value;\n $hasilbagi = ($jumlah-$sisa)/$list->default_value;\n $satuan[$index] = $list->unit;\n $lebih[$index] = $sisa;\n $harga = $harga / $list->default_value;\n if ($sisa > 0){\n $stok[$index] = sprintf($format, $sisa, $list->unit);\n }\n if($banyak == $index+1){\n $satuan = array();\n $stok[$index] = sprintf($format, $hasilbagi, $list->unit);\n $stokquantity = array_values($stok);\n $stok = array();\n }\n }else if($index == 1){\n $sisa = $hasilbagi % $list->default_value;\n $hasilbagi = ($hasilbagi-$sisa)/$list->default_value;\n $satuan[$index] = $list->unit;\n $lebih[$index] = $sisa;\n $harga = $harga / $list->default_value;\n if($sisa > 0){\n $stok[$index-1] = sprintf($format, $sisa+$lebih[$index-1], $satuan[$index-1]);\n }\n if($banyak == $index+1){\n $satuan = array();\n $stok[$index] = sprintf($format, $hasilbagi, $list->unit);\n $stokquantity = array_values($stok);\n $stok = array();\n }\n }else if($index == 2){\n $sisa = $hasilbagi % $list->default_value;\n $hasilbagi = ($hasilbagi-$sisa)/$list->default_value;\n $satuan[$index] = $list->unit;\n $lebih[$index] = $sisa;\n $harga = $harga / $list->default_value;\n if($sisa > 0){\n $stok[$index-1] = sprintf($format, $sisa, $satuan[$index-1]);\n }\n if($banyak == $index+1){\n $satuan = array();\n $stok[$index] = sprintf($format, $hasilbagi, $list->unit);\n $stokquantity = array_values($stok);\n $stok = array();\n }\n } \n }\n $jumlah_stok = implode(\" \",$stokquantity);\n $d->stok_quantity = $jumlah_stok;\n $d->total_harga = $harga * $d->jumlah;\n $this->dataisi[] = [\"id_unit\"=>$id,\"produk_nama\"=>$d->produk_nama,\"capital_price\"=>$capital_price,\"stok_harga\"=>$d->total_harga,\"jumlah\"=>$d->stok_quantity,\"produk_harga\"=>$d->produk_harga,\"stok_id\"=>$d->stok_id,\"nama_cabang\"=>$d->nama_gudang];\n }\n \n return datatables()->of($this->dataisi)->toJson();\n \n }", "function Array_Get_Estados()\n{\n $lugares = consultar(\"SELECT * FROM tb_estados_partido WHERE id_estado!='6'\"); \n $datos = array();\n while ($valor = mysqli_fetch_array($lugares)) {\n $id_estado = $valor['id_estado'];\n $nombre = $valor['nombre'];\n $vector = array(\n 'id_estado'=>\"$id_estado\",\n 'nombre' => \"$nombre\",\n );\n array_push($datos, $vector);\n }\n\n return $datos; \n}", "public function getData() : array;", "public function getData() : array;", "function getDatos(){\n $res = $this->Consulta('SELECT C.*, P.id_planta FROM '.$this->Table .' C\n INNER JOIN\n equipos E ON E.id_equipos = C.`id_equipos`\n INNER JOIN\n secciones S ON S.id_secciones = E.id_secciones\n INNER JOIN\n plantas P ON P.id_planta = S.id_planta\n \n WHERE '.$this->PrimaryKey.' = '.$this->_datos);\n $resultado = $res[0];\n // $resultado = array_map('utf8_encode',$resultado);\n \n print_r( json_encode( $resultado ) );\n }", "function Provincias() {\n /* Creamos la instancia del objeto. Ya estamos conectados */\n $bd = Db::getInstance();\n\n /* Creamos una query sencilla */\n $sql = 'SELECT cod, nombre as nom\n\t\t\t FROM `tbl_provincias`';\n\n /* Ejecutamos la query */\n $bd->Consulta($sql);\n\n // Creamos el array donde se guardarán las provincias\n $Provincias = Array();\n\n /* Realizamos un bucle para ir obteniendo los resultados */\n while ($reg = $bd->LeeRegistro()) {\n $Provincias[$reg['cod']] = $reg['nom'];\n }\n return $Provincias;\n}", "public function simpan_data_penerima_bansos()\n {\n $noKK = $this->request->getVar('noKK');\n $kepalaKeluarga = $this->request->getVar('kepalaKeluarga');\n $idBansos = $this->request->getVar('idBansos');\n $namaBansos = $this->request->getVar('namaBansos');\n $kategori = $this->request->getVar('kategori');\n $pendamping = $this->request->getVar('pendamping');\n $nominal = $this->request->getVar('nominal');\n $jumlahData = count($noKK);\n $jumlahBerhasil = 0;\n $jumlahGagal = 0;\n $jumlahTerdaftar = 0;\n $jumlahDataKKTidakDitemukan = 0;\n $jumlahDataBansosTidakDitemukan = 0;\n $jumlahBelumDisetujui = 0;\n for ($i = 0; $i < $jumlahData; $i++) {\n // cek apakah fieldnya kosong\n if ($noKK[$i] == 0 || $idBansos[$i] == 0) {\n $jumlahGagal++;\n } else {\n // cek pada database apakah data KK tersebut ada\n $dataKeluarga = $this->KeluargaModel->where('noKK', $noKK[$i])->first();\n if ($dataKeluarga) {\n // cek pada database apakah data bansos ada\n $dataBansos = $this->DataBansosModel->where('idBansos', $idBansos[$i])->first();\n if ($dataBansos) {\n // cek apakah data keluarga sudah\n $status = 'Disetujui';\n $disetujui = $this->KeluargaModel->where('noKK', $noKK[$i])->where('status', $status)->first();\n if ($disetujui) {\n // cek data peserta apakah sudah terdaftar\n $pesertaBansos = $this->BansosModel->where('noKK', $noKK[$i])->where('idBansos', $idBansos[$i])->first();\n if ($pesertaBansos) {\n $jumlahTerdaftar++;\n } else {\n\n $this->BansosModel->save([\n 'noKK' => $noKK[$i],\n 'kepalaKeluarga' => $kepalaKeluarga[$i],\n 'idBansos' => $idBansos[$i],\n 'namaBansos' => $namaBansos[$i],\n 'kategori' => $kategori[$i],\n 'pendamping' => $pendamping[$i],\n 'nominal' => $nominal[$i],\n 'statusAnggota' => 'Aktif'\n ]);\n $jumlahBerhasil++;\n }\n } else {\n $jumlahBelumDisetujui++;\n }\n } else {\n $jumlahDataBansosTidakDitemukan++;\n }\n } else {\n $jumlahDataKKTidakDitemukan++;\n }\n }\n }\n session()->setFlashdata('pesan', '' . $jumlahBerhasil . ' Berhasil Disimpan, ' . $jumlahTerdaftar . ' Telah Terdaftar, ' . $jumlahDataKKTidakDitemukan . ' Data KK Tidak Ditemukan, ' . $jumlahDataBansosTidakDitemukan . ' Data Bansos Tidak Ditemukan dan ' . $jumlahBelumDisetujui . ' Belum Disetujui');\n return redirect()->to('/Admin/penerima_bansos');\n }", "private function _generateProductsData(){\n \n $products = $this->context->cart->getProducts();\n $pagseguro_items = array();\n \n $cont = 1;\n \n foreach ($products as $product) {\n \n $pagSeguro_item = new PagSeguroItem();\n $pagSeguro_item->setId($cont++);\n $pagSeguro_item->setDescription(Tools::truncate($product['name'], 255));\n $pagSeguro_item->setQuantity($product['quantity']);\n $pagSeguro_item->setAmount($product['price_wt']);\n $pagSeguro_item->setWeight($product['weight'] * 1000); // defines weight in gramas\n \n if ($product['additional_shipping_cost'] > 0)\n $pagSeguro_item->setShippingCost($product['additional_shipping_cost']);\n \n array_push($pagseguro_items, $pagSeguro_item);\n }\n \n return $pagseguro_items;\n }", "public function run()\n {\n //tugas\n $produk = [\n ['KategoriProduk'=>'MakeUp', 'NamaProduk'=>'Lipstik','JenisProduk'=>'Padat','Jumlah'=> 4,'HargaProduk'=> 50000,'Kualitas'=>'Baru','Alamat'=>'Kp.Cilisung'], ['KategoriProduk'=>'Fashion', 'NamaProduk'=>'Baju','JenisProduk'=>'Katun','Jumlah'=> 3,'HargaProduk'=> 1.500000,'Kualitas'=>'Baru','Alamat'=>'Cirebon'],\n ['KategoriProduk'=>'Fashion', 'NamaProduk'=>'Celana','JenisProduk'=>'jeans','Jumlah'=> 3,'HargaProduk'=> 150000,'Kualitas'=>'Baru','Alamat'=>'Kp.salak'], ['KategoriProduk'=>'minuman', 'NamaProduk'=>'jus jeruk','JenisProduk'=>'cair','Jumlah'=> 10,'HargaProduk'=> 140000,'Kualitas'=>'Baru','Alamat'=>'Kp.bojong malaka'], ['KategoriProduk'=>'MakeUp', 'NamaProduk'=>'Lipstik','JenisProduk'=>'Padat','Jumlah'=> 2,'HargaProduk'=> 6000,'Kualitas'=>'Baru','Alamat'=>'Kp.bojong malaka'], ['KategoriProduk'=>'MakeUp', 'NamaProduk'=>'Lipstik','JenisProduk'=>'Padat','Jumlah'=> 5,'HargaProduk'=> 7000,'Kualitas'=>'Baru','Alamat'=>'Kp.bojong malaka'], ['KategoriProduk'=>'MakeUp', 'NamaProduk'=>'Lipstik','JenisProduk'=>'Padat','Jumlah'=> 6,'HargaProduk'=> 15000,'Kualitas'=>'Baru','Alamat'=>'Kp.bojong malaka'], ['KategoriProduk'=>'MakeUp', 'NamaProduk'=>'Lipstik','JenisProduk'=>'Padat','Jumlah'=> 1,'HargaProduk'=> 20000,'Kualitas'=>'Baru','Alamat'=>'Kp.bojong malaka'], ['KategoriProduk'=>'MakeUp', 'NamaProduk'=>'Lipstik','JenisProduk'=>'Padat','Jumlah'=> 8,'HargaProduk'=> 12000,'Kualitas'=>'Baru','Alamat'=>'Kp.bojong malaka'], ['KategoriProduk'=>'Mmakanan', 'NamaProduk'=>'kentang','JenisProduk'=>'Makanan','Jumlah'=> 1,'HargaProduk'=> 5000,'Kualitas'=>'Baru','Alamat'=>'Kp.bojong malaka']\n ];\n // masukkan data ke database\n DB::table('produk')->insert($produk);\n }", "public function getData()\n {\n return array(\n\n );\n }", "function cunsultas()\n {\n \t $data['categoria']=categoria::get();\n \t\t$data['unidad']=unidad::get();\n\n \t\treturn $data;\n }", "public function run()\n {\n $jawaban_soal_ujians = [\n [ \n\t\t\t'jawaban'\t\t=> '3500',\n\t\t\t'is_benar'\t\t=> '0',\t\t\t\n\t\t\t'poin'\t\t=> '0',\n\t\t\t'id_soal'\t\t=> '1',\t\t\t\n\t\t],\n\t\t[ \n\t\t\t'jawaban'\t\t=> '2500',\n\t\t\t'is_benar'\t\t=> '1',\t\t\t\n\t\t\t'poin'\t\t=> '10',\n\t\t\t'id_soal'\t\t=> '1',\t\t\t\n\t\t],\n\t\t[ \n\t\t\t'jawaban'\t\t=> '8900',\n\t\t\t'is_benar'\t\t=> '0',\t\t\t\n\t\t\t'poin'\t\t=> '0',\n\t\t\t'id_soal'\t\t=> '1',\t\t\t\n\t\t],\n\t\t[ \n\t\t\t'jawaban'\t\t=> '250',\n\t\t\t'is_benar'\t\t=> '0',\t\t\t\n\t\t\t'poin'\t\t=> '0',\n\t\t\t'id_soal'\t\t=> '1',\t\t\t\n\t\t],\n\t\t[ \n\t\t\t'jawaban'\t\t=> 'Mensyukuri',\n\t\t\t'is_benar'\t\t=> '0',\t\t\t\n\t\t\t'poin'\t\t=> '0',\n\t\t\t'id_soal'\t\t=> '2',\t\t\t\n\t\t], \n\t\t[ \n\t\t\t'jawaban'\t\t=> 'Menyukai',\n\t\t\t'is_benar'\t\t=> '0',\t\t\t\n\t\t\t'poin'\t\t=> '0',\n\t\t\t'id_soal'\t\t=> '2',\t\t\t\n\t\t],\n\t\t[ \n\t\t\t'jawaban'\t\t=> 'Membenci',\n\t\t\t'is_benar'\t\t=> '0',\t\t\t\n\t\t\t'poin'\t\t=> '0',\n\t\t\t'id_soal'\t\t=> '2',\t\t\t\n\t\t],\n\t\t[ \n\t\t\t'jawaban'\t\t=> 'Menyayangi',\n\t\t\t'is_benar'\t\t=> '1',\t\t\t\n\t\t\t'poin'\t\t=> '10',\n\t\t\t'id_soal'\t\t=> '2',\t\t\t\n\t\t],\t\n\t\t]; \n\n\t\tDB::table('jawaban_soal_ujians')->insert($jawaban_soal_ujians);\n }", "function getDatosInArray(){ if($this->mSocioIniciado == false ){ $this->init(); } \treturn $this->mDSocioByArray;\t}", "function &getDatas()\r\n\t{\r\n\t\t// Load the data\r\n\t\tif (empty( $this->_data )) \r\n\t\t{\r\n\t\t\t$query = ' SELECT * FROM #__hotelreservation_packages WHERE hotel_id='.$this->_hotel_id.\" ORDER BY package_name \";\r\n\t\t\t//$this->_db->setQuery( $query );\r\n\t\t\t$this->_data = &$this->_getList( $query );\r\n\t\t\t\r\n\t\t\tforeach( $this->_data as $key => $value )\r\n\t\t\t{\r\n\t\t\t\tif( $this->_data[$key]->is_price_day == false )\r\n\t\t\t\t\t$this->_data[$key]->package_type_price = 1;\r\n\t\t\t\t$this->_data[$key]->package_prices = null;\r\n\t\t\t\t$this->_data[$key]->package_prices[ $value->package_price_1 ][] = 1;\r\n\t\t\t\t$this->_data[$key]->package_prices[ $value->package_price_2 ][] = 2;\r\n\t\t\t\t$this->_data[$key]->package_prices[ $value->package_price_3 ][] = 3;\r\n\t\t\t\t$this->_data[$key]->package_prices[ $value->package_price_4 ][] = 4;\r\n\t\t\t\t$this->_data[$key]->package_prices[ $value->package_price_5 ][] = 5;\r\n\t\t\t\t$this->_data[$key]->package_prices[ $value->package_price_6 ][] = 6;\r\n\t\t\t\t$this->_data[$key]->package_prices[ $value->package_price_7 ][] = 7;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $this->_data;\r\n\t}", "function get_all_array($p=0)\r\n {\r\n $qry = $this->db->where('cat_padre', $p)\r\n ->get($this->_cat);\r\n $rs = array('all'=>'Todos');\r\n if($qry->num_rows() > 0)\r\n {\r\n foreach($qry->result() as $r)\r\n $rs[$r->cat_id] = $r->cat_nombre;\r\n }\r\n return $rs;\r\n }", "public function getAllArr()\n\t{\n\t\t$sql = \"SELECT g.id,g.nombre,g.total,u.nombre,u.apellido_pat,u.apellido_mat,g.created_date,gt.nombre gastostipo,gt.tipo\n\t\tFROM gastos g \n\t\tleft join gastos_tipo gt on gt.id=g.id_gastostipo \n\t\tleft join user u on u.id=g.id_user \n\t\t\twhere g.status='active';\";\n\t\t$res = $this->db->query($sql);\n\t\t$set = array();\n\t\tif(!$res){ die(\"Error getting result\"); }\n\t\telse{\n\t\t\twhile ($row = $res->fetch_assoc())\n\t\t\t\t{ $set[] = $row; }\n\t\t}\n\t\treturn $set;\n\t}", "function Certificates_Table_Datas()\n {\n $datas=array(\"No\",\"Generate\",\"Generated\",\"Mailed\",\"Type\",\"Name\",\"TimeLoad\",\"Code\",);\n\n return $datas;\n }", "function recuperaDatosMetas(){\n $folio=0;\n $tmp=array();\n if(trim($this->data['folio']) != \"\"){\n $tmp=explode('-',$this->data['folio']);\n $folio= $tmp[0] + 0;\n if($folio > 0){\n $this->arrayDatos=$this->regresaMetas($folio);\n }\n }\n }", "public function setList(){\r\n\t\t $arr=func_num_args();\r\n\t\t\t $arr1=func_get_args();\r\n\t\t\t if ($arr==2){\r\n\t\t\t $this->su[$this->counte]=$arr1[0];\r\n\t\t\t $this->data[$this->counte]=$arr1[1];\r\n\t\t\t\t }\r\n\t\t\t\t if ($arr==1){\r\n\t\t\t\t $this->data[$this->counte]=$arr1[0];\r\n\t\t\t\t $this->su[$this->counte]=$this->oklad;\r\n\t\t\t\t // $this->su=$this->oklad;\r\n\t\t\t\t }\r\n\t\t\t\t \r\n\t $this->listing[$this->counte] =array($this->su,$this->data);\r\n\t\t\t $this->counte++;\r\n\t\t\t}", "public function consultarProdutos(){\n //$conexao = $c->conexao();\n\n $sql = \"SELECT c.nome,a.* FROM tbproduto a, tbcategorias c where a.idcategoria = c.idcategoria order by a.referencia\";\n $sql = $this->conexao->query($sql);\n $dados = array();\n\n while ($row = $sql->fetch_assoc()) {\n\n $idproduto = $row['id'];\n $nome = $row['nome'];\n $referencia = $row['referencia'];\n $idcategoria = $row['idcategoria'];\n $preco = $row['preco'];\n $descricao = $row['descricao'];\n $estoque = $row['estoque'];\n $habilitado = $row['habilitado'];\n $imagem = $row['imagem'];\n // $url = $row['url'];\n\n $dado = array();\n $dado['idproduto'] = $idproduto;\n $dado['idcategoria'] = $idcategoria;\n $dado['nome'] = $nome;\n $dado['referencia'] = $referencia;\n $dado['descricao'] = $descricao;\n $dado['preco'] = $preco;\n $dado['estoque'] = $estoque;\n $dado['habilitado'] = $habilitado;\n $dado['imagem'] = $imagem;\n $dados[] = $dado;\n }\n\n return $dados;\n\n }", "function getArrayCampos() {\n\t\t$arr = array(\n\t\t\t\"id\"=>$this->id,\n\t\t\t\"idov\"=>$this->idov,\n\t\t\t\"ordinal\"=>$this->ordinal,\n\t\t\t\"visible\"=>$this->visible,\n\t\t\t\"iconoov\"=>$this->iconoov,\n\t\t\t\"name\"=>$this->name,\n\t\t\t\"idov_refered\"=>$this->idov_refered,\n\t\t\t\"idresource_refered\"=>$this->idresource_refered,\n\t\t\t\"type\"=>$this->type\n\t\t);\n\t\treturn $arr;\n\t}", "public function getDatas(){\n $r=array();\n $className=get_class($this);\n foreach($this->fields() as $f){\n $r[$f->name]=$f;\n }\n return $r;\n }", "private function prepData($label_bukus, $id_judul)\n {\n $data = [];\n foreach($label_bukus as $label_buku) {\n\n $data[] = [\n 'label_buku' => $label_buku,\n 'id_judul' => $id_judul\n ];\n }\n return $data;\n }", "public function getData(): array;", "public function getData(): array;", "public function getData(): array;", "public function getData(): array;", "function insertPB()\n {\n\n $productos = $this->Import_model->get_productos();\n\n $valores = array();\n\n foreach ($productos as $key => $producto) {\n\n $detalle_pivote = $this->Import_model->get_detalle_pivote($producto->codigo_producto);\n\n $this->crearPresentacion($producto->id_entidad, $detalle_pivote);\n //$this->Import_model->insertProductoBodega($producto->id_entidad);\n //$this->Import_model->insertCategoriaProducto($producto->id_entidad, $producto->id_familia, $producto->id_grupo );\n\n }\n }", "function Array_Get_Perfiles($perfil)\n{\n\tif($perfil=='3')\n\t{\n\t\t$perfiles = consultar(\"SELECT * FROM `tb_perfiles`\");\n\t}\n\telse\n\t{\n\t\t$perfiles = consultar(\"SELECT * FROM `tb_perfiles` WHERE id_perfiles!=3\");\n\t}\n\t$datos = array();\n\twhile ($valor = mysqli_fetch_array($perfiles)) {\n\t\t$id_perfiles = $valor['id_perfiles'];\n\t\t$nombre = $valor['nombre'];\n\t\t$descripcion = $valor['descripcion'];\n\t\t$nivel = $valor['nivel'];\n\t\t$vector = array(\n\t\t\t'id_perfiles'=>\"$id_perfiles\",\n\t\t\t'nombre' => \"$nombre\",\n\t\t\t'descripcion' => \"$descripcion\",\n\t\t\t'nivel' => \"$nivel\"\n\t\t\t);\n\t\tarray_push($datos, $vector);\n\t}\n\n\treturn $datos;\t\n\n}", "function getArrayCampos() {\n\t\t$arr = array(\n\t\t\t\"id\"=>$this->id,\n\t\t\t\"idov\"=>$this->idov,\n\t\t\t\"idseccion\"=>$this->idseccion,\n\t\t\t\"idrecurso\"=>$this->idrecurso,\n\t\t\t\"value\"=>$this->value\n\t\t);\n\t\treturn $arr;\n\t}", "public function listar_abonos_detalle_table($idGenAbono) {\n $dato = [];\n\n //--- Datos del Logeado ---//\n $userdata = $this->session->all_userdata();\n //--- datos ---//\n $abonos_detalle = $this->app_model->get_detalle_abono_by_idGenAbono($idGenAbono);\n $ivaTipos = $this->app_model->get_iva_tipos();\n $empresa = $this->app_model->get_empresas();\n if ($abonos_detalle) {\n foreach ($abonos_detalle as $key => $value) {\n\n $idGenAbono = \"'\" . $value['idGenAbono'] . \"'\";\n\n $opcines_iva = \"\";\n\n if (isset($ivaTipos)):\n for ($j = 0; $j < count($ivaTipos); $j++) :\n if ($ivaTipos[$j]['valorIva'] == $value['iva']):\n $opcines_iva .= '<option selected value=\"' . $ivaTipos[$j]['valorIva'] . '\">' . $ivaTipos[$j]['descripcion'] . '</option>';\n else:\n $opcines_iva .= '<option value=\"' . $ivaTipos[$j]['valorIva'] . '\">' . $ivaTipos[$j]['descripcion'] . '</option>';\n endif;\n endfor;\n endif;\n\n //--- control de stock ---//\n $cantidad = \"\";\n if ($empresa[0]['stock'] == 0) {\n $cantidad = '<input type=\"text\" value=\"' . $value[\"cantidad\"] . '\" id=\"cantProd' . $value[\"idProducto\"] . '\" onkeyup=\"calculoAbonoEditar(' . $value[\"idProducto\"] . ',' . $value[\"stock\"] . ',' . $value[\"cantidad\"] . ',' . $empresa[0]['stock'] . ')\" class=\"form-control\">';\n } elseif ($empresa[0]['stock'] == 1) {\n $cantidad = '<input type=\"text\" value=\"' . $value[\"cantidad\"] . '\" id=\"cantProd' . $value[\"idProducto\"] . '\" onkeyup=\"calculoAbonoEditar(' . $value[\"idProducto\"] . ',' . $value[\"stock\"] . ',' . $value[\"cantidad\"] . ',' . $empresa[0]['stock'] . ')\" class=\"form-control\">';\n }\n\n $dato[] = array(\n $value[\"idProducto\"],\n $value['codigo'],\n $value['nombre'],\n $cantidad,\n $value['stock'],\n '<div class=\"input-group\">' .\n '<span class=\"input-group-addon\">$</span>' .\n '<input type=\"text\" value=\"' . $value[\"precio\"] . '\" id=\"precioProd' . $value[\"idProducto\"] . '\" disabled class=\"form-control\">' .\n '</div>',\n '<div class=\"input-group\">' .\n '<span class=\"input-group-addon\">%</span>' .\n '<input type=\"text\" value=\"' . $value[\"descuento\"] . '\" id=\"descProd' . $value[\"idProducto\"] . '\" onkeyup=\"calculoAbonoEditar(' . $value[\"idProducto\"] . ',' . $empresa[0][\"stock\"] . ')\" class=\"form-control\">' .\n '</div>',\n '<div class=\"input-group\">' .\n '<span class=\"input-group-addon\">$</span>' .\n '<input type=\"text\" value=\"' . $value[\"subTotal\"] . '\" id=\"subTotalProd' . $value[\"idProducto\"] . '\" readonly class=\"form-control\">' .\n '</div>',\n '<select id=\"selectIva' . $value[\"idProducto\"] . '\" onchange=\"calculoAbonoEditar(' . $value[\"idProducto\"] . ',' . $empresa[0][\"stock\"] . ')\" class=\"select-full\" required>\n <option value=\"0\">IVA</option>' .\n $opcines_iva .\n '</select>',\n '<i class=\"icon-remove4\" onclick=\"deleteRowListaAbonoEditar(' . $value[\"idProducto\"] . ')\"></i>',\n \"DT_RowId\" => $value['idProducto']\n );\n }\n }\n\n $aa = array(\n 'sEcho' => 1,\n 'iTotalRecords' => count($dato),\n 'iTotalDisplayRecords' => 10,\n 'aaData' => $dato\n );\n echo json_encode($aa);\n }", "public function dataProveedoresInicial ($id_prod, $id_prov) {\n\n //Busqueda de todos los paises donde quiere recibir el productor para filtrar los metodos de envio\n $paises_prod = DB::select(DB::raw(\"SELECT id_pais FROM rdj_productores_paises\n WHERE id_productor=? ORDER BY id_pais\"),[$id_prod]);\n\n $prov = []; //Variable donde se almacenan los datos a responder de la solicitud HTTP\n\n //Busqueda de información basica del proveedor\n $query = DB::select(\n DB::raw(\"SELECT pr.id AS idp, pr.nombre AS prov, pa.nombre AS pais FROM \n rdj_paises pa, rdj_proveedores pr WHERE pa.id=pr.id_pais AND pr.id=?\"),\n [$id_prov]);\n\n //Almacenamiento de la info basica en aux\n $prov[\"idp\"] = $query[0]->idp;\n $prov[\"prov\"] = $query[0]->prov;\n $prov[\"pais\"] = $query[0]->pais;\n \n //Busqueda de los metodos de pago del proveedor\n $query = DB::select(\n DB::raw(\"SELECT CASE WHEN pa.tipo='c' THEN 'Cuota única' WHEN pa.tipo='p'\n THEN 'Por cuotas' END AS tipo, pa.num_cuotas AS numc, pa.porcentaje AS porc,\n pa.meses AS meses, pa.id FROM rdj_metodos_pagos pa WHERE pa.id_proveedor=?\"),\n [$prov[\"idp\"]]);\n \n //Almacenamiento de arreglo de metodos de pagos del proveedor\n $prov[\"pagos\"] = $query;\n\n //Para los metodos de envio, creamos un arreglo ya que pueden ser varios\n $prov[\"envios\"] = [];\n foreach($paises_prod as $pais) { //Para cada pais del productor buscamos si hay metodo de envio\n\n $query = DB::select(\n DB::raw(\"SELECT e.duracion, e.precio, e.id AS id_envio, p.id AS id_pais, p.nombre AS pais,\n CASE WHEN e.tipo='t' THEN 'Terrestre' WHEN e.tipo='a' THEN 'Aéreo'\n WHEN e.tipo='m' THEN 'Marítimo' END AS tipo FROM rdj_paises p,\n rdj_metodos_envios e WHERE e.id_pais=? AND e.id_proveedor=?\n AND e.id_pais=p.id ORDER BY e.id_pais\"),[$pais->id_pais, $prov[\"idp\"]]);\n\n //Agregamos al arreglo si conseguimos un metodo de envio para el pais\n //como pueden haber varios metodos de envio con el mismo pais necesitamos\n //hacer otro foreach\n if($query != []) {\n foreach($query as $met) {\n $metodo = [];\n $metodo[\"detalles\"] = [];\n $metodo[\"id_envio\"] = $met->id_envio;\n $metodo[\"id_pais\"] = $met->id_pais;\n $metodo[\"duracion\"] = $met->duracion;\n $metodo[\"precio\"] = $met->precio;\n $metodo[\"pais\"] = $met->pais;\n $metodo[\"tipo\"] = $met->tipo;\n array_push($prov[\"envios\"],$metodo);\n }\n }\n }\n\n //Para los detalles o modificadores de los metodos de envios conseguidos\n for($i = 0; $i <= sizeof($prov[\"envios\"]) - 1; $i++) {\n //Busqueda de los detalles de un metodo de envio\n $query = DB::select(\n DB::raw(\"SELECT d.id, d.nombre AS det, d.mod_precio AS precio, d.mod_duracion AS duracion\n FROM rdj_detalles_metodos_envios d WHERE d.id_envio=? AND d.id_proveedor=?\n AND d.id_pais=?\"),[$prov[\"envios\"][$i][\"id_envio\"], $id_prov, $prov[\"envios\"][$i][\"id_pais\"]]\n );\n //Agregamos al arreglo si conseguimos un detalle de envio para el metodo\n //como pueden haber varios detalles de envio con el mismo metodo necesitamos\n //hacer otro foreach\n if($query != []) {\n foreach($query as $det) {\n $detalle = [];\n $detalle[\"id\"] = $det->id;\n $detalle[\"det\"] = $det->det;\n $detalle[\"precio\"] = $det->precio;\n $detalle[\"duracion\"] = $det->duracion;\n array_push($prov[\"envios\"][$i][\"detalles\"],$detalle);\n }\n } \n }\n\n /* Buscamos todas las esencias del proveedor y las guardamos */\n $prov[\"esencias\"] = $query = DB::select(\n DB::raw(\"SELECT e.cas_ing_esencia AS cas, e.nombre AS ing, CASE WHEN\n e.naturaleza='n' THEN 'natural' WHEN e.naturaleza='s' THEN 'sintetica' END\n AS tipo FROM rdj_ingredientes_esencias e WHERE e.id_proveedor=? \n ORDER BY e.cas_ing_esencia\"), \n [$id_prov]);\n \n /* Buscamos todos los otros ingredientes del proveedor y los guardamos */\n $prov[\"otros\"] = $query = DB::select(\n DB::raw(\"SELECT o.cas_otro_ing AS cas, o.nombre AS ing\n FROM rdj_otros_ingredientes o WHERE o.id_proveedor=? \n ORDER BY o.cas_otro_ing\"), \n [$id_prov]);\n\n /* Proceso que elimina ingredientes contratados exclusivamente de la lista de ingredientes disponibles */\n $ingsExclusivos = DB::select(DB::raw(\"SELECT dc.cas_ing_esencia AS cas_esen, dc.cas_otro_ing AS cas_otro \n FROM rdj_contratos c, rdj_detalles_contratos dc WHERE c.fecha_apertura=dc.fecha_apertura \n AND c.id_proveedor=dc.id_proveedor AND c.id_proveedor=? AND c.exclusivo=true AND c.cancelacion=false\"),[$id_prov]);\n\n $esenFiltradas = [];\n $otrosFiltrados = [];\n\n foreach($prov[\"esencias\"] as $esen) {\n $cond = false;\n foreach($ingsExclusivos as $ing) {\n if($ing->cas_esen != null && $esen->cas == $ing->cas_esen) \n $cond = true;\n }\n if($cond == false) array_push($esenFiltradas, $esen);\n }\n\n foreach($prov[\"otros\"] as $otro) {\n $cond = false;\n foreach($ingsExclusivos as $ing) {\n if($ing->cas_otro != null && $otro->cas == $ing->cas_otro) \n $cond = true;\n }\n if($cond == false) array_push($otrosFiltrados, $otro);\n }\n\n $prov[\"esencias\"] = $esenFiltradas;\n $prov[\"otros\"] = $otrosFiltrados;\n \n /* Buscamos las presentaciones de cada esencia y las guardamos */\n foreach($prov[\"esencias\"] as $esen) {\n $query = DB::select(\n DB::raw(\"SELECT p.id, p.volumen AS vol, p.precio\n FROM rdj_presents_ings_esencias p WHERE p.cas_ing_esencia=?\n ORDER BY p.id\"),\n [$esen->cas]);\n $esen->cas = Controller::stringifyCas($esen->cas);\n $esen->pres = $query;\n }\n \n /* Buscamos las presentaciones de cada otro ing y las guardamos */\n foreach($prov[\"otros\"] as $otro) {\n $query = DB::select(\n DB::raw(\"SELECT p.id, p.volumen AS vol, p.precio\n FROM rdj_present_otros_ings p WHERE p.cas_otro_ing=?\n ORDER BY p.id\"),\n [$otro->cas]);\n $otro->cas = Controller::stringifyCas($otro->cas);\n $otro->pres = $query;\n }\n\n \n //Devolvemos a la interfaz la data necesaria para continuar\n return response([$prov],200);\n }", "function foreachMultipleResult($result,$field,$print){\n $counter = 0 ;\n $data = array();\n foreach($result->result() as $a){\n for($b = 0; $b<count($field);$b++){ /*untuk ngeloop semua variable yang dinginkan*/\n $string = $field[$b];\n $data[$counter][$print[$b]] = $a->$string; /* $data[0][\"nama_mahasiswa\"] = \"joni\"; $data[0][\"jurusan_mahasiswa\"] = \"sistem informasi */\n }\n $counter++;\n }\n return $data;\n }", "function pengguna_rinci($nama_pengguna) {\n $re = array(); //set nilai awal array kosong\n global $conn; //memanggil koneksi\n //melakukan select berdasarkan nama pengguna dan dijoin dengan tabel jenis pengguna sebagai kerangan apakah admin/customer\n $q = $conn->prepare(\"SELECT * FROM pengguna JOIN jenis_pengguna ON jenis_pengguna.id=pengguna.jenis_pengguna WHERE nama_pengguna='$nama_pengguna' AND aktif='1'\");\n $q->execute();\n //mengeset array kosong tadi dengan index 'pengguna', dan diisi data yang telah diselect tadi, tentunya index ke 0 karena tidak mungkin ada data yang sama\n $re['pengguna'] = @$q->fetchAll()[0];\n //select rekening juga berdasarkan nama pengguna dan yang aktif\n $q = $conn->prepare(\"SELECT * FROM rekening WHERE nama_pengguna='$nama_pengguna' AND aktif='1'\");\n $q->execute();\n //menyimpan data rekening dalam array dengan index 'rekening' dan tidak index 0 saja, karena bisa jadi punya lebih dari 1 rekening\n $re['rekening'] = @$q->fetchAll();\n return $re; //mereturn data\n}" ]
[ "0.693015", "0.6741323", "0.6734692", "0.6702981", "0.6696012", "0.65984267", "0.65250266", "0.6514879", "0.64138967", "0.63875115", "0.6387299", "0.6369357", "0.6355248", "0.6349206", "0.6344906", "0.63329136", "0.63289297", "0.63288647", "0.6310994", "0.6304199", "0.6301418", "0.6292963", "0.62427086", "0.62327397", "0.6213707", "0.6206414", "0.6184681", "0.61774725", "0.61763626", "0.61719745", "0.61710924", "0.6164646", "0.6155542", "0.61534125", "0.61444324", "0.61421216", "0.6139581", "0.6133456", "0.6114619", "0.6114619", "0.6113267", "0.61109245", "0.6108794", "0.6108028", "0.6099649", "0.60908437", "0.60897946", "0.6085635", "0.6083952", "0.60782874", "0.60645473", "0.6058784", "0.6055555", "0.60542053", "0.6048109", "0.60331094", "0.60249996", "0.60204554", "0.60164243", "0.60109127", "0.60070336", "0.6005981", "0.59945256", "0.59870154", "0.5984124", "0.59834975", "0.5982928", "0.5979812", "0.59693426", "0.59680885", "0.59680885", "0.5967906", "0.5963024", "0.5961853", "0.59589154", "0.59588605", "0.59540385", "0.5952325", "0.5947614", "0.5947052", "0.59466106", "0.5946094", "0.59446645", "0.5939278", "0.5935639", "0.5933437", "0.5931601", "0.5929909", "0.5929333", "0.592796", "0.5916846", "0.5916846", "0.5916846", "0.5916846", "0.59160215", "0.59136695", "0.5913119", "0.5909964", "0.59081787", "0.588988", "0.5882717" ]
0.0
-1
Get the name of the view.
public function name();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getName()\n {\n return $this->view;\n }", "public function getName()\n {\n return $this->view;\n }", "public function getViewName()\n\t{\n\t\treturn $this->viewName;\n\t}", "public function getName()\n\t{\n\t\tif (empty($this->_name))\n\t\t{\n\t\t\t$classname = get_class($this);\n\t\t\t$viewpos = strpos($classname, 'View');\n\n\t\t\tif ($viewpos === false)\n\t\t\t{\n\t\t\t\tthrow new Exception(JText::_('JLIB_APPLICATION_ERROR_VIEW_GET_NAME'), 500);\n\t\t\t}\n\n\t\t\t$lastPart = substr($classname, $viewpos + 4);\n\t\t\t$pathParts = explode(' ', JStringNormalise::fromCamelCase($lastPart));\n\n\t\t\tif (!empty($pathParts[1]))\n\t\t\t{\n\t\t\t\t$this->_name = strtolower($pathParts[0]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->_name = strtolower($lastPart);\n\t\t\t}\n\t\t}\n\n\t\treturn $this->_name;\n\t}", "public function viewName(): string\n {\n return $this->config['view'];\n }", "protected function viewsName()\n {\n return $this->argument('name');\n }", "protected function getName()\n {\n return $this->slimInstance->router()->getCurrentRoute()->getName();\n }", "public function name()\n {\n if ($name = $this->route->getName()) {\n return $name;\n }\n\n $name = $this->route->getActionName();\n\n if ($name === 'Closure') {\n return null;\n }\n\n $namespace = array_get($this->route->getAction(), 'namespace');\n\n return str_replace($namespace . '\\\\', '', $name);\n }", "public function getViewableName() {\n $class = get_class($this->program);\n $this->program_name = substr($class, (strrpos($class, '\\\\') + 1));\n $viewable_name = $this->program->getViewableName();\n return (is_null($viewable_name)) ? $this->program_name : $viewable_name;\n }", "public function get_qualifed_view_name()\n {\n return $this->qualifiedViewName;\n }", "protected function resolveViewClassName(): string\n {\n return $this->configurationService->getConfigByPath('Signature', 'Mvc.View.DefaultViewClassname');\n }", "protected function getViewObjectName($viewFormat) {\n\t\treturn 'View' . ucfirst($viewFormat);\n\t}", "protected function getViewPrefix()\n {\n if ($this->viewPrefix !== null) {\n return $this->viewPrefix;\n }\n\n return str_plural(snake_case($this->getControllerName()));\n }", "public function getName (){\n \t\t// return view('welcome', compact('me'));\n \n \t\treturn view('welcome')->with('name', $this->name);\n }", "public function getViewSuffix()\n {\n return $this->_viewSuffix;\n }", "protected function getName()\n {\n return $this->getRequest()->args('name') ?: $this->profile->code . '_' . $this->tpl['name'];\n }", "protected function getView()\n {\n $name = str_replace('\\\\', '/', $this->argument('name'));\n\n return collect(explode('/', $name))\n ->map(function ($part) {\n return Str::camel($part);\n })\n ->implode('.');\n }", "protected function getName()\r\n {\r\n return app::values()->page();\r\n }", "public function getViewSuffix()\n {\n return $this->layout->getViewSuffix();\n }", "public function getRouteName();", "protected function getRouteName()\n {\n if (is_null($this->routeName)) {\n $this->routeName = $this->getCurrentCallingControllerName();\n }\n\n return $this->routeName;\n }", "public function getNameForViewBuilder()\n {\n list($plugin, ) = namespaceSplit(get_class($this));\n $plugin = preg_replace('/\\\\\\/', '/', $plugin);\n return $plugin;\n }", "public function getViewClassNameForViewBuilder()\n {\n list($plugin, $theme) = namespaceSplit(get_class($this));\n $plugin = preg_replace('/\\\\\\/', '/', $plugin);\n return $plugin . '.' . $theme;\n }", "public static function name()\n {\n return 'index';\n }", "protected function resolveViewObjectName() {}", "public function name()\n {\n if (isset($this->attributes[self::NAME])) {\n return $this->attributes[self::NAME];\n }\n\n return $this->path();\n }", "public function getName()\n {\n return $this->action['name'] ?? null;\n }", "protected function GetRenderViewName()\n {\n return $this->fieldRenderViewName;\n }", "public function getActionNm()\r\n {\r\n\t\t$tabInfo = $this->getPathInfo();\r\n\t\treturn $tabInfo[2];\r\n }", "function getRouteName();", "protected function getView(): string\n {\n $view = $this->option('markdown');\n\n if (! $view) {\n $name = str_replace('\\\\', '/', $this->argument('name'));\n\n $view = 'mail.'.collect(explode('/', $name))\n ->map(fn ($part) => Str::kebab($part))\n ->implode('.');\n }\n\n return $view;\n }", "public static function name()\n {\n $path = explode('\\\\', get_called_class());\n $controller_name = array_pop($path);\n return trim(str_replace(\"Controller\", \"\", $controller_name));\n }", "public function getName()\n {\n return Craft::t('Controller Action');\n }", "public function viewName($type = null): string\n {\n if (Arr::isAssoc($this->getfieldsetTypes())) {\n $type = $this->getfieldsetTypes()[$type];\n }\n\n $type = $type ?? $this->getDefaultTypes()[0];\n\n return $this->handle.'.'.$type;\n }", "public function getActionName()\n {\n return isset($this->action['controller']) ? $this->action['controller'] : 'Closure';\n }", "public function getViewType(): string\n {\n return $this->viewType;\n }", "public function getViewNameFromUrlSegments($segments) {\n\t\t//TODO: See if the out-commented line below works right\n\n\t\t// return KenedoView::getViewNameFromClass(get_class($this->getDefaultView()));\n\t\treturn self::getControllerNameFromClass(get_class($this));\n\t}", "public function render()\n {\n return $this->getTemplateName();\n }", "public function editViewName() {\n return ContentServiceProvider::NAME.\"::admin.edit\";\n }", "protected function resolveViewTemplateName(): string\n {\n $controllerName = ltrim($this->request->getControllerName(), '\\\\');\n $namespaceParts = explode('\\\\', $controllerName);\n $controllerClassName = array_pop($namespaceParts);\n\n // Get rid of module name\n array_shift($namespaceParts);\n\n if (strtolower($namespaceParts[0]) == 'mvc') {\n array_shift($namespaceParts);\n }\n\n if (strtolower($namespaceParts[0]) == 'controller') {\n array_shift($namespaceParts);\n }\n\n $controllerClassName = str_replace('Controller', '', $controllerClassName);\n\n return\n $this->getTemplateDir() . implode(DIRECTORY_SEPARATOR, [\n '',\n 'Templates',\n implode('\\\\', $namespaceParts),\n ucfirst($controllerClassName),\n ucfirst($this->request->getControllerActionName())\n ]) . '.phtml';\n }", "public function name()\n {\n return $this->getName();\n }", "public function name()\n {\n return $this->getName();\n }", "public function getInspectTemplateName()\n {\n return $this->inspect_template_name;\n }", "public function getRouteName()\n {\n return $this->routeName;\n }", "public function getRouteName()\n {\n return $this->routeName;\n }", "public function forTemplate() {\n\t\treturn $this->ActionName;\n\t}", "public function getDefaultViewName()\n\t{\n\t\treturn 'Success';\n\t}", "public function getViewName($pageType) {\n\t\tswitch ($pageType) {\n\t\t\tcase \"hub\" :\n\t\t\t\t// contributors.blade.php\n\t\t\t\t$output = 'contributors';\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $output;\n\t}", "public function name() {\n\t\t// @version 1.2.0 Use filename then fallback to path\n\t\t$path = $this->data('name') ?: $this->path();\n\n\t\treturn pathinfo($path, PATHINFO_FILENAME);\n\t}", "public function name() {\n\t\treturn $this->name;\n\t}", "public function view()\n {\n return $this->view;\n }", "public function view()\n {\n return $this->view;\n }", "public function name() : string\n {\n return call_user_func([get_called_class(), 'resolveName']);\n }", "public function getName(): string\n {\n if ($this->_name === null) {\n $endpoint = namespaceSplit(static::class);\n $endpoint = substr(end($endpoint), 0, -8);\n\n $inflectMethod = $this->getInflectionMethod();\n $this->_name = Inflector::{$inflectMethod}($endpoint);\n }\n\n return $this->_name;\n }", "protected function get_view_uri() {\n\t\treturn self::VIEW_URI;\n\t}", "protected function getStoreViewNameComment()\n {\n return '<b>[store_view_name]</b> - ' . __('output a current store view name') . ';';\n }", "public function getName()\n {\n return isset($this->action['as']) ? $this->action['as'] : null;\n }", "protected function getName()\n {\n return $this->arguments['name'];\n }", "private function getKey(string $view): string\n {\n return str_replace(\n \".blade.php\",\n \"\",\n basename($view)\n );\n }", "function get_name() {\n\t\treturn $this->get_name_from_vtec();\t\n\t}", "public function getName()\n {\n return $this->_pageName;\n }", "public function getName()\n {\n return $this->__call(__FUNCTION__, func_get_args());\n }", "public function getName()\n\t{\n\t\treturn $this->name ?: class_basename($this);\n\t}", "protected function getViewPath()\n {\n $name = str_replace('\\\\', '/', $this->argument('name'));\n\n return collect(explode('/', $name))\n ->map(function ($part) {\n return Str::camel($part);\n })\n ->implode('/');\n }", "public function currentRouteName()\n {\n return $this->current() ? $this->current()->getName() : null;\n }", "public function getName()\n {\n return $this->get(self::_NAME);\n }", "public function getName()\n {\n return $this->get(self::_NAME);\n }", "public function getName()\n {\n return $this->get(self::_NAME);\n }", "public function getName()\n {\n return $this->get(self::_NAME);\n }", "public function getName()\n {\n return $this->get(self::_NAME);\n }", "public function getName()\n {\n return $this->get(self::_NAME);\n }", "public function getName()\n {\n return $this->get(self::_NAME);\n }", "protected function _getViewFileName($name = null) {\n\t\t$name = $name ?: $this->view;\n\n\t\t$this->subDir = $this->apiFormat;\n\n\t\ttry {\n\t\t\treturn parent::_getViewFileName($name);\n\t\t} catch (MissingViewException $exception) {\n\t\t}\n\n\t\ttry {\n\t\t\treturn parent::_getViewFileName(DS . $this->apiFormat . DS . $name);\n\t\t} catch (MissingViewException $e) {\n\t\t\tif (isset($this->viewVars['success']) || isset($this->viewVars['data'])) {\n\t\t\t\treturn parent::_getViewFileName(DS . $this->apiFormat . DS . 'fallback_template');\n\t\t\t}\n\t\t\tthrow $e;\n\t\t}\n\t}", "public function getName() : string\n {\n return $this->url;\n }", "public function getName () {\n\treturn $this->get('name');\n }", "public function getName() {\n\n list(,$name) = URLUtil::splitPath($this->principalInfo['uri']);\n return $name;\n\n }", "public function name() {\n\t\treturn basename($this->path);\n\t}", "private function get_view( $view ) {\n\t\tif ( 'navigation' === $view ) {\n\t\t\t$view = 'no-navigation';\n\t\t}\n\n\t\treturn rank_math()->admin_dir() . \"wizard/views/{$view}.php\";\n\t}", "public function get_resource_name();", "public function getName()\n\t{\n\t\treturn $this->actionName;\n\t}", "public function name()\n\t{\n\t\treturn $this->name;\n\t}", "public function name()\n\t{\n\t\treturn $this->name;\n\t}", "public function name()\n\t{\n\t\treturn $this->name;\n\t}", "abstract public function getRenderName();", "public function getRouteKeyName()\n {\n return 'name';\n }", "public function getRouteKeyName()\n {\n return 'name';\n }", "public function getRouteKeyName()\n {\n return 'name';\n }", "public function name()\n\t{\n\t\treturn $this->_name;\n\t}", "public function getName() {\n\t\treturn NodePaths::getNodeNameFromPath($this->path);\n\t}", "public function getName()\n {\n return $this->__get(\"name\");\n }", "public function getName()\n {\n return $this->__get(\"name\");\n }", "public function getControllerName() {}", "public function getMethodName() {\r\n\t\treturn($this->method_name);\r\n\t}", "public function get_name();", "public function get_name();", "public function get_name();", "public function view()\n {\n return $this->entry->getPath();\n }", "public function getName() {\n\t\treturn $this->current_name;\n\t}", "public function getViewHelperClassName() {}", "public function name() {\n return $this->name;\n }", "public static function viewName(string $project, string $location, string $view): string\n {\n return self::getPathTemplate('view')->render([\n 'project' => $project,\n 'location' => $location,\n 'view' => $view,\n ]);\n }" ]
[ "0.8987239", "0.8987239", "0.8656853", "0.8272492", "0.82023036", "0.79977685", "0.741791", "0.7322777", "0.72701627", "0.7266851", "0.71150583", "0.70502067", "0.7024975", "0.6968983", "0.69659656", "0.69382405", "0.6876908", "0.6753196", "0.6748113", "0.67431945", "0.670065", "0.670025", "0.6695365", "0.66512614", "0.6635866", "0.6621339", "0.66175026", "0.6611972", "0.6579088", "0.65739566", "0.6573559", "0.65643984", "0.65519387", "0.6547199", "0.6512611", "0.65073466", "0.6506854", "0.65064", "0.6502857", "0.649543", "0.6482236", "0.6482236", "0.6472456", "0.6459742", "0.6459742", "0.64582276", "0.6457536", "0.64558583", "0.6442493", "0.64421135", "0.6433203", "0.6433203", "0.64278954", "0.6418315", "0.641827", "0.6413214", "0.6399889", "0.63986564", "0.6386816", "0.6363283", "0.6363035", "0.63597816", "0.6354439", "0.6352503", "0.63477594", "0.63453895", "0.63453895", "0.63453895", "0.63453895", "0.63453895", "0.63453895", "0.63453895", "0.63453746", "0.63443106", "0.6326526", "0.6326346", "0.63262373", "0.63249034", "0.63234055", "0.63216025", "0.6319906", "0.6319906", "0.6319906", "0.6316789", "0.6314763", "0.6314763", "0.6314763", "0.63023704", "0.6300117", "0.6299837", "0.6299837", "0.629958", "0.629734", "0.6297326", "0.6297326", "0.6297326", "0.6297268", "0.62949383", "0.6281497", "0.62755805", "0.62696236" ]
0.0
-1
Add a piece of data to the view.
public function with($key, $value = null);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addData($viewData) {\n $this->viewData = array_merge($this->viewData, $viewData);\n }", "public function addData()\n {\n $data['city'] = $this->admin_m->getCities();\n $data['deptt'] = $this->admin_m->getDeptt();\n $data['pName'] = $this->admin_m->getPapers();\n $data['cat'] = $this->admin_m->getCategories();\n\n $data['content'] = 'admin/admin_v';\n $this->load->view('components/template', $data);\n }", "public function add_data()\n {\n $this->load->helper('url');\n $this->load->view('add_data_view');\n }", "public function addDataView($data)\n {\n $this->vars = array_merge($this->vars, $data);\n }", "public function add_data($data)\n {\n }", "function add()\n\t{\n\t\t$this->_updatedata();\n\t}", "public function addView($name, $viewData = [], $data = [])\n\t{\n\t\t$this->viewsData[] = [\n\t\t\t'start' => isset($data['time']) ? $data['time'] : null,\n\t\t\t'end' => isset($data['time'], $data['duration']) ? $data['time'] + $data['duration'] / 1000 : null,\n\t\t\t'duration' => isset($data['duration']) ? $data['duration'] : null,\n\t\t\t'description' => 'Rendering a view',\n\t\t\t'data' => [\n\t\t\t\t'name' => $name,\n\t\t\t\t'data' => (new Serializer)->normalize($viewData)\n\t\t\t]\n\t\t];\n\t}", "public function add($data)\n {\n }", "public function add_record()\n {\n $data['main_content'] = $this->type.'/'.$this->viewname.'/add';\n\t $this->load->view($this->type.'/assets/template',$data);\n }", "public function addData(string $data);", "public function add()\n {\n $data = [\n 'property' => [\n 'template' => 'extracurricular_add',\n 'title' => 'Tambah Ekstrakurikuler',\n 'menu' => $this->menu->read(),\n ],\n 'data' => [],\n ];\n\n $this->load->view('template', $data);\n }", "public function add(){\n\t\t$this->load->view('top');\n\t\t$this->load->view(\"timHPS/timHps_add\",$data);\n\t\t$this->load->view('bottom');\n\t}", "public function add()\n {\n //renderView('add');\n }", "public function add_data($data)\n {\n $this->builder->insert($data);\n }", "public function AddData ($key, $value) {\n\t\t$this->data[$key] = $value;\t\t\t\t\n\t}", "public function add($data) {\n global $DB;\n\n $this->set_view($data);\n\n if (!$viewid = $DB->insert_record('dataform_views', $this->data)) {\n return false;\n }\n\n $this->id = $viewid;\n\n // Update item id of files area.\n $fs = get_file_storage();\n $contextid = $this->df->context->id;\n $component = $this->component;\n foreach ($this::get_file_areas() as $filearea) {\n $files = $fs->get_area_files($contextid, $component, $filearea, 0);\n if (count($files) > 1) {\n foreach ($files as $file) {\n $filerec = new \\stdClass;\n $filerec->itemid = $this->id;\n $fs->create_file_from_storedfile($filerec, $file);\n }\n }\n $fs->delete_area_files($contextid, $component, $filearea, 0);\n }\n\n // Trigger an event for creating this view.\n $event = \\mod_dataform\\event\\view_created::create($this->default_event_params);\n $event->add_record_snapshot('dataform_views', $this->data);\n $event->trigger();\n\n return $this->id;\n }", "public function addView()\n {\n return $this->render('Add');\n }", "public function append($data)\n {\n $this->data .= $data;\n }", "public function addData($data)\n {\n $data = $this->hydrateIfJsonToArray($data);\n $this->data[] = $data;\n }", "function add($data){\n if(array_key_exists($data['id'], $this->fields)){\n exit(\"Field with ID: '\".$data['id'].\"' already exists.\");\n }\n if(!isset($data['validate'])){\n $data['validate'] = false;\n }\n if(!isset($data['inline'])){\n $data['inline'] = null;\n }\n if(!isset($data['value'])){\n $data['value'] = null;\n }\n if(!isset($data['readonly'])){\n $data['readonly'] = false;\n }\n\n $this->fields[$data['id']] = $data;\n }", "public function addContentData()\n\t\t{\n\t\t\t_is_logged_in();\n\n\t\t\t$data = array();\n\n\t\t\tif ($_POST) {\n\n\t\t\t\tforeach ($this->input->post() as $key => $value) {\n\n\t\t\t\t\tif ($key == 'section_name') {\n\t\t\t\t\t\t$data['section_slug'] = url_title(convert_accented_characters($value));\n\t\t\t\t\t}\n\t\t\t\t\t$data[$key] = $value;\n\t\t\t\t}\n\n\t\t\t\t$data['language'] = $this->session->userdata('language');\n\t\t\t}\n\n\t\t\t// Send data\n\t\t\t$query = $this->co_pages_model->add_section($data);\n\n\t\t\tif ($query > 0) {\n\t\t\t\tredirect('admin/co_pages/add_content?action=success');\n\t\t\t} else {\n\t\t\t\tredirect('admin/co_pages/add_content?action=error');\n\t\t\t}\n\n\t\t}", "public function add()\n {\n $this->view->state = $this->request->has('id') ? 'Edit Row' : 'Add Row';\n return $this->view('add');\n }", "public function add() \r\n\t{\r\n\t\t$data['header']['title'] = 'Add a new country';\r\n\t\t$data['footer']['scripts']['homescript.js'] = 'home';\r\n\t\t$data['view_name'] = 'country/country_add_view';\r\n\t\t$data['view_data'] = '';\r\n\t\t$this->load->view('country/page_view', $data);\r\n\t}", "public function add() {\r\n\t\t$model = $this->getModel('languages');\r\n\t\t$model->add();\r\n\t\t\r\n\t\t$this->view = $this->getView(\"languages\");\r\n\t\t$this->view->setModel($model, true);\r\n\t\t$this->view->display();\r\n\t}", "function addComponent($data);", "public function add($data)\n {\n if (is_array($data[0])) {\n return array_map(function ($val) use ($data) {\n return [\"view\" => $val, \"content\" => $data[1], \"region\" => $data[2]];\n }, $data[0]);\n }\n // if multiple content (multideminsional) create indexes for them\n if (array_key_exists(0, $data[1])) {\n return array_map(function ($val) use ($data) {\n return [\"view\" => $data[0], \"content\" => $val, \"region\" => $data[2]];\n }, $data[1]);\n }\n return [[\"view\" => $data[0], \"content\" => $data[1], \"region\" => $data[2]]];\n }", "public function append($data);", "public function addView()\n {\n $translate = $this->getTranslate('CodeAddView');\n $this->setParam('translate', $translate);\n\n $codeModel = new codeModel();\n\n $statusList = $codeModel->getStatusList();\n $this->setParam('statusList', $statusList);\n\n $moldRefSpecs = $codeModel->getRefSpecsPossible('R1');\n $this->setParam('refSpecs', $moldRefSpecs);\n\n // traduction des statuts\n $translateStatusList = $this->getTranslate('Status_List');\n $this->setParam('translateStatusList', $translateStatusList);\n\n\n // Récupération de la liste des données avec leurs descriptions\n $dataModel = new dataModel();\n\n $dataList = $dataModel->getDataList('Code_App');\n $this->setParam('dataList', $dataList);\n\n $dataCategoryList = $dataModel->getDataCategoryListUser('Code_App');\n $this->setParam('dataCategoryList', $dataCategoryList);\n\n // traduction des données et des catégories\n $translateData = $this->getTranslate('Data_List');\n $this->setParam('translateData', $translateData);\n $translateDataCategory = $this->getTranslate('Data_Category_List');\n $this->setParam('translateDataCategory', $translateDataCategory);\n\n\n $this->setParam('titlePage', $this->getVerifyTranslate($translate, 'pageTitle'));\n $this->setView('codeAdd');\n $this->setApp('Code_App');\n\n\n // Vérification des droits utilisateurs\n if (frontController::haveRight('add', 'Code_App'))\n $this->showView();\n else\n header('Location: /code');\n }", "public function add(): void\n {\n $exerciseforms = $this->exerciseformBLL->getAllExcerciseforms();\n\n $data = [\n 'exerciseforms' => $exerciseforms,\n 'name' => '',\n 'description' => '',\n 'repetitions' => '',\n 'sets' => ''\n ];\n\n $this->view('exercises/add', $data);\n }", "public function add()\n\t{\n\n\t\t$this->data['_pageview'] = $this->data[\"_directory\"] . \"edit\";\n\t\t$this->data['option'] \t\t= \"add\";\n\n\t\treturn view($this->constants[\"ADMINCMS_TEMPLATE_VIEW\"], $this->data);\n\t}", "public function add() {\r\n $this->api->loadView('contact-form',\r\n array(\r\n 'row' => $this->model\r\n ));\r\n }", "protected function addToList($data)\n {\n return \\XLite\\Core\\Database::getRepo('\\XLite\\Model\\ViewList')->insert(new \\XLite\\Model\\ViewList($data));\n }", "public function add()\n\t{\n\t\t$this->template('crud/add');\t\n\t}", "public function addElement($data)\n {\n return $this->save($data);\n }", "public function p_add() {\n\t\t\n\t\t$_POST['user_id'] = $this->user->user_id;\n\t\t$_POST['created'] = Time::now();\n\t\t$_POST['modified'] = Time::now();\n\t\t\n\t\tDB::instance(DB_NAME)->insert('posts',$_POST);\n\t\t\n\t\t//$view = new View('v_posts_p_add');\n\t\t\n\t\t//$view->created = Time::display(Time::now());\n\t\t\n\t\techo $view;\n\t\t\t\t\t\t\n\t\t\t\t\n\t}", "public function addData(array $data)\n {\n $this->data->setData($data);\n }", "final public function add_data($data = array())\n\t{\n\t\t$data = !is_array($data) ? (array)$data: $data;\n\t\t$this->data = array_merge($this->data, $data);\n\t}", "public function add(){\n $outData['script']= CONTROLLER_NAME.\"/add\";\n $this->assign('output',$outData);\n $this->display();\n }", "public function addView()\n {\n $nbViews = $this->getData('nb_views') + 1;\n $this->save(array(\n 'nb_views' => $nbViews,\n ));\n\n return $this;\n }", "public function add(){\n $this->edit();\n }", "public function addAction() {\n \t$dataType = $this->getInput('dataType');\n \tif (!in_array($dataType,$this->DATATYPE)) {\n \t exit(\"参数错误\");\n \t}\n \t$this->assign('dataType', $dataType);\n $this->assign('dataTypes', $this->DATATYPE);\n }", "public function add_to_foot($data)\n\t{\n\t\t$this->footer_item[] = $data;\n\t}", "public function addData($name, $value) {\n\t\t$this->data[$name] = $value;\n\t}", "public function addData ($value, $key = false) : void {\n\t\tif ($key !== false) {\n\t\t\t$this->data [$key] = $value;\n\t\t\treturn;\n\t\t}\n\t\t$this->data [] = $value;\n\t}", "public function view_adding_instruction(){\n\t\t$headerData = null;\n\t\t$sidebarData = null;\n\t\t$page = 'admin/add_instructions';\n\t\t$mainData = array(\n\t\t\t'pagetitle'=> 'Add Instructions',\n\t\t\t'courselist' => $this->setting_model->Get_All('course'),\n\n\t\t);\n\t\t$footerData = null;\n\n\t\t$this->template($headerData, $sidebarData, $page, $mainData, $footerData);\n\t}", "public function setData($data)\n\t{\n\t\t$this->_pageData['data'] = $data;\n\t}", "public function add()\n {\n // récupérer les catégories pour l'affichage du <select>\n $categoryList = Category::findAll();\n // récupérer les types de produits pour l'affichage du <select>\n $typeList = Type::findAll();\n // récupérer les marques pour l'affichage du <select>\n $brandList = Brand::findAll();\n\n // compact est l'inverse d'extract, on s'en sert pour générer un array à partir de variables :\n // on fournit les noms (attention, sous forme de string) des variables à ajouter à l'array \n // les clés de ces valeurs seront les noms des variables\n $viewVars = compact('categoryList', 'typeList', 'brandList');\n $this->show('product/add', $viewVars);\n // équivaut à :\n // $this->show('product/add', [\n // 'categoryList' => $categoryList,\n // 'typeList' => $typeList,\n // 'brandList' => $brandList\n // ]);\n }", "public function Add_Note($data) {\n // Populate the entry data\n $this->store_note = array(\n 'uuid' => isset($data['uuid']) ? $data['uuid'] : uniqid(),\n 'entry_uuid' => $data['entry_uuid'],\n 'form_uuid' => $data['form_uuid'],\n 'note_data' => $data['note_data'],\n 'time_created' => isset($data['time_created']) ? $data['time_created'] : time(),\n 'time_modified' => isset($data['time_modified']) ? $data['time_modified'] : time(),\n 'date_created' => isset($data['date_created']) ? $data['date_created'] : date(\"Y-m-d H:i:s\"),\n 'date_modifed' => isset($data['date_modifed']) ? $data['date_modifed'] : date(\"Y-m-d H:i:s\"),\n );\n // Return for chaining\n return $this;\n }", "public function setViewData($data)\n {\n $this->__viewData = $data;\n }", "public function addAction()\n {\n $this->templatelang->load($this->_controller.'.'.$this->_action);\n\n // Rendering view page\n $this->_view();\n }", "public function get_add(){\n return View::make('stance.add')->with('title', 'Submit a Stance')->with('subtitle', 'Try to make your views official party Stances');;\n }", "private function add_data(&$data)\n\t{\n\t\t$params = [\n\t\t\t'payment_compropago_mode',\n\t\t\t'payment_compropago_publickey',\n\t\t\t'payment_compropago_privatekey',\n\t\t\t'payment_compropago_spei_status',\n\t\t\t'payment_compropago_spei_title',\n\t\t\t'payment_compropago_spei_sort_order'\n\t\t];\n\t\tforeach($params as $param)\n\t\t{\n\t\t\t$data[$param] = isset($this->request->post[$param])\n\t\t\t\t? $this->request->post[$param]\n\t\t\t\t: $this->config->get($param);\n\t\t}\n\n\t\t$data['payment_compropago_spei_title'] = empty($data['payment_compropago_spei_title'])\n\t\t\t? $this->language->get('entry_default_spei_title')\n\t\t\t: $data['payment_compropago_spei_title'];\n\n\t\t$data['payment_compropago_spei_sort_order'] = empty($data['payment_compropago_spei_sort_order'])\n\t\t\t? 1\n\t\t\t: $data['payment_compropago_spei_sort_order'];\n\t}", "public function additional(array $data);", "public function addData($data)\n {\n DB::table('tbl_laporankeluar')->insert($data);\n }", "public function add($data)\n {\n // this method can be overloaded\n foreach (func_get_args() as $data) {\n // redefine var\n $data = (string) $data;\n\n // load data\n $value = $this->load($data);\n $key = ($data != $value) ? $data : 0;\n\n // initialize key\n if(!array_key_exists($key, $this->data)) $this->data[$key] = '';\n\n // store data\n $this->data[$key] .= $value;\n }\n }", "public function add() {\r\n if(isset($this->data) && isset($this->data['Product'])) {\r\n $product = $this->Product->save($this->data);\r\n $this->set('response', array('Products' => $this->Product->findByProductid($product['Product']['ProductID'])));\r\n $this->Links['self'] = Router::url(array('controller' => $this->name, 'action' => 'view', $product['Product']['ProductID']), true);\r\n } else {\r\n $this->Links['self'] = Router::url(array('controller' => $this->name, 'action' => 'index'), true);\r\n }\r\n }", "public function addDataElement($value)\n {\n $this->dataElements[] = $value;\n }", "public function add( $data, $shard = NULL );", "public function add($data)\n {\n $d['mimetype'] = $data['newMimetype'];\n $d['description'] = $data['description'];\n \n return $this->getDbTable()->insert($d);\n }", "function add($name, $data) {\n $this->data[$name] = $data;\n return $data;\n }", "function append($data) {}", "protected function add(){\n\t\tif(!isset($_SESSION['is_logged_in'])){\n\t\t\theader('Location: '.ROOT_URL. 'pages/1');\n\t\t}\n\t\t$viewmodel = new ShareModel();\n\n\t\t$this->returnView($viewmodel->add(), true);\n\t}", "public function addData($name, $value)\n\t{\n\t\t$this->data->addKey($name, $value);\n\t}", "public function extendData() {\n }", "function acf_append_data($name, $data)\n{\n}", "function additem()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $this->global['pageTitle'] = '新增轮播图';\n $this->global['pageName'] = 'carousel_add';\n $data = '';\n\n $this->loadViews(\"carousel_add\", $this->global, $data, NULL);\n }\n }", "public function setData($data);", "public function setData($data);", "public function setData($data);", "public function setData($data);", "public function setData($data);", "public function renderAdd()\r\n\t{\r\n\t\t$this['itemForm']['save']->caption = 'Přidat';\r\n $this->template->titul = self::TITUL_ADD;\r\n\t\t$this->template->is_addon = TRUE;\r\n\r\n\t}", "public function add(array $data)\n {\n $this->data = array_merge($this->data, $data);\n }", "public function add() {\n\t\n\t\t# Make sure user is logged in if they want to use anything in this controller\n\t\tif(!$this->user) {\n\t\t\tRouter::redirect(\"/index/unauthorized\");\n\t\t}\n\t\t\n\t\t# Setup view\n\t\t$this->template->content = View::instance('v_teachers_add');\n\n\t\t$this->template->title = \"Add Teacher\";\n\n\t\t$client_files_head = array(\"/css/teachers_add.css\");\n\t\t$this->template->client_files_head = Utils::load_client_files($client_files_head);\n\n\t\t#$client_files_body = array(\"/js/ElementValidation.js\", \"/js/shout_out_utils.js\");\n\t\t#$this->template->client_files_body = Utils::load_client_files($client_files_body);\n\n\t\t# Render template\n\t\techo $this->template;\n\t\t\n\t}", "public function renderData();", "public function add()\n {\n $item = new stdClass();\n $item->item_id = null;\n $item->barcode = null;\n $item->price = null;\n $item->stock = null;\n $item->name = null;\n $item->category_id = null;\n $query_category = $this->categorys_m->get();\n $query_unit = $this->units_m->get();\n $unit[null] = '-Pilih-';\n foreach ($query_unit->result() as $u) {\n\n $unit[$u->unit_id] = $u->name;\n };\n $data = [\n 'page' => 'add',\n 'row' => $item,\n 'category' => $query_category,\n 'unit' => $unit,\n 'selectedunit' => null\n ];\n $this->template->load('template', 'product/item/item_add', $data);\n }", "public function addSectionData()\n\t\t{\n\t\t\t_is_logged_in();\n\n\t\t\t$data = array();\n\n\t\t\tif ($_POST) {\n\n\t\t\t\tforeach ($this->input->post() as $key => $value) {\n\n\t\t\t\t\tif ($key == 'section_name') {\n\t\t\t\t\t\t$data['section_slug'] = url_title(convert_accented_characters($value));\n\t\t\t\t\t}\n\t\t\t\t\t$data[$key] = $value;\n\t\t\t\t}\n\n\t\t\t\t$data['language'] = $this->session->userdata('language');\n\t\t\t}\n\n\t\t\t// Send data\n\t\t\t$query = $this->co_pages_model->add_section($data);\n\n\t\t\tif ($query > 0) {\n\t\t\t\tredirect('admin/co_pages/add_section?action=success');\n\t\t\t} else {\n\t\t\t\tredirect('admin/co_pages/add_section?action=error');\n\t\t\t}\n\n\t\t}", "public function addContentData($key, $value)\n\t{\n if(empty($this->_pageData['data']['content'])) {\n $this->_pageData['data']['content'] = array();\n }\n // If we have a scalar value setup then just return false(maybe throw an exception in future)\n if(!is_array($this->_pageData['data']['content'])) {\n return false;\n }\n $this->_pageData['data']['content'][$key] = $value;\n return $this;\n\t}", "public function addData(array $data, $templates = null);", "public function addActivity($data);", "public function add() {\n\t\t$entry = $this->getEntryToAdd('clov_expense');\n\t\t\n\t\t// Default to the logged-in user.\n\t\t$loggedInUser = new User;\n\t\t$entry->setAttribute('clov_expense_payer', $loggedInUser->getUserID());\n\t\t\n\t\t// If the user got here from a project page, pre-fill the project \n\t\t// attribute.\n\t\tLoader::helper('clov_url', 'clov');\n\t\tif($project = ClovUrlHelper::loadReferrerPage('clov_project')) {\n\t\t\t$entry->setAttribute('clov_expense_project', $project->getCollectionID());\n\t\t}\n\t\t\n\t\t$this->set('entry', $entry);\n\t\t$this->set('showSaveDraft', true);\n\t\t$this->render('clov/default/add');\n\t}", "protected function add() {\n\t}", "public function actionAdd()\n\t{\n\t\t$this->render('add');\n\t}", "public function add()\n {\n $category = new stdClass();\n $category->category_id = null;\n $category->name = null;\n $data = [\n 'page' => 'add',\n 'row' => $category\n ];\n $this->template->load('template', 'product/category/category_add', $data);\n }", "public function add()\n\t{\n\t\t$fake_id = $this->_get_id_cur();\n\t\t$form = array();\n\t\t$form['view'] = 'form';\n\t\t$form['validation']['params'] = $this->_get_params();\n\t\t$form['submit'] = function()use ($fake_id)\n\t\t{\n\t\t\t$data = $this->_get_inputs();\n\t\t\t$data['sort_order'] = $this->_model()->get_total() + 1;\n\t\t\t$id = 0;\n\t\t\t$this->_model()->create($data,$id);\n\t\t\t// Cap nhat lai table_id table file\n\t\t\tmodel('file')->update_table_id_of_mod($this->_get_mod(), $fake_id, $id);\n\t\t\tfake_id_del($this->_get_mod());\n\n\t\t\tset_message(lang('notice_add_success'));\n\t\t\t\n\t\t\treturn admin_url($this->_get_mod());\n\t\t};\n\t\t$form['form'] = function() use ($fake_id)\n\t\t{\n\t\t\t$this->_create_view_data($fake_id);\n\n\t\t\t$this->_display('form');\n\t\t};\n\t\t$this->_form($form);\n\t}", "public function add(){\n\t\t\t$formAction = \"index.php?area=backend&controller=news&action=do_add\";\n\t\t\t//xuat du lieu ra view qua ham renderHTML\n\t\t\t$this->renderHTML(\"views/backend/add_edit_news.php\",array(\"formAction\"=>$formAction));\n\t\t}", "public function addData( \\Aimeos\\MW\\View\\Iface $view, array &$tags = [], &$expire = null )\n\t{\n\t\tforeach( $this->getSubClients() as $name => $subclient ) {\n\t\t\t$view = $subclient->addData( $view, $tags, $expire );\n\t\t}\n\n\t\treturn $view;\n\t}", "private function addData($data)\n {\n if(!is_array($data))\n\t\t\tthrow new Exception(\"Could not load a non-array data!\");\n\t\tif(!isset ($data['id']))\n\t\t\tthrow new Exception(\"Every array of data needs an 'id'!\");\n\t\tif(!isset ($data['data']))\n\t\t\tthrow new Exception(\"Loaded array needs an element 'data'!\");\n\n\t\t$this->_data[]=$data;\n }", "private function includeWithData($path, $data) {\n\t\t$v = new View($path, $data);\n\t\t$v->render();\n\t}", "function pushData($key, $data);", "public function add()\n {\n if($this->Auth->user('level') != \"Officer\" && $this->Auth->user('level') != \"Admin\")\n $this->redirect(\n array('controller' => 'Users', 'action' => 'profilehub/' . $this->Auth->user('id')));\n \n if($this->request->is('post'))\n {\n $this->Event->create();\n \n if($this->Event->save($this->request->data))\n {\n $this->redirect('announcements');\n }\n }\n \n $this->loadModel('User');\n $users = $this->User->find('all');\n\n $this->set('user', $users);\n \n $this->layout = 'hero-ish';\n $this->Session->write('Page', 'Hub');\n }", "public function add_instance($data) {\n\n\n\n }", "function Add($name, $value)\r\n\t{\r\n\t\tif (is_array($this->Data))\r\n\t\t{\r\n\t\t\t$this->Data[$name] = $value;\t\r\n\t\t}\t\r\n\t\telse if (is_object($this->Data))\r\n\t\t{\r\n\t\t\t$this->Data->$name = $value;\t\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\ttrigger_error(\"A DataRow of base type, cannot have fields added.\",E_USER_ERROR);\t\r\n\t\t}\r\n\t\t\r\n\t}", "public function addData(array $arr);", "public static function setData($data) {}", "public function setData($data) { \n $this->data = $data; \n }", "function add($type,$data){\n\t// PARAM $type : type of data, as above\n\t// $data : data to add\n\n\t\tif (!is_array($this->$type)) { die(\"Not a valid data type\"); }\n\t\t$this->$type[] = $data;\n\t}", "public function data($data){\n $this->_options['data'] = $data;\n return $this;\n }", "public function showAdd()\n {\n return View::make('honeys.add');\n }", "function addEntry($newentry) {\n\t\t$this->data[] = $newentry;\n\t}", "function add() \n {\n // on the action being rendered\n $this->viewData['navigationPath'] = $this->getNavigationPath('users');\n \n // Render the action with template\n $this->renderWithTemplate('users/add', 'AdminPageBaseTemplate');\n }" ]
[ "0.71786714", "0.7164205", "0.6650918", "0.66379297", "0.6631713", "0.6624757", "0.6419889", "0.6400608", "0.62962043", "0.6176247", "0.61150414", "0.6073496", "0.6057999", "0.6032058", "0.59849364", "0.59548515", "0.59343255", "0.5889853", "0.58828974", "0.58453643", "0.584109", "0.5775732", "0.5763808", "0.5754364", "0.5753866", "0.5741206", "0.570326", "0.5696958", "0.5694749", "0.5694727", "0.568898", "0.56851643", "0.5673951", "0.5667686", "0.5657486", "0.56189245", "0.56186384", "0.56120723", "0.5611207", "0.5603158", "0.55807436", "0.5572126", "0.55583304", "0.5556233", "0.5549105", "0.5534948", "0.5532481", "0.55205226", "0.55200964", "0.5512239", "0.5510801", "0.5508258", "0.55060995", "0.5504555", "0.54990405", "0.548563", "0.54782546", "0.5475086", "0.5474608", "0.5472514", "0.5470474", "0.5465132", "0.5458392", "0.545623", "0.5444293", "0.5442886", "0.54384035", "0.54384035", "0.54384035", "0.54384035", "0.54384035", "0.5433099", "0.5431896", "0.54251456", "0.54188687", "0.5411786", "0.54089105", "0.54066014", "0.53895795", "0.53756684", "0.5368571", "0.53669244", "0.53599054", "0.53578275", "0.5355562", "0.53530383", "0.5342379", "0.53398687", "0.53387123", "0.5317918", "0.53144246", "0.5298788", "0.5297616", "0.52961576", "0.52906424", "0.52895314", "0.52843505", "0.5283276", "0.5282924", "0.5281264", "0.5281087" ]
0.0
-1
Get the array of view data.
public function getData();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getViewData()\n {\n return $this->__viewData;\n }", "public function getData()\n {\n return array(\n\n );\n }", "public function getDataArr(){\n\t\treturn $this->data_arr;\n\t}", "protected function getData()\n {\n return [];\n }", "public function data() : array\n {\n return $this->data->toArray();\n }", "public function getArray() {\n\t\treturn $this->data; \n\t}", "public function getArray() {\n\t\treturn $this->data; \n\t}", "public function get_data() {\n return $this->_view;\n }", "public function getData () : array {\n\t\treturn $this->data;\n\t}", "public function data()\n {\n return static::toArray($this);\n }", "private function getDataArray() {\n\t\treturn $this->dataArray;\n\t}", "public function getData() : array\n {\n return $this->data;\n }", "public function getData() : array\n {\n return $this->data;\n }", "public function getData() : array\n {\n return $this->data;\n }", "public function get_data(): array;", "public function get_data(): array;", "public static function data(): array\n {\n return self::$data;\n }", "public static function data(): array\n {\n return self::$data;\n }", "public function data(): array\n {\n return $this->data;\n }", "public function toArray() {\n\t\treturn $this->data;\n\t}", "public function toArray() // untested\n {\n return $this->data;\n }", "public function toArray()\r\n\t{\r\n\t\treturn $this->m_data;\r\n\t}", "public function getData(): array\n {\n return $this->data;\n }", "public function getData(): array\n {\n return $this->data;\n }", "public function getData(): array\n {\n return $this->data;\n }", "function toArray(){\r\n\t\treturn $this->data;\r\n\t}", "public final function getData()\n {\n return $this->googleVisualization->getDataTable()->toArray();\n }", "protected function getViewData() {\n\n }", "public function toArray()\n {\n return $this->_data;\n }", "public function toArray()\n {\n return $this->_data;\n }", "public function getData(): array\n\t{\n\t\treturn $this->data;\n\t}", "public function toArray()\r\n {\r\n return $this->data;\r\n }", "public function asArray()\n {\n return $this->data;\n }", "protected function get_variables_for_view()\n\t{\n\t\t$ary = array();\n\t\tforeach (get_object_vars ($this->set) as $k => $v)\n\t\t\t$ary[$k] = $v;\n\t\treturn $ary;\n\t}", "public function toArray() {\n return $this->data;\n }", "public function toArray() {\n return $this->data;\n }", "public function asArray()\r\n {\r\n return $this->data;\r\n }", "public function toArray()\n {\n return $this->data;\n }", "public function toArray()\n {\n return $this->data;\n }", "public function toArray()\n {\n return $this->data;\n }", "public function toArray()\n {\n return $this->data;\n }", "public function toArray()\n {\n return $this->data;\n }", "public function toArray()\n {\n return $this->data;\n }", "public function data()\n\t{\n\t\t$query = $this->query;\n\t\t$query['limit'] = $this->per_page;\n\t\t$query['offset'] = ($this->get_cur_page() - 1) * $this->per_page;\n\t\treturn $this->model->all($query);\n\t}", "public function data()\n\t{\n\t\treturn [\n\t\t\t'permissions' => $this->getPermissions(),\n\t\t\t'roles' => $this->getRoles(),\n\t\t];\n\t}", "public function toArray()\n {\n\n\n return $this->data;\n }", "public function getData(): array;", "public function getData(): array;", "public function getData(): array;", "public function getData(): array;", "public function getData() : array{\n $this->collection->rewind();\n $data = [];\n while($this->collection->valid()){\n $data[] = $this->collection->current()->getData();\n $this->collection->next();\n }\n return $data;\n }", "public function toArray() {\n return $this->getData();\n }", "public function asArray(){\n return $this->data;\n }", "public function toArray() : array\n {\n return $this->data;\n }", "public function getArray() {\r\n \r\n $data = [\r\n \"id\" => $this->id,\r\n \"name\" => $this->name,\r\n \"description\" => $this->desc,\r\n \"url_file\" => $this->url_file,\r\n \"filename\" => $this->filename,\r\n \"filepath\" => $this->filepath,\r\n \"filesize\" => $this->filesize,\r\n \"mime\" => $this->mime,\r\n \"active\" => $this->active,\r\n \"approved\" => $this->approved,\r\n \"meta\" => $this->extra_data,\r\n \"date\" => $this->Date,\r\n \"author\" => $this->Author->getArray(),\r\n \"url\" => $this->url->getURLs(),\r\n \"thumbnail\" => $this->getThumbnail(),\r\n \"icon\" => $this->getIcon(),\r\n ];\r\n \r\n return $data;\r\n \r\n }", "public function getAllData() {\n\t\treturn $this->_data;\n\t}", "public function getData() : array;", "public function getData() : array;", "public function getData(): array\n {\n return $this->variables;\n }", "protected function data(): array\n {\n return $this->removeEmpty([\n 'name' => $this->name,\n 'identification' => $this->identification,\n 'engine_event_id' => $this->engineEventId,\n 'workflow_step_id' => $this->workflowStepId,\n 'x_position' => $this->xPosition,\n 'y_position' => $this->yPosition,\n ]);\n }", "public function getAllData() {\n\t\treturn $this->data;\n\t}", "protected function getDataArray(): array\n {\n return [];\n }", "protected function _getItemsData()\n {\n return array();\n }", "public /*array*/ function toArray()\n\t{\n\t\treturn $this->_data;\n\t}", "public function getDataArray(){\n return array($this->item_id,$this->name,$this->count,$this->price);\n }", "public function &getData() : array\n {\n return $this->data;\n }", "public function data(): array\n {\n $this->attributes = $this->attributes ?: new ComponentAttributeBag();\n\n return $this->data + ['attributes' => $this->attributes];\n }", "public function get_all_data()\n\t{\n\t\treturn $this->_data;\n\t}", "public function buildViewData()\n {\n $data = $this->viewData;\n\n foreach ((new ReflectionClass($this))->getProperties(ReflectionProperty::IS_PUBLIC) as $property) {\n if ($property->getDeclaringClass()->getName() !== self::class) {\n $data[$property->getName()] = $property->getValue($this);\n }\n }\n\n return $data;\n }", "public function toArray()\n\t{\n\t\treturn $this->_d;\n\t}", "public function indexActionViewData() {\n return [];\n }", "public function getData() {\n if ($this->_multiple) {\n return $this->_data;\n }\n return isset($this->_data[0])? $this->_data[0] : [];\n }", "protected function data()\n {\n $row = array('id' => 0, 'name' => '', 'age' => 0, 'gender' => '');\n\n $rougin = $angel = $royce = $roilo = $rouine = $row;\n\n $rougin['id'] = 1;\n $rougin['name'] = 'rougin';\n $rougin['age'] = 18;\n $rougin['gender'] = 'male';\n\n $angel['id'] = 2;\n $angel['name'] = 'angel';\n $angel['age'] = 19;\n $angel['gender'] = 'female';\n\n $royce['id'] = 3;\n $royce['name'] = 'royce';\n $royce['age'] = 15;\n $royce['gender'] = 'male';\n\n $roilo['id'] = 4;\n $roilo['name'] = 'roilo';\n $roilo['age'] = 17;\n $roilo['gender'] = 'male';\n\n $rouine['id'] = 5;\n $rouine['name'] = 'rouine';\n $rouine['age'] = 12;\n $rouine['gender'] = 'male';\n\n return array($rougin, $angel, $royce, $roilo, $rouine);\n }", "public function toArray(): array\n {\n return $this->data;\n }", "public function toArray(): array\n {\n return $this->data;\n }", "public function getData()\n {\n return [\n 'fetchBlock' => $this->fetchBlock,\n 'generateKey' => $this->generateKey,\n 'hits' => $this->hits,\n 'strategyClass' => $this->strategyClass,\n ];\n }", "public function ToDataView(): array {\n return $this->Reduce(static function(array $Events, Event $Event): array {\n $Events[] = $Event->ToDataView();\n return $Events;\n },\n []);\n }", "public function getData()\n\t{\n\t\treturn $this->arrData;\n\t}", "public function getData()\n\t{\n\t\treturn $this->arrData;\n\t}", "protected function getDataArray() {\n trace('[METHOD] '.__METHOD__);\n\n\t\t$dataArray = array();\n\n\t\tforeach (get_class_vars( __CLASS__ ) as $propertyname => $pvalue) {\n\t\t\t$getter = 'get_'.$propertyname;\n\t\t\t$dataArray[$propertyname] = $this->$getter();\n\t\t}\n\n\t\treturn $dataArray;\n\t}", "public function getData()\n {\n $data = parent::getData();\n\n return $data;\n }", "public function getAsArray()\n\t{\n\t\t\n\t\t$path = $this->get();\n\t\t\n\t\treturn self::toArray($path);\n\t\t\n\t}", "public function getData()\n {\n //let's assume that this array is from a database\n return array('persian', 'bob', 'tabby', 'stray');\n }", "public function getData() {\n return $this->items;\n }", "public function getData ()\n {\n\n $data = [];\n\n foreach ($this as $key => $value) {\n\n $method = 'get' . ucfirst(camel_case($key));\n\n if (method_exists($this, $method)) {\n\n $data[$key] = $this->{$method}();\n\n }\n\n }\n\n $data['request_data'] = $this->hideProtectedFields($data['request_data']);\n\n return $data;\n }", "public function getAsArray();", "public function get_all () {\r\n\t\treturn $this->_data;\r\n\t}", "public function toArray()\n {\n return $this->fetchData;\n }", "protected function getViewData()\r\n {\r\n // to do: fetch data for this view from the database\r\n $bestellung = 'SELECT PizzaID, fBestellungID, fPizzaName, Status FROM bestelltepizza';\r\n $result = $this->_database->query($bestellung);\r\n \r\n return $result;\r\n }", "public function _getData(): array\n {\n $result = [\n 'traveler' => $this->getTraveler(),\n 'watcher' => $this->getWatcher(),\n 'distance' => $this->getDistance(),\n ];\n\n return parent::normalizeData($result);\n }", "public function getDatas()\n {\n return $this->datas;\n }", "public function getData() {\r\n $vehicles = Auth::user()->vehicles;\r\n $violations = Auth::user()->violations;\r\n $data = [\r\n 'vehicles' => $vehicles,\r\n 'violations' => $violations,\r\n ];\r\n\r\n return $data;\r\n }", "public function getArray() {\n \treturn array(\n \t\t\t'id' => $this->id,\n \t\t\t'name' => $this->name,\n \t\t\t'path' => $this->path,\n \t\t\t'description' => $this->description,\n \t\t\t'version' => $this->version,\n \t\t\t'groups' => $this->groups,\n \t\t\t'enabled' => $this->enabled\n \t);\n }", "public function &contentsArray()\n {\n return $this->store->data(true);\n }", "public function getItems(): array\n {\n return $this->getData();\n }", "public function getViewData()\n {\n return $this->modelVar;\n }", "public function getArray()\n {\n return $this->get(self::_ARRAY);\n }", "public function getArray()\n\t{\n\t\treturn $this->row;\n\t}", "public function get(): array;", "public function get(): array;", "public function getArray()\n {\n return $this->array;\n }" ]
[ "0.7909176", "0.7458217", "0.7323995", "0.72699213", "0.72453374", "0.7206896", "0.7206896", "0.7196223", "0.7176462", "0.71688056", "0.7164324", "0.7128089", "0.7128089", "0.7128089", "0.70910615", "0.70910615", "0.7065366", "0.7065366", "0.70536804", "0.7017327", "0.7010694", "0.7005328", "0.70013136", "0.70013136", "0.70013136", "0.7000162", "0.6992558", "0.6934998", "0.6929995", "0.6929995", "0.69285524", "0.6927344", "0.68991536", "0.6898035", "0.6892562", "0.6892562", "0.68855083", "0.68815947", "0.68815947", "0.68815947", "0.68815947", "0.68815947", "0.68815947", "0.6860825", "0.68565625", "0.68561107", "0.68518925", "0.68518925", "0.68518925", "0.68518925", "0.68381864", "0.6797142", "0.67917454", "0.67870444", "0.67555445", "0.6749737", "0.6746825", "0.6746825", "0.6743554", "0.6740057", "0.6739403", "0.6731708", "0.67298955", "0.6706717", "0.66952366", "0.669318", "0.6677635", "0.66663325", "0.66600573", "0.6659715", "0.66583514", "0.66474146", "0.66454047", "0.66420084", "0.66420084", "0.6639755", "0.6601398", "0.6593193", "0.6593193", "0.65897566", "0.6583549", "0.656624", "0.65645015", "0.65576506", "0.6555527", "0.6527267", "0.652668", "0.65218973", "0.6518399", "0.65171176", "0.6515722", "0.6498872", "0.64712274", "0.64701515", "0.6467395", "0.64635515", "0.64595276", "0.6448161", "0.6440928", "0.6440928", "0.64394325" ]
0.0
-1
Get the evaluated contents of the object.
public function render();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function contents() {\n\t\t$vals = array_values(get_object_vars($this));\n\t\treturn( array_reduce($vals, create_function('$a,$b',\n\t\t\t\t'return is_null($a) ? \"$b\" : \"$a\".\"\\t\".\"$b\";')));\n\t}", "public function __invoke()\n {\n return $this->contents;\n }", "public function contents() {\n\t\t$vals = array_values(get_object_vars($this));\n\t\treturn( array_reduce($vals, create_function('$a,$b','return is_null($a) ? \"$b\" : \"$a\".\"\\t\".\"$b\";')));\n\t}", "public function evaluate() {\n\t\treturn \\TYPO3\\Flow\\var_dump($this->tsRuntime->getCurrentContext(), '', TRUE);\n\t}", "public function getContents()\n {\n $this->load();\n\n return $this->_contents;\n }", "public function getVars()\n {\n return $this->_contents;\n }", "protected function getContents()\n {\n return $this->engine->get($this->path, $this->gatherData());\n }", "public function get()\n {\n return $this->contents;\n }", "public function content()\n {\n return $this->cache->get('content');\n }", "public function getParsedContent()\n {\n return oxUtilsView::getInstance()->parseThroughSmarty( $this->getContent()->oxcontents__oxcontent->value, $this->getContent()->getId() );\n }", "public function getParsedContent()\n {\n /** @var oxUtilsView $oUtilsView */\n $oUtilsView = oxRegistry::get(\"oxUtilsView\");\n return $oUtilsView->parseThroughSmarty($this->getContent()->oxcontents__oxcontent->value, $this->getContent()->getId(), null, true);\n }", "public function get_content()\n\t\t{\n\t\t\tif (!$this->is_cached()) {\n\t\t\t\t$this->load();\n\t\t\t}\n\n\t\t\treturn $this->content;\n\t\t}", "public function raw() {\n return $this->obj;\n }", "public function getValue(){\n return $this->_content;\n }", "public function get()\n {\n if(is_null($this->contents) && $this->exists())\n $this->contents = file_get_contents($this->getPath());\n\n return $this->contents;\n }", "public function contents() {\n\t\treturn file_get_contents($this->path);\n\t}", "public function contents()\n\t{\n\t\treturn $this->contents;\n\t}", "function getCompiledTemplate()\n {\n return $this->_objectPool[$this->_lastUsedObjectKey]->getCompiledTemplate();\n }", "public function getContents()\n {\n return $this->contents;\n }", "public function getContents()\n {\n return $this->contents;\n }", "public function contents() { return $this->_m_contents; }", "public function getCompiledText()\n {\n return $this->owner->compileText($this->getType(), $this->getData());\n }", "public function getContents(): string\n {\n return $this->contents;\n }", "public function getContents(): string\n {\n return $this->contents;\n }", "public function getContents()\n {\n return $this->getContents();\n }", "public function getContents(){\n return file_get_contents($this->source);\n }", "public function getContent() {\n\t\treturn $this->storage->file_get_contents($this->path);\n\t}", "public function getContents() \r\n { \r\n return $this->_contents; \r\n }", "public function render()\n {\n return $this->load($this->getFile(), $this->getVariables());\n }", "public function __invoke() {\n return (object) $this->data;\n }", "public function getValue()\n {\n if ($this->isClosure($this->value)) {\n return $this->callClosure($this->value);\n }\n return $this->value;\n }", "public function get()\n {\n return static::getContents($this->getPathname());\n }", "public function read()\n {\n return $this->_contents;\n }", "function get_contents(){\n return $this->input_content;\n }", "public function value ()\n {\n return $this->context->storage->value ($this->name);\n }", "public function get_content() {\n // Check if no content is yet loaded\n if (empty($this->content)) {\n $this->content = @file_get_contents($this->name);\n }\n\n return $this->content;\n }", "public function get()\n {\n return $this->execute(\n $this->syntax->selectSyntax(get_object_vars($this))\n );\n }", "public function getValue()\n {\n return $this->objects;\n }", "public function getContent()\n {\n return $this->objOutput->getObjectRender()->overrideContent($this->output);\n }", "public function getContent()\n {\n return $this->objOutput->getObjectRender()->overrideContent($this->output);\n }", "public function get_Eval(){\n return $this->eval_note;\n }", "public function getCompiled()\n {\n return $this->compiled;\n }", "public function getContent()\n {\n return file_get_contents($this->fullPath);\n }", "public function fetch()\n\t{\t\t\n\t\tob_start();\t\t\n\t\t$this->display();\n\t\t$content = ob_get_clean();\n\t\treturn $content;\n\t}", "public function __toString() {\n ob_start();\n extract($this->_vars);\n\n include $this->_viewFile;\n\n return ob_get_clean();\n }", "public function Data()\n {\n return $this->parseobject($this->content);\n }", "public function evaluate();", "public function evaluate();", "public function __toString()\n {\n $viewData = $this->variables;\n $templates = Context::getInstance()->getTemplates();\n if ($this->template != false) {\n $renderedTemplate = $templates->render($this->template, $viewData);\n $viewData['contents'] = $renderedTemplate;\n }\n if ($this->layout != false) {\n return $templates->render($this->layout, $viewData);\n }\n }", "public function __toString()\n {\n return $this->view->fetch($this->template);\n }", "public function __toString() {\n // This is a neat way to get save the output of var_dump to a string \n // instead of printing it immediately\n ob_start();\n var_dump($this);\n $value = ob_get_contents();\n ob_end_clean();\n \n return $value;\n }", "public function __invoke() {\n \n return $this->_value;\n }", "public function getData()\n\t{\n\t\ttry\n\t\t{\n\n\t\t\treturn $content;\n\t\t}\n\t\tcatch (RuntimeException $e)\n\t\t{\n\t\t\t\t$content = '';\n\t\t\treturn $content;\n\n\t\t}\n\n\t}", "protected function getContents() {\n return file_get_contents($this->query);\n }", "function tidy_get_output(tidy $object) {}", "public static function getContent() {\n\t\treturn self::$_content;\n\t}", "public function getContent()\n\t{\n\t\treturn $this->output;\n\t}", "function getValue() { return $this->readText(); }", "public function getContent()\n {\n return $this->data;\n }", "public function getContent(){\n\t\treturn $this->content? $this->content:$this->content = file_get_contents($this->getFullName());\n\t}", "public function getContent () {\r\n\t\treturn $this->content;\r\n\t}", "public function getContents() : string {\n\n\t\t\tif (!$this->enabled) return '';\n\n\t\t\t# Lock the block\n\n\t\t\t$this->enabled = false;\n\n\t\t\t# Generate contents\n\n\t\t\t$contents = ((0 === $this->count) ? $this->buildContents() : parent::getContents());\n\n\t\t\t# Unlock the block\n\n\t\t\t$this->enabled = true;\n\n\t\t\t# ------------------------\n\n\t\t\treturn $contents;\n\t\t}", "public function evaluate()\n {\n $path = $this->tsValue('path');\n $packageName = $this->tsValue('packageName') ?:\n $this->fusionService->inferPackageNameFromPath($this->path, $this->runtime);\n\n $styleSettings = $this->styleSettingsService->getStyleSettingsForPackage($packageName);\n\n return ObjectAccess::getPropertyPath($styleSettings, $path);\n }", "public function getContents(): string\n {\n return (string) file_get_contents($this->getAbsolutePath());\n }", "public function getContent()\n\t{\n\t\treturn $this->_content;\n\t}", "public function getContent()\n\t{\n\t\treturn $this->_content;\n\t}", "public function get_content()\n {\n extract($this->_keystore);\n ob_start();\n include($this->_file);\n return ob_get_clean();\n }", "public function render()\n {\n return $this->data;\n }", "public function getContents()\n {\n return stream_get_contents($this->stream);\n }", "protected function loadPageObject()\n\t{\n\t\treturn $this->PoObj->run();\n\t}", "public function getContent() {\n\t\treturn $this->content;\n\t}", "public function getContent() {\n\t\treturn $this->content;\n\t}", "public function getContent() {\n\t\treturn $this->content;\n\t}", "public function getContent()\n {\n return $this->_content;\n }", "public function __invoke()\n {\n return $this->value;\n }", "public function getContent()\n\t{\n\t\treturn $this->content_;\n\t}", "public function getContents(): string\n {\n $body = $this->getBody();\n $body->rewind();\n return $body->getContents();\n }", "function getValue() { return $this->readText(); }", "public function getEncapsulateContent()\n {\n return $this->_encapsulateContent;\n }", "public function getContent()\n {\n \t$content = $this->content;\n return $content;\n }", "public function getContent() {\r\n\t\treturn $this->content;\r\n\t}", "public function getContent()\r\n {\r\n return $this->_content;\r\n }", "public function get()\n {\n // we hit the cache when we get the item.. so we allways return the value\n return $this->value;\n }", "private function value()\n {\n $this->white();\n switch ($this->currentByte) {\n case '{':\n return $this->obj();\n case '[':\n return $this->arr();\n case '\"':\n case \"'\":\n return $this->string();\n case '-':\n case '+':\n case '.':\n return $this->number();\n default:\n return \\is_numeric($this->currentByte) ? $this->number() : $this->word();\n }\n }", "protected function getContent() {\n return $this->content;\n }", "protected function getRawContent() {\n @trigger_error('AssertLegacyTrait::getRawContent() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->getSession()->getPage()->getContent() instead. See https://www.drupal.org/node/3129738', E_USER_DEPRECATED);\n return $this->getSession()->getPage()->getContent();\n }", "public function get_output() {\n return $this->data;\n }", "public function content()\n\t{\n\t\tif ($this->_content === null)\n\t\t\t$this->_content = file_get_contents('php://input');\n\n\t\treturn $this->_content;\n\t}", "public function getEvaluation()\n {\n return $this->evaluation;\n }", "public function getContent()\n\t{\n\t\treturn $this->content;\n\t}", "public function getContent()\n\t{\n\t\treturn $this->content;\n\t}", "public function getContent()\n\t{\n\t\treturn $this->content;\n\t}", "function loadCacheObject ()\n {\n if (!$this->cacheObjectLocked()) {\n $return = $this->cacheObjectContents($this->cacheObjectId);\n } else {\n $return = $this->loadLockedObject();\n }\n\n return $return;\n }", "public function render()\n {\n return $this->content;\n }", "public function getContent()\r\n {\r\n return $this->template;\r\n }", "public function data()\n {\n return $this->_data;\n }", "protected function getResult()\n {\n return $this->getOwningAnalyser()->getResult();\n }", "public function data ()\n {\n return $this->_data;\n }", "public function getContent()\n {\n return $this->get(self::_CONTENT);\n }", "public function getContent()\n {\n return $this->get(self::_CONTENT);\n }", "public function getContent()\n {\n return $this->get(self::_CONTENT);\n }" ]
[ "0.6578897", "0.6416526", "0.6347371", "0.6275416", "0.6168338", "0.60603875", "0.60326356", "0.59818095", "0.5942801", "0.5915284", "0.58979535", "0.5886692", "0.5878967", "0.5840518", "0.5827942", "0.58156407", "0.58153176", "0.58032405", "0.58011967", "0.58011967", "0.57746565", "0.5773005", "0.5770608", "0.5770608", "0.57427573", "0.57325625", "0.57211953", "0.57127136", "0.5703935", "0.5696843", "0.56705517", "0.56656146", "0.5664087", "0.565638", "0.56561214", "0.56392187", "0.56263185", "0.5625707", "0.56240803", "0.56240803", "0.5618526", "0.56138796", "0.56133175", "0.5595876", "0.55910146", "0.55856055", "0.5565393", "0.5565393", "0.55554575", "0.55387646", "0.5526541", "0.55250996", "0.5513948", "0.5509538", "0.54952794", "0.54945964", "0.54926896", "0.5491154", "0.54896426", "0.548762", "0.548322", "0.54774284", "0.547049", "0.5469537", "0.5460006", "0.5460006", "0.5459762", "0.5457512", "0.54519266", "0.545018", "0.54381526", "0.54381526", "0.54381526", "0.54348934", "0.5426952", "0.5426183", "0.54214656", "0.5421043", "0.541941", "0.54124135", "0.54122627", "0.5409734", "0.5409729", "0.54079276", "0.54001886", "0.5398869", "0.5383572", "0.53789985", "0.5378219", "0.5364596", "0.5364596", "0.5364596", "0.5350689", "0.5340908", "0.53405315", "0.5334218", "0.5333382", "0.5332141", "0.5330404", "0.5330404", "0.5330404" ]
0.0
-1
Form edit credit card by token
function commerce_braintree_creditcard_edit_form($form, &$form_state, $sid) { module_load_include('inc', 'commerce_payment', 'includes/commerce_payment.credit_card'); $form_state['build_info']['files']['form'] = drupal_get_path('module', 'commerce_braintree') . '/commerce_braintree.form.inc'; $sub = commerce_braintree_subscription_local_get(array('sid' => $sid), FALSE); $payment = commerce_payment_method_instance_load('braintree|commerce_payment_braintree'); $creditcard = commerce_braintree_creditcard_get_by_token($sub['token']); $billing_address = isset($creditcard->billingAddress) ? $creditcard->billingAddress : null; $form['payment_method'] = array( '#type' => 'fieldset', '#title' => t('Payment Method Details'), ); $form['payment_method']['ca_cardholder_name'] = array( '#type' => 'textfield', '#title' => t('Cardholder Name'), '#default_value' => isset($creditcard->cardholderName) ? $creditcard->cardholderName : '', ); // NOTE: A hidden field is changable via Firebug. Value is not. // Because there's no validation, this would have allowed any user with access to this form // to change any credit card on the website for any user, providing they guess another ca_token. //$form['payment_method']['ca_token'] = array('#type' => 'value', '#value' => $token); $form['payment_method']['sid'] = array('#type' => 'value', '#value' => $sid); // Prepare the fields to include on the credit card form. $fields = array( 'code' => '', ); // Add the credit card types array if necessary. $card_types = array_diff(array_values($payment['settings']['card_types']), array(0)); if (!empty($card_types)) { $fields['type'] = $card_types; } $defaults = array( 'type' => isset($creditcard->cardType) ? $creditcard->cardType : '', 'number' => isset($creditcard->maskedNumber) ? $creditcard->maskedNumber : '', 'exp_month' => isset($creditcard->expirationMonth) ? $creditcard->expirationMonth : '', 'exp_year' => isset($creditcard->expirationYear) ? $creditcard->expirationYear : '', ); // load oder $order = commerce_order_load($sub['order_id']); $order_wrapper = entity_metadata_wrapper('commerce_order', $order); // get profile id $profile_id = $order_wrapper->commerce_customer_billing->profile_id->value(); // load customer profile $profile = commerce_customer_profile_load($profile_id); if (isset($profile->commerce_customer_address['und']['0']['first_name'])) { $profile->commerce_customer_address['und']['0']['first_name'] = isset($billing_address->firstName) ? $billing_address->firstName :'' ; } if (isset($profile->commerce_customer_address['und']['0']['last_name'])) { $profile->commerce_customer_address['und']['0']['last_name'] = isset($billing_address->lastName) ? $billing_address->lastName : ''; } if (isset($profile->commerce_customer_address['und']['0']['organisation_name'])) { // //company $profile->commerce_customer_address['und']['0']['organisation_name'] = isset($billing_address->company) ? $billing_address->company :''; } if (isset($profile->commerce_customer_address['und']['0']['administrative_area'])) { //state $profile->commerce_customer_address['und']['0']['administrative_area'] = isset($billing_address->region) ? $billing_address->region : ''; } if (isset($profile->commerce_customer_address['und']['0']['premise'])) { //address 2 $profile->commerce_customer_address['und']['0']['premise'] = isset($billing_address->extendedAddress) ? $billing_address->extendedAddress : ''; } if (isset($profile->commerce_customer_address['und']['0']['locality'])) { //city $profile->commerce_customer_address['und']['0']['locality'] = isset($billing_address->locality) ? $billing_address->locality : ''; } if (isset($profile->commerce_customer_address['und']['0']['postal_code'])) { //postal code $profile->commerce_customer_address['und']['0']['postal_code'] = isset($billing_address->postalCode) ? $billing_address->postalCode : ''; } if (isset($profile->commerce_customer_address['und']['0']['thoroughfare'])) { // address 1 $profile->commerce_customer_address['und']['0']['thoroughfare'] = isset($billing_address->streetAddress) ? $billing_address->streetAddress : ''; } // Add the field related form elements. $form_state['customer_profile'] = $profile; // Attach address field to form field_attach_form('commerce_customer_profile', $profile, $form, $form_state); $form['commerce_customer_address']['#weight'] = '0'; $form['payment_method'] += commerce_payment_credit_card_form($fields, $defaults); $form['submit'] = array( '#type' => 'submit', '#value' => t('Save'), ); $form['#validate'][] = 'commerce_braintree_creditcard_edit_form_validate'; $form['#submit'][] = 'commerce_braintree_creditcard_edit_form_submit'; return $form; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function editcardAction()\n {\n $isValidToken = false;\n $token = $this->getRequest()->getParam('t');\n $customer = $this->_getCustomer();\n $api = $this->_getApi();\n $paymentMethods = $api->getPaymentMethods($customer->getId(), true);\n \n foreach($paymentMethods as $key => $pm) {\n if($pm->getData('paymentMethodToken') == $token) {\n $isValidToken = true;\n }\n }\n \n if($isValidToken) {\n \n } else {\n Mage::getSingleton('core/session')->addError('Credit card token is not valid. Please try again.');\n $this->_redirect('payments/customer/creditcards');\n }\n \n $this->loadLayout();\n $this->_initLayoutMessages('customer/session');\n $this->renderLayout();\n }", "public function edit(CreditCard $creditCard)\n {\n //\n }", "function commerce_braintree_creditcard_edit_form_submit($form, &$form_state) {\n $sub = commerce_braintree_subscription_local_get(array('sid' => $form_state['values']['sid']), FALSE);\n $token = $sub['token'];\n $commerce_customer_address = $form_state['values']['commerce_customer_address']['und'][0];\n //billing address\n $billing_address['firstName'] = isset($commerce_customer_address['first_name']) ? $commerce_customer_address['first_name'] : '';\n $billing_address['lastName'] = isset($commerce_customer_address['last_name']) ? $commerce_customer_address['last_name'] : '';\n $billing_address['company'] = isset($commerce_customer_address['organisation_name']) ? $commerce_customer_address['organisation_name'] : '';\n $billing_address['streetAddress'] = isset($commerce_customer_address['thoroughfare']) ? $commerce_customer_address['thoroughfare'] : '';\n $billing_address['extendedAddress'] = isset($commerce_customer_address['premise']) ? $commerce_customer_address['premise'] : '';\n $billing_address['locality'] = isset($commerce_customer_address['locality']) ? $commerce_customer_address['locality'] : '';\n $billing_address['region'] = isset($commerce_customer_address['administrative_area']) ? $commerce_customer_address['administrative_area'] : '';\n $billing_address['postalCode'] = isset($commerce_customer_address['postal_code']) ? $commerce_customer_address['postal_code'] : '';\n $billing_address['countryCodeAlpha2'] = isset($commerce_customer_address['country']) ? $commerce_customer_address['country'] : '';\n \n //creditcard\n $creditcard['cardholderName'] = $form_state['values']['ca_cardholder_name'];\n $creditcard['number'] = $form_state['values']['credit_card']['number'];\n $creditcard['cvv'] = $form_state['values']['credit_card']['code'];\n $creditcard['expirationDate'] = $form_state['values']['credit_card']['exp_month'];\n $creditcard['expirationDate'] .= '/' . $form_state['values']['credit_card']['exp_year'];\n $creditcard['billingAddress'] = $billing_address;\n $creditcard['options'] = array('verifyCard' => TRUE);\n $creditcard['billingAddress']['options'] = array('updateExisting' => TRUE);\n \n $card = commerce_braintree_credit_card_update($creditcard, $token);\n if ($card->success) {\n drupal_set_message(t('Updated Successfull.'));\n return;\n }\n drupal_set_message(t('There are error. @errors', array('@errors' => commerce_braintree_get_errors($card))), 'error');\n}", "public function editAction()\n {\n $this->_title($this->__('AuthnetToken'));\n $this->_title($this->__('Customer'));\n $this->_title($this->__('Edit Item'));\n\n $profileId = $this->getRequest()->getParam('id');\n $model = Mage::getModel('authnettoken/cim_payment_profile')->load($profileId);\n if ($model->getId()) {\n\n // Retreive extra data fields from Authorize.Net CIM API\n try {\n $model->retrieveCimProfileData();\n }\n catch (SFC_AuthnetToken_Helper_Cim_Exception $eCim) {\n Mage::getSingleton('adminhtml/session')->addError('Failed to retrieve saved credit card info from Authorize.Net CIM!');\n if ($eCim->getResponse() != null) {\n Mage::getSingleton('adminhtml/session')->addError('CIM Result Code: ' . $eCim->getResponse()->getResultCode());\n Mage::getSingleton('adminhtml/session')->addError('CIM Message Code: ' . $eCim->getResponse()->getMessageCode());\n Mage::getSingleton('adminhtml/session')->addError('CIM Message Text: ' . $eCim->getResponse()->getMessageText());\n }\n // Send customer back to saved credit cards grid\n $this->_redirect('adminhtml/customer/edit/tab/customer_info_tabs_paymentprofile',\n array('id' => $model->getCustomerId()));\n\n return;\n }\n // Save profile in registry\n Mage::register('paymentprofile_data', $model);\n Mage::register('customer_id', $model->getCustomerId());\n\n $this->loadLayout();\n $this->_setActiveMenu('authnettoken/paymentprofile');\n $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Payment Profile'), Mage::helper('adminhtml')->__('Payment Profile'));\n $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Payment Profile'), Mage::helper('adminhtml')->__('Information'));\n $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);\n $this->_addContent($this->getLayout()->createBlock('authnettoken/adminhtml_customer_paymentprofiles_edit'));\n $this->_addLeft($this->getLayout()->createBlock('authnettoken/adminhtml_customer_paymentprofiles_edit_tabs'));\n $this->renderLayout();\n }\n else {\n Mage::getSingleton('adminhtml/session')->addError(Mage::helper('authnettoken')->__('Failed to find saved credit card.'));\n $this->_redirect('*/*/');\n }\n }", "public function edit(Card $card)\n {\n //\n }", "public function edit(Card $card)\n {\n //\n }", "public function edit(Card $card)\n {\n //\n }", "public function update(Request $request, CreditCard $creditCard)\n {\n //\n }", "public function postEditCard(EditCardRequest $request)\n {\n try {\n $expiry = explode('/', $request->expiry);\n $month = $expiry[0];\n $year = $expiry[1];\n $customerId = RecruiterProfile::where(['user_id' => Auth::user()->id])->pluck('customer_id');\n $customer = \\Stripe\\Customer::retrieve($customerId[0]);\n $card = $customer->sources->retrieve($request->cardId);\n $card->exp_month = $month;\n $card->exp_year = $year;\n $card->save();\n $this->response['success'] = true;\n $this->response['message'] = trans('messages.card_edidted');\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 }", "function update_creditcard($form = array(), $userid = 0)\n {\n global $ilance, $ilconfig, $phrase, $ilpage;\n $form['number_encrypted'] = $ilance->crypt->three_layer_encrypt($form['number'], $ilconfig['key1'], $ilconfig['key2'], $ilconfig['key3']);\n $form['authorized'] = 'yes';\n if ($ilconfig['creditcard_authentication'])\n {\n $form['authorized'] = 'no'; \n }\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"creditcards \n SET creditcard_number = '\" . $ilance->db->escape_string($form['number_encrypted']) . \"',\n creditcard_type = '\" . mb_strtolower($form['type']) . \"',\n date_updated = '\" . DATETIME24H . \"',\n creditcard_expiry = '\" . $form['expmon'] . $form['expyear'] . \"',\n cvv2 = '\" . $ilance->db->escape_string($form['cvv2']) . \"',\n name_on_card = '\" . $ilance->db->escape_string($form['first_name'] . \" \" . $form['last_name']) . \"',\n phone_of_cardowner = '\" . $ilance->db->escape_string($form['phone']) . \"',\n email_of_cardowner = '\" . $ilance->db->escape_string($form['email']) . \"',\n card_billing_address1 = '\" . $ilance->db->escape_string($form['address1']) . \"',\n card_billing_address2 = '\" . $ilance->db->escape_string($form['address2']) . \"',\n card_city = '\" . $ilance->db->escape_string($form['city']) . \"',\n card_state = '\" . $ilance->db->escape_string($form['state']) . \"',\n card_postalzip = '\" . $ilance->db->escape_string($form['postalzip']) . \"',\n card_country = '\" . $ilance->db->escape_string($form['countryid']) . \"',\n authorized = '\" . $ilance->db->escape_string($form['authorized']) . \"'\n WHERE user_id = '\" . intval($userid) . \"'\n AND cc_id = '\" . $ilance->db->escape_string($form['cc_id']) . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $ilance->email->mail = fetch_user('email', intval($userid));\n $ilance->email->slng = fetch_user_slng(intval($userid));\n $ilance->email->get('member_updated_creditcard');\t\t\n $ilance->email->set(array(\n '{{member}}' => fetch_user('username', intval($userid)),\n ));\n $ilance->email->send();\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"subscription_user\n SET paymethod = 'account'\n WHERE user_id = '\" . intval($userid) . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n return true;\n }", "function edds_credit_card_form( $echo = true ) {\n\n\tglobal $edd_options;\n\n\tif ( edd_stripe()->rate_limiting->has_hit_card_error_limit() ) {\n\t\tedd_set_error( 'edd_stripe_error_limit', __( 'We are unable to process your payment at this time, please try again later or contact support.', 'edds' ) );\n\t\treturn;\n\t}\n\n\tob_start(); ?>\n\n\t<?php if ( ! wp_script_is ( 'edd-stripe-js' ) ) : ?>\n\t\t<?php edd_stripe_js( true ); ?>\n\t<?php endif; ?>\n\n\t<?php do_action( 'edd_before_cc_fields' ); ?>\n\n\t<fieldset id=\"edd_cc_fields\" class=\"edd-do-validate\">\n\t\t<legend><?php _e( 'Credit Card Info', 'edds' ); ?></legend>\n\t\t<?php if( is_ssl() ) : ?>\n\t\t\t<div id=\"edd_secure_site_wrapper\">\n\t\t\t\t<span class=\"padlock\">\n\t\t\t\t\t<svg class=\"edd-icon edd-icon-lock\" xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"28\" viewBox=\"0 0 18 28\" aria-hidden=\"true\">\n\t\t\t\t\t\t<path d=\"M5 12h8V9c0-2.203-1.797-4-4-4S5 6.797 5 9v3zm13 1.5v9c0 .828-.672 1.5-1.5 1.5h-15C.672 24 0 23.328 0 22.5v-9c0-.828.672-1.5 1.5-1.5H2V9c0-3.844 3.156-7 7-7s7 3.156 7 7v3h.5c.828 0 1.5.672 1.5 1.5z\"/>\n\t\t\t\t\t</svg>\n\t\t\t\t</span>\n\t\t\t\t<span><?php _e( 'This is a secure SSL encrypted payment.', 'edds' ); ?></span>\n\t\t\t</div>\n\t\t<?php endif; ?>\n\n\t\t<?php\n\t\t$existing_cards = edd_stripe_get_existing_cards( get_current_user_id() );\n\t\t?>\n\t\t<?php if ( ! empty( $existing_cards ) ) { edd_stripe_existing_card_field_radio( get_current_user_id() ); } ?>\n\n\t\t<div class=\"edd-stripe-new-card\" <?php if ( ! empty( $existing_cards ) ) { echo 'style=\"display: none;\"'; } ?>>\n\t\t\t<?php do_action( 'edd_stripe_new_card_form' ); ?>\n\t\t\t<?php do_action( 'edd_after_cc_expiration' ); ?>\n\t\t</div>\n\n\t</fieldset>\n\t<?php\n\n\tdo_action( 'edd_after_cc_fields' );\n\n\t$form = ob_get_clean();\n\n\tif ( false !== $echo ) {\n\t\techo $form;\n\t}\n\n\treturn $form;\n}", "public function editCustomerCreditCard($data) {\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\t\t'NameOnCreditCard' => $data['cardName'],\n\t\t\t\t'CreditCardNumber' => $data['cardNumber'],\n\t\t\t\t'CreditCardExpiryYear' => $data['cardExpiryYear'],\n\t\t\t\t'CreditCardExpiryMonth' => $data['cardExpiryMonth'],\n\t\t\t\t'Reactivate' => $data['reactivate'],\n\t\t\t\t'Username' => $data['username']\n\t\t];\n\n\t\treturn $soapclient->editCustomerCreditCard($params);\n\t}", "public function storeCreditCardWithNumberCard($token)\n {\n $user = User::find(\\Auth::user()->id);\n\n try {\n if (empty($user->stripe_id)) {\n $user->createAsStripeCustomer($token);\n } else {\n $user->updateCard($token);\n }\n } catch (\\Exception $ex) {\n \\Log::error(\"Can not update credit card. \" . $ex->getMessage());\n throw new UpdateCreditCardException();\n }\n }", "public function edit(Request $request, Token $token)\n {\n\t\t//$this->authorize('update', $token);\n\t\t//add the jsvalidator\n\t\t$jsvalidator = JsValidator::make([\n\t\t\t'user_id' => 'numeric|nullable|exits:users,id',\n\t\t\t'account_id' => 'numeric|required|exits:accounts,id',\n\t\t\t'name' => 'required|string|max:75',\n\t\t\t'contract_address' => 'nullable|string|max:42',\n\t\t\t'mainsale_address' => 'nullable|string|max:42',\n\t\t\t'contract_ABI_array' => 'nullable|string',\n\t\t\t'contract_Bin' => 'nullable|string',\n\t\t\t'token_price' => 'required|numeric',\n\t\t\t'symbol' => 'required|string',\n\t\t\t'decimals' => 'required|numeric',\n\t\t\t'logo' => 'nullable|file',\n\t\t\t'image' => 'nullable|file',\n\t\t\t'template' => 'nullable|string',\n\t\t\t'website' => 'required|string|url',\n\t\t\t'twitter' => 'required|string|url',\n\t\t\t'facebook' => 'required|string|url',\n\t\t\t'whitepaper' => 'nullable|string|url',\n\t\t\t'description' => 'required|string',\n\t\t\t'technology' => 'nullable|string',\n\t\t\t'features' => 'required|string',\n\t\t\t'sweepthreshold'=>'nullable|numeric',\n\t\t\t'sweeptoaddress'=>'nullable|string',\n\t\t]);\n\t\n\t\t$users = \\App\\Models\\User::all();\n\t\t$accounts = \\App\\Models\\Account::all();\n return view('admin.tokens.edit', compact('token', 'jsvalidator','users','accounts'));\n }", "public function changeCreaditCard(){\n return View::make('user.change_credit_card')->with(array('title_for_layout' => 'Thay đổi thẻ tín dụng'));\n }", "public function edit(Postcard $postcard)\n {\n //\n }", "public function creditcardAction()\r\n\t{\r\n\t if(defined('EMPTABCONFIGS'))\r\n\t\t{\r\n\t\t $empOrganizationTabs = explode(\",\",EMPTABCONFIGS);\r\n\t\t\tif(in_array('creditcarddetails',$empOrganizationTabs))\r\n\t\t\t{\r\n\t\t\t\t$tabName = \"creditcard\";\r\n\t\t\t\t$employeeData =array();\r\n\t\t\t\t\r\n\t\t\t $auth = Zend_Auth::getInstance();\r\n\t\t\t if($auth->hasIdentity())\r\n\t\t\t {\r\n\t\t\t\t\t$loginUserId = $auth->getStorage()->read()->id;\r\n\t\t\t\t}\r\n\t\t\t\t$id = $loginUserId;\r\n\t\t\t\t$employeeModal = new Default_Model_Employee();\r\n\t\t\t\t$empdata = $employeeModal->getsingleEmployeeData($id);\r\n\t\t\t\tif($empdata == 'norows')\r\n\t\t\t\t{\r\n\t\t\t\t $this->view->rowexist = \"norows\";\r\n\t\t\t\t $this->view->empdata = \"\";\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{ \r\n\t\t\t\t\t$this->view->rowexist = \"rows\";\r\n\t\t\t\t\tif(!empty($empdata))\r\n\t\t\t\t\t{ \r\n\t\t\t\t\t\t$creditcardDetailsform = new Default_Form_Creditcarddetails();\r\n\t\t\t\t\t\t$creditcardDetailsModel = new Default_Model_Creditcarddetails();\r\n\t\t\t\t\t\tif($id)\r\n\t\t\t\t\t\t{\t\r\n\t\t\t\t\t\t\t$data = $creditcardDetailsModel->getcreditcarddetailsRecord($id);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(!empty($data))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault(\"id\",$data[0][\"id\"]);\r\n\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault(\"user_id\",$data[0][\"user_id\"]);\r\n\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault(\"card_type\",$data[0][\"card_type\"]);\r\n\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault(\"card_number\",$data[0][\"card_number\"]);\r\n\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault(\"nameoncard\",$data[0][\"nameoncard\"]);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$expiry_date = sapp_Global::change_date($data[0][\"card_expiration\"],'view');\r\n\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault('card_expiration', $expiry_date);\r\n\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault(\"card_issuedby\",$data[0][\"card_issued_comp\"]);\r\n\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault(\"card_code\",$data[0][\"card_code\"]);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$creditcardDetailsform->setAttrib('action',BASE_URL.'mydetails/creditcard/');\r\n\t\t\t\t\t\t\t$this->view->id=$id;\r\n\t\t\t\t\t\t\t$this->view->form = $creditcardDetailsform;\r\n\t\t\t\t\t\t\t$this->view->data=$data;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif($this->getRequest()->getPost())\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$result = $this->save($creditcardDetailsform,$tabName);\t\r\n\t\t\t\t\t\t\t$this->view->msgarray = $result; \r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$this->view->empdata = $empdata; \r\n\t\t\t\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n else\r\n\t\t\t{\r\n\t\t \t $this->_redirect('error');\r\n\t\t }\r\n }\r\n\t\telse\r\n\t\t{\r\n\t\t \t$this->_redirect('error');\r\n\t\t}\t\t\t\r\n\t}", "public function editCustomerAction(Request $request, Card $card)\n {\n $customer = $card->getCustomer();\n $form = $this->createForm(CustomerType::class, $customer);\n $form->handleRequest($request);\n\n if($form->isSubmitted() && $form->isValid()){\n $birthday = $request->request->get('appbundle_customer')['birthday'];\n $customer->setBirthday(new \\DateTime($birthday));\n $em = $this->getDoctrine()->getManager();\n $em->persist($customer);\n $em->flush();\n\n $this->addFlash('success', \"The customer's informations were modified.\");\n\n return $this->redirectToRoute('staff_customer_view', [\n 'number' => $card->getNumber()\n ]);\n }\n\n return $this->render('staff/customer/edit_customer.html.twig', array(\n \"form\" => $form->createView(),\n \"customer\" => $customer\n ));\n }", "function commerce_oz_migs_2p_submit_form($payment_method, $pane_values, $checkout_pane, $order) {\n \n//\t// dsm($payment_method, '$payment_method');\n//\t// dsm($checkout_pane);\n//\t// dsm($pane_values);\n//\t// dsm($order);\n \t \t \t\n // Include the Drupal Commerce credit card file for forms\n module_load_include('inc', 'commerce_payment', 'includes/commerce_payment.credit_card');\n \n\t$settings = _commweb_get_var('commerce_oz_gateway_' . $payment_method['gateway_provider']);\n \n// \tdsm($settings, '$settings');\n\n $form_params = array();\n $form_defaults = array();\n \n // Use CVV Field?\n if($settings['commerce_oz_use_cvv'] == 'cvv')\n {\n \t$form_params['code'] = '';\n }\n \n // Use Card Holder Name Field ?\n if($settings['commerce_oz_use_card_name'] == 'name')\n {\n \t$form_params['owner'] = 'Card Holder';\n }\n \n \n // set the defaults for testing\n if($settings['commerce_oz_transaction_mode'] == 'test')\n {\n\n\t\t \t$form_defaults['number'] = $settings['commerce_oz_test_card_number'];\n\t\t \t$form_defaults['code'] = $settings['commerce_oz_test_card_cvv'];\n\t\t \t$form_defaults['exp_month'] = $settings['commerce_oz_test_card_exp_month'];\n\t\t \t$form_defaults['exp_year'] = $settings['commerce_oz_test_card_exp_year'];\n\t\t}\n\t\t\n\n $gateway = commerce_oz_load_gateway_provider($payment_method['gateway_provider']);\n \n \t$form = commerce_payment_credit_card_form($form_params, $form_defaults);\n\n\t$logopath = '/' . drupal_get_path('module', 'commerce_oz') . '/image/' . $payment_method['gateway_provider'] . '_68.png';\n\t\n\t$descText = '<a href=\"' . $gateway['owner_website'] . '\"><img src=\"' . $logopath . '\" /></a><br />Enter your payment details below and Click Continue.<br />On completing your transaction, you will be taken to your Receipt information.<br />';\n\n $form['commweb_3p_head'] = array(\n '#type' => 'fieldset',\n '#title' => t($payment_method['title']),\n '#collapsible' => FALSE, \n \t'#collapsed' => FALSE,\n '#description' => t($descText),\n );\n \n\n if($settings['commerce_oz_transaction_mode'] == 'test')\n {\n // // dsm($form);\n \n \n $form['credit_card']['number']['#description'] = t('<strong>Test Mode</strong> - You can only use the credit cards listed here to test in Test Mode. Valid card numbers are:\n \t\t<br /><br />Master:&nbsp;&nbsp;5123456789012346\n <br />Visa:&nbsp;&nbsp;&nbsp;&nbsp;4987654321098769\n <br />Amex:&nbsp;&nbsp;&nbsp;345678901234564\n <br />Diners:&nbsp;&nbsp;30123456789019\n <br /><br />All CommWeb Test Cards must use 05-2013 as the Expiry Date.');\n\n $form['credit_card']['exp_year']['#description'] = t('<strong>est Mode</strong> - All CommWeb Test Cards must use 05-2013 as the Expiry Date');\n\n $form['credit_card']['owner']['#description'] = t('<strong>Test Mode</strong> - Transactions do NOT require or use the Card Owner field. If you choose to request this information from your users it will however be stored with the transaction record.');\n\n \n \n // Provide a textfield to pass different Amounts to MIGS \n $form['credit_card']['test_amount'] = array(\n '#input' => TRUE,\n\n '#type' => 'textfield',\n '#size' => 6,\n '#maxlength' => 10,\n \t\t\n '#title' => t('Test Mode - Custom Amount'), \n '#default_value' => $order->commerce_order_total['und'][0]['amount'],\n '#disabled' => FALSE,\n '#description' => t('<strong>Test Mode</strong> - Update the Amount (in cents) sent for processing to change your desired transaction response.<br /> Valid amounts are <br />xxx00 = Approved\n <br />xxx05 = Declined. Contact Bank.\n <br />xxx10 = Transaction could not be processed.\n <br />xxx33 = Expired Card.\n <br />xxx50 = Unspecified Failure.\n <br />xxx51 = Insufficient Funds.\n <br />xxx68 = Communications failure with bank'),\n '#required' => FALSE, \n ); \n \n }\n \n \n \t$form['commweb_3p_head']['credit_card'] = $form['credit_card'];\n\tunset($form['credit_card']);\n\t\n//\t// dsm($form);\n\t\n return $form;\n \n}", "function edit($id)\n { \n // check if the card exists before trying to edit it\n $data['card'] = $this->Card_model->get_card($id);\n \n if(isset($data['card']['id']))\n {\n if(isset($_POST) && count($_POST) > 0) \n { \n $params = array(\n\t\t\t\t\t'jns_card' => $this->input->post('jns_card'),\n );\n\n $this->Card_model->update_card($id,$params); \n redirect('card/index');\n }\n else\n {\n $data['_view'] = 'card/edit';\n $this->load->view('layouts/main',$data);\n }\n }\n else\n show_error('The card you are trying to edit does not exist.');\n }", "public function edit($id){\n\t\t$token = Token::findOrFail($id);\n\t\treturn view('_admin.tokens.edit')->with(['token'=>$token]);\n\t}", "public function formAction()\n {\n $token = Generator::getRandomString(25);\n $this->set(\"token\", $token);\n $_SESSION['token'] = $token;\n }", "public function action_addcreditcard() {\n $package = Model::factory('package');\n $btn_card_confirm = arr::get($_REQUEST, 'btn_card_confirm');\n $config_country['taxicountry'] = $this->country_info();\n $this->session = Session::instance();\n $errors = array();\n $userid = $this->session->get('userid');\n $postvalue = Arr::map('trim', $this->request->post());\n\n $getadmin_profile_info = $package->getadmin_profile_info();\n\n\n $post_values = Securityvalid::sanitize_inputs($postvalue);\n $billing_card_info_details = $package->billing_card_info_details();\n if (empty($billing_card_info_details)) {\n $billing_info_id = '';\n } else {\n $billing_info_id = $billing_card_info_details[0]['_id'];\n }\n if (isset($btn_card_confirm) && Validation::factory($_POST)) {\n $validator = $package->upgrade_plan_validate(arr::extract($post_values, array('cardnumber', 'cvv', 'expirydate', 'firstName', 'lastname', 'address', 'postal_code', 'terms', 'country', 'state', 'city')), $userid);\n if ($validator->check()) {\n $cardnumber = $postvalue['cardnumber'];\n $cvv = $postvalue['cvv'];\n $expirydate = explode('/', $postvalue['expirydate']);\n $firstname = $postvalue['firstName'];\n $lastname = $postvalue['lastname'];\n $address = $postvalue['address'];\n $city = $postvalue['city'];\n $country = $postvalue['country'];\n $state = $postvalue['state'];\n $postal_code = $postvalue['postal_code'];\n $package_upgrade_time = PACKAGE_UPGRADE_TIME;\n $cardnumber = preg_replace('/\\s+/', '', $cardnumber);\n \n $this->billing_info['card_number'] = $cardnumber;\n $this->billing_info['cvv'] = $cvv;\n $this->billing_info['expirationMonth'] = $expirydate[0];\n $this->billing_info['expirationYear'] = $expirydate[1];\n $this->billing_info['firstName'] = $firstname;\n $this->billing_info['lastname'] = $lastname;\n $this->billing_info['address'] = $address;\n $this->billing_info['city'] = $city;\n $this->billing_info['country'] = $country;\n $this->billing_info['state'] = $state;\n $this->billing_info['postal_code'] = $postal_code;\n $this->billing_info['createdate'] = $package_upgrade_time; \n $this->billing_info['currency']=CLOUD_CURRENCY_FORMAT; \n $billing_info_reg = $package->billing_registration($this->billing_info, $billing_info_id);\n if ($billing_info_reg) {\n Message::success(__('billing_updated_sucessfully'));\n }\n } else {\n $errors = $validator->errors('errors');\n }\n }\n $view = View::factory(ADMINVIEW . 'package_plan/addcreditcard')\n ->bind('postedvalues', $this->userPost)\n ->bind('errors', $errors)\n ->bind('getadmin_profile_info', $getadmin_profile_info)\n ->bind('subscription_cost_month', $subscription_cost_month)\n ->bind('billing_card_info_details', $billing_card_info_details)\n ->bind('all_country_list', $config_country['taxicountry'])\n ->bind('setup_cost', $setup_cost)\n ->bind('postvalue', $post_values);\n $this->template->title = CLOUD_SITENAME . \" | \" . __('add_credit_card');\n $this->template->page_title = __('add_credit_card');\n $this->template->content = $view;\n }", "function InfUpdateCreditCard($inf_card_id, $CardNumber='', $ExpirationMonth, $ExpirationYear, $NameOnCard, $BillAddress1, $BillCity, $BillState, $BillZip, $BillCountry) {\n\n\t$credit_card = new Infusionsoft_CreditCard();\n\t$credit_card->Id = $inf_card_id;\n\tif ($CreditCard<>\"\") {\n\t\t$credit_card->CardNumber = $CardNumber;\n\t}\n\t$credit_card->ExpirationMonth = $ExpirationMonth;\n\t$credit_card->ExpirationYear = $ExpirationYear;\n\t$credit_card->NameOnCard = $NameOnCard;\n\t$credit_card->BillAddress1 = $BillAddress1;\n\t$credit_card->BillCity = $BillCity;\n\t$credit_card->BillState = $BillState;\n\t$credit_card->BillZip = $BillZip;\n\t$credit_card->BillCountry = $BillCountry;\n\treturn $credit_card->save(); // Update Card in Infusionsoft\n}", "public function actionPaymentcard()\n\t{ \n\t\t\n\t\tif( isset($_SESSION['invoice_id']) )\n\t\t{\n\t\t\t$invoiceModel = new Invoices;\n\t\t\t$payment\t\t= $invoiceModel->getInvoicePayment( $_SESSION['invoice_id'] );\n\t\t\t# Add 2% of the total in the invoice total for creditcard only\n\t\t\t$twoPercentAmount = ($payment[0]['payment_amount'] * 2)/100;\n\t\t\t$payment[0]['payment_amount'] += round($twoPercentAmount, 2);\n\t\t\t$this->render(\"cardForm\", array(\"payment\"=>$payment));\n \t\t}\n\t\t\n\t}", "function protectForm() {\n\t\techo \"<input type=\\\"hidden\\\" name=\\\"spack_token\\\" value=\\\"\".$this->token.\"\\\" />\";\n\t}", "function edd_stripe_new_card_form() {\n\tif ( edd_stripe()->rate_limiting->has_hit_card_error_limit() ) {\n\t\tedd_set_error( 'edd_stripe_error_limit', __( 'Adding new payment methods is currently unavailable.', 'edds' ) );\n\t\tedd_print_errors();\n\t\treturn;\n\t}\n?>\n\n<p id=\"edd-card-name-wrap\">\n\t<label for=\"card_name\" class=\"edd-label\">\n\t\t<?php esc_html_e( 'Name on the Card', 'edds' ); ?>\n\t\t<span class=\"edd-required-indicator\">*</span>\n\t</label>\n\t<span class=\"edd-description\"><?php esc_html_e( 'The name printed on the front of your credit card.', 'edds' ); ?></span>\n\t<input type=\"text\" name=\"card_name\" id=\"card_name\" class=\"card-name edd-input required\" placeholder=\"<?php esc_attr_e( 'Card name', 'edds' ); ?>\" autocomplete=\"cc-name\" />\n</p>\n\n<div id=\"edd-card-wrap\">\n\t<label for=\"edd-card-element\" class=\"edd-label\">\n\t\t<?php esc_html_e( 'Credit Card', 'edds' ); ?>\n\t\t<span class=\"edd-required-indicator\">*</span>\n\t</label>\n\n\t<div id=\"edd-stripe-card-element\"></div>\n\t<div id=\"edd-stripe-card-errors\" role=\"alert\"></div>\n\n\t<p></p><!-- Extra spacing -->\n</div>\n\n<?php\n\t/**\n\t * Allow output of extra content before the credit card expiration field.\n\t *\n\t * This content no longer appears before the credit card expiration field\n\t * with the introduction of Stripe Elements.\n\t *\n\t * @deprecated 2.7\n\t * @since unknown\n\t */\n\tdo_action( 'edd_before_cc_expiration' );\n}", "public function updatecard(){\n //retreive and clean data from the register card form\n $cardid = parent::CleanData($_GET['cardid']);\n $costcenter = parent::CleanData($_GET['costcenter']); \n $location = parent::CleanData($_GET['location']);\n $funcarea = parent::CleanData($_GET['funcarea']);\n //check for empty fields\n if (empty($cardid) || empty($costcenter) || empty($location) || empty($funcarea))\n {\n ?>\n <p>* Nekatera polja so prazna, prosim da pozkusite ponovno.</p>\n <?php \n } else {\n //create query with form data\n $query = \"INSERT INTO table1 (St_kartice1, Cost_center, Lokacija_koda, Func_area)\n VALUES('$cardid','$costcenter','$location','$funcarea')\";\n //execute query\n $result = mysql_query($query);\n //Check result\n if ($result) {\n ?>\n <p>* Kartica je bila registrirana, prosim da validirate ponovno</p>\n <?php \n } else {\n ?>\n <p>* Registriranje ni mozno: <?php print mysql_error();?></p>\n <?php\n }\n }\n }", "public function stripeformAction() {\n\n $this->conf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['armpayments']);\n $apiSecretKey = $this->conf['stripeApiKey'];\n $publishKey = $this->conf['stripePubKey'];\n $stripeObj = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('ARM\\\\Armpayments\\\\Libraries\\\\Stripe\\\\T3Stripe', $apiSecretKey, $publishKey);\n $stripeObj->init();\n\n $orderid = $this->request->getArgument('orderid');\n $amount = $this->request->getArgument('amount');\n $amountCent = intval($this->request->getArgument('amountcent'));\n $vat = $this->request->getArgument('vat');\n $tablename = $this->request->getArgument('tablename');\n $currency = $this->request->getArgument('currency');\n $description = $this->request->getArgument('description');\n $method = $this->request->getArgument('method');\n $mail = $this->request->getArgument('email');\n\n $this->view->assign('stripePubKey', $publishKey);\n $this->view->assign('orderid', $orderid);\n $this->view->assign('amount', $amount);\n $this->view->assign('amountCent', $amountCent);\n $this->view->assign('vat', $vat);\n $this->view->assign('currency', $currency);\n $this->view->assign('description', urldecode($description));\n $this->view->assign('tablename', $tablename); \n $this->view->assign('method', $method);\n $this->view->assign('email', $mail);\n\n }", "public function edit()\n\t{\n\t\t\t$id = Auth::id();\n\t\t\n\t\t $userCardio = User::find($id)->UserCardio;\n\n\n // show the edit form and pass the userStat\n return View::make('userCardio.edit')\n ->with('userCardio', $userCardio);\n\t\t\n\t}", "public function ProcessUpdateCreditCardForm($result, $value, $form, $field)\r\n\t{\r\n\t\tif($field->type == 'creditcard')\r\n\t\t{\r\n\t\t\t// Get the user id to send to stripe\r\n\t\t\t$customer_id = $this->GetUser();\r\n\r\n\t\t\t$response = json_decode(str_replace('\\\\\"', '\"', $_POST['stripe_response']));\r\n\r\n\t\t\ttry {\r\n\t\t\t\t$this->Stripe->UpdateCustomerCreditCard($customer_id, $response);\r\n\t\t\t} catch (Exception $e) {\r\n\t\t\t\t$err = $e->getJsonBody();\r\n\t\t\t\t$err = $err['error'];\r\n\r\n\t\t\t\t$result['is_valid'] = false;\r\n\t\t\t\t$result['message'] = $err['message'];\r\n\t\t\t}\t\t\t\t\r\n\t\t}\r\n\r\n\t\treturn $result;\r\n\t}", "public function deletecardAction()\n {\n $isValidToken = false;\n $token = $this->getRequest()->getParam('t');\n $customer = $this->_getCustomer();\n $api = $this->_getApi();\n $paymentMethods = $api->getPaymentMethods($customer->getId(), true);\n \n foreach($paymentMethods as $key => $pm) {\n if($pm->getData('paymentMethodToken') == $token) {\n $isValidToken = true;\n }\n }\n \n if($isValidToken) {\n $this->_delete($customer->getId(), $token);\n Mage::getSingleton('core/session')->addSuccess('Credit card has been deleted.');\n $this->_redirect('payments/customer/creditcards');\n } else {\n Mage::getSingleton('core/session')->addError('Credit card token is not valid. Please try again.');\n $this->_redirect('payments/customer/creditcards');\n }\n }", "public function edit($id)\n {\n $customer = Customer::find($id);\n $credit_cards = CreditCard::all();\n\n return view('transaction.customer.edit', compact('customer', 'credit_cards'));\n }", "public function credit ($number)\n {\n $req = new FortieRequest();\n $req->method('PUT');\n $req->path($this->basePath)->path($number)->path('credit');\n\n return $this->send($req->build());\n }", "public function edit_promocode_form(){\n\t\tif ($this->checkLogin('A') == ''){\n\t\t\tredirect(ADMIN_ENC_URL);\n\t\t}else {\n\t\t if ($this->lang->line('admin_promocode_edit_coupon_code') != '') \n\t\t $this->data['heading']= stripslashes($this->lang->line('admin_promocode_edit_coupon_code')); \n\t\t else $this->data['heading'] = 'Edit Coupon Code';\n\t\t\t$promo_id = $this->uri->segment(4,0);\n\t\t\t$condition = array('_id' => MongoID($promo_id));\n\t\t\t$this->data['promocode_details'] = $this->promocode_model->get_all_details(PROMOCODE,$condition);\n\t\t\tif ($this->data['promocode_details']->num_rows() == 1){\n\t\t\t\t$this->load->view(ADMIN_ENC_URL.'/promocode/edit_promocode',$this->data);\n\t\t\t}else {\n\t\t\t\tredirect(ADMIN_ENC_URL);\n\t\t\t}\n\t\t}\n\t}", "public function edit(Cryptocurrency $cryptocurrency)\n {\n //\n }", "public function getChangeNumberCardForm(){\n $cards = $this->getCardsWithoutCustomer();\n $choices = array();\n foreach ($cards as $availableCard){\n $choices[\"Card n°\".$availableCard->getNumber()] = $availableCard->getNumber();\n }\n\n $form = $this->formFactory->create()\n ->add('number', ChoiceType::class, array(\n \"choices\" => $choices,\n 'attr' => array(\n \"class\" => \"browser-default\"\n )\n ));\n\n return $form;\n }", "public function edit(Bank $bank)\n {\n //\n }", "public function saveAction()\n {\n $postData = $this->getRequest()->getPost();\n\n if ($profileId = $this->getRequest()->getParam('id')) {\n $model = Mage::getModel('authnettoken/cim_payment_profile')->load($profileId);\n }\n else {\n $model = Mage::getModel('authnettoken/cim_payment_profile');\n }\n\n if ($postData) {\n\n try {\n try {\n // Save post data to model\n $model->addData($postData);\n // Now try to save payment profile to Auth.net CIM\n $model->saveCimProfileData(true);\n }\n catch (SFC_AuthnetToken_Helper_Cim_Exception $eCim) {\n Mage::getSingleton('adminhtml/session')->addError('Failed to save credit card to Authorize.Net CIM!');\n if ($eCim->getResponse() != null) {\n Mage::getSingleton('adminhtml/session')->addError('CIM Result Code: ' . $eCim->getResponse()->getResultCode());\n Mage::getSingleton('adminhtml/session')->addError('CIM Message Code: ' .\n $eCim->getResponse()->getMessageCode());\n Mage::getSingleton('adminhtml/session')->addError('CIM Message Text: ' .\n $eCim->getResponse()->getMessageText());\n }\n // Send customer back to saved credit cards grid\n $this->_redirect('adminhtml/customer/edit/tab/customer_info_tabs_paymentprofile',\n array('id' => $postData['customer_id']));\n\n return;\n }\n\n // Now save model\n $model->save();\n\n Mage::getSingleton('adminhtml/session')->addSuccess(\n Mage::helper('adminhtml')->__('Saved credit card ' . $model->getCustomerCardnumber() . '.'));\n Mage::getSingleton('adminhtml/session')->setCustomerData(false);\n\n if ($this->getRequest()->getParam('back')) {\n $this->_redirect('*/*/edit', array('id' => $model->getId()));\n\n return;\n }\n $this->_redirect('adminhtml/customer/edit/tab/customer_info_tabs_paymentprofile',\n array('id' => $model->getCustomerId()));\n\n return;\n }\n catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError('Failed to save credit card!');\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n // Send customer back to saved credit cards grid\n $this->_redirect('adminhtml/customer/edit/tab/customer_info_tabs_paymentprofile',\n array('id' => $postData['customer_id']));\n }\n }\n\n // Send customer back to saved credit cards grid\n $this->_redirect('adminhtml/customer/edit/tab/customer_info_tabs_paymentprofile', array('id' => $postData['customer_id']));\n }", "public function edit()\n {\n // get resources for display \n $website = Website::where('name','flooflix')->first();\n if (!is_null($website) && !empty($website)) {\n $page = Page::where('website_id', $website->id)->where('name','modifier_carte')->first();\n if(!is_null($page) && !empty($page)){\n $datas = $page->getResourcesToDisplayPage($page);\n } \n }else{\n return view('errors.404');\n }\n return view('Flooflix.forms.editBankCard', compact('datas'));\n }", "function give_get_cc_form( $form_id ) {\n\n\tob_start();\n\n\t/**\n\t * Fires while rendering credit card info form, before the fields.\n\t *\n\t * @param int $form_id The form ID.\n\t *\n\t * @since 1.0\n\t *\n\t */\n\tdo_action( 'give_before_cc_fields', $form_id );\n\t?>\n\t<fieldset id=\"give_cc_fields-<?php echo $form_id; ?>\" class=\"give-do-validate\">\n\t\t<legend><?php echo apply_filters( 'give_credit_card_fieldset_heading', esc_html__( 'Credit Card Info', 'give' ) ); ?></legend>\n\t\t<?php if ( is_ssl() ) : ?>\n\t\t\t<div id=\"give_secure_site_wrapper-<?php echo $form_id; ?>\">\n\t\t\t\t<span class=\"give-icon padlock\"></span>\n\t\t\t\t<span><?php _e( 'This is a secure SSL encrypted payment.', 'give' ); ?></span>\n\t\t\t</div>\n\t\t<?php endif; ?>\n\t\t<p id=\"give-card-number-wrap-<?php echo $form_id; ?>\" class=\"form-row form-row-two-thirds form-row-responsive\">\n\t\t\t<label for=\"card_number-<?php echo $form_id; ?>\" class=\"give-label\">\n\t\t\t\t<?php _e( 'Card Number', 'give' ); ?>\n\t\t\t\t<span class=\"give-required-indicator\">*</span>\n\t\t\t\t<?php echo Give()->tooltips->render_help( __( 'The (typically) 16 digits on the front of your credit card.', 'give' ) ); ?>\n\t\t\t\t<span class=\"card-type\"></span>\n\t\t\t</label>\n\n\t\t\t<input type=\"tel\" autocomplete=\"off\" name=\"card_number\" id=\"card_number-<?php echo $form_id; ?>\"\n\t\t\t class=\"card-number give-input required\" placeholder=\"<?php _e( 'Card number', 'give' ); ?>\"\n\t\t\t required aria-required=\"true\"/>\n\t\t</p>\n\n\t\t<p id=\"give-card-cvc-wrap-<?php echo $form_id; ?>\" class=\"form-row form-row-one-third form-row-responsive\">\n\t\t\t<label for=\"card_cvc-<?php echo $form_id; ?>\" class=\"give-label\">\n\t\t\t\t<?php _e( 'CVC', 'give' ); ?>\n\t\t\t\t<span class=\"give-required-indicator\">*</span>\n\t\t\t\t<?php echo Give()->tooltips->render_help( __( 'The 3 digit (back) or 4 digit (front) value on your card.', 'give' ) ); ?>\n\t\t\t</label>\n\n\t\t\t<input type=\"tel\" size=\"4\" autocomplete=\"off\" name=\"card_cvc\" id=\"card_cvc-<?php echo $form_id; ?>\"\n\t\t\t class=\"card-cvc give-input required\" placeholder=\"<?php _e( 'Security code', 'give' ); ?>\"\n\t\t\t required aria-required=\"true\"/>\n\t\t</p>\n\n\t\t<p id=\"give-card-name-wrap-<?php echo $form_id; ?>\" class=\"form-row form-row-two-thirds form-row-responsive\">\n\t\t\t<label for=\"card_name-<?php echo $form_id; ?>\" class=\"give-label\">\n\t\t\t\t<?php _e( 'Cardholder Name', 'give' ); ?>\n\t\t\t\t<span class=\"give-required-indicator\">*</span>\n\t\t\t\t<?php echo Give()->tooltips->render_help( __( 'The name of the credit card account holder.', 'give' ) ); ?>\n\t\t\t</label>\n\n\t\t\t<input type=\"text\" autocomplete=\"off\" name=\"card_name\" id=\"card_name-<?php echo $form_id; ?>\"\n\t\t\t class=\"card-name give-input required\" placeholder=\"<?php esc_attr_e( 'Cardholder Name', 'give' ); ?>\"\n\t\t\t required aria-required=\"true\"/>\n\t\t</p>\n\t\t<?php\n\t\t/**\n\t\t * Fires while rendering credit card info form, before expiration fields.\n\t\t *\n\t\t * @param int $form_id The form ID.\n\t\t *\n\t\t * @since 1.0\n\t\t *\n\t\t */\n\t\tdo_action( 'give_before_cc_expiration' );\n\t\t?>\n\t\t<p class=\"card-expiration form-row form-row-one-third form-row-responsive\">\n\t\t\t<label for=\"card_expiry-<?php echo $form_id; ?>\" class=\"give-label\">\n\t\t\t\t<?php _e( 'Expiration', 'give' ); ?>\n\t\t\t\t<span class=\"give-required-indicator\">*</span>\n\t\t\t\t<?php echo Give()->tooltips->render_help( __( 'The date your credit card expires, typically on the front of the card.', 'give' ) ); ?>\n\t\t\t</label>\n\n\t\t\t<input type=\"hidden\" id=\"card_exp_month-<?php echo $form_id; ?>\" name=\"card_exp_month\"\n\t\t\t class=\"card-expiry-month\"/>\n\t\t\t<input type=\"hidden\" id=\"card_exp_year-<?php echo $form_id; ?>\" name=\"card_exp_year\"\n\t\t\t class=\"card-expiry-year\"/>\n\n\t\t\t<input type=\"tel\" autocomplete=\"off\" name=\"card_expiry\" id=\"card_expiry-<?php echo $form_id; ?>\"\n\t\t\t class=\"card-expiry give-input required\" placeholder=\"<?php esc_attr_e( 'MM / YY', 'give' ); ?>\"\n\t\t\t required aria-required=\"true\"/>\n\t\t</p>\n\t\t<?php\n\t\t/**\n\t\t * Fires while rendering credit card info form, after expiration fields.\n\t\t *\n\t\t * @param int $form_id The form ID.\n\t\t *\n\t\t * @since 1.0\n\t\t *\n\t\t */\n\t\tdo_action( 'give_after_cc_expiration', $form_id );\n\t\t?>\n\t</fieldset>\n\t<?php\n\t/**\n\t * Fires while rendering credit card info form, before the fields.\n\t *\n\t * @param int $form_id The form ID.\n\t *\n\t * @since 1.0\n\t *\n\t */\n\tdo_action( 'give_after_cc_fields', $form_id );\n\n\techo ob_get_clean();\n}", "public function editCurrencyAction(){\r\n $form = $this -> view -> form = new Groupbuy_Form_Admin_Currency();\r\n\r\n //Check post method\r\n if($this -> getRequest() -> isPost() && $form -> isValid($this -> getRequest() -> getPost())) {\r\n\r\n $values = $form -> getValues();\r\n $db = Engine_Db_Table::getDefaultAdapter();\r\n $db -> beginTransaction();\r\n try {\r\n\t\t// Edit currency in the database\r\n $code=$values[\"code\"];\r\n $table = new Groupbuy_Model_DbTable_Currencies;\r\n $select = $table -> select() ->where('code = ?',\"$code\");\r\n $row = $table->fetchRow($select);\r\n\r\n $row -> name = $values[\"label\"];\r\n $row -> symbol = $values[\"symbol\"];\r\n $row -> precision = $values[\"precision\"];\r\n $row -> display = $values[\"display\"];\r\n\r\n if(isset($values[\"status\"])) $row -> status = $values[\"status\"];\r\n //Database Commit\r\n $row -> save();\r\n $db -> commit();\r\n }\r\n catch( Exception $e ) {\r\n $db -> rollBack();\r\n throw $e;\r\n }\r\n //Close Form If Editing Successfully\r\n\t\t$this -> _forward('success', 'utility', 'core', array('smoothboxClose' => 10, 'parentRefresh' => 10, 'messages' => array('')));\r\n }\r\n \r\n // Get Code Id - Throw Exception If There Is No Code Id\r\n if(!($code = $this -> _getParam('code_id'))) {\r\n throw new Zend_Exception('No code id specified');\r\n }\r\n\r\n // Generate and assign form\r\n\t\t$table = new Groupbuy_Model_DbTable_Currencies;\r\n\t\t$select = $table -> select() ->where('code = ?',\"$code\");\r\n $currency = $table->fetchRow($select);\r\n\t\t$form ->populate(array( 'label' => $currency->name,\r\n 'symbol' => $currency->symbol,\r\n 'precision' => $currency->precision,\r\n 'status' => $currency->status,\r\n 'display' => $currency->currencyDisplay(),\r\n 'code' => $currency->code));\r\n \r\n //Hide Status Element if modifing the default currency\r\n if($code == Engine_Api::_()->getApi('settings', 'core')->getSetting('groupbuy.currency', 'USD')){\r\n $form->removeElement('status');\r\n }\r\n //Output\r\n $this -> renderScript('admin-currency/form.tpl');\r\n\r\n }", "public static function getCreditCardForm($order, $amount, $fp_sequence, $relay_response_url, $api_login_id, $transaction_key, $data = null, $test_mode = false, $prefill = true)\n {\n $time = time();\n $fp = self::getFingerprint($api_login_id, $transaction_key, $amount, $fp_sequence, $time);\n $sim = new AuthorizeNetSIM_Form(\n array(\n 'x_amount' => $amount,\n 'x_fp_sequence' => $fp_sequence,\n 'x_fp_hash' => $fp,\n 'x_fp_timestamp' => $time,\n 'x_relay_response'=> \"TRUE\",\n 'x_relay_url' => $relay_response_url,\n 'x_login' => $api_login_id,\n 'x_order' => $order,\n //'x_test_request' => true,\n )\n );\n $hidden_fields = $sim->getHiddenFieldString();\n $post_url = ($test_mode ? self::SANDBOX_URL : self::LIVE_URL);\n $billing_address = (!empty($data['user'])) ? '<div class=\"row\"><label style=\"margin-left:30px; color:#ff8500\">BILLING ADDRESS</label><input type=\"checkbox\" style=\"margin-right:5px;\" id=\"billing\">Use my contact Address here</div>' : \"\"; //BILLING ADDRESS\n $exp_m = '';\n for($i = 1; $i<=12; $i++){\n $j = ($i < 10) ? \"0\".$i : $i;\n $exp_m .= \"<option value='{$j}'>{$j}</option>\";\n } \n\n $Y = date(\"Y\");\n $exp_y = '';\n for($i = $Y; $i < $Y+11; $i++){\n $val = substr($i, -2);\n $exp_y .= \"<option value='{$val}'>{$i}</option>\";\n }\n /*\n<div class=\"row\">\n <label style=\"float:left; margin-left: 30.4%;margin-bottom: 6px;\">Exp.</label>\n <div class=\"date form_datetime b_date\" data-date=\"'.date(\"Y-m-d\").'\" data-date-format=\"mm/dd\" data-link-field=\"dtp_input1\">\n <input size=\"16\" type=\"text\" name=\"x_exp_date\" class=\"form-control1 form-control-bus date_input input-sm\" style=\"width:22%\" value=\"04/17\" readonly>\n <span class=\"add-on\" style=\"float:left;\"><i class=\"icon-th\"></i></span>\n <input type=\"hidden\" id=\"dtp_input1\" value=\"\" />\n </div>\n </div>\n */\n\n \n $form = '\n <div class=\"row payment\" style=\"width:100%;margin:0 auto;text-align:center\"><form method=\"post\" action=\"'.$post_url.'\">\n '.$hidden_fields.'\n <div class=\"row\" style=\"margin-left: -60px;\">\n <label>Card type</label>\n <select name=\"card_type\">\n <option value=\"Visa\">Visa</option>\n <option value=\"American Express\">American Express</option>\n <option value=\"Diners Club\">Diners Club</option>\n <option value=\"Discover\">Discover</option>\n <option value=\"MasterCard\">MasterCard</option>\n <option value=\"UATP Card\">UATP Card</option>\n </select>\n </div>\n <div class=\"row\">\n <label>Card Number</label>\n <input type=\"text\" class=\"text required form-control2 input-sm\" autocomplete=\"off\" size=\"25\" title=\"Card num\" data-toggle=\"popover\" data-content=\"Please enter your card number\" data-type=\"number\" name=\"x_card_num\" value=\"\"></input>\n </div>\n <div class=\"row\">\n <label style=\"float:left; margin-left: 30.4%;margin-bottom: 6px;\">Exp.</label>\n <select name=\"exp_m\" style=\"float:left\">'.$exp_m.'</select>\n <select name=\"exp_y\" style=\"float:left\">'.$exp_y.'</select>\n <input type=\"hidden\" name=\"x_exp_date\" value=\"\">\n </div>\n <div class=\"row\">\n <label style=\"margin-left: 20px;\">CCV</label>\n <input type=\"text\" class=\"text required form-control2 input-sm\" size=\"25\" data-type=\"number\" autocomplete=\"off\" name=\"x_card_code\" value=\"\"></input>&nbsp;&nbsp;<a class=\"glyphicon glyphicon-question-sign\" data-toggle=\"modal\" data-target=\"#myModal\">\n</a>\n </div>\n <div class=\"row\">\n <label>First Name</label>\n <input type=\"text\" class=\"text required form-control2 input-sm\" size=\"25\" title=\"first name\" name=\"x_first_name\" data-content=\"John\" value=\"\"></input>\n </div>\n <div class=\"row\">\n <label>Last Name</label>\n <input type=\"text\" class=\"text required form-control2 input-sm\" size=\"25\" title=\"last name\" name=\"x_last_name\" data-content=\"Doe\" value=\"\"></input>\n </div>'.$billing_address.'\n <div class=\"row\">\n <label>Steet Address</label>\n <input type=\"text\" class=\"text required form-control2 input-sm\" size=\"25\" title=\"address\" name=\"x_address\" data-content=\"123 Main Street\" value=\"\"></input>\n </div>\n <div class=\"row\">\n <label></label>\n <input type=\"text\" class=\"text required form-control2 input-sm\" size=\"25\" title=\"address2\" name=\"x_address2\" data-content=\"123 Main Street\" value=\"\"></input>\n </div>\n <div class=\"row\">\n <label>City</label>\n <input type=\"text\" class=\"text required form-control2 input-sm\" size=\"25\" title=\"city\" name=\"x_city\" data-content=\"Boston\" value=\"\"></input>\n </div>\n <div class=\"row\">\n <label>State</label>\n <select class=\"text required form-control2 input-sm bfh-states\" id=\"state\" name=\"x_state\" data-country=\"country\"></select>\n </div>\n <div class=\"row\">\n <label>Zip Code</label>\n <input type=\"text\" class=\"text required form-control2 input-sm\" size=\"25\" title=\"zip\" data-type=\"number\" name=\"x_zip\" data-content=\"02142\" value=\"\"></input>\n </div>\n <div class=\"row\">\n <label>Country</label>\n <select id=\"country\" name=\"x_country\" class=\"text required form-control2 input-sm bfh-countries\" data-country=\"US\"></select>\n </div>\n <div class=\"row\">\n <div class=\"col-md-12\">\n <label style=\"text-align:center; color:red; margin:0 auto\">amount: $'.$amount.'</label>\n </div>\n </div>\n <div class=\"row\" style=\"text-align:center\">\n<button type=\"button\" id=\"btn-pay\" class=\"noprint btn btn-primary \">Payment</button>\n </div>\n </form></div>';\n return $form;\n }", "public function update(Request $request, $id){\n\t\t$token = Token::find($id);\n\t\t$request->validate([\n\t\t\t'name' => 'required',\n\t\t\t'contract_ABI_array' => 'required',\n\t\t\t'contract_address' => 'required',\n\t\t\t'symbol' => 'required|max:8',\n\t\t\t'decimals' => 'required',\n\t\t\t'description' => 'required',\n\t\t\t'facebook' => 'max:100',\n\t\t]);\n\t\t$ico_start = $request->input('ico_start',NULL);\n\t\t$ico_start = $ico_start? \\Carbon\\Carbon::parse($ico_start):NULL;\n\t\t$ico_ends = $request->input('ico_ends',NULL);\n\t\t$ico_ends = $ico_ends? \\Carbon\\Carbon::parse($ico_ends):NULL;\n\t\t$token->name = $request->input('name');\n\t\t$token->contract_address = $request->input('contract_address');\n\t\t$token->contract_ABI_array = $request->input('contract_ABI_array');\n\t\t$token->contract_Bin = $request->input('contract_Bin');\n\t\t$token->symbol = $request->input('symbol');\n\t\t$token->description = $request->input('description');\n\t\t$token->ico_start = $ico_ends;\n\t\t$token->ico_ends = $ico_ends;\n\t\t$token->token_price = $request->input('token_price',NULL);\n\t\t$token->price = $request->input('token_price', 1);\n\t\t$token->decimals = $request->input('decimals', 18);\n\t\t$token->website = $request->input('website');\n\t\t$token->twitter = $request->input('twitter');\n\t\t$token->facebook = $request->input('facebook');\n\t\t$token->features = $request->input('features');\n\t\t$img = $this->upload('image');\n\t\tif($img){\n\t\t\t$token->technology = $img;\n\t\t}\n\t\t$logo = $this->upload('logo');\n\t\tif($logo){\n\t\t\t$token->logo = $logo;\n\t\t}\n\t\t$token->save();\n\t\treturn response()->json(['status' => 'SUCCESS','message' => 'Token Updated Successfully']);\n\t}", "public function createToken($cardinfo){\n \\Stripe\\Stripe::setApiKey($this->getApi('secret_key'));\n $token = \\Stripe\\Token::create(array(\n \"card\" => array(\n \"number\" => $cardinfo['number'],\n \"exp_month\" => $cardinfo['exp_month'],\n \"exp_year\" => $cardinfo['exp_year'],\n \"cvc\" => $cardinfo['cvc']\n )\n ));\n $this->_token = $token; \n $this->_card = $token->card;\n return $token->card->id;\n }", "public function testTokenEditPage()\n {\n $response = $this->actingAsTestingUser()\n ->withEncryptionKey()\n ->get(route('tokens.edit', [$this->token->id_hash]));\n\n $response->assertStatus(200);\n $response->assertViewIs('tokens.form');\n }", "public function credit()\n\t{\n\t\t\\IPS\\Dispatcher::i()->checkAcpPermission( 'invoices_edit' );\n\t\t\n\t\t/* Load Invoice */\n\t\ttry\n\t\t{\n\t\t\t$invoice = \\IPS\\nexus\\Invoice::load( \\IPS\\Request::i()->id );\n\t\t}\n\t\tcatch ( \\OutOfRangeException $e )\n\t\t{\n\t\t\t\\IPS\\Output::i()->error( 'node_error', '2X190/A', 404, '' );\n\t\t}\n\t\t\t\t\n\t\t/* Can we do this? */\n\t\tif ( $invoice->status !== \\IPS\\nexus\\Invoice::STATUS_PENDING )\n\t\t{\n\t\t\t\\IPS\\Output::i()->error( 'invoice_status_err', '2X190/B', 403, '' );\n\t\t}\n\t\t\n\t\t/* How much can we do? */\n\t\t$amountToPay = $invoice->amountToPay()->amount;\n\t\t$credits = $invoice->member->cm_credits;\n\t\t$credit = $credits[ $invoice->currency ]->amount;\n\t\t$maxCanCharge = ( $credit->compare( $amountToPay ) === -1 ) ? $credit : $amountToPay;\n\n\t\t/* Build Form */\n\t\t$form = new \\IPS\\Helpers\\Form( 'amount', 'invoice_charge_to_credit' );\n\t\t$form->add( new \\IPS\\Helpers\\Form\\Number( 't_amount', $maxCanCharge, TRUE, array( 'min' => 0.01, 'max' => (string) $maxCanCharge, 'decimals' => TRUE ), NULL, NULL, $invoice->currency ) );\n\t\t\n\t\t/* Handle submissions */\n\t\tif ( $values = $form->values() )\n\t\t{\t\t\t\n\t\t\t$transaction = new \\IPS\\nexus\\Transaction;\n\t\t\t$transaction->member = $invoice->member;\n\t\t\t$transaction->invoice = $invoice;\n\t\t\t$transaction->amount = new \\IPS\\nexus\\Money( $values['t_amount'], $invoice->currency );\n\t\t\t$transaction->ip = \\IPS\\Request::i()->ipAddress();\n\t\t\t$transaction->extra = array( 'admin' => \\IPS\\Member::loggedIn()->member_id );\n\t\t\t$transaction->save();\n\t\t\t$transaction->approve( NULL );\n\t\t\t$transaction->sendNotification();\n\t\t\t\n\t\t\t$credits[ $invoice->currency ]->amount = $credits[ $invoice->currency ]->amount->subtract( $transaction->amount->amount );\n\t\t\t$invoice->member->cm_credits = $credits;\n\t\t\t$invoice->member->save();\n\t\t\t\n\t\t\t$invoice->member->log( 'transaction', array(\n\t\t\t\t'type'\t\t\t=> 'paid',\n\t\t\t\t'status'\t\t=> \\IPS\\nexus\\Transaction::STATUS_PAID,\n\t\t\t\t'id'\t\t\t=> $transaction->id,\n\t\t\t\t'invoice_id'\t=> $invoice->id,\n\t\t\t\t'invoice_title'\t=> $invoice->title,\n\t\t\t) );\n\t\t\t\n\t\t\t$this->_redirect( $invoice );\n\t\t}\n\t\t\n\t\t/* Display */\n\t\t\\IPS\\Output::i()->title = \\IPS\\Member::loggedIn()->language()->addToStack( 'invoice_charge_to_credit' );\n\t\t\\IPS\\Output::i()->output = $form;\n\t}", "public function newPostAction()\n {\n // The card\n $card = Mage::getModel('mbiz_cc/cc');\n\n try {\n $post = $this->getRequest()->getPost();\n\n $card->setData(array(\n 'customer' => $this->_getCustomerSession()->getCustomer(),\n 'dateval' => isset($post['dateval-month'], $post['dateval-year']) ? sprintf('%02d%02d', (int) $post['dateval-month'], $post['dateval-year'] - 2000) : null,\n 'cvv' => isset($post['cvv']) ? $post['cvv'] : null,\n 'type' => isset($post['type']) ? $post['type'] : null,\n 'owner' => isset($post['owner']) ? $post['owner'] : null,\n 'number' => isset($post['number']) ? $post['number'] : null,\n ));\n\n /* INFO:\n * To specify the token you can use the event \"cc_validate_before\"\n */\n\n $errors = $card->validate();\n\n if ($errors) {\n foreach ($errors as $error) {\n $this->_getSession()->addError($error);\n }\n } else {\n $card->save();\n $this->_getSession()->addSuccess($this->__('Credit card saved successfully.'));\n }\n\n } catch (Mage_Core_Exception $e) {\n $this->_getSession()->addError($e->getMessage());\n Mage::logException($e);\n }\n\n $this->_redirect('customer/cc/index');\n }", "public function admin_edit($token) {\n\n //Look for the requested\n $meta_data = $this->MetaData->fetch($token);\n \n //Save the user submitted data\n if(!empty($this->request->data)){\n \n if($this->MetaData->save($this->request->data)){\n $this->Session->setFlash(__('The meta data has been updated'), 'success');\n $this->redirect(\"/admin/contents/meta_data/edit/{$token}/\");\n }else{\n $this->Session->setFlash(__('Please correct the errors below'), 'error');\n }\n \n }else{\n $this->request->data = $meta_data;\n }\n }", "public function edit()\n {\n return view('panel.order-management.payment.form-edit');\n }", "function InfUpdateCreditCardCVV($inf_card_id, $CVV2) {\n\n\t$credit_card = new Infusionsoft_CreditCard();\n\t$credit_card->Id = $inf_card_id;\n\t$credit_card->CVV2 = $CVV2;\n\treturn $credit_card->save(); // Update Card in Infusionsoft\n}", "public function creditCardPayment()\n {\n }", "public function edit()\n {\n // Get logged in user\n $customer_user = Auth::user();\n $customer = Auth::user()->customer;\n\n $tab_index = 'customer';\n \n return view('abcc.account.edit', compact('customer_user', 'customer', 'tab_index'));\n }", "public function CreditCard($name, $number, $exp_month, $exp_year, $security_code = FALSE) {\n\t\t$number = str_replace(' ','',$number);\n\t\t$number = trim($number);\n\n\t\t$this->Param('name', $name, 'credit_card');\n\t\t$this->Param('card_num', $number, 'credit_card');\n\t\t$this->Param('exp_month', $exp_month, 'credit_card');\n\t\t$this->Param('exp_year', $exp_year, 'credit_card');\n\t\tif($security_code) {\n\t\t\t$this->Param('cvv', $security_code, 'credit_card');\n\t\t}\n\n\t\treturn true;\n\t}", "public function CreditCard($name, $number, $exp_month, $exp_year, $security_code = FALSE) {\n\t\t$number = str_replace(' ','',$number);\n\t\t$number = trim($number);\n\n\t\t$this->Param('name', $name, 'credit_card');\n\t\t$this->Param('card_num', $number, 'credit_card');\n\t\t$this->Param('exp_month', $exp_month, 'credit_card');\n\t\t$this->Param('exp_year', $exp_year, 'credit_card');\n\t\tif($security_code) {\n\t\t\t$this->Param('cvv', $security_code, 'credit_card');\n\t\t}\n\n\t\treturn true;\n\t}", "public function postChangeCard(BillingRequest $request)\n {\n try {\n $payload = $request->all();\n $creditCardToken = $payload['stripeToken'];\n auth()->user()->meta->updateCard($creditCardToken);\n return redirect('user/billing/details')->with('message', 'Your subscription has been updated!');\n } catch (Exception $e) {\n Log::error($e->getMessage());\n return back()->withErrors(['Could not process the billing please try again.']);\n }\n\n return back()->withErrors(['Could not complete billing, please try again.']);\n }", "public function edit($id)\n {\n //\n return view('admin.credit.edit')->with('credit', Credit::find($id));\n }", "function insert_creditcard($form = array(), $userid = 0)\n {\n global $ilance, $ilconfig, $phrase, $ilpage;\n $form['number_encrypted'] = $ilance->crypt->three_layer_encrypt($form['number'], $ilconfig['key1'], $ilconfig['key2'], $ilconfig['key3']);\n $form['authorized'] = 'yes';\n $form['creditcard_status'] = 'active';\n $form['default_card'] = 'yes';\n if ($ilconfig['creditcard_authentication'])\n {\n $form['authorized'] = 'no';\n }\n $ilance->db->query(\"\n INSERT INTO \" . DB_PREFIX . \"creditcards\n (cc_id, date_added, date_updated, user_id, creditcard_number, creditcard_expiry, cvv2, name_on_card, phone_of_cardowner, email_of_cardowner, card_billing_address1, card_billing_address2, card_city, card_state, card_postalzip, card_country, creditcard_status, default_card, creditcard_type, authorized) \n VALUES(\n NULL,\n '\" . DATETIME24H . \"',\n '\" . DATETIME24H . \"',\n '\" . intval($userid) . \"',\n '\" . $ilance->db->escape_string($form['number_encrypted']) . \"',\n '\" . $ilance->db->escape_string($form['expmon'] . $form['expyear']) . \"',\n '\" . intval($form['cvv2']) . \"',\n '\" . $ilance->db->escape_string($form['first_name'] . \" \" . $form['last_name']) . \"',\n '\" . $ilance->db->escape_string($form['phone']) . \"',\n '\" . $ilance->db->escape_string($form['email']) . \"',\n '\" . $ilance->db->escape_string($form['address1']) . \"',\n '\" . $ilance->db->escape_string($form['address2']) . \"',\n '\" . $ilance->db->escape_string($form['city']) . \"',\n '\" . $ilance->db->escape_string($form['state']) . \"',\n '\" . $ilance->db->escape_string($form['postalzip']) . \"',\n '\" . $ilance->db->escape_string($form['countryid']) . \"',\n '\" . $ilance->db->escape_string($form['creditcard_status']) . \"',\n '\" . $ilance->db->escape_string($form['default_card']) . \"',\n '\" . $ilance->db->escape_string($form['type']) . \"',\n '\" . $ilance->db->escape_string($form['authorized']) . \"')\n \", 0, null, __FILE__, __LINE__);\n $cc_id = $ilance->db->insert_id(); \n $ilance->email->mail = fetch_user('email', $userid);\n $ilance->email->slng = fetch_user_slng(intval($userid));\n $ilance->email->get('member_added_new_card');\t\t\n $ilance->email->set(array(\n '{{username}}' => fetch_user('username', intval($userid)),\n ));\n $ilance->email->send();\n $ilance->email->mail = SITE_EMAIL;\n $ilance->email->slng = fetch_site_slng();\n $ilance->email->get('member_added_new_card_admin');\t\t\n $ilance->email->set(array(\n '{{username}}' => fetch_user('username', intval($userid)),\n ));\n $ilance->email->send();\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"subscription_user\n SET paymethod = 'account'\n WHERE user_id = '\" . intval($userid) . \"'\n \", 0, null, __FILE__, __LINE__);\n return true;\n }", "public function edit(Currency $currency)\n {\n //\n }", "public function update(Request $request, Card $card)\n {\n //\n }", "public function update(Request $request, Card $card)\n {\n //\n }", "public function update(Request $request, Card $card)\n {\n //\n }", "public function update(Request $request, Card $card)\n {\n //\n }", "public function editarCarreraController(){\n $datosController = $_GET[\"id\"];\n //Enviamos al modelo el id para hacer la consulta y obtener sus datos\n $respuesta = Datos::editarCarreraModel($datosController, \"carreras\");\n //Recibimos respuesta del modelo e IMPRIMIMOS UNA FORM PARA EDITAR\n echo'<input type=\"hidden\" value=\"'.$respuesta[\"id\"].'\"\n name=\"idEditar\">\n <input type=\"text\" value =\"'.$respuesta[\"nombre\"].'\"\n name=\"carreraEditar\" required>\n <input type=\"submit\" value= \"Actualizar\">';\n }", "function account_edit()\n {\n }", "public function edit(BankAccount $bankAccount)\n {\n //\n }", "public function edit(BankAccount $bankAccount)\n {\n //\n }", "public function edit(Credito $credito)\n {\n //\n }", "public function edit(Credito $credito)\n {\n //\n }", "function content() {\n echo \"\n <form action='' method='post'>\n <input name='token' type='hidden' value='{$this->params['editToken']}'>\n <input name='editId' type='hidden' value='{$this->params['editId']}'>\n <label for='username'>Username</label>\n <input name='username' placeholder='Username' id='username' type='text' value='{$this->params['username']}'>\n <label for='password'>Password</label>\n <input name='password' placeholder='Replace password (Optional)' id='password' type='password'>\n <label for='role'>Role</label>\n <select name='role' id='role' {$this->params['rolePower']}>\n <option value='1' {$this->params['isAdmin']}>Admin</option>\n <option value='2' {$this->params['isAgent']}>Agent</option>\n </select>\n <input type='submit' value='Edit Account'>\n </form>\n \";\n }", "public function creditcardsAction() {\n if (!$this->_getSession()->isLoggedIn()) {\n $this->_redirect('customer/account/login');\n return;\n }\n\n if ($this->getRequest()->isPost()) {\n $data = $this->getRequest()->getParams();\n if (isset($data)) {\n $result = $this->_save($data);\n switch ($result->getResponseCode()) {\n case self::RESPONSE_CODE_SUCCESS:\n Mage::getSingleton('core/session')->addSuccess('Credit card has been added.');\n break;\n case self::RESPONSE_CODE_FAILURE:\n Mage::getSingleton('core/session')->addError('Credit card has not been saved. Please try again.');\n break;\n }\n\n $this->_redirect('payments/customer/creditcards');\n }\n }\n\n $this->loadLayout();\n $this->_initLayoutMessages('customer/session');\n $this->renderLayout();\n }", "public function edit()\n {\n $data = Customer::where('userID', '=', Auth::user()->id)->first();\n return view('customer.edit', compact('data'))->with('success','Your account details have been updated successfully!');;\n }", "public function resetPasswordForm(string $token): void\n {\n /** Vérifie que le token contient bien le nombre de caractères attendu */\n if (strlen($token) !== 100)\n {\n FlashMessageService::addErrorMessage('Le lien de reinitialisation n\\'est pas valide.');\n }\n else\n {\n /** Créer une instance de Users défini le token passer en paramètre et rechercher un utilisateur avec ce token */\n $userInfo = (new Users())->setPasswordResetToken($token)->getUserByPasswordResetToken();\n\n /** L'utilisateur existe en base de données */\n if ($userInfo !== false)\n {\n /** Si la date d'expiration est dépasser */\n if ($userInfo->getPasswordResetExpire() < (new \\DateTime())->format('Y-m-d H:i:s'))\n {\n FlashMessageService::addErrorMessage('Le lien de reinitialisation est expiré.');\n }\n /** Si le token donnée en paramètre et celui en base de données. */\n else if ($token === $userInfo->getPasswordResetToken())\n {\n $FV = new FormValidator($_POST);\n /** Vérifie que le formulaire est envoyé et que le token CSRF est valide. */\n if ($FV->checkFormIsSend('resetPasswordForm'))\n {\n /** Vérification des champs */\n $FV->verify('password')->isNotEmpty()->passwordConstraintRegex()\n ->passwordCorrespondTo('confirmPassword')->needReEntry();\n $FV->verify('confirmPassword')->needReEntry();\n\n /** Si le formulaire est valide */\n if ($FV->formIsValid())\n {\n /** On stock le mot de passe entrer par l'utilisateur dans l'objet */\n $userInfo->setPassword(password_hash($FV->getFieldValue('password'), PASSWORD_BCRYPT));\n /** Mettre à jour le mot de passe, si un problème survient on indique une erreur. */\n if ($userInfo->updateUserPasswordById())\n {\n FlashMessageService::addSuccessMessage('Mot de passe mis à jour avec succès, vous pouvez désormais vous connecté.');\n $this->redirect(\\AltoRouter::getRouterInstance()\n ->generate('login'));\n }\n else\n {\n FlashMessageService::addErrorMessage('Une erreur est survenue lors de la mise à jour de votre mot de passe, veuillez ressayer.');\n }\n }\n }\n }\n }\n else\n {\n FlashMessageService::addErrorMessage('Le lien de reinitialisation n\\'est pas valide.');\n }\n }\n $this->render('Authentification/ResetPasswordForm', 'Reinitialisation du mot de passe.');\n }", "public function edit(Cards $cards)\n {\n //return view('cards.edit', ['cards'=>$cards]);\n }", "public function edit($id)\n\t{\n\t\t$paymentmethod = Paymentmethod::find($id);\n $accounts = Account::where('organization_id',Confide::user()->organization_id)->get();\n\t\treturn View::make('paymentmethods.edit', compact('paymentmethod','accounts'));\n\t}", "protected function form($id = null)\n {\n $user = Auth::user();\n if (is_null($id)) {\n return view('billing.add');\n } else {\n\n$data=PayCompany::where('my_company_id',$user->my_company_id)->where('id',$id)->first();\n return view('billing.edit', $data);\n }\n\n\n }", "public function edit(VoucherUniqueCode $voucherUniqueCode)\n {\n //\n }", "function twitter_oauth_callback_form($form, &$form_state) {\n $form['#post']['oauth_token'] = $_GET['oauth_token'];\n $form['oauth_token'] = array(\n '#type' => 'hidden',\n '#default_value' => $_GET['oauth_token'],\n );\n return $form;\n}", "public function edit(Request $request)\n {\n $request->user()->createOrGetStripeCustomer();\n return $request->user()->redirectToBillingPortal();\n }", "public function edit($pm_id)\n {\n if(!is_group('admin')){\n redirect('admin');\n exit();\n }\n // check if the payment exists before trying to edit it\n $render_data['payment'] = $this->payment->get_payment($pm_id);\n\n if (isset($render_data['payment']['pm_id'])) {\n if (isset($_POST) && count($_POST) > 0) {\n $params = array(\n 'title' => $this->input->post('title'),\n 'bank_name' => $this->input->post('bank_name',true),\n 'bank_acc' => $this->input->post('bank_acc',true),\n 'bank_branch' => $this->input->post('bank_branch',true),\n 'bank_type' => $this->input->post('bank_type',true),\n 'type' => $this->input->post('type',true),\n 'detail' => $this->input->post('detail',true)\n );\n\n $this->payment->update_payment($pm_id, $params);\n redirect('admin/payment/index');\n } else {\n $js = ' $(function(){\n\t\t\t\tCKEDITOR.replace( \"body\" ,{\n\t\t\t\t\tfilebrowserBrowseUrl : \"'.base_url('js/ckfinder/ckfinder.html').'\",\n\t\t\t\t\tfilebrowserImageBrowseUrl : \"'.base_url('js/ckfinder/ckfinder.html?type=Images').'\",\n\t\t\t\t\tfilebrowserFlashBrowseUrl : \"'.base_url('js/ckfinder/ckfinder.html?type=Flash').'\",\n\t\t\t\t\tfilebrowserUploadUrl : \"'.base_url('js/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files').'\",\n\t\t\t\t\tfilebrowserImageUploadUrl : \"'.base_url('js/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images').'\",\n\t\t\t\t\tfilebrowserFlashUploadUrl : \"'.base_url('js/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash').'\"\n\t\t\t\t});\n\t\t\t\t$(\"#slideshow_upload\").hide();\n\t\t\t\tif ($(\"#is_slideshow\").attr(\"checked\") == \"checked\")\n\t\t\t\t{\n\t\t\t\t\t$(\"#slideshow_upload\").show();\n\t\t\t\t}\n\t\t\t\t$(\"#is_slideshow\").click(function(){\n\t\t\t\t\tif ($(this).attr(\"checked\") == \"checked\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$(\"#slideshow_upload\").slideDown();\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$(\"#slideshow_upload\").slideUp();\n\t\t\t\t\t}\n\t\t\t\t}); \n\t\t\t});';\n $this->template->write('js', $js);\n //******* Defalut ********//\n $render_data['user'] = $this->session->userdata('fnsn');\n $this->template->write('title', 'Payment Information');\n $this->template->write('user_id', $render_data['user']['aid']);\n $this->template->write('user_name', $render_data['user']['name']);\n $this->template->write('user_group', $render_data['user']['group']);\n //******* Defalut ********//\n $this->template->write_view('content', 'admin/payment/edit', $render_data);\n $this->template->render();\n }\n } else\n show_error('The payment you are trying to edit does not exist.');\n }", "public function edit(accreditation $accreditation)\n {\n //\n }", "public function edit_token($id)\n {\n $record = LanguageToken::where('id', $id)->get()->first();\n if($isValid = $this->isValidRecord($record))\n return redirect($isValid);\n $data['record'] = $record;\n $data['active_class'] = 'languages';\n $data['title'] = LanguageHelper::getPhrase('edit_language_token');\n $data['layout'] = 'layouts.admin.adminlayout';\n $data['admin'] = $this->admin;\n $data['breadcumbs'] = $this->breadcumbs;\n return view('lmanager::languages.add-edit-token', $data);\n }", "public function edit($id, Request $request)\n\t{\n\t\t$back_route = $request->has('back_route') ? urldecode($request->input('back_route')) : '' ;\n\t\t\n\t\t$payment = $this->payment->with('currency')->findOrFail($id);\n\t\t\n\t\treturn view('customer_vouchers.edit', compact('payment', 'back_route'));\n\t}", "function edit($message = '') {\n\t$add_certificates = open_table_form('Edit Certificate Amount','edit_certificate_amount',SITE_ADMIN_SSL_URL.'?sect=retcustomer&mode=certificateamounteditcheck&lid='.$_GET['lid'],'post',$message);\n\t$add_certificates .= $this->form();\n\t$add_certificates .= close_table_form();\n return $add_certificates;\n }", "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 {\n //\n\n $barcode = Crypt::decryptString($id);\n $mhs = Mhs::findOrFail($barcode);\n return view('admin/kupon.edit',['id'=>$mhs]);\n }", "public function edit(Annonce $annonce)\n {\n //\n }", "public function edit(Annonce $annonce)\n {\n //\n }", "public function edit(Creditor $creditor)\n {\n //\n }", "public function edit(Payment $payment)\n {\n //\n }", "public function edit(Payment $payment)\n {\n //\n }", "public function edit(Payment $payment)\n {\n //\n }", "public function edit(Payment $payment)\n {\n //\n }", "public function edit(Payment $payment)\n {\n //\n }", "public function edit(Payment $payment)\n {\n //\n }", "public function edit(Payment $payment)\n {\n //\n }", "public function edit(Payment $payment)\n {\n //\n }", "public function edit(Payment $payment)\n {\n //\n }", "public function edit(Payment $payment)\n {\n //\n }", "public function edit(Payment $payment)\n {\n //\n }" ]
[ "0.8145177", "0.6976542", "0.66536474", "0.65408385", "0.6494564", "0.6494564", "0.6494564", "0.633532", "0.63348025", "0.63150686", "0.62528104", "0.62510896", "0.6241109", "0.62127894", "0.61215955", "0.59383416", "0.59321797", "0.5925111", "0.5918788", "0.59097654", "0.5866299", "0.5832515", "0.5828296", "0.5826403", "0.579838", "0.5766069", "0.57487196", "0.5743659", "0.5737989", "0.5729139", "0.56898284", "0.5689724", "0.5674752", "0.5666344", "0.5658879", "0.56575376", "0.56299347", "0.56274396", "0.5625895", "0.5625664", "0.56187207", "0.5607649", "0.5604603", "0.5596669", "0.55855864", "0.55746377", "0.5574058", "0.55695444", "0.55426675", "0.5533307", "0.5521773", "0.551494", "0.5502397", "0.54677945", "0.54677945", "0.54671407", "0.5466801", "0.54647106", "0.5462171", "0.54525596", "0.54525596", "0.54525596", "0.54525596", "0.54503775", "0.54464805", "0.5436593", "0.5436593", "0.54146534", "0.54146534", "0.5413796", "0.5412416", "0.5401937", "0.5400386", "0.53989697", "0.53977364", "0.5397575", "0.53809553", "0.5376551", "0.537649", "0.53705794", "0.53671587", "0.5351048", "0.53496796", "0.5341688", "0.53371704", "0.5331863", "0.532923", "0.532923", "0.5324307", "0.5318997", "0.5318997", "0.5318997", "0.5318997", "0.5318997", "0.5318997", "0.5318997", "0.5318997", "0.5318997", "0.5318997", "0.5318997" ]
0.69644594
2
Form edit credit card submit
function commerce_braintree_creditcard_edit_form_submit($form, &$form_state) { $sub = commerce_braintree_subscription_local_get(array('sid' => $form_state['values']['sid']), FALSE); $token = $sub['token']; $commerce_customer_address = $form_state['values']['commerce_customer_address']['und'][0]; //billing address $billing_address['firstName'] = isset($commerce_customer_address['first_name']) ? $commerce_customer_address['first_name'] : ''; $billing_address['lastName'] = isset($commerce_customer_address['last_name']) ? $commerce_customer_address['last_name'] : ''; $billing_address['company'] = isset($commerce_customer_address['organisation_name']) ? $commerce_customer_address['organisation_name'] : ''; $billing_address['streetAddress'] = isset($commerce_customer_address['thoroughfare']) ? $commerce_customer_address['thoroughfare'] : ''; $billing_address['extendedAddress'] = isset($commerce_customer_address['premise']) ? $commerce_customer_address['premise'] : ''; $billing_address['locality'] = isset($commerce_customer_address['locality']) ? $commerce_customer_address['locality'] : ''; $billing_address['region'] = isset($commerce_customer_address['administrative_area']) ? $commerce_customer_address['administrative_area'] : ''; $billing_address['postalCode'] = isset($commerce_customer_address['postal_code']) ? $commerce_customer_address['postal_code'] : ''; $billing_address['countryCodeAlpha2'] = isset($commerce_customer_address['country']) ? $commerce_customer_address['country'] : ''; //creditcard $creditcard['cardholderName'] = $form_state['values']['ca_cardholder_name']; $creditcard['number'] = $form_state['values']['credit_card']['number']; $creditcard['cvv'] = $form_state['values']['credit_card']['code']; $creditcard['expirationDate'] = $form_state['values']['credit_card']['exp_month']; $creditcard['expirationDate'] .= '/' . $form_state['values']['credit_card']['exp_year']; $creditcard['billingAddress'] = $billing_address; $creditcard['options'] = array('verifyCard' => TRUE); $creditcard['billingAddress']['options'] = array('updateExisting' => TRUE); $card = commerce_braintree_credit_card_update($creditcard, $token); if ($card->success) { drupal_set_message(t('Updated Successfull.')); return; } drupal_set_message(t('There are error. @errors', array('@errors' => commerce_braintree_get_errors($card))), 'error'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(CreditCard $creditCard)\n {\n //\n }", "public function editcardAction()\n {\n $isValidToken = false;\n $token = $this->getRequest()->getParam('t');\n $customer = $this->_getCustomer();\n $api = $this->_getApi();\n $paymentMethods = $api->getPaymentMethods($customer->getId(), true);\n \n foreach($paymentMethods as $key => $pm) {\n if($pm->getData('paymentMethodToken') == $token) {\n $isValidToken = true;\n }\n }\n \n if($isValidToken) {\n \n } else {\n Mage::getSingleton('core/session')->addError('Credit card token is not valid. Please try again.');\n $this->_redirect('payments/customer/creditcards');\n }\n \n $this->loadLayout();\n $this->_initLayoutMessages('customer/session');\n $this->renderLayout();\n }", "function commerce_braintree_creditcard_edit_form($form, &$form_state, $sid) {\n module_load_include('inc', 'commerce_payment', 'includes/commerce_payment.credit_card');\n $form_state['build_info']['files']['form'] = drupal_get_path('module', 'commerce_braintree') . '/commerce_braintree.form.inc';\n $sub = commerce_braintree_subscription_local_get(array('sid' => $sid), FALSE);\n $payment = commerce_payment_method_instance_load('braintree|commerce_payment_braintree');\n $creditcard = commerce_braintree_creditcard_get_by_token($sub['token']);\n $billing_address = isset($creditcard->billingAddress) ? $creditcard->billingAddress : null;\n $form['payment_method'] = array(\n '#type' => 'fieldset', \n '#title' => t('Payment Method Details'),\n );\n $form['payment_method']['ca_cardholder_name'] = array(\n '#type' => 'textfield',\n '#title' => t('Cardholder Name'),\n '#default_value' => isset($creditcard->cardholderName) ? $creditcard->cardholderName : '',\n );\n // NOTE: A hidden field is changable via Firebug. Value is not.\n // Because there's no validation, this would have allowed any user with access to this form\n // to change any credit card on the website for any user, providing they guess another ca_token.\n //$form['payment_method']['ca_token'] = array('#type' => 'value', '#value' => $token);\n $form['payment_method']['sid'] = array('#type' => 'value', '#value' => $sid);\n \n\n \n // Prepare the fields to include on the credit card form.\n $fields = array(\n 'code' => '',\n );\n\n // Add the credit card types array if necessary.\n $card_types = array_diff(array_values($payment['settings']['card_types']), array(0));\n if (!empty($card_types)) {\n $fields['type'] = $card_types;\n }\n \n $defaults = array(\n 'type' => isset($creditcard->cardType) ? $creditcard->cardType : '',\n 'number' => isset($creditcard->maskedNumber) ? $creditcard->maskedNumber : '', \n 'exp_month' => isset($creditcard->expirationMonth) ? $creditcard->expirationMonth : '', \n 'exp_year' => isset($creditcard->expirationYear) ? $creditcard->expirationYear : '',\n );\n \n // load oder\n $order = commerce_order_load($sub['order_id']);\n $order_wrapper = entity_metadata_wrapper('commerce_order', $order);\n\n // get profile id\n $profile_id = $order_wrapper->commerce_customer_billing->profile_id->value();\n \n // load customer profile\n $profile = commerce_customer_profile_load($profile_id);\n \n if (isset($profile->commerce_customer_address['und']['0']['first_name'])) {\n $profile->commerce_customer_address['und']['0']['first_name'] = isset($billing_address->firstName) ? $billing_address->firstName :'' ;\n }\n if (isset($profile->commerce_customer_address['und']['0']['last_name'])) {\n $profile->commerce_customer_address['und']['0']['last_name'] = isset($billing_address->lastName) ? $billing_address->lastName : '';\n }\n if (isset($profile->commerce_customer_address['und']['0']['organisation_name'])) {\n // //company\n $profile->commerce_customer_address['und']['0']['organisation_name'] = isset($billing_address->company) ? $billing_address->company :'';\n }\n if (isset($profile->commerce_customer_address['und']['0']['administrative_area'])) {\n //state\n $profile->commerce_customer_address['und']['0']['administrative_area'] = isset($billing_address->region) ? $billing_address->region : '';\n }\n if (isset($profile->commerce_customer_address['und']['0']['premise'])) {\n //address 2\n $profile->commerce_customer_address['und']['0']['premise'] = isset($billing_address->extendedAddress) ? $billing_address->extendedAddress : '';\n }\n if (isset($profile->commerce_customer_address['und']['0']['locality'])) {\n //city\n $profile->commerce_customer_address['und']['0']['locality'] = isset($billing_address->locality) ? $billing_address->locality : '';\n }\n if (isset($profile->commerce_customer_address['und']['0']['postal_code'])) {\n //postal code\n $profile->commerce_customer_address['und']['0']['postal_code'] = isset($billing_address->postalCode) ? $billing_address->postalCode : '';\n }\n if (isset($profile->commerce_customer_address['und']['0']['thoroughfare'])) {\n // address 1\n $profile->commerce_customer_address['und']['0']['thoroughfare'] = isset($billing_address->streetAddress) ? $billing_address->streetAddress : '';\n }\n \n // Add the field related form elements.\n $form_state['customer_profile'] = $profile;\n // Attach address field to form\n field_attach_form('commerce_customer_profile', $profile, $form, $form_state);\n $form['commerce_customer_address']['#weight'] = '0';\n $form['payment_method'] += commerce_payment_credit_card_form($fields, $defaults);\n\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Save'),\n );\n \n \n $form['#validate'][] = 'commerce_braintree_creditcard_edit_form_validate';\n $form['#submit'][] = 'commerce_braintree_creditcard_edit_form_submit';\n return $form;\n}", "public function edit(Card $card)\n {\n //\n }", "public function edit(Card $card)\n {\n //\n }", "public function edit(Card $card)\n {\n //\n }", "function update_creditcard($form = array(), $userid = 0)\n {\n global $ilance, $ilconfig, $phrase, $ilpage;\n $form['number_encrypted'] = $ilance->crypt->three_layer_encrypt($form['number'], $ilconfig['key1'], $ilconfig['key2'], $ilconfig['key3']);\n $form['authorized'] = 'yes';\n if ($ilconfig['creditcard_authentication'])\n {\n $form['authorized'] = 'no'; \n }\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"creditcards \n SET creditcard_number = '\" . $ilance->db->escape_string($form['number_encrypted']) . \"',\n creditcard_type = '\" . mb_strtolower($form['type']) . \"',\n date_updated = '\" . DATETIME24H . \"',\n creditcard_expiry = '\" . $form['expmon'] . $form['expyear'] . \"',\n cvv2 = '\" . $ilance->db->escape_string($form['cvv2']) . \"',\n name_on_card = '\" . $ilance->db->escape_string($form['first_name'] . \" \" . $form['last_name']) . \"',\n phone_of_cardowner = '\" . $ilance->db->escape_string($form['phone']) . \"',\n email_of_cardowner = '\" . $ilance->db->escape_string($form['email']) . \"',\n card_billing_address1 = '\" . $ilance->db->escape_string($form['address1']) . \"',\n card_billing_address2 = '\" . $ilance->db->escape_string($form['address2']) . \"',\n card_city = '\" . $ilance->db->escape_string($form['city']) . \"',\n card_state = '\" . $ilance->db->escape_string($form['state']) . \"',\n card_postalzip = '\" . $ilance->db->escape_string($form['postalzip']) . \"',\n card_country = '\" . $ilance->db->escape_string($form['countryid']) . \"',\n authorized = '\" . $ilance->db->escape_string($form['authorized']) . \"'\n WHERE user_id = '\" . intval($userid) . \"'\n AND cc_id = '\" . $ilance->db->escape_string($form['cc_id']) . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $ilance->email->mail = fetch_user('email', intval($userid));\n $ilance->email->slng = fetch_user_slng(intval($userid));\n $ilance->email->get('member_updated_creditcard');\t\t\n $ilance->email->set(array(\n '{{member}}' => fetch_user('username', intval($userid)),\n ));\n $ilance->email->send();\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"subscription_user\n SET paymethod = 'account'\n WHERE user_id = '\" . intval($userid) . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n return true;\n }", "function edit($id)\n { \n // check if the card exists before trying to edit it\n $data['card'] = $this->Card_model->get_card($id);\n \n if(isset($data['card']['id']))\n {\n if(isset($_POST) && count($_POST) > 0) \n { \n $params = array(\n\t\t\t\t\t'jns_card' => $this->input->post('jns_card'),\n );\n\n $this->Card_model->update_card($id,$params); \n redirect('card/index');\n }\n else\n {\n $data['_view'] = 'card/edit';\n $this->load->view('layouts/main',$data);\n }\n }\n else\n show_error('The card you are trying to edit does not exist.');\n }", "public function update(Request $request, CreditCard $creditCard)\n {\n //\n }", "function edds_credit_card_form( $echo = true ) {\n\n\tglobal $edd_options;\n\n\tif ( edd_stripe()->rate_limiting->has_hit_card_error_limit() ) {\n\t\tedd_set_error( 'edd_stripe_error_limit', __( 'We are unable to process your payment at this time, please try again later or contact support.', 'edds' ) );\n\t\treturn;\n\t}\n\n\tob_start(); ?>\n\n\t<?php if ( ! wp_script_is ( 'edd-stripe-js' ) ) : ?>\n\t\t<?php edd_stripe_js( true ); ?>\n\t<?php endif; ?>\n\n\t<?php do_action( 'edd_before_cc_fields' ); ?>\n\n\t<fieldset id=\"edd_cc_fields\" class=\"edd-do-validate\">\n\t\t<legend><?php _e( 'Credit Card Info', 'edds' ); ?></legend>\n\t\t<?php if( is_ssl() ) : ?>\n\t\t\t<div id=\"edd_secure_site_wrapper\">\n\t\t\t\t<span class=\"padlock\">\n\t\t\t\t\t<svg class=\"edd-icon edd-icon-lock\" xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"28\" viewBox=\"0 0 18 28\" aria-hidden=\"true\">\n\t\t\t\t\t\t<path d=\"M5 12h8V9c0-2.203-1.797-4-4-4S5 6.797 5 9v3zm13 1.5v9c0 .828-.672 1.5-1.5 1.5h-15C.672 24 0 23.328 0 22.5v-9c0-.828.672-1.5 1.5-1.5H2V9c0-3.844 3.156-7 7-7s7 3.156 7 7v3h.5c.828 0 1.5.672 1.5 1.5z\"/>\n\t\t\t\t\t</svg>\n\t\t\t\t</span>\n\t\t\t\t<span><?php _e( 'This is a secure SSL encrypted payment.', 'edds' ); ?></span>\n\t\t\t</div>\n\t\t<?php endif; ?>\n\n\t\t<?php\n\t\t$existing_cards = edd_stripe_get_existing_cards( get_current_user_id() );\n\t\t?>\n\t\t<?php if ( ! empty( $existing_cards ) ) { edd_stripe_existing_card_field_radio( get_current_user_id() ); } ?>\n\n\t\t<div class=\"edd-stripe-new-card\" <?php if ( ! empty( $existing_cards ) ) { echo 'style=\"display: none;\"'; } ?>>\n\t\t\t<?php do_action( 'edd_stripe_new_card_form' ); ?>\n\t\t\t<?php do_action( 'edd_after_cc_expiration' ); ?>\n\t\t</div>\n\n\t</fieldset>\n\t<?php\n\n\tdo_action( 'edd_after_cc_fields' );\n\n\t$form = ob_get_clean();\n\n\tif ( false !== $echo ) {\n\t\techo $form;\n\t}\n\n\treturn $form;\n}", "public function updatecard(){\n //retreive and clean data from the register card form\n $cardid = parent::CleanData($_GET['cardid']);\n $costcenter = parent::CleanData($_GET['costcenter']); \n $location = parent::CleanData($_GET['location']);\n $funcarea = parent::CleanData($_GET['funcarea']);\n //check for empty fields\n if (empty($cardid) || empty($costcenter) || empty($location) || empty($funcarea))\n {\n ?>\n <p>* Nekatera polja so prazna, prosim da pozkusite ponovno.</p>\n <?php \n } else {\n //create query with form data\n $query = \"INSERT INTO table1 (St_kartice1, Cost_center, Lokacija_koda, Func_area)\n VALUES('$cardid','$costcenter','$location','$funcarea')\";\n //execute query\n $result = mysql_query($query);\n //Check result\n if ($result) {\n ?>\n <p>* Kartica je bila registrirana, prosim da validirate ponovno</p>\n <?php \n } else {\n ?>\n <p>* Registriranje ni mozno: <?php print mysql_error();?></p>\n <?php\n }\n }\n }", "public function postEditCard(EditCardRequest $request)\n {\n try {\n $expiry = explode('/', $request->expiry);\n $month = $expiry[0];\n $year = $expiry[1];\n $customerId = RecruiterProfile::where(['user_id' => Auth::user()->id])->pluck('customer_id');\n $customer = \\Stripe\\Customer::retrieve($customerId[0]);\n $card = $customer->sources->retrieve($request->cardId);\n $card->exp_month = $month;\n $card->exp_year = $year;\n $card->save();\n $this->response['success'] = true;\n $this->response['message'] = trans('messages.card_edidted');\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 edit(Postcard $postcard)\n {\n //\n }", "public function editCurrencyAction(){\r\n $form = $this -> view -> form = new Groupbuy_Form_Admin_Currency();\r\n\r\n //Check post method\r\n if($this -> getRequest() -> isPost() && $form -> isValid($this -> getRequest() -> getPost())) {\r\n\r\n $values = $form -> getValues();\r\n $db = Engine_Db_Table::getDefaultAdapter();\r\n $db -> beginTransaction();\r\n try {\r\n\t\t// Edit currency in the database\r\n $code=$values[\"code\"];\r\n $table = new Groupbuy_Model_DbTable_Currencies;\r\n $select = $table -> select() ->where('code = ?',\"$code\");\r\n $row = $table->fetchRow($select);\r\n\r\n $row -> name = $values[\"label\"];\r\n $row -> symbol = $values[\"symbol\"];\r\n $row -> precision = $values[\"precision\"];\r\n $row -> display = $values[\"display\"];\r\n\r\n if(isset($values[\"status\"])) $row -> status = $values[\"status\"];\r\n //Database Commit\r\n $row -> save();\r\n $db -> commit();\r\n }\r\n catch( Exception $e ) {\r\n $db -> rollBack();\r\n throw $e;\r\n }\r\n //Close Form If Editing Successfully\r\n\t\t$this -> _forward('success', 'utility', 'core', array('smoothboxClose' => 10, 'parentRefresh' => 10, 'messages' => array('')));\r\n }\r\n \r\n // Get Code Id - Throw Exception If There Is No Code Id\r\n if(!($code = $this -> _getParam('code_id'))) {\r\n throw new Zend_Exception('No code id specified');\r\n }\r\n\r\n // Generate and assign form\r\n\t\t$table = new Groupbuy_Model_DbTable_Currencies;\r\n\t\t$select = $table -> select() ->where('code = ?',\"$code\");\r\n $currency = $table->fetchRow($select);\r\n\t\t$form ->populate(array( 'label' => $currency->name,\r\n 'symbol' => $currency->symbol,\r\n 'precision' => $currency->precision,\r\n 'status' => $currency->status,\r\n 'display' => $currency->currencyDisplay(),\r\n 'code' => $currency->code));\r\n \r\n //Hide Status Element if modifing the default currency\r\n if($code == Engine_Api::_()->getApi('settings', 'core')->getSetting('groupbuy.currency', 'USD')){\r\n $form->removeElement('status');\r\n }\r\n //Output\r\n $this -> renderScript('admin-currency/form.tpl');\r\n\r\n }", "public function creditcardAction()\r\n\t{\r\n\t if(defined('EMPTABCONFIGS'))\r\n\t\t{\r\n\t\t $empOrganizationTabs = explode(\",\",EMPTABCONFIGS);\r\n\t\t\tif(in_array('creditcarddetails',$empOrganizationTabs))\r\n\t\t\t{\r\n\t\t\t\t$tabName = \"creditcard\";\r\n\t\t\t\t$employeeData =array();\r\n\t\t\t\t\r\n\t\t\t $auth = Zend_Auth::getInstance();\r\n\t\t\t if($auth->hasIdentity())\r\n\t\t\t {\r\n\t\t\t\t\t$loginUserId = $auth->getStorage()->read()->id;\r\n\t\t\t\t}\r\n\t\t\t\t$id = $loginUserId;\r\n\t\t\t\t$employeeModal = new Default_Model_Employee();\r\n\t\t\t\t$empdata = $employeeModal->getsingleEmployeeData($id);\r\n\t\t\t\tif($empdata == 'norows')\r\n\t\t\t\t{\r\n\t\t\t\t $this->view->rowexist = \"norows\";\r\n\t\t\t\t $this->view->empdata = \"\";\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{ \r\n\t\t\t\t\t$this->view->rowexist = \"rows\";\r\n\t\t\t\t\tif(!empty($empdata))\r\n\t\t\t\t\t{ \r\n\t\t\t\t\t\t$creditcardDetailsform = new Default_Form_Creditcarddetails();\r\n\t\t\t\t\t\t$creditcardDetailsModel = new Default_Model_Creditcarddetails();\r\n\t\t\t\t\t\tif($id)\r\n\t\t\t\t\t\t{\t\r\n\t\t\t\t\t\t\t$data = $creditcardDetailsModel->getcreditcarddetailsRecord($id);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(!empty($data))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault(\"id\",$data[0][\"id\"]);\r\n\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault(\"user_id\",$data[0][\"user_id\"]);\r\n\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault(\"card_type\",$data[0][\"card_type\"]);\r\n\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault(\"card_number\",$data[0][\"card_number\"]);\r\n\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault(\"nameoncard\",$data[0][\"nameoncard\"]);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$expiry_date = sapp_Global::change_date($data[0][\"card_expiration\"],'view');\r\n\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault('card_expiration', $expiry_date);\r\n\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault(\"card_issuedby\",$data[0][\"card_issued_comp\"]);\r\n\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault(\"card_code\",$data[0][\"card_code\"]);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$creditcardDetailsform->setAttrib('action',BASE_URL.'mydetails/creditcard/');\r\n\t\t\t\t\t\t\t$this->view->id=$id;\r\n\t\t\t\t\t\t\t$this->view->form = $creditcardDetailsform;\r\n\t\t\t\t\t\t\t$this->view->data=$data;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif($this->getRequest()->getPost())\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$result = $this->save($creditcardDetailsform,$tabName);\t\r\n\t\t\t\t\t\t\t$this->view->msgarray = $result; \r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$this->view->empdata = $empdata; \r\n\t\t\t\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n else\r\n\t\t\t{\r\n\t\t \t $this->_redirect('error');\r\n\t\t }\r\n }\r\n\t\telse\r\n\t\t{\r\n\t\t \t$this->_redirect('error');\r\n\t\t}\t\t\t\r\n\t}", "public function action_addcreditcard() {\n $package = Model::factory('package');\n $btn_card_confirm = arr::get($_REQUEST, 'btn_card_confirm');\n $config_country['taxicountry'] = $this->country_info();\n $this->session = Session::instance();\n $errors = array();\n $userid = $this->session->get('userid');\n $postvalue = Arr::map('trim', $this->request->post());\n\n $getadmin_profile_info = $package->getadmin_profile_info();\n\n\n $post_values = Securityvalid::sanitize_inputs($postvalue);\n $billing_card_info_details = $package->billing_card_info_details();\n if (empty($billing_card_info_details)) {\n $billing_info_id = '';\n } else {\n $billing_info_id = $billing_card_info_details[0]['_id'];\n }\n if (isset($btn_card_confirm) && Validation::factory($_POST)) {\n $validator = $package->upgrade_plan_validate(arr::extract($post_values, array('cardnumber', 'cvv', 'expirydate', 'firstName', 'lastname', 'address', 'postal_code', 'terms', 'country', 'state', 'city')), $userid);\n if ($validator->check()) {\n $cardnumber = $postvalue['cardnumber'];\n $cvv = $postvalue['cvv'];\n $expirydate = explode('/', $postvalue['expirydate']);\n $firstname = $postvalue['firstName'];\n $lastname = $postvalue['lastname'];\n $address = $postvalue['address'];\n $city = $postvalue['city'];\n $country = $postvalue['country'];\n $state = $postvalue['state'];\n $postal_code = $postvalue['postal_code'];\n $package_upgrade_time = PACKAGE_UPGRADE_TIME;\n $cardnumber = preg_replace('/\\s+/', '', $cardnumber);\n \n $this->billing_info['card_number'] = $cardnumber;\n $this->billing_info['cvv'] = $cvv;\n $this->billing_info['expirationMonth'] = $expirydate[0];\n $this->billing_info['expirationYear'] = $expirydate[1];\n $this->billing_info['firstName'] = $firstname;\n $this->billing_info['lastname'] = $lastname;\n $this->billing_info['address'] = $address;\n $this->billing_info['city'] = $city;\n $this->billing_info['country'] = $country;\n $this->billing_info['state'] = $state;\n $this->billing_info['postal_code'] = $postal_code;\n $this->billing_info['createdate'] = $package_upgrade_time; \n $this->billing_info['currency']=CLOUD_CURRENCY_FORMAT; \n $billing_info_reg = $package->billing_registration($this->billing_info, $billing_info_id);\n if ($billing_info_reg) {\n Message::success(__('billing_updated_sucessfully'));\n }\n } else {\n $errors = $validator->errors('errors');\n }\n }\n $view = View::factory(ADMINVIEW . 'package_plan/addcreditcard')\n ->bind('postedvalues', $this->userPost)\n ->bind('errors', $errors)\n ->bind('getadmin_profile_info', $getadmin_profile_info)\n ->bind('subscription_cost_month', $subscription_cost_month)\n ->bind('billing_card_info_details', $billing_card_info_details)\n ->bind('all_country_list', $config_country['taxicountry'])\n ->bind('setup_cost', $setup_cost)\n ->bind('postvalue', $post_values);\n $this->template->title = CLOUD_SITENAME . \" | \" . __('add_credit_card');\n $this->template->page_title = __('add_credit_card');\n $this->template->content = $view;\n }", "function commerce_oz_migs_2p_submit_form($payment_method, $pane_values, $checkout_pane, $order) {\n \n//\t// dsm($payment_method, '$payment_method');\n//\t// dsm($checkout_pane);\n//\t// dsm($pane_values);\n//\t// dsm($order);\n \t \t \t\n // Include the Drupal Commerce credit card file for forms\n module_load_include('inc', 'commerce_payment', 'includes/commerce_payment.credit_card');\n \n\t$settings = _commweb_get_var('commerce_oz_gateway_' . $payment_method['gateway_provider']);\n \n// \tdsm($settings, '$settings');\n\n $form_params = array();\n $form_defaults = array();\n \n // Use CVV Field?\n if($settings['commerce_oz_use_cvv'] == 'cvv')\n {\n \t$form_params['code'] = '';\n }\n \n // Use Card Holder Name Field ?\n if($settings['commerce_oz_use_card_name'] == 'name')\n {\n \t$form_params['owner'] = 'Card Holder';\n }\n \n \n // set the defaults for testing\n if($settings['commerce_oz_transaction_mode'] == 'test')\n {\n\n\t\t \t$form_defaults['number'] = $settings['commerce_oz_test_card_number'];\n\t\t \t$form_defaults['code'] = $settings['commerce_oz_test_card_cvv'];\n\t\t \t$form_defaults['exp_month'] = $settings['commerce_oz_test_card_exp_month'];\n\t\t \t$form_defaults['exp_year'] = $settings['commerce_oz_test_card_exp_year'];\n\t\t}\n\t\t\n\n $gateway = commerce_oz_load_gateway_provider($payment_method['gateway_provider']);\n \n \t$form = commerce_payment_credit_card_form($form_params, $form_defaults);\n\n\t$logopath = '/' . drupal_get_path('module', 'commerce_oz') . '/image/' . $payment_method['gateway_provider'] . '_68.png';\n\t\n\t$descText = '<a href=\"' . $gateway['owner_website'] . '\"><img src=\"' . $logopath . '\" /></a><br />Enter your payment details below and Click Continue.<br />On completing your transaction, you will be taken to your Receipt information.<br />';\n\n $form['commweb_3p_head'] = array(\n '#type' => 'fieldset',\n '#title' => t($payment_method['title']),\n '#collapsible' => FALSE, \n \t'#collapsed' => FALSE,\n '#description' => t($descText),\n );\n \n\n if($settings['commerce_oz_transaction_mode'] == 'test')\n {\n // // dsm($form);\n \n \n $form['credit_card']['number']['#description'] = t('<strong>Test Mode</strong> - You can only use the credit cards listed here to test in Test Mode. Valid card numbers are:\n \t\t<br /><br />Master:&nbsp;&nbsp;5123456789012346\n <br />Visa:&nbsp;&nbsp;&nbsp;&nbsp;4987654321098769\n <br />Amex:&nbsp;&nbsp;&nbsp;345678901234564\n <br />Diners:&nbsp;&nbsp;30123456789019\n <br /><br />All CommWeb Test Cards must use 05-2013 as the Expiry Date.');\n\n $form['credit_card']['exp_year']['#description'] = t('<strong>est Mode</strong> - All CommWeb Test Cards must use 05-2013 as the Expiry Date');\n\n $form['credit_card']['owner']['#description'] = t('<strong>Test Mode</strong> - Transactions do NOT require or use the Card Owner field. If you choose to request this information from your users it will however be stored with the transaction record.');\n\n \n \n // Provide a textfield to pass different Amounts to MIGS \n $form['credit_card']['test_amount'] = array(\n '#input' => TRUE,\n\n '#type' => 'textfield',\n '#size' => 6,\n '#maxlength' => 10,\n \t\t\n '#title' => t('Test Mode - Custom Amount'), \n '#default_value' => $order->commerce_order_total['und'][0]['amount'],\n '#disabled' => FALSE,\n '#description' => t('<strong>Test Mode</strong> - Update the Amount (in cents) sent for processing to change your desired transaction response.<br /> Valid amounts are <br />xxx00 = Approved\n <br />xxx05 = Declined. Contact Bank.\n <br />xxx10 = Transaction could not be processed.\n <br />xxx33 = Expired Card.\n <br />xxx50 = Unspecified Failure.\n <br />xxx51 = Insufficient Funds.\n <br />xxx68 = Communications failure with bank'),\n '#required' => FALSE, \n ); \n \n }\n \n \n \t$form['commweb_3p_head']['credit_card'] = $form['credit_card'];\n\tunset($form['credit_card']);\n\t\n//\t// dsm($form);\n\t\n return $form;\n \n}", "public function actionPaymentcard()\n\t{ \n\t\t\n\t\tif( isset($_SESSION['invoice_id']) )\n\t\t{\n\t\t\t$invoiceModel = new Invoices;\n\t\t\t$payment\t\t= $invoiceModel->getInvoicePayment( $_SESSION['invoice_id'] );\n\t\t\t# Add 2% of the total in the invoice total for creditcard only\n\t\t\t$twoPercentAmount = ($payment[0]['payment_amount'] * 2)/100;\n\t\t\t$payment[0]['payment_amount'] += round($twoPercentAmount, 2);\n\t\t\t$this->render(\"cardForm\", array(\"payment\"=>$payment));\n \t\t}\n\t\t\n\t}", "public function creditcardsAction() {\n if (!$this->_getSession()->isLoggedIn()) {\n $this->_redirect('customer/account/login');\n return;\n }\n\n if ($this->getRequest()->isPost()) {\n $data = $this->getRequest()->getParams();\n if (isset($data)) {\n $result = $this->_save($data);\n switch ($result->getResponseCode()) {\n case self::RESPONSE_CODE_SUCCESS:\n Mage::getSingleton('core/session')->addSuccess('Credit card has been added.');\n break;\n case self::RESPONSE_CODE_FAILURE:\n Mage::getSingleton('core/session')->addError('Credit card has not been saved. Please try again.');\n break;\n }\n\n $this->_redirect('payments/customer/creditcards');\n }\n }\n\n $this->loadLayout();\n $this->_initLayoutMessages('customer/session');\n $this->renderLayout();\n }", "public function changeCreaditCard(){\n return View::make('user.change_credit_card')->with(array('title_for_layout' => 'Thay đổi thẻ tín dụng'));\n }", "public function edit(Cryptocurrency $cryptocurrency)\n {\n //\n }", "function give_get_cc_form( $form_id ) {\n\n\tob_start();\n\n\t/**\n\t * Fires while rendering credit card info form, before the fields.\n\t *\n\t * @param int $form_id The form ID.\n\t *\n\t * @since 1.0\n\t *\n\t */\n\tdo_action( 'give_before_cc_fields', $form_id );\n\t?>\n\t<fieldset id=\"give_cc_fields-<?php echo $form_id; ?>\" class=\"give-do-validate\">\n\t\t<legend><?php echo apply_filters( 'give_credit_card_fieldset_heading', esc_html__( 'Credit Card Info', 'give' ) ); ?></legend>\n\t\t<?php if ( is_ssl() ) : ?>\n\t\t\t<div id=\"give_secure_site_wrapper-<?php echo $form_id; ?>\">\n\t\t\t\t<span class=\"give-icon padlock\"></span>\n\t\t\t\t<span><?php _e( 'This is a secure SSL encrypted payment.', 'give' ); ?></span>\n\t\t\t</div>\n\t\t<?php endif; ?>\n\t\t<p id=\"give-card-number-wrap-<?php echo $form_id; ?>\" class=\"form-row form-row-two-thirds form-row-responsive\">\n\t\t\t<label for=\"card_number-<?php echo $form_id; ?>\" class=\"give-label\">\n\t\t\t\t<?php _e( 'Card Number', 'give' ); ?>\n\t\t\t\t<span class=\"give-required-indicator\">*</span>\n\t\t\t\t<?php echo Give()->tooltips->render_help( __( 'The (typically) 16 digits on the front of your credit card.', 'give' ) ); ?>\n\t\t\t\t<span class=\"card-type\"></span>\n\t\t\t</label>\n\n\t\t\t<input type=\"tel\" autocomplete=\"off\" name=\"card_number\" id=\"card_number-<?php echo $form_id; ?>\"\n\t\t\t class=\"card-number give-input required\" placeholder=\"<?php _e( 'Card number', 'give' ); ?>\"\n\t\t\t required aria-required=\"true\"/>\n\t\t</p>\n\n\t\t<p id=\"give-card-cvc-wrap-<?php echo $form_id; ?>\" class=\"form-row form-row-one-third form-row-responsive\">\n\t\t\t<label for=\"card_cvc-<?php echo $form_id; ?>\" class=\"give-label\">\n\t\t\t\t<?php _e( 'CVC', 'give' ); ?>\n\t\t\t\t<span class=\"give-required-indicator\">*</span>\n\t\t\t\t<?php echo Give()->tooltips->render_help( __( 'The 3 digit (back) or 4 digit (front) value on your card.', 'give' ) ); ?>\n\t\t\t</label>\n\n\t\t\t<input type=\"tel\" size=\"4\" autocomplete=\"off\" name=\"card_cvc\" id=\"card_cvc-<?php echo $form_id; ?>\"\n\t\t\t class=\"card-cvc give-input required\" placeholder=\"<?php _e( 'Security code', 'give' ); ?>\"\n\t\t\t required aria-required=\"true\"/>\n\t\t</p>\n\n\t\t<p id=\"give-card-name-wrap-<?php echo $form_id; ?>\" class=\"form-row form-row-two-thirds form-row-responsive\">\n\t\t\t<label for=\"card_name-<?php echo $form_id; ?>\" class=\"give-label\">\n\t\t\t\t<?php _e( 'Cardholder Name', 'give' ); ?>\n\t\t\t\t<span class=\"give-required-indicator\">*</span>\n\t\t\t\t<?php echo Give()->tooltips->render_help( __( 'The name of the credit card account holder.', 'give' ) ); ?>\n\t\t\t</label>\n\n\t\t\t<input type=\"text\" autocomplete=\"off\" name=\"card_name\" id=\"card_name-<?php echo $form_id; ?>\"\n\t\t\t class=\"card-name give-input required\" placeholder=\"<?php esc_attr_e( 'Cardholder Name', 'give' ); ?>\"\n\t\t\t required aria-required=\"true\"/>\n\t\t</p>\n\t\t<?php\n\t\t/**\n\t\t * Fires while rendering credit card info form, before expiration fields.\n\t\t *\n\t\t * @param int $form_id The form ID.\n\t\t *\n\t\t * @since 1.0\n\t\t *\n\t\t */\n\t\tdo_action( 'give_before_cc_expiration' );\n\t\t?>\n\t\t<p class=\"card-expiration form-row form-row-one-third form-row-responsive\">\n\t\t\t<label for=\"card_expiry-<?php echo $form_id; ?>\" class=\"give-label\">\n\t\t\t\t<?php _e( 'Expiration', 'give' ); ?>\n\t\t\t\t<span class=\"give-required-indicator\">*</span>\n\t\t\t\t<?php echo Give()->tooltips->render_help( __( 'The date your credit card expires, typically on the front of the card.', 'give' ) ); ?>\n\t\t\t</label>\n\n\t\t\t<input type=\"hidden\" id=\"card_exp_month-<?php echo $form_id; ?>\" name=\"card_exp_month\"\n\t\t\t class=\"card-expiry-month\"/>\n\t\t\t<input type=\"hidden\" id=\"card_exp_year-<?php echo $form_id; ?>\" name=\"card_exp_year\"\n\t\t\t class=\"card-expiry-year\"/>\n\n\t\t\t<input type=\"tel\" autocomplete=\"off\" name=\"card_expiry\" id=\"card_expiry-<?php echo $form_id; ?>\"\n\t\t\t class=\"card-expiry give-input required\" placeholder=\"<?php esc_attr_e( 'MM / YY', 'give' ); ?>\"\n\t\t\t required aria-required=\"true\"/>\n\t\t</p>\n\t\t<?php\n\t\t/**\n\t\t * Fires while rendering credit card info form, after expiration fields.\n\t\t *\n\t\t * @param int $form_id The form ID.\n\t\t *\n\t\t * @since 1.0\n\t\t *\n\t\t */\n\t\tdo_action( 'give_after_cc_expiration', $form_id );\n\t\t?>\n\t</fieldset>\n\t<?php\n\t/**\n\t * Fires while rendering credit card info form, before the fields.\n\t *\n\t * @param int $form_id The form ID.\n\t *\n\t * @since 1.0\n\t *\n\t */\n\tdo_action( 'give_after_cc_fields', $form_id );\n\n\techo ob_get_clean();\n}", "public function editCustomerAction(Request $request, Card $card)\n {\n $customer = $card->getCustomer();\n $form = $this->createForm(CustomerType::class, $customer);\n $form->handleRequest($request);\n\n if($form->isSubmitted() && $form->isValid()){\n $birthday = $request->request->get('appbundle_customer')['birthday'];\n $customer->setBirthday(new \\DateTime($birthday));\n $em = $this->getDoctrine()->getManager();\n $em->persist($customer);\n $em->flush();\n\n $this->addFlash('success', \"The customer's informations were modified.\");\n\n return $this->redirectToRoute('staff_customer_view', [\n 'number' => $card->getNumber()\n ]);\n }\n\n return $this->render('staff/customer/edit_customer.html.twig', array(\n \"form\" => $form->createView(),\n \"customer\" => $customer\n ));\n }", "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(Currency $currency)\n {\n //\n }", "public function editCustomerCreditCard($data) {\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\t\t'NameOnCreditCard' => $data['cardName'],\n\t\t\t\t'CreditCardNumber' => $data['cardNumber'],\n\t\t\t\t'CreditCardExpiryYear' => $data['cardExpiryYear'],\n\t\t\t\t'CreditCardExpiryMonth' => $data['cardExpiryMonth'],\n\t\t\t\t'Reactivate' => $data['reactivate'],\n\t\t\t\t'Username' => $data['username']\n\t\t];\n\n\t\treturn $soapclient->editCustomerCreditCard($params);\n\t}", "public function edit()\n {\n // get resources for display \n $website = Website::where('name','flooflix')->first();\n if (!is_null($website) && !empty($website)) {\n $page = Page::where('website_id', $website->id)->where('name','modifier_carte')->first();\n if(!is_null($page) && !empty($page)){\n $datas = $page->getResourcesToDisplayPage($page);\n } \n }else{\n return view('errors.404');\n }\n return view('Flooflix.forms.editBankCard', compact('datas'));\n }", "function edd_stripe_new_card_form() {\n\tif ( edd_stripe()->rate_limiting->has_hit_card_error_limit() ) {\n\t\tedd_set_error( 'edd_stripe_error_limit', __( 'Adding new payment methods is currently unavailable.', 'edds' ) );\n\t\tedd_print_errors();\n\t\treturn;\n\t}\n?>\n\n<p id=\"edd-card-name-wrap\">\n\t<label for=\"card_name\" class=\"edd-label\">\n\t\t<?php esc_html_e( 'Name on the Card', 'edds' ); ?>\n\t\t<span class=\"edd-required-indicator\">*</span>\n\t</label>\n\t<span class=\"edd-description\"><?php esc_html_e( 'The name printed on the front of your credit card.', 'edds' ); ?></span>\n\t<input type=\"text\" name=\"card_name\" id=\"card_name\" class=\"card-name edd-input required\" placeholder=\"<?php esc_attr_e( 'Card name', 'edds' ); ?>\" autocomplete=\"cc-name\" />\n</p>\n\n<div id=\"edd-card-wrap\">\n\t<label for=\"edd-card-element\" class=\"edd-label\">\n\t\t<?php esc_html_e( 'Credit Card', 'edds' ); ?>\n\t\t<span class=\"edd-required-indicator\">*</span>\n\t</label>\n\n\t<div id=\"edd-stripe-card-element\"></div>\n\t<div id=\"edd-stripe-card-errors\" role=\"alert\"></div>\n\n\t<p></p><!-- Extra spacing -->\n</div>\n\n<?php\n\t/**\n\t * Allow output of extra content before the credit card expiration field.\n\t *\n\t * This content no longer appears before the credit card expiration field\n\t * with the introduction of Stripe Elements.\n\t *\n\t * @deprecated 2.7\n\t * @since unknown\n\t */\n\tdo_action( 'edd_before_cc_expiration' );\n}", "public function edit_promocode_form(){\n\t\tif ($this->checkLogin('A') == ''){\n\t\t\tredirect(ADMIN_ENC_URL);\n\t\t}else {\n\t\t if ($this->lang->line('admin_promocode_edit_coupon_code') != '') \n\t\t $this->data['heading']= stripslashes($this->lang->line('admin_promocode_edit_coupon_code')); \n\t\t else $this->data['heading'] = 'Edit Coupon Code';\n\t\t\t$promo_id = $this->uri->segment(4,0);\n\t\t\t$condition = array('_id' => MongoID($promo_id));\n\t\t\t$this->data['promocode_details'] = $this->promocode_model->get_all_details(PROMOCODE,$condition);\n\t\t\tif ($this->data['promocode_details']->num_rows() == 1){\n\t\t\t\t$this->load->view(ADMIN_ENC_URL.'/promocode/edit_promocode',$this->data);\n\t\t\t}else {\n\t\t\t\tredirect(ADMIN_ENC_URL);\n\t\t\t}\n\t\t}\n\t}", "public function display_edit_form(){\n echo \"<form action='../../Controllers/charity_controller.class.php?action=update' method='post'>\";\n echo \"<input type='hidden' name='id' value=\".$this->id.\" />\";\n echo \"Name: <input type='text' name='name' value=\".$this->name.\" /><br />\";\n echo \"Description: <textarea name='description'>\".$this->description.\"</textarea><br />\";\n echo \"<input type='submit' value='Update' />\";\n echo \"</form>\";\n }", "public function edit()\n\t{\n\t\t\t$id = Auth::id();\n\t\t\n\t\t $userCardio = User::find($id)->UserCardio;\n\n\n // show the edit form and pass the userStat\n return View::make('userCardio.edit')\n ->with('userCardio', $userCardio);\n\t\t\n\t}", "public function stripeformAction() {\n\n $this->conf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['armpayments']);\n $apiSecretKey = $this->conf['stripeApiKey'];\n $publishKey = $this->conf['stripePubKey'];\n $stripeObj = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('ARM\\\\Armpayments\\\\Libraries\\\\Stripe\\\\T3Stripe', $apiSecretKey, $publishKey);\n $stripeObj->init();\n\n $orderid = $this->request->getArgument('orderid');\n $amount = $this->request->getArgument('amount');\n $amountCent = intval($this->request->getArgument('amountcent'));\n $vat = $this->request->getArgument('vat');\n $tablename = $this->request->getArgument('tablename');\n $currency = $this->request->getArgument('currency');\n $description = $this->request->getArgument('description');\n $method = $this->request->getArgument('method');\n $mail = $this->request->getArgument('email');\n\n $this->view->assign('stripePubKey', $publishKey);\n $this->view->assign('orderid', $orderid);\n $this->view->assign('amount', $amount);\n $this->view->assign('amountCent', $amountCent);\n $this->view->assign('vat', $vat);\n $this->view->assign('currency', $currency);\n $this->view->assign('description', urldecode($description));\n $this->view->assign('tablename', $tablename); \n $this->view->assign('method', $method);\n $this->view->assign('email', $mail);\n\n }", "public function newPostAction()\n {\n // The card\n $card = Mage::getModel('mbiz_cc/cc');\n\n try {\n $post = $this->getRequest()->getPost();\n\n $card->setData(array(\n 'customer' => $this->_getCustomerSession()->getCustomer(),\n 'dateval' => isset($post['dateval-month'], $post['dateval-year']) ? sprintf('%02d%02d', (int) $post['dateval-month'], $post['dateval-year'] - 2000) : null,\n 'cvv' => isset($post['cvv']) ? $post['cvv'] : null,\n 'type' => isset($post['type']) ? $post['type'] : null,\n 'owner' => isset($post['owner']) ? $post['owner'] : null,\n 'number' => isset($post['number']) ? $post['number'] : null,\n ));\n\n /* INFO:\n * To specify the token you can use the event \"cc_validate_before\"\n */\n\n $errors = $card->validate();\n\n if ($errors) {\n foreach ($errors as $error) {\n $this->_getSession()->addError($error);\n }\n } else {\n $card->save();\n $this->_getSession()->addSuccess($this->__('Credit card saved successfully.'));\n }\n\n } catch (Mage_Core_Exception $e) {\n $this->_getSession()->addError($e->getMessage());\n Mage::logException($e);\n }\n\n $this->_redirect('customer/cc/index');\n }", "function display_card_form($name){\n?>\n<form action='../model/process.php' method='post'>\n<table border='0' width='100%' cellspacing='0'>\n <tr>\n <th colspan='2' bgcolor=\"#cccccc\">Credit Card Details</th>\n </tr>\n <tr>\n <td align='right'>Type:</td>\n <td>\n <select name='card_type'>\n <option value='VISA'>VISA</option>\n <option value='MasterCard'>MasterCard</option>\n <option value='American Express'>American Express</option>\n </select>\n </td>\n </tr>\n <tr>\n <td align='right'>Number:</td>\n <td>\n <input type='text' name='card_number' value='' maxlength='16' size='40'>\n </td>\n </tr>\n <tr>\n <td align='right'>AMEX code (if required):</td>\n <td>\n <input type='text' name='amex_code' value='' maxlength='4' size='4'>\n </td>\n </tr>\n <tr>\n <td align='right'>Expiry Date:</td>\n <td>Month\n <select name='card_month'>\n <option value='01'>01</option>\n <option value='02'>02</option>\n <option value='03'>03</option>\n <option value='04'>04</option>\n <option value='05'>05</option>\n <option value='06'>06</option>\n <option value='07'>07</option>\n <option value='08'>08</option>\n <option value='09'>09</option>\n <option value='10'>10</option>\n <option value='11'>11</option>\n <option value='12'>12</option>\n </select>\n Year\n <select name='card_year'>\n <?php\n for ($year=date('Y'); $year<date('Y')+10; $year++) {\n echo '<option value=\"' . $year . '\">' . $year . '</option>';\n }\n ?>\n </select>\n </td>\n </tr>\n <tr>\n <td align='right'>Name on Card:</td>\n <td>\n <input type='text' name='card_name' value='<?php echo $name; ?>'\n maxlength='40' size='40'>\n </td>\n </tr>\n <tr>\n <td colspan='2' align='center'>\n <p><strong>Please press <em>Purchase</em> to confirm your purchase, or\n <em>Continue Shopping</em> to add or remove items.</em></strong></p>\n <?php display_form_button('purchase', 'Purchase These Items'); ?>\n </td>\n </tr>\n </form>\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 }", "function account_edit()\n {\n }", "public function credit()\n\t{\n\t\t\\IPS\\Dispatcher::i()->checkAcpPermission( 'invoices_edit' );\n\t\t\n\t\t/* Load Invoice */\n\t\ttry\n\t\t{\n\t\t\t$invoice = \\IPS\\nexus\\Invoice::load( \\IPS\\Request::i()->id );\n\t\t}\n\t\tcatch ( \\OutOfRangeException $e )\n\t\t{\n\t\t\t\\IPS\\Output::i()->error( 'node_error', '2X190/A', 404, '' );\n\t\t}\n\t\t\t\t\n\t\t/* Can we do this? */\n\t\tif ( $invoice->status !== \\IPS\\nexus\\Invoice::STATUS_PENDING )\n\t\t{\n\t\t\t\\IPS\\Output::i()->error( 'invoice_status_err', '2X190/B', 403, '' );\n\t\t}\n\t\t\n\t\t/* How much can we do? */\n\t\t$amountToPay = $invoice->amountToPay()->amount;\n\t\t$credits = $invoice->member->cm_credits;\n\t\t$credit = $credits[ $invoice->currency ]->amount;\n\t\t$maxCanCharge = ( $credit->compare( $amountToPay ) === -1 ) ? $credit : $amountToPay;\n\n\t\t/* Build Form */\n\t\t$form = new \\IPS\\Helpers\\Form( 'amount', 'invoice_charge_to_credit' );\n\t\t$form->add( new \\IPS\\Helpers\\Form\\Number( 't_amount', $maxCanCharge, TRUE, array( 'min' => 0.01, 'max' => (string) $maxCanCharge, 'decimals' => TRUE ), NULL, NULL, $invoice->currency ) );\n\t\t\n\t\t/* Handle submissions */\n\t\tif ( $values = $form->values() )\n\t\t{\t\t\t\n\t\t\t$transaction = new \\IPS\\nexus\\Transaction;\n\t\t\t$transaction->member = $invoice->member;\n\t\t\t$transaction->invoice = $invoice;\n\t\t\t$transaction->amount = new \\IPS\\nexus\\Money( $values['t_amount'], $invoice->currency );\n\t\t\t$transaction->ip = \\IPS\\Request::i()->ipAddress();\n\t\t\t$transaction->extra = array( 'admin' => \\IPS\\Member::loggedIn()->member_id );\n\t\t\t$transaction->save();\n\t\t\t$transaction->approve( NULL );\n\t\t\t$transaction->sendNotification();\n\t\t\t\n\t\t\t$credits[ $invoice->currency ]->amount = $credits[ $invoice->currency ]->amount->subtract( $transaction->amount->amount );\n\t\t\t$invoice->member->cm_credits = $credits;\n\t\t\t$invoice->member->save();\n\t\t\t\n\t\t\t$invoice->member->log( 'transaction', array(\n\t\t\t\t'type'\t\t\t=> 'paid',\n\t\t\t\t'status'\t\t=> \\IPS\\nexus\\Transaction::STATUS_PAID,\n\t\t\t\t'id'\t\t\t=> $transaction->id,\n\t\t\t\t'invoice_id'\t=> $invoice->id,\n\t\t\t\t'invoice_title'\t=> $invoice->title,\n\t\t\t) );\n\t\t\t\n\t\t\t$this->_redirect( $invoice );\n\t\t}\n\t\t\n\t\t/* Display */\n\t\t\\IPS\\Output::i()->title = \\IPS\\Member::loggedIn()->language()->addToStack( 'invoice_charge_to_credit' );\n\t\t\\IPS\\Output::i()->output = $form;\n\t}", "public function ProcessUpdateCreditCardForm($result, $value, $form, $field)\r\n\t{\r\n\t\tif($field->type == 'creditcard')\r\n\t\t{\r\n\t\t\t// Get the user id to send to stripe\r\n\t\t\t$customer_id = $this->GetUser();\r\n\r\n\t\t\t$response = json_decode(str_replace('\\\\\"', '\"', $_POST['stripe_response']));\r\n\r\n\t\t\ttry {\r\n\t\t\t\t$this->Stripe->UpdateCustomerCreditCard($customer_id, $response);\r\n\t\t\t} catch (Exception $e) {\r\n\t\t\t\t$err = $e->getJsonBody();\r\n\t\t\t\t$err = $err['error'];\r\n\r\n\t\t\t\t$result['is_valid'] = false;\r\n\t\t\t\t$result['message'] = $err['message'];\r\n\t\t\t}\t\t\t\t\r\n\t\t}\r\n\r\n\t\treturn $result;\r\n\t}", "public function edit(Cards $cards)\n {\n //return view('cards.edit', ['cards'=>$cards]);\n }", "public function actionEdit(){\n\t\t$form = $_POST;\n\t\t$id = $form['id'];\n\t\tunset($form['id']);\n\t\tunset($form['submit_']);\n\t\tif($form['active'] == 'on'){\n\t\t\t$form['active'] = 1;\n\t\t}\n\t\t$db = $this->context->getService('database');\n\t\t$db->exec('UPDATE core_pages SET ? WHERE id = ?', $form, $id);\n\t\t$this->redirect('pages:');\n\t}", "public function editAction()\n {\n $this->_title($this->__('AuthnetToken'));\n $this->_title($this->__('Customer'));\n $this->_title($this->__('Edit Item'));\n\n $profileId = $this->getRequest()->getParam('id');\n $model = Mage::getModel('authnettoken/cim_payment_profile')->load($profileId);\n if ($model->getId()) {\n\n // Retreive extra data fields from Authorize.Net CIM API\n try {\n $model->retrieveCimProfileData();\n }\n catch (SFC_AuthnetToken_Helper_Cim_Exception $eCim) {\n Mage::getSingleton('adminhtml/session')->addError('Failed to retrieve saved credit card info from Authorize.Net CIM!');\n if ($eCim->getResponse() != null) {\n Mage::getSingleton('adminhtml/session')->addError('CIM Result Code: ' . $eCim->getResponse()->getResultCode());\n Mage::getSingleton('adminhtml/session')->addError('CIM Message Code: ' . $eCim->getResponse()->getMessageCode());\n Mage::getSingleton('adminhtml/session')->addError('CIM Message Text: ' . $eCim->getResponse()->getMessageText());\n }\n // Send customer back to saved credit cards grid\n $this->_redirect('adminhtml/customer/edit/tab/customer_info_tabs_paymentprofile',\n array('id' => $model->getCustomerId()));\n\n return;\n }\n // Save profile in registry\n Mage::register('paymentprofile_data', $model);\n Mage::register('customer_id', $model->getCustomerId());\n\n $this->loadLayout();\n $this->_setActiveMenu('authnettoken/paymentprofile');\n $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Payment Profile'), Mage::helper('adminhtml')->__('Payment Profile'));\n $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Payment Profile'), Mage::helper('adminhtml')->__('Information'));\n $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);\n $this->_addContent($this->getLayout()->createBlock('authnettoken/adminhtml_customer_paymentprofiles_edit'));\n $this->_addLeft($this->getLayout()->createBlock('authnettoken/adminhtml_customer_paymentprofiles_edit_tabs'));\n $this->renderLayout();\n }\n else {\n Mage::getSingleton('adminhtml/session')->addError(Mage::helper('authnettoken')->__('Failed to find saved credit card.'));\n $this->_redirect('*/*/');\n }\n }", "public function edit()\n\t{\n\t\t$v = Payment::validate(Input::all());\n\t\t\n\t\t// if everything ok...\n\t\tif ( $v->passes() ) {\n\t\t\t\t\n\t\t\t// get the delivery from ID\n\t\t\t$payment = Payment::find(Input::get('id'));\n\t\t\t// edit the informations \n\t\t\t$payment->name = Input::get('name');\n\t\t\t$payment->slug = trim(Input::get('slug'));\n\t\t\t$payment->action = Input::get('action');\n\t\t\t$payment->amount = str_replace(',','.',Input::get('amount'));\n\t\t\t// setConnection -required- for BRAND DB\n\t\t\t$payment->setConnection(Auth::user()->options->brand_in_use->slug);\n\t\t\t// save the line(s)\n\t\t\t$payment->save();\n\n\t\t\t// success message\n\t\t\tAlert::success(trans('messages.Payment Option updated'));\n\t\t\n\t\t// if not ok...\n\t\t} else {\n\t\t\t\n\t\t\t// prepare error message composed by validation messages\n\t\t\t$messages = ''; foreach($v->messages()->messages() as $error) { $messages .= $error[0].'<br>'; } Alert::error($messages);\n\t\t}\n\t\t\n\t\t// redirect back\n\t\treturn redirect()->back();\n\t}", "function saveCard()\n {\n $table = 'module_isic_card';\n $card = $this->vars[\"card_id\"];\n $this->convertValueFieldKeys();\n //print_r($this->vars);\n // there are 2 possibilites for saving card (modify existing or add new)\n if ($card) { // modify existing card\n\n $row_old = $this->isic_common->getCardRecord($card);\n $t_field_data = $this->getFieldData($row_old[\"type_id\"]);\n\n\n $r = &$this->db->query('\n UPDATE\n `module_isic_card`\n SET\n `module_isic_card`.`moddate` = NOW(),\n `module_isic_card`.`moduser` = ?,\n `module_isic_card`.`person_name` = ?,\n `module_isic_card`.`person_addr1` = ?,\n `module_isic_card`.`person_addr2` = ?,\n `module_isic_card`.`person_addr3` = ?,\n `module_isic_card`.`person_addr4` = ?,\n `module_isic_card`.`person_email` = ?,\n `module_isic_card`.`person_phone` = ?,\n `module_isic_card`.`person_position` = ?,\n `module_isic_card`.`person_class` = ?,\n `module_isic_card`.`person_stru_unit` = ?,\n `module_isic_card`.`person_bankaccount` = ?,\n `module_isic_card`.`person_bankaccount_name` = ?,\n `module_isic_card`.`person_newsletter` = ?,\n `module_isic_card`.`confirm_user` = !,\n `module_isic_card`.`confirm_payment_collateral` = !,\n `module_isic_card`.`confirm_payment_cost` = !,\n `module_isic_card`.`confirm_admin` = !\n WHERE\n `module_isic_card`.`id` = !\n ', $this->userid,\n $this->vars[\"person_name\"],\n $this->vars[\"person_addr1\"],\n $this->vars[\"person_addr2\"],\n $this->vars[\"person_addr3\"],\n $this->vars[\"person_addr4\"],\n $this->vars[\"person_email\"],\n $this->vars[\"person_phone\"],\n $this->vars[\"person_position\"],\n $this->vars[\"person_class\"],\n $this->vars[\"person_stru_unit\"],\n $this->vars[\"person_bankaccount\"],\n $this->vars[\"person_bankaccount_name\"],\n $this->vars[\"person_newsletter\"] ? 1 : 0,\n $this->vars[\"confirm_user\"] ? 1: 0,\n $this->user_type == 1 ? ($this->vars[\"confirm_payment_collateral\"] ? 1 : 0) : $row_old[\"confirm_payment_collateral\"],\n $this->user_type == 1 ? ($this->vars[\"confirm_payment_cost\"] ? 1 : 0) : $row_old[\"confirm_payment_cost\"],\n $this->user_type == 1 ? ($this->vars[\"confirm_admin\"] ? 1 : 0) : $row_old[\"confirm_admin\"],\n $card\n );\n if ($r) {\n $success = true;\n $this->isic_common->saveCardChangeLog(2, $card, $row_old, $this->isic_common->getCardRecord($card));\n $message = 'card saved ...';\n } else {\n $success = false;\n $message = 'card modify failed ...';\n }\n\n } else { // adding new card\n $success = false;\n $action = 1; // add\n $t_field_data = $this->getFieldData($this->vars[\"type_id\"]);\n //print_r($t_field_data);\n foreach ($t_field_data[\"detailview\"] as $fkey => $fval) {\n // check for disabled fields, setting these values to empty\n if (in_array($action, $fval[\"disabled\"])) {\n unset($this->vars[$fkey]);\n continue;\n }\n // check for requried fields\n if (in_array($action, $fval[\"required\"])) {\n if (!$this->vars[$fkey]) {\n $error = $error_required_fields = true;\n break;\n }\n }\n if (!$error) {\n $insert_fields[] = $this->db->quote_field_name(\"{$fkey}\");\n $t_value = '';\n switch ($fval['type']) {\n case 1: // textfield\n $t_value = $this->db->quote($this->vars[$fkey] ? $this->vars[$fkey] : '');\n break;\n case 2: // combobox\n $t_value = $this->vars[$fkey] ? $this->vars[$fkey] : 0;\n break;\n case 3: // checkbox\n $t_value = $this->vars[$fkey] ? 1 : 0;\n break;\n case 5: // date\n $t_date = $this->convertDate($this->vars[$fkey]);\n $t_value = $this->db->quote($t_date);\n break;\n default :\n break;\n }\n $insert_values[] = $t_value;\n }\n }\n if (!$error) {\n $r = &$this->db->query('INSERT INTO ' . $this->db->quote_field_name($table) . ' FIELDS (' . implode(',', $insert_fields) . ') VALUES (' . implode(',', $insert_values) . ')');\n echo \"<!-- \" . $this->db->show_query() . \" -->\\n\";\n $card = $this->db->insert_id();\n\n }\n\n if ($r && $card) {\n $success = true;\n $this->isic_common->saveCardChangeLog(1, $card, array(), $this->isic_common->getCardRecord($card));\n $message = 'new card saved ...';\n } else {\n $success = false;\n $message = 'card add failed ...';\n }\n }\n\n echo JsonEncoder::encode(array('success' => $success, 'msg' => $message));\n exit();\n \n }", "public function editarCarreraController(){\n $datosController = $_GET[\"id\"];\n //Enviamos al modelo el id para hacer la consulta y obtener sus datos\n $respuesta = Datos::editarCarreraModel($datosController, \"carreras\");\n //Recibimos respuesta del modelo e IMPRIMIMOS UNA FORM PARA EDITAR\n echo'<input type=\"hidden\" value=\"'.$respuesta[\"id\"].'\"\n name=\"idEditar\">\n <input type=\"text\" value =\"'.$respuesta[\"nombre\"].'\"\n name=\"carreraEditar\" required>\n <input type=\"submit\" value= \"Actualizar\">';\n }", "public function editAction() {\n# process the edit form.\n# check the post data and filter it.\n\t\tif(isset($_POST['cancel'])) {\n\t\t\tAPI::Redirect(API::printUrl($this->_redirect));\n\t\t}\n\t\t$input_check = $this->_model->check_input($_POST);\n\t\tif(is_array($input_check)) {\n\t\t\tAPI::Error($input_check);\n\t\t\tAPI::redirect(API::printUrl($this->_redirect));\n\t\t}\n\t\t// all hooks will stack their errors onto the API::Error stack\n\t\t// but WILL NOT redirect.\n\t\tAPI::callHooks(self::$module, 'validate', 'controller', $_POST);\n\t\tif(API::hasErrors()) {\n\t\t\tAPI::redirect(API::printUrl($this->_redirect));\n\t\t}\n\n\t\t$this->_model->set_data($_POST);\n\n\t\t// auto call the hooks for this module/action\n\t\tAPI::callHooks(self::$module, 'save', 'controller');\n\n\t\tAPI::redirect(API::printUrl($this->_redirect));\n\n\n\t}", "protected function submitCreditCardForm(array $element, FormStateInterface $form_state) {\n\n $values = $form_state->getValue($element['#parents']);\n \n $this->entity->card_type = $values['type'];\n $this->entity->card_number = substr($values['number'], -4);\n $this->entity->card_exp_month = $values['expiration']['month'];\n $this->entity->card_exp_year = $values['expiration']['year'];\n $this->entity->cpf = $values['information']['cpf'];\n $this->entity->birth_date = $values['information']['birth_date'];\n $this->entity->card_holder_name = $values['card_holder_name'];\n $this->entity->sender_hash = $values['sender_hash'];\n $this->entity->card_hash = $values['card_hash'];\n $this->entity->card_brand = $values['card_brand'];\n $this->entity->installments = $values['installments'];\n }", "public function editar(){\n\t\t\n\t\t$this->form_validation->set_rules('resposta', 'RESPOSTA', 'trim');\n\t\tif ($this->form_validation->run()==TRUE):\n\t\t$dados = elements(array('resposta'), $this->input->post());\n\t\t$this->Comentarios->do_update($dados, array('id_comentario'=>$this->input->post('idcomentario')));\n\t\tendif;\n\t\tset_tema('titulo', 'Resposta de Coment&aacute;rio');\n\t\tset_tema('conteudo', load_modulo('Comentarios', 'editar'));\n\t\tload_template();\n\t}", "public function saveAction()\n {\n $postData = $this->getRequest()->getPost();\n\n if ($profileId = $this->getRequest()->getParam('id')) {\n $model = Mage::getModel('authnettoken/cim_payment_profile')->load($profileId);\n }\n else {\n $model = Mage::getModel('authnettoken/cim_payment_profile');\n }\n\n if ($postData) {\n\n try {\n try {\n // Save post data to model\n $model->addData($postData);\n // Now try to save payment profile to Auth.net CIM\n $model->saveCimProfileData(true);\n }\n catch (SFC_AuthnetToken_Helper_Cim_Exception $eCim) {\n Mage::getSingleton('adminhtml/session')->addError('Failed to save credit card to Authorize.Net CIM!');\n if ($eCim->getResponse() != null) {\n Mage::getSingleton('adminhtml/session')->addError('CIM Result Code: ' . $eCim->getResponse()->getResultCode());\n Mage::getSingleton('adminhtml/session')->addError('CIM Message Code: ' .\n $eCim->getResponse()->getMessageCode());\n Mage::getSingleton('adminhtml/session')->addError('CIM Message Text: ' .\n $eCim->getResponse()->getMessageText());\n }\n // Send customer back to saved credit cards grid\n $this->_redirect('adminhtml/customer/edit/tab/customer_info_tabs_paymentprofile',\n array('id' => $postData['customer_id']));\n\n return;\n }\n\n // Now save model\n $model->save();\n\n Mage::getSingleton('adminhtml/session')->addSuccess(\n Mage::helper('adminhtml')->__('Saved credit card ' . $model->getCustomerCardnumber() . '.'));\n Mage::getSingleton('adminhtml/session')->setCustomerData(false);\n\n if ($this->getRequest()->getParam('back')) {\n $this->_redirect('*/*/edit', array('id' => $model->getId()));\n\n return;\n }\n $this->_redirect('adminhtml/customer/edit/tab/customer_info_tabs_paymentprofile',\n array('id' => $model->getCustomerId()));\n\n return;\n }\n catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError('Failed to save credit card!');\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n // Send customer back to saved credit cards grid\n $this->_redirect('adminhtml/customer/edit/tab/customer_info_tabs_paymentprofile',\n array('id' => $postData['customer_id']));\n }\n }\n\n // Send customer back to saved credit cards grid\n $this->_redirect('adminhtml/customer/edit/tab/customer_info_tabs_paymentprofile', array('id' => $postData['customer_id']));\n }", "public function edit()\n {\n return view('panel.order-management.payment.form-edit');\n }", "public function edit($id)\n\t{\n\t\t$this->is_allowed('amuco_credit_insurance_update');\n\n\t\t$this->data['amuco_credit_insurance'] = $this->model_amuco_credit_insurance->find($id);\n\n\t\t$this->template->title('Amuco Credit Insurance Update');\n\t\t$this->render('backend/standart/administrator/amuco_credit_insurance/amuco_credit_insurance_update', $this->data);\n\t}", "public function edit(cr $cr)\n {\n //\n }", "public function edit(cr $cr)\n {\n //\n }", "public function edit(cr $cr)\n {\n //\n }", "public function edit(cr $cr)\n {\n //\n }", "public function edit(cr $cr)\n {\n //\n }", "function InfUpdateCreditCard($inf_card_id, $CardNumber='', $ExpirationMonth, $ExpirationYear, $NameOnCard, $BillAddress1, $BillCity, $BillState, $BillZip, $BillCountry) {\n\n\t$credit_card = new Infusionsoft_CreditCard();\n\t$credit_card->Id = $inf_card_id;\n\tif ($CreditCard<>\"\") {\n\t\t$credit_card->CardNumber = $CardNumber;\n\t}\n\t$credit_card->ExpirationMonth = $ExpirationMonth;\n\t$credit_card->ExpirationYear = $ExpirationYear;\n\t$credit_card->NameOnCard = $NameOnCard;\n\t$credit_card->BillAddress1 = $BillAddress1;\n\t$credit_card->BillCity = $BillCity;\n\t$credit_card->BillState = $BillState;\n\t$credit_card->BillZip = $BillZip;\n\t$credit_card->BillCountry = $BillCountry;\n\treturn $credit_card->save(); // Update Card in Infusionsoft\n}", "function procEditAccount() {\n global $session, $form;\n /* Account edit attempt */\n if ($_POST['avatar_type'] == \"predefined\") {\n $avatar = $_POST['avatar'];\n } else {\n $avatar = $_POST['avatar_url'];\n }\n\n $retval = $session->editAccount($_POST['curpass'], $_POST['newpass'], $_POST['email'], $avatar);\n\n /* Account edit successful */\n if ($retval) {\n $_SESSION['useredit'] = true;\n header(\"Location: \" . $session->referrer);\n }\n /* Error found with form */ else {\n $_SESSION['value_array'] = $_POST;\n $_SESSION['error_array'] = $form->getErrorArray();\n header(\"Location: \" . $session->referrer);\n }\n }", "public function edit($id)\n {\n $customer = Customer::find($id);\n $credit_cards = CreditCard::all();\n\n return view('transaction.customer.edit', compact('customer', 'credit_cards'));\n }", "public function edit(Bank $bank)\n {\n //\n }", "public function creditCardFormAdd()\n {\n\t\tif(isset($_POST[\"addBankDetails\"])){\n\t\t\t$this->form_validation->set_rules('cc_number', 'Credit Card Number:', 'required|min_length[15]',\n\t\t\t\tarray('required' => 'Please fill your correct Credit Card number.',\n\t\t\t\t\t'min_length' => 'Should be Numeric and have 15 or 16 digits.'\n\t\t\t\t)\n\t\t\t);\n\t\t\t$this->form_validation->set_rules('cc_ccv', 'Verification Code:', 'required|min_length[3]',\n\t\t\t\tarray('required' => 'Please fill in your Credit card verification code.',\n\t\t\t\t\t'min_length' => 'Should be Numeric and have 3 digits.'\n\t\t\t\t)\n\t\t\t);\n\t\t\t$this->form_validation->set_rules('nickname', 'Card Name:', 'required',\n\t\t\t\tarray('required' => 'Please fill in Card Name field.')\n\t\t\t);\n\t\t\t$this->form_validation->set_rules('f_name', 'Cardholder Name:', 'required',\n\t\t\t\tarray('required' => 'Please fill in your first name.')\n\t\t\t);\n\t\t\t$this->form_validation->set_rules('c_address1', 'Address:', 'required',\n\t\t\t\tarray('required' => 'Please fill in your address.')\n\t\t\t);\n\t\t\t$this->form_validation->set_rules('v_city', 'City:', 'required',\n\t\t\t\tarray('required' => 'Please fill in your city.')\n\t\t\t);\n\t\t\t$this->form_validation->set_rules('v_state', 'State:', 'required',\n\t\t\t\tarray('required' => 'Please fill in your state.')\n\t\t\t);\n\t\t\t$this->form_validation->set_rules('v_zip', 'Zip Code:', 'required',\n\t\t\t\tarray('required' => 'Please fill in your zip postal code.')\n\t\t\t);\n\t\t\t$this->form_validation->set_rules('cty', 'Country:', 'required',\n\t\t\t\tarray('required' => 'Please fill in your country.')\n\t\t\t);\n\t\t\t$form = $this->input->post(NULL, TRUE);\n\t\t\tif($this->form_validation->run() !== FALSE) {\n\t\t\t\t$addcreditinfo = $this->banks->addcreditinfo($form);\n\t\t\t\tif($addcreditinfo == TRUE){ ?>\n\t\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\t\t$(document).ready(function(){\n\t\t\t\t\t\t\t$(\"#credit_card_info_form\").trigger('reset');\n\t\t\t\t\t\t});\n\t\t\t\t\t</script> <?php\n\t\t\t\t\t//------Credit Cards Detail Form Default Parameters--->\t\n\t\t\t\t\t$data[\"cc_number\"] = \"\";\n\t\t\t\t\t$data[\"cc_month\"] = \"\";\n\t\t\t\t\t$data[\"cc_year\"] = \"\";\n\t\t\t\t\t$data[\"cc_ccv\"] = \"\";\n\t\t\t\t\t$data[\"nickname\"] = \"\";\n\t\t\t\t\t$data[\"f_name\"] = \"\";\n\t\t\t\t\t$data[\"c_address1\"] = \"\";\n\t\t\t\t\t$data[\"v_city\"] = \"\";\n\t\t\t\t\t$data[\"v_state\"] = \"\";\n\t\t\t\t\t$data[\"v_zip\"] = \"\";\n\t\t\t\t\t$data[\"cty\"] = \"\";\n\t\t\t\t\t//------./Credit Cards Detail Form Default Parameters--->\n\n\t\t\t\t\t$data[\"cc_amount\"] = \"\";\n\t\t\t\t\t$data[\"selectAccount\"] = \"\";\n\t\t\t\t\t$data[\"getBalance\"] = $this->banks->getbalanceinfo();\n\t\t\t\t\t$data[\"msg\"] = \"Credit account has been added successfully.\";\n\t\t\t\t\t$data['getcreditinfo'] = $this->banks->getCreditInfo();\n\t\t\t\t\t$data['getbankinfo'] = $this->banks->getBankInfo();\n\t\t\t\t\t//$data['getRecurringinfo'] = $this->banks->getRecurringInfo();\n\t\t\t\t\t$data['title'] = \"Account Summary\";\n\t\t\t\t\t$this->load->view('header', $data);\n\t\t\t\t\t$this->load->view('bank/inc_account_summary2', $data);\n\t\t\t\t\t$this->load->view('footer');\n\t\t\t\t} else {\n\n\t\t\t\t}\n\t\t\t} else{\n\t\t\t\t$this->accountSummary();\n\t\t\t}\n\t\t}\n\t}", "public function edit(Coin $coin)\n {\n //\n }", "public function creditcarddetailsviewAction()\r\n\t{\t\r\n\t if(defined('EMPTABCONFIGS'))\r\n\t\t{\r\n\t\t $empOrganizationTabs = explode(\",\",EMPTABCONFIGS);\r\n\t\t\tif(in_array('creditcarddetails',$empOrganizationTabs))\r\n\t\t\t{\r\n\t\t\t\t$tabName = \"creditcard\";\r\n\t\t\t\t$employeeData =array();\r\n\t\t\t\t$objName = 'mydetails';\r\n\t\t\t\t$editPrivilege='';\r\n\t\t\t\t$auth = Zend_Auth::getInstance();\r\n\t\t\t\t if($auth->hasIdentity())\r\n\t\t\t\t {\r\n\t\t\t\t\t\t$loginUserId = $auth->getStorage()->read()->id;\r\n\t\t\t\t\t}\r\n\t\t\t\t$id = $loginUserId;\r\n\t\t\t\t$callval = $this->getRequest()->getParam('call');\r\n\t\t\t\tif($callval == 'ajaxcall')\r\n\t\t\t\t\t$this->_helper->layout->disableLayout();\r\n\t\t\t\t\r\n\t\t\t\t$creditcardDetailsform = new Default_Form_Creditcarddetails();\r\n\t\t\t\t$creditcardDetailsModel = new Default_Model_Creditcarddetails();\r\n\t\t\t\t\r\n\t\t\t\t$creditcardDetailsform->removeElement(\"submit\");\r\n\t\t\t\t$elements = $creditcardDetailsform->getElements();\r\n\t\t\t\tif(count($elements)>0)\r\n\t\t\t\t{\r\n\t\t\t\t\tforeach($elements as $key=>$element)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(($key!=\"Cancel\")&&($key!=\"Edit\")&&($key!=\"Delete\")&&($key!=\"Attachments\")){\r\n\t\t\t\t\t\t$element->setAttrib(\"disabled\", \"disabled\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif($id)\r\n\t\t\t\t{\r\n\t\t\t\t\t$data = $creditcardDetailsModel->getcreditcarddetailsRecord($id);\r\n\t\t\t\t\t$employeeModal = new Default_Model_Employee();\r\n\t\t\t\t\ttry\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$empdata = $employeeModal->getsingleEmployeeData($id);\r\n\t\t\t\t\t\tif($empdata == 'norows')\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$this->view->rowexist = \"norows\";\r\n\t\t\t\t\t\t\t$this->view->empdata = \"\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$this->view->rowexist = \"rows\";\r\n\t\t\t\t\t\t\tif(!empty($empdata))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif(!empty($data))\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault(\"id\",$data[0]['id']);\r\n\t\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault('user_id',$data[0]['user_id']);\r\n\t\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault(\"card_type\",$data[0][\"card_type\"]);\r\n\t\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault(\"card_number\",$data[0][\"card_number\"]);\r\n\t\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault(\"nameoncard\",$data[0][\"nameoncard\"]);\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t$expiry_date = sapp_Global::change_date($data[0][\"card_expiration\"], 'view');\r\n\t\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault('card_expiration', $expiry_date);\r\n\t\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault(\"card_issuedby\",$data[0][\"card_issued_comp\"]);\r\n\t\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault(\"card_code\",$data[0][\"card_code\"]);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t$this->view->controllername = $objName;\r\n\t\t\t\t\t\t\t\t$this->view->actionname = 'creditcard';\t//Edit action name\r\n\t\t\t\t\t\t\t\t$this->view->id = $id;\r\n\t\t\t\t\t\t\t\tif(!empty($empdata))\r\n\t\t\t\t\t\t\t\t\t$this->view->employeedata = $empdata[0];\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t$this->view->employeedata = $empdata;\r\n\t\t\t\t\t\t\t\t$this->view->form = $creditcardDetailsform;\r\n\t\t\t\t\t\t\t\t$this->view->data =$data;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$this->view->empdata =$empdata;\r\n\t\t\t\t\t\t\t$this->view->editPrivilege = $this->mydetailsobjPrivileges;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcatch(Exception $e)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->view->rowexist = \"norows\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n else\r\n\t\t\t{\r\n\t\t \t $this->_redirect('error');\r\n\t\t }\r\n }\r\n else\r\n\t\t{\r\n\t\t \t$this->_redirect('error');\r\n\t\t} \t\t\r\n\t}", "function insert_creditcard($form = array(), $userid = 0)\n {\n global $ilance, $ilconfig, $phrase, $ilpage;\n $form['number_encrypted'] = $ilance->crypt->three_layer_encrypt($form['number'], $ilconfig['key1'], $ilconfig['key2'], $ilconfig['key3']);\n $form['authorized'] = 'yes';\n $form['creditcard_status'] = 'active';\n $form['default_card'] = 'yes';\n if ($ilconfig['creditcard_authentication'])\n {\n $form['authorized'] = 'no';\n }\n $ilance->db->query(\"\n INSERT INTO \" . DB_PREFIX . \"creditcards\n (cc_id, date_added, date_updated, user_id, creditcard_number, creditcard_expiry, cvv2, name_on_card, phone_of_cardowner, email_of_cardowner, card_billing_address1, card_billing_address2, card_city, card_state, card_postalzip, card_country, creditcard_status, default_card, creditcard_type, authorized) \n VALUES(\n NULL,\n '\" . DATETIME24H . \"',\n '\" . DATETIME24H . \"',\n '\" . intval($userid) . \"',\n '\" . $ilance->db->escape_string($form['number_encrypted']) . \"',\n '\" . $ilance->db->escape_string($form['expmon'] . $form['expyear']) . \"',\n '\" . intval($form['cvv2']) . \"',\n '\" . $ilance->db->escape_string($form['first_name'] . \" \" . $form['last_name']) . \"',\n '\" . $ilance->db->escape_string($form['phone']) . \"',\n '\" . $ilance->db->escape_string($form['email']) . \"',\n '\" . $ilance->db->escape_string($form['address1']) . \"',\n '\" . $ilance->db->escape_string($form['address2']) . \"',\n '\" . $ilance->db->escape_string($form['city']) . \"',\n '\" . $ilance->db->escape_string($form['state']) . \"',\n '\" . $ilance->db->escape_string($form['postalzip']) . \"',\n '\" . $ilance->db->escape_string($form['countryid']) . \"',\n '\" . $ilance->db->escape_string($form['creditcard_status']) . \"',\n '\" . $ilance->db->escape_string($form['default_card']) . \"',\n '\" . $ilance->db->escape_string($form['type']) . \"',\n '\" . $ilance->db->escape_string($form['authorized']) . \"')\n \", 0, null, __FILE__, __LINE__);\n $cc_id = $ilance->db->insert_id(); \n $ilance->email->mail = fetch_user('email', $userid);\n $ilance->email->slng = fetch_user_slng(intval($userid));\n $ilance->email->get('member_added_new_card');\t\t\n $ilance->email->set(array(\n '{{username}}' => fetch_user('username', intval($userid)),\n ));\n $ilance->email->send();\n $ilance->email->mail = SITE_EMAIL;\n $ilance->email->slng = fetch_site_slng();\n $ilance->email->get('member_added_new_card_admin');\t\t\n $ilance->email->set(array(\n '{{username}}' => fetch_user('username', intval($userid)),\n ));\n $ilance->email->send();\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"subscription_user\n SET paymethod = 'account'\n WHERE user_id = '\" . intval($userid) . \"'\n \", 0, null, __FILE__, __LINE__);\n return true;\n }", "public function edit($id)\n {\n //\n return view('admin.credit.edit')->with('credit', Credit::find($id));\n }", "public function edit_validation($cus_id)\n {\n #$this->session->set_userdata('cus_id',$cus_id);\n\n $this->header_left();\n $data['record']=$this->customer_M->edit_validation($cus_id);\n $this->load->view('customer_edit_V',$data); \n $this->footer(); \n }", "public function edit(Btc $btc)\n {\n //\n }", "public function creditCardPayment()\n {\n }", "function doEdit() {\n\t\t\n\t\t// Require a validated association \n\t\tProfileAssociationValidRequired::check();\r\n\t\n\t\t// Get the annonce\r\n\t\t$this->fetchAnnonce();\n\t\t\n\t\t// We should have write access to this annonce\r\n\t\t$this->checkWriteAccess();\n\t\t\n\t\t// Delete old version\n\t\t$this->annonce->delete();\r\n\t\n\t\t// Populate from request\n\t\t$this->populateAnnonce();\n\t\t\n\t\t// Publish new one\n\t\t$this->annonce->publish();\n\t\t\n\t\t// Success\n\t\t$this->setSuccess(_(\"Annonce mise à jour\"));\n\t\t\r\n\t\t// Redirect to the details\r\n\t\t$this->details();\r\n\t}", "public function edit1()\n\t{\n \t// $table_form5->tanggapan_audit = $request->auditi;\n \t// $table_form5->rencana_perbaikan = $request->perbaikan;\n \t// $table_form5->save();\n\n\t\t// $table_form5 = \\App\\Ptpp::findOrFail($request->idd);\n\t\t$table_form5->update($request->all());\n\n\t\treturn back()->with('sukses', 'Data sukses ditambahkan');;\n\t}", "public function editAccountAction()\n {\n //Current customer Data.\n $cst = $this->model->getByUserName($_SESSION['userName']);\n if (empty($_POST) === false) {\n //User want to Update his Data.\n if (isset($_POST['update'])) {\n $message = \"\";\n $currentUserName = $cst->getuserName();\n //Check if customer`s new User Name or \n //new Email exists in Data Base.\n if ($currentUserName != $_POST['userName'])\n $message = $this->checkIfExists($_POST['userName'], \"\");\n if (!$message)\n if ($cst->getemail() != $_POST['email'])\n $message = $this->checkIfExists(\"\", $_POST['email']);\n if ($message != \"\")\n $this->regMassage($message);\n //Upadating Customer`s Data.\n else {\n $cst = $this->customerCreate();\n $this->update($cst, $currentUserName);\n $_SESSION['userName'] = $_POST['userName'];\n }\n }\n }\n\n $vars['update'] = \"\";\n $vars['customer'] = $cst;\n $this->view->render('edit profile', $vars);\n }", "public function editAction() {\n $model = new Application_Model_Compromisso();\n //busco no banco o quem eu quero editar\n $comp = $model->find($this->_getParam('id'));\n // renderiso uma view com os dados\n $this->view->assign(\"compromisso\", $comp);\n }", "public function update(Request $request, Card $card)\n {\n //\n }", "public function update(Request $request, Card $card)\n {\n //\n }", "public function update(Request $request, Card $card)\n {\n //\n }", "public function update(Request $request, Card $card)\n {\n //\n }", "public function edit_submit() {\n if (User::is_logged_in()) {\n// check if form wasn't submitted for a second time\n if(isset($_POST['token']) && isset($_SESSION[$_POST['token']])) {\n unset($_SESSION[$_POST['token']]);\n\n if (isset($_POST['edit'])) {\n // edit post\n $change_picture = null;\n if (isset($_POST['form-change-picture']) && isset($_FILES['picture'])) {\n $change_picture = true;\n }\n Post::edit($_POST['description'], $_POST['category'], $_FILES['picture'], $_GET['post_id'], $change_picture);\n } else if (isset($_POST['delete'])) {\n //delete post\n Post::delete($_GET['post_id']);\n }\n } else {\n // form was submitted for the second time\n// redirect to home page\n call('posts', 'index');\n Message::info('Second attempt to submit a form was denied.');\n }\n }\n }", "public function editForm(): void\n {\n $this->articleId = $_GET['id'];\n $query = $this->articleModel->displayOneArticle($this->articleId);\n $editArticle = $query->fetch();\n\n $this->title = $editArticle['title'];\n $this->content = $editArticle['content'];\n $this->category = $editArticle['category'];\n }", "public function execute()\n {\n $dataRequest = $this->getRequest()->getParams();\n\n// echo '<pre>'\n\n if (isset($dataRequest['giftcard_id'])){\n// Edit\n if (!isset($dataRequest['code'])){\n $dataRequest['code'] = null;\n }\n if (!isset($dataRequest['balance'])){\n $dataRequest['balance'] = null;\n }\n if (!isset($dataRequest['amount_used'])){\n $dataRequest['amount_used'] = null;\n }\n if (!isset($dataRequest['create_from'])){\n $dataRequest['create_from'] = null;\n }\n\n $data = [\n 'code' => $dataRequest['code'],\n 'balance' => $dataRequest['balance'],\n 'amount_used' => $dataRequest['amount_used'],\n 'create_from' => $dataRequest['create_from']\n ];\n $this->update($dataRequest['giftcard_id'], $data);\n $this->messageManager->addSuccessMessage('Edit successfully');\n if (isset($dataRequest['back']) && $dataRequest['back'] == 'edit'){\n// Save And Edit\n $this->_redirect('giftcard/code/edit/id/'.$dataRequest['giftcard_id']);\n } elseif (!isset($dataRequest['back'])){\n// Save\n $this->_redirect('giftcard/code/index');\n }\n } else {\n// Create New\n $code_length = $this->getRequest()->getParam('code_length');\n $code = $this->_random->getRandomString($code_length, 'ABCDEFGHIJKLMLOPQRSTUVXYZ0123456789');\n// $code = $this->random_code($code_length);\n $data = [\n 'code' => $code,\n 'balance' => $dataRequest['balance'],\n 'create_from' => 'admin'\n ];\n if (isset($dataRequest['back']) && $dataRequest['back'] == 'edit'){\n// Save And Edit\n $id = $this->insertAndReturnId($data);\n $this->messageManager->addSuccessMessage('Add Success');\n $this->_redirect('giftcard/code/edit/id/'.$id);\n } elseif (!isset($dataRequest['back'])){\n// Save\n $this->insert($data);\n $this->messageManager->addSuccessMessage('Add Success');\n $this->_redirect('giftcard/code/index');\n }\n }\n }", "public function edit(){\r\n\t\t//$this->auth->set_access('edit');\r\n\t\t//$this->auth->validate();\r\n\r\n\t\t//call save method\r\n\t\t$this->save();\r\n\t}", "function EditPraktijk()\n {\n if(!isset($_POST['submitted']))\n {\n return false;\n }\n \n // Maak een Array\n $formvars = array();\n \n $this->CollectRegistrationSubmissionPraktijk($formvars);\n \n $formvars['edit'] = \"1\";\n \n if(!$this->SaveToDatabasePraktijk($formvars))\n {\n return false;\n }\n \n return true;\n }", "public function payment_fields() {\n echo '<p><strong>Pay securely using your credit card</strong> <img src=\"' . plugins_url() . '/woocommerce-pay-fabric/images/visa.svg\" alt=\"Visa\" class=\"card-img\" width=\"32\"> <img src=\"' . plugins_url() . '/woocommerce-pay-fabric/images/mastercard.svg\" alt=\"Mastercard\" class=\"card-img\" width=\"32\"> <img src=\"' . plugins_url() . '/woocommerce-pay-fabric/images/discover.svg\" alt=\"Discover\" class=\"card-img\" width=\"32\"> <img src=\"' . plugins_url() . '/woocommerce-pay-fabric/images/amex.svg\" alt=\"Amex\" class=\"card-img\" width=\"32\"></p>';\n // Trying render payment form\n // Call orginal payment the Woocommerce\n $this->form();\n }", "public function postChangeCard(BillingRequest $request)\n {\n try {\n $payload = $request->all();\n $creditCardToken = $payload['stripeToken'];\n auth()->user()->meta->updateCard($creditCardToken);\n return redirect('user/billing/details')->with('message', 'Your subscription has been updated!');\n } catch (Exception $e) {\n Log::error($e->getMessage());\n return back()->withErrors(['Could not process the billing please try again.']);\n }\n\n return back()->withErrors(['Could not complete billing, please try again.']);\n }", "public function edit(Suitcase $suitcase)\n {\n //\n }", "public function gateway_cc_form()\n {\n // register the action to remove default CC form\n return;\n }", "public function actionPaymentdebitcard()\n\t{ \n\t\t\n\t\tif( isset($_SESSION['invoice_id']) )\n\t\t{\n\t\t\t$invoiceModel = new Invoices;\n\t\t\t$payment\t\t= $invoiceModel->getInvoicePayment( $_SESSION['invoice_id'] );\n \t\t\t$this->render(\"cardForm\", array(\"payment\"=>$payment));\n \t\t}\n\t\t\n\t}", "function edit() {\n\t\t\t\n\t\t// Require a validated association \n\t\tProfileAssociationValidRequired::check();\r\n\t\n\t\t// Get annonce\r\n\t\t$this->fetchAnnonce();\n\t\t\n\t\t// We should have write access to this annonce\n\t\t$this->checkWriteAccess();\r\n\t\r\n\t\t// Redirect to the annonce\r\n\t\t$this->renderView(\"editAnnonce\");\r\n\t\r\n\t}", "protected function buildCreditCardForm(array $element, FormStateInterface $form_state) {\n\n $plugin = $this->plugin;\n $config = $plugin->getConfig();\n\n $amount = 0;\n // Loading order for loading total price and customer.\n $param = \\Drupal::routeMatch()->getParameter('commerce_order');\n if (isset($param)) {\n if(method_exists($param,'id')) {\n $order_id = $param->id();\n $order = Order::load($order_id);\n $getOrder = $order->getTotalPrice()->getNumber();\n $amount = number_format($getOrder, 2,'.','');\n }\n }\n \n // Build a month select list that shows months with a leading zero.\n $months = [];\n for ($i = 1; $i < 13; $i++) {\n $month = str_pad($i, 2, '0', STR_PAD_LEFT);\n $months[$month] = $month;\n }\n // Build a year select list that uses a 4 digit key with a 2 digit value.\n $current_year = date('Y');\n $years = [];\n for ($i = 0; $i < 14; $i++) {\n $years[$current_year + $i] = $current_year + $i;\n }\n\n $parcelas = [\n -1 => 'Escolha a quantidade de parcelas...',\n ];\n\n $element['#attributes']['class'][] = 'credit-card-form';\n // Placeholder for the detected card type. Set by validateCreditCardForm().\n $element['type'] = [\n '#type' => 'hidden',\n '#value' => '',\n ];\n $element['number'] = [\n '#type' => 'textfield',\n '#title' => t('Card number'),\n '#attributes' => [\n 'autocomplete' => 'off', \n 'id' => 'card-number'\n ],\n '#required' => TRUE,\n '#maxlength' => 19,\n '#size' => 20,\n '#suffix' => '<div id=\"show-card-brand\"></div>',\n ];\n\n $element['expiration'] = [\n '#type' => 'container',\n '#attributes' => [\n 'class' => ['credit-card-form__expiration'],\n ],\n ];\n\n $element['expiration']['month'] = [\n '#type' => 'select',\n '#title' => t('Month'),\n '#options' => $months,\n '#default_value' => date('m'),\n '#required' => TRUE,\n '#attributes' => ['id' => 'expiration-month'],\n ];\n\n $element['expiration']['divider'] = [\n '#type' => 'item',\n '#title' => '',\n '#markup' => '<span class=\"credit-card-form__divider\">/</span>',\n ];\n\n $element['expiration']['year'] = [\n '#type' => 'select',\n '#title' => t('Year'),\n '#options' => $years,\n '#default_value' => $current_year,\n '#required' => TRUE,\n '#prefix' => '<span>&nbsp;&nbsp;',\n '$suffix' => '</span>',\n '#attributes' => ['id' => 'expiration-year'],\n ];\n\n $element['expiration']['security_code'] = [\n '#type' => 'textfield',\n '#title' => t('CVV'),\n '#attributes' => [\n 'autocomplete' => 'off',\n 'id' => 'security-code',\n ],\n '#required' => TRUE,\n '#maxlength' => 10,\n '#size' => 10,\n ];\n\n $element['card_holder_name'] = [\n '#type' => 'textfield',\n '#title' => t('Nome Impresso no cartão'),\n '#attributes' => [\n 'autocomplete' => 'off',\n 'id' => 'holder-name',\n ],\n '#required' => TRUE,\n '#maxlength' => 60,\n '#size' => 60,\n ];\n\n $element['information'] = [\n '#type' => 'container',\n '#attributes' => [\n 'class' => ['credit-card-form__information'],\n ],\n ];\n\n $element['information']['cpf'] = [\n '#type' => 'textfield',\n '#title' => t('CPF do titular'),\n '#attributes' => [\n 'autocomplete' => 'off',\n 'id' => 'cpf-card',\n ],\n '#required' => TRUE,\n '#maxlength' => 20,\n '#size' => 20,\n '#prefix' => '<span>&nbsp;&nbsp;',\n '$suffix' => '</span>',\n ];\n\n $element['information']['birth_date'] = [\n '#type' => 'date',\n '#title' => t('Data de aniversário'),\n '#attributes' => [\n 'autocomplete' => 'off',\n 'id' => 'birth-card',\n ],\n '#date_date_format' => 'd/m/Y',\n '#required' => TRUE,\n ];\n\n $element['installments'] = [\n '#type' => 'select',\n '#title' => t('Deseja parcelar?'),\n '#options' => $parcelas,\n '#default_value' => $parcelas,\n '#required' => TRUE,\n '#attributes' => ['id' => 'installments'],\n '#validated' => TRUE,\n ];\n\n $element['sender_hash'] = [\n '#type' => 'hidden',\n '#default_value' => '',\n '#attributes' => ['id' => 'sender-hash'],\n ];\n\n $element['card_hash'] = [\n '#type' => 'hidden',\n '#default_value' => '',\n '#attributes' => ['id' => 'card-hash'],\n ];\n\n $element['card_brand'] = [\n '#type' => 'hidden',\n '#default_value' => '',\n '#attributes' => ['id' => 'card-brand'],\n ];\n\n $element['#attached']['library'][] = 'commerce_pagseguro_v2/pagseguro_sandbox';\n\n $session = $this->getSession($config);\n // Passing the params session to the .js.\n $element['#attached']['drupalSettings']['commercePagseguroV2']['commercePagseguro']['session'] = $session;\n $element['#attached']['drupalSettings']['commercePagseguroV2']['commercePagseguro']['amount'] = $amount;\n\n return $element;\n }", "public function edit($pm_id)\n {\n if(!is_group('admin')){\n redirect('admin');\n exit();\n }\n // check if the payment exists before trying to edit it\n $render_data['payment'] = $this->payment->get_payment($pm_id);\n\n if (isset($render_data['payment']['pm_id'])) {\n if (isset($_POST) && count($_POST) > 0) {\n $params = array(\n 'title' => $this->input->post('title'),\n 'bank_name' => $this->input->post('bank_name',true),\n 'bank_acc' => $this->input->post('bank_acc',true),\n 'bank_branch' => $this->input->post('bank_branch',true),\n 'bank_type' => $this->input->post('bank_type',true),\n 'type' => $this->input->post('type',true),\n 'detail' => $this->input->post('detail',true)\n );\n\n $this->payment->update_payment($pm_id, $params);\n redirect('admin/payment/index');\n } else {\n $js = ' $(function(){\n\t\t\t\tCKEDITOR.replace( \"body\" ,{\n\t\t\t\t\tfilebrowserBrowseUrl : \"'.base_url('js/ckfinder/ckfinder.html').'\",\n\t\t\t\t\tfilebrowserImageBrowseUrl : \"'.base_url('js/ckfinder/ckfinder.html?type=Images').'\",\n\t\t\t\t\tfilebrowserFlashBrowseUrl : \"'.base_url('js/ckfinder/ckfinder.html?type=Flash').'\",\n\t\t\t\t\tfilebrowserUploadUrl : \"'.base_url('js/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files').'\",\n\t\t\t\t\tfilebrowserImageUploadUrl : \"'.base_url('js/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images').'\",\n\t\t\t\t\tfilebrowserFlashUploadUrl : \"'.base_url('js/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash').'\"\n\t\t\t\t});\n\t\t\t\t$(\"#slideshow_upload\").hide();\n\t\t\t\tif ($(\"#is_slideshow\").attr(\"checked\") == \"checked\")\n\t\t\t\t{\n\t\t\t\t\t$(\"#slideshow_upload\").show();\n\t\t\t\t}\n\t\t\t\t$(\"#is_slideshow\").click(function(){\n\t\t\t\t\tif ($(this).attr(\"checked\") == \"checked\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$(\"#slideshow_upload\").slideDown();\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$(\"#slideshow_upload\").slideUp();\n\t\t\t\t\t}\n\t\t\t\t}); \n\t\t\t});';\n $this->template->write('js', $js);\n //******* Defalut ********//\n $render_data['user'] = $this->session->userdata('fnsn');\n $this->template->write('title', 'Payment Information');\n $this->template->write('user_id', $render_data['user']['aid']);\n $this->template->write('user_name', $render_data['user']['name']);\n $this->template->write('user_group', $render_data['user']['group']);\n //******* Defalut ********//\n $this->template->write_view('content', 'admin/payment/edit', $render_data);\n $this->template->render();\n }\n } else\n show_error('The payment you are trying to edit does not exist.');\n }", "public function actionEdit()\r\n {\r\n $userId = User::checkLogged();\r\n\r\n $user = User::getUserById($userId);\r\n\r\n // new user info valiables\r\n $name = $user['name'];\r\n $password = $user['password'];\r\n\r\n $result = false;\r\n\r\n // form processing\r\n if (isset($_POST['submit'])) {\r\n $name = $_POST['name'];\r\n $password = $_POST['password'];\r\n\r\n $errors = false;\r\n\r\n // validate fields\r\n if (!User::checkName($name))\r\n $errors[] = 'Имя должно быть длиннее 3-х символов';\r\n\r\n if (!User::checkPassword($password))\r\n $errors[] = 'Пароль должен быть длиннее 5-ти символов';\r\n\r\n // save new data \r\n if ($errors == false)\r\n\r\n $result = User::edit($userId, $name, $password);\r\n }\r\n\r\n // attach specified view\r\n require_once(ROOT . '/app/views/cabinet/edit.php');\r\n return true;\r\n }", "public function edit(CaretakerForm $caretakerForm)\n {\n //\n }", "public function edit_save($id)\n\t{\n\t\tif (!$this->is_allowed('amuco_credit_insurance_update', false)) {\n\t\t\techo json_encode([\n\t\t\t\t'success' => false,\n\t\t\t\t'message' => cclang('sorry_you_do_not_have_permission_to_access')\n\t\t\t\t]);\n\t\t\texit;\n\t\t}\n\t\t\n\t\t$this->form_validation->set_rules('customer_id', 'Customer Id', 'trim|required|max_length[10]');\n\t\t$this->form_validation->set_rules('raiting', 'Raiting', 'trim|required');\n\t\t$this->form_validation->set_rules('credit_ever_denied', 'Credit Ever Denied', 'trim|required');\n\t\t$this->form_validation->set_rules('available_credit', 'Available Credit', 'trim|required');\n\t\t$this->form_validation->set_rules('insured_credit', 'Insured Credit', 'trim|required');\n\t\t$this->form_validation->set_rules('own_risk', 'Own Risk', 'trim|required');\n\t\t$this->form_validation->set_rules('highest_ever_insured', 'Highest Ever Insured', 'trim|required');\n\t\t$this->form_validation->set_rules('request_increase_status', 'Request Increase Status', 'trim|max_length[20]');\n\t\t\n\t\tif ($this->form_validation->run()) {\n\t\t\n\t\t\t$save_data = [\n\t\t\t\t'customer_id' => $this->input->post('customer_id'),\n\t\t\t\t'raiting' => $this->input->post('raiting'),\n\t\t\t\t'credit_ever_denied' => $this->input->post('credit_ever_denied'),\n\t\t\t\t'available_credit' => $this->input->post('available_credit'),\n\t\t\t\t'insured_credit' => $this->input->post('insured_credit'),\n\t\t\t\t'own_risk' => $this->input->post('own_risk'),\n\t\t\t\t'highest_ever_insured' => $this->input->post('highest_ever_insured'),\n\t\t\t\t'request_increase_status' => $this->input->post('request_increase_status'),\n\t\t\t\t'mount_increase' => $this->input->post('mount_increase'),\n\t\t\t\t'last_increased_requested' => $this->input->post('last_increased_requested'),\n\t\t\t\t'date_last_increased_requested' => $this->input->post('date_last_increased_requested'),\n\t\t\t\t'date_updated' => date(\"Y-m-d H:i:s\"),\n\t\t\t];\n\n\t\t\t\t\t\t$data_output=$this->model_amuco_credit_insurance->find($id);\n\t\t $save_amuco_credit_insurance = $this->model_amuco_credit_insurance->change($id, $save_data);\n\n\t\t\tif ($save_amuco_credit_insurance) {\n\t\t\t\t$save_data_tracer=array_merge($save_data,['id'=>$id]);\n\t\t\t\t$this->insert_logs($save_data_tracer,'updated',$data_output);\n\t\t\t\n\t\t\t\tif ($this->input->post('save_type') == 'stay') {\n\t\t\t\t\t$this->data['success'] = true;\n\t\t\t\t\t$this->data['id'] \t = $id;\n\t\t\t\t\t$this->data['message'] = cclang('success_update_data_stay', [\n\t\t\t\t\t\tanchor('administrator/amuco_credit_insurance', ' Go back to list')\n\t\t\t\t\t]);\n\t\t\t\t} else {\n\t\t\t\t\tset_message(\n\t\t\t\t\t\tcclang('success_update_data_redirect', [\n\t\t\t\t\t]), 'success');\n\n \t\t$this->data['success'] = true;\n\t\t\t\t\t$this->data['redirect'] = base_url('administrator/amuco_credit_insurance');\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($this->input->post('save_type') == 'stay') {\n\t\t\t\t\t$this->data['success'] = false;\n\t\t\t\t\t$this->data['message'] = cclang('data_not_change');\n\t\t\t\t} else {\n \t\t$this->data['success'] = false;\n \t\t$this->data['message'] = cclang('data_not_change');\n\t\t\t\t\t$this->data['redirect'] = base_url('administrator/amuco_credit_insurance');\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$this->data['success'] = false;\n\t\t\t$this->data['message'] = 'Opss validation failed';\n\t\t\t$this->data['errors'] = $this->form_validation->error_array();\n\t\t}\n\n\t\techo json_encode($this->data);\n\t\texit;\n\t}", "function edit($message = '') {\n\t$add_certificates = open_table_form('Edit Certificate Amount','edit_certificate_amount',SITE_ADMIN_SSL_URL.'?sect=retcustomer&mode=certificateamounteditcheck&lid='.$_GET['lid'],'post',$message);\n\t$add_certificates .= $this->form();\n\t$add_certificates .= close_table_form();\n return $add_certificates;\n }", "public function edit(CurrencyList $currency)\n {\n //\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit(BankAccount $bankAccount)\n {\n //\n }", "public function edit(BankAccount $bankAccount)\n {\n //\n }", "public function edit($id='') \n {\n if ($id != '') \n {\n\n $data['delivery_method'] = $this->delivery_methods->get_one($id);\n $data['action'] = 'delivery_method/save/' . $id; \n \n $this->template->js_add('\n $(document).ready(function(){\n // binds form submission and fields to the validation engine\n $(\"#form_delivery_method\").parsley();\n });','embed');\n \n $this->template->render('delivery_method/form',$data);\n \n }\n else \n {\n $this->session->set_flashdata('notif', notify('no id','info'));\n redirect(site_url('delivery_method'));\n }\n }", "public function edit_testimonials_form(){\n\t\tif ($this->checkLogin('A') == ''){\n\t\t\tredirect('admin');\n\t\t}else {\n\t\t\t$this->data['heading'] = 'Edit Contact';\n\t\t\t$testimonials_id = $this->uri->segment(4,0);\n\t\t\t$condition = array('id' => $testimonials_id);\n\t\t\t$this->data['testimonials_details'] = $this->review_model->get_all_details(TESTIMONIALS,$condition);\n\t\t\tif ($this->data['testimonials_details']->num_rows() == 1){\n\t\t\t\t$this->load->view('admin/testimonials/edit_testimonials',$this->data);\n\t\t\t}else {\n\t\t\t\tredirect('admin');\n\t\t\t}\n\t\t}\n\t}", "public function editPriceMoney(){\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public function edit()\n {\n return view('billing::edit');\n }" ]
[ "0.7642047", "0.7630158", "0.7235667", "0.7094024", "0.7094024", "0.7094024", "0.682281", "0.6821482", "0.6817083", "0.6816876", "0.67423236", "0.6722168", "0.66860217", "0.65675193", "0.6545074", "0.654394", "0.6481275", "0.6428689", "0.6425542", "0.6411294", "0.6322264", "0.6312957", "0.630403", "0.628833", "0.62677467", "0.6265454", "0.62565386", "0.62385476", "0.62197226", "0.6210605", "0.6186229", "0.61852384", "0.6169964", "0.6166768", "0.61458087", "0.6117248", "0.6111173", "0.60880476", "0.60624254", "0.6047808", "0.60412586", "0.6025549", "0.6014548", "0.60040396", "0.60010463", "0.5981259", "0.5978544", "0.59655726", "0.59603214", "0.59582114", "0.5956067", "0.5956067", "0.5956067", "0.5956067", "0.5956067", "0.5945753", "0.59437317", "0.5942303", "0.5934952", "0.593346", "0.5928623", "0.5928029", "0.5921686", "0.591895", "0.5918118", "0.59070164", "0.5900126", "0.5899314", "0.5881319", "0.5879894", "0.5878992", "0.5873127", "0.5873127", "0.5873127", "0.5873127", "0.5866574", "0.585544", "0.5845826", "0.58440644", "0.5827086", "0.58241016", "0.58239084", "0.58227044", "0.58194995", "0.5817704", "0.58102816", "0.5810276", "0.5798734", "0.57933635", "0.578663", "0.5782232", "0.5781474", "0.5778078", "0.57760155", "0.5772568", "0.5772568", "0.57724327", "0.5770318", "0.57495314", "0.5746823" ]
0.6926618
6
Define form to upgrade
function commerce_braintree_form_upgrade() { $form = array(); $form['profile_nid'] = array( '#type' => 'select', '#title' => t('Choose a profile'), '#options' => commerce_braintree_profile_list(), ); $form['submit'] = array( '#type' => 'submit', '#value' => t('Upgrade'), ); return $form; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function update_form()\n\t{\n\t\t$this->title = sprintf(lang('update_title'), $this->installed_version, $this->version);\n\t\t$vars['action'] = $this->set_qstr('do_update');\n\t\t$this->set_output('update_form', $vars);\n\t}", "abstract function setupform();", "abstract protected function _setNewForm();", "public function updateForm(){\n $new = $this->model->getNew();\n $this->view->updateForm($new);\n }", "public function save_upgrade() {\n\t\tglobal $wpdb;\n\n\t\tif ( !isset( $_REQUEST['action'] ) || !isset( $_GET['page'] ) )\n\t\t\treturn;\n\n\t\tif ( 'visual-form-builder-pro' !== $_GET['page'] )\n\t\t\treturn;\n\n\t\tif ( 'vfb-upgrade' !== $_REQUEST['action'] )\n\t\t\treturn;\n\n\t\t// Set database names of free version\n\t\t$vfb_fields = $wpdb->prefix . 'visual_form_builder_fields';\n\t\t$vfb_forms = $wpdb->prefix . 'visual_form_builder_forms';\n\t\t$vfb_entries = $wpdb->prefix . 'visual_form_builder_entries';\n\n\t\t// Get all forms, fields, and entries\n\t\t$forms = $wpdb->get_results( \"SELECT * FROM $vfb_forms ORDER BY form_id\" );\n\n\t\t// Truncate the tables in case any forms or fields have been added\n\t\t$wpdb->query( \"TRUNCATE TABLE $this->form_table_name\" );\n\t\t$wpdb->query( \"TRUNCATE TABLE $this->field_table_name\" );\n\t\t$wpdb->query( \"TRUNCATE TABLE $this->entries_table_name\" );\n\n\t\t// Setup email design defaults\n\t\t$email_design = array(\n\t\t\t'format' \t\t\t\t=> 'html',\n\t\t\t'link_love' \t\t\t=> 'yes',\n\t\t\t'footer_text' \t\t\t=> '',\n\t\t\t'background_color' \t\t=> '#eeeeee',\n\t\t\t'header_text'\t\t\t=> '',\n\t\t\t'header_image' \t\t\t=> '',\n\t\t\t'header_color' \t\t\t=> '#810202',\n\t\t\t'header_text_color' \t=> '#ffffff',\n\t\t\t'fieldset_color' \t\t=> '#680606',\n\t\t\t'section_color' \t\t=> '#5C6266',\n\t\t\t'section_text_color' \t=> '#ffffff',\n\t\t\t'text_color' \t\t\t=> '#333333',\n\t\t\t'link_color' \t\t\t=> '#1b8be0',\n\t\t\t'row_color' \t\t\t=> '#ffffff',\n\t\t\t'row_alt_color' \t\t=> '#eeeeee',\n\t\t\t'border_color' \t\t\t=> '#cccccc',\n\t\t\t'footer_color' \t\t\t=> '#333333',\n\t\t\t'footer_text_color' \t=> '#ffffff',\n\t\t\t'font_family' \t\t\t=> 'Arial',\n\t\t\t'header_font_size' \t\t=> 32,\n\t\t\t'fieldset_font_size' \t=> 20,\n\t\t\t'section_font_size' \t=> 15,\n\t\t\t'text_font_size' \t\t=> 13,\n\t\t\t'footer_font_size' \t\t=> 11\n\t\t);\n\n\t\t// Migrate all forms, fields, and entries\n\t\tforeach ( $forms as $form ) :\n\n\t\t\t// Set email header text default as form subject\n\t\t\t$email_design['header_text'] = $form->form_email_subject;\n\n\t\t\t$data = array(\n\t\t\t\t'form_id' \t\t\t\t\t\t=> $form->form_id,\n\t\t\t\t'form_key' \t\t\t\t\t\t=> $form->form_key,\n\t\t\t\t'form_title' \t\t\t\t\t=> $form->form_title,\n\t\t\t\t'form_email_subject' \t\t\t=> $form->form_email_subject,\n\t\t\t\t'form_email_to' \t\t\t\t=> $form->form_email_to,\n\t\t\t\t'form_email_from' \t\t\t\t=> $form->form_email_from,\n\t\t\t\t'form_email_from_name' \t\t\t=> $form->form_email_from_name,\n\t\t\t\t'form_email_from_override' \t\t=> $form->form_email_from_override,\n\t\t\t\t'form_email_from_name_override' => $form->form_email_from_name_override,\n\t\t\t\t'form_success_type' \t\t\t=> $form->form_success_type,\n\t\t\t\t'form_success_message' \t\t\t=> $form->form_success_message,\n\t\t\t\t'form_notification_setting' \t=> $form->form_notification_setting,\n\t\t\t\t'form_notification_email_name' \t=> $form->form_notification_email_name,\n\t\t\t\t'form_notification_email_from' \t=> $form->form_notification_email_from,\n\t\t\t\t'form_notification_email' \t\t=> $form->form_notification_email,\n\t\t\t\t'form_notification_subject' \t=> $form->form_notification_subject,\n\t\t\t\t'form_notification_message' \t=> $form->form_notification_message,\n\t\t\t\t'form_notification_entry' \t\t=> $form->form_notification_entry,\n\t\t\t\t'form_email_design' \t\t\t=> serialize( $email_design ),\n\t\t\t\t'form_label_alignment' \t\t\t=> '',\n\t\t\t\t'form_verification' \t\t\t=> 1,\n\t\t\t\t'form_entries_allowed' \t\t\t=> '',\n\t\t\t\t'form_entries_schedule'\t\t\t=> '',\n\t\t\t\t'form_unique_entry'\t\t\t\t=> 0\n\t\t\t);\n\n\t\t\t$wpdb->insert( $this->form_table_name, $data );\n\n\t\t\t$fields = $wpdb->get_results( $wpdb->prepare( \"SELECT * FROM $vfb_fields WHERE form_id = %d ORDER BY field_id\", $form->form_id ) );\n\t\t\t// Copy each field and data\n\t\t\tforeach ( $fields as $field ) {\n\n\t\t\t\t$data = array(\n\t\t\t\t\t'field_id' \t\t\t=> $field->field_id,\n\t\t\t\t\t'form_id' \t\t\t=> $field->form_id,\n\t\t\t\t\t'field_key' \t\t=> $field->field_key,\n\t\t\t\t\t'field_type' \t\t=> $field->field_type,\n\t\t\t\t\t'field_name' \t\t=> $field->field_name,\n\t\t\t\t\t'field_description' => $field->field_description,\n\t\t\t\t\t'field_options' \t=> $field->field_options,\n\t\t\t\t\t'field_sequence' \t=> $field->field_sequence,\n\t\t\t\t\t'field_validation' \t=> $field->field_validation,\n\t\t\t\t\t'field_required' \t=> $field->field_required,\n\t\t\t\t\t'field_size' \t\t=> $field->field_size,\n\t\t\t\t\t'field_css' \t\t=> $field->field_css,\n\t\t\t\t\t'field_layout' \t\t=> $field->field_layout,\n\t\t\t\t\t'field_parent' \t\t=> $field->field_parent,\n\t\t\t\t\t'field_default'\t\t=> $field->field_default,\n\t\t\t\t);\n\n\t\t\t\t$wpdb->insert( $this->field_table_name, $data );\n\t\t\t}\n\n\t\t\t$entries = $wpdb->get_results( $wpdb->prepare( \"SELECT * FROM $vfb_entries WHERE form_id = %d ORDER BY entries_id\", $form->form_id ) );\n\n\t\t\t// Copy each entry\n\t\t\tforeach ( $entries as $entry ) {\n\n\t\t\t\t$data = array(\n\t\t\t\t\t'form_id' \t\t\t=> $entry->form_id,\n\t\t\t\t\t'data' \t\t\t\t=> $entry->data,\n\t\t\t\t\t'subject' \t\t\t=> $entry->subject,\n\t\t\t\t\t'sender_name' \t\t=> $entry->sender_name,\n\t\t\t\t\t'sender_email' \t\t=> $entry->sender_email,\n\t\t\t\t\t'emails_to' \t\t=> $entry->emails_to,\n\t\t\t\t\t'date_submitted' \t=> $entry->date_submitted,\n\t\t\t\t\t'ip_address'\t \t=> $entry->ip_address\n\t\t\t\t);\n\n\t\t\t\t$wpdb->insert( $this->entries_table_name, $data );\n\t\t\t}\n\n\t\tendforeach;\n\n\t\t// Automatically deactivate free version of Visual Form Builder, if active\n\t\tif ( is_plugin_active( 'visual-form-builder/visual-form-builder.php' ) )\n\t\t\tdeactivate_plugins( '/visual-form-builder/visual-form-builder.php' );\n\n\t\t// Set upgrade as complete so admin notice closes\n\t\tupdate_option( 'vfb_db_upgrade', 1 );\n\t}", "public function populateForm() {}", "function form( $instance ) {\n\n require( 'src/widget-fields.php' );\n }", "function update_tt_1_alkes_form() {\n\t\treturn $this->add_tt_1_alkes_form();\n\t}", "public function form()\n {\n $this->switch('auto_df_switch', __('message.tikuanconfig.auto_df_switch'));\n $this->timeRange('auto_df_stime', 'auto_df_etime', '开启时间');\n $this->text('auto_df_maxmoney', __('message.tikuanconfig.auto_df_maxmoney'))->setWidth(2);\n $this->text('auto_df_max_count', __('message.tikuanconfig.auto_df_max_count'))->setWidth(2);\n $this->text('auto_df_max_sum', __('message.tikuanconfig.auto_df_max_sum'))->setWidth(2);\n\n }", "public function addform() {\n require_once 'modeles/etudiant_modele.php';\n require_once 'vues/etudiants/etudiants_addform_vue.php';\n }", "public function formAction()\r\n {\r\n \r\n\t\t$this->loadLayout();\r\n\t\t\r\n\t\t$root = $this->getLayout()->getBlock('root');\r\n\t\t$settemplate = \"page/1column.phtml\";\r\n\t\t$root->setTemplate($settemplate);\r\n\t\t\r\n $block = $this->getLayout()->createBlock(\r\n 'Mage_Core_Block_Template',\r\n 'advancedpermissions.vendor_form',\r\n array(\r\n 'template' => 'advancedpermissions/vendor_form.phtml'\r\n )\r\n );\r\n\r\n $this->getLayout()->getBlock('content')->append($block);\r\n $this->_initLayoutMessages('core/session');\r\n\t\t\r\n $this->renderLayout();\r\n\t\t\r\n }", "public function createComponentEditForm(){\n $frm = $this->formFactory->create();\n $listingID = $this->hlp->sess(\"listing\")->listingID;\n \n //query database for listing type\n $FE = $this->listings->isFE($listingID);\n $MS = $this->listings->isMultisig($listingID);\n \n //checkbox value rendering logic\n $checkVal = array();\n \n if ($MS){\n $checkVal[\"ms\"] = \"ms\";\n }\n \n if ($FE){\n $checkVal[\"fe\"] = \"fe\";\n }\n \n $this->lHelp->constructCheckboxList($frm)->setValue($checkVal);\n \n //discard option array\n unset($checkVal);\n\n $cnt = count ($this->postageOptions); \n $session = $this->hlp->sess(\"postage\");\n\n \n for ($i = 0; $i<$cnt; $i++){\n\n $frm->addText(\"postage\" . $i, \"Doprava\");\n $frm->addText(\"pprice\" . $i, \"Cena dopravy\");\n\n }\n \n //additional postage textboxes logic\n $counter = $session->counterEdit;\n $values = $session->values;\n \n if (!is_null($counter)){\n \n $frm->addGroup(\"Postage\");\n \n for ($i =0; $i<$counter; $i++){\n $frm->addText(\"postage\" .$i. \"X\", \"Doprava\"); \n $frm->addText(\"pprice\" .$i. \"X\", \"Cena\");\n }\n }\n \n $frm->addSubmit(\"submit\", \"Upravit\");\n $frm->addSubmit(\"add_postage\", \"Přidat dopravu\")->onClick[] = \n \n function() use($listingID) {\n \n //inline onlclick handler, that counts postage options\n $session = $this->hlp->sess(\"postage\");\n $counter = &$session->counterEdit;\n \n if ($counter <= self::MAX_POSTAGE_OPTIONS){\n $counter++;\n } else {\n $this->flashMessage(\"Dosáhli jste maxima poštovních možností.\");\n }\n \n $form = $this->getComponent(\"editForm\");\n $session->values = $form->getValues(TRUE);\n \n $this->redirect(\"Listings:editListing\", $listingID);\n };\n \n $this->lHelp->fillForm($frm, $values); \n $frm->onSuccess[] = array($this, 'editSuccess');\n $frm->onValidate[] = array($this, 'editValidate');\n \n return $frm; \n }", "abstract function setupForm(&$mform);", "public function valiteForm();", "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( &$form )\n\t{\n\t}", "public function buildForm()\n {\n }", "public function form()\r\n {\r\n $this->switch('field_select_create', Support::trans('main.select_create'))\r\n ->default(admin_setting('field_select_create'));\r\n }", "abstract public function createForm();", "abstract public function createForm();", "public function form(): void {\n include \"admin\" . DS . \"form.php\";\n }", "function crushftp_form($crushftp = NULL) {\n $form['name'] = array(\n '#type' => 'textfield',\n '#title' => t('User Name'),\n );\n\n $form['password'] = array(\n '#type' => 'password',\n '#title' => t('Password'),\n ); \n $form['password'] = array(\n '#type' => 'password_confirm',\n '#title' => t(''),\n );\n $form['auto-generate'] = array(\n '#type' => 'radios',\n '#title' => t('For auto generate password select yes'),\n '#options' => array(\n 0 => t('No'),\n 1 => t('Yes'),\n ),\n '#default_value' => 0,\n );\n //Set account expiry disable in update form\n /* $form['update_expiry'] = array(\n '#type' => 'radios',\n '#title' => t('Update Account expiry'),\n '#options' => array(\n 0 => t('No'),\n 1 => t('Yes'),\n ),\n '#default_value' => 0,\n );\n $form['active'] = array(\n '#type' => 'select',\n '#options' => array(30 => t('30 Days'), 60 => t('60 Days'), 90 => t('90 Days'), 31 => t('Unlimited')),\n '#description' => t('Select the account expiry options'),\n '#states' => array(\n 'disabled' => array(':input[name=\"update_expiry\"]' => array('value' => 0),\n ),\n ),\n ); */ \n $form['active'] = array(\n '#type' => 'select',\n '#title' => t('Account Expiry'),\n '#options' => array(30 => t('30 Days'), 60 => t('60 Days'), 90 => t('90 Days'), 31 => t('Unlimited')),\n '#description' => t('Select the account expiry options'),\n ); \n $form['unlimited_account_notification'] = array(\n '#type' => 'item',\n '#markup' => '<b>Request sent to service desk, you are currently set to 30 days expiry</b>',\n '#states' => array(\n 'visible' => array(':input[name=\"active\"]' => array('value' => 31),\n ),\n ),\n );\n $form['client'] = array(\n '#type' =>'textfield',\n '#title' => t('Client Name'), \n );\n $form['email'] = array(\n '#type' =>'textfield',\n '#title' => t('E-mail Address'), \n );\n return $form; \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 }", "public function hookForm() {\n }", "public function createForm()\n {\n }", "public function createForm();", "public function createForm();", "function opensanmateo_govdelivery_app_configure_form_submit($form, $form_state) {\n features_template_revert();\n}", "public function form( $instance ){\n }", "public function outputSetupForm() {\n\t\t$this->_directFormHtml( 'webinarjamstudio' );\n\t}", "public function form()\n {\n $this->setData();\n }", "private function updater() {\n\n\t\t\\add_action(\n\t\t\t'wpforms_updater',\n\t\t\tfunction ( $key ) {\n\t\t\t\tnew \\WPForms_Updater(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'plugin_name' => 'WPForms Conversational Forms',\n\t\t\t\t\t\t'plugin_slug' => 'wpforms-conversational-forms',\n\t\t\t\t\t\t'plugin_path' => \\plugin_basename( \\WPFORMS_CONVERSATIONAL_FORMS_FILE ),\n\t\t\t\t\t\t'plugin_url' => \\trailingslashit( $this->url ),\n\t\t\t\t\t\t'remote_url' => \\WPFORMS_UPDATER_API,\n\t\t\t\t\t\t'version' => \\WPFORMS_CONVERSATIONAL_FORMS_VERSION,\n\t\t\t\t\t\t'key' => $key,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t);\n\t}", "public function form()\n {\n $this->switch('footer_remove', Support::trans('main.footer_remove'))\n ->default(admin_setting('footer_remove'));\n $defaultColors = [\n 'default' => '墨蓝',\n 'blue' => '蓝',\n 'blue-light' => '亮蓝',\n 'green' => '墨绿',\n ];\n foreach (explode(\",\", ServiceProvider::setting('additional_theme_colors')) as $value) {\n if (!empty($value)) {\n [$k, $v] = explode(\":\", $value);\n $defaultColors[$k] = $v;\n }\n }\n\n $this->radio('theme_color', Support::trans('main.theme_color'))\n ->options($defaultColors)\n ->default(admin_setting('theme_color'));\n $this->radio('sidebar_style', Support::trans('main.sidebar_style'))\n ->options([\n 'default' => '默认',\n 'sidebar-separate' => '菜单分离',\n 'horizontal_menu' => '水平菜单'\n ])\n ->default(admin_setting('sidebar_style'));\n $this->switch('grid_row_actions_right', Support::trans('main.grid_row_actions_right'))\n ->help('启用后表格行操作按钮将永远贴着最右侧。')\n ->default(admin_setting('grid_row_actions_right'));\n }", "function buildSettingsForm() {}", "function init_form_fields() {\n\n \tinclude ( SUMO_SAGEPLUGINPATH . 'includes/sagepay-form-admin.php' );\n\n }", "function logger_firmwareupgrade_page() {\n\n drupal_set_title(t('Device Firmware Upgrade'));\n\n $form = drupal_get_form('logger_firmwareupgradefilter_form');\n\n return drupal_render($form);\n}", "public function createComponentBuyForm(){ \n $form = new Nette\\Application\\UI\\Form;\n \n $session = $this->hlp->sess(\"listing\");\n $listingID = $session->listingDetails->id;\n $postageOptionsDB = $this->listings->getPostageOptions($listingID);\n $postageOptions = array();\n $postageIDs = array();\n \n foreach($postageOptionsDB as $option){\n array_push($postageOptions, $option[\"option\"] . \" +\" . $option[\"price\"] . \"Kč\");\n array_push($postageIDs, $option[\"postage_id\"]);\n }\n \n asort($postageIDs);\n \n //store for later check, that selectbox was not maliciously altered\n $session->postageIDs = $postageIDs;\n \n $form->addSelect(\"postage\", \"Možnosti zásilky:\")->setItems($postageOptions, FALSE);\n // ->addRule($form::FILLED, \"Vyberte prosím některou z možností zásilky.\");\n \n $form->addText('quantity', 'Množství:')\n ->addRule($form::FILLED, \"Vyplňte prosím množství.\")\n ->addRule($form::INTEGER, \"Množství musí být číslo\")\n ->addRule($form::RANGE, \"Množství 1 až 99 maximum.\", array(1, 99));\n \n $form->addSubmit(\"koupit\", \"Koupit\");\n \n $form->onSuccess[] = array($this, \"buyFormOnSuccess\");\n $form->onValidate[] = array($this, \"buyFormValidate\");\n \n return $form;\n }", "public function newAssocForm()\n {\n $assocs = $this->assocManager->getAssocs();\n require_once 'vue/new.assoc.view.php';\n }", "public function alterForm(Form $form)\n {\n }", "function form( $instance ) {\n }", "function installSetupForm() {\n // Build form.\n $this->form = new HTML_QuickForm('admin_user_setup', 'POST', '/install');\n $this->form->addElement('text', 'adminUsername', 'Admin Username', ['class' => 'form-control']);\n $this->form->addElement('password', 'adminPassword_1', 'Admin Password', ['class' => 'form-control']);\n $this->form->addElement('password', 'adminPassword_2', 'Re-enter Password', ['class' => 'form-control']);\n $this->form->addElement('submit', 'btnSubmit', 'Install', ['class' => 'btn btn-primary']);\n\n // Add validation\n $this->form->addRule('adminUsername', 'Username is required', 'required');\n $this->form->addRule('adminPassword_1', 'Please enter a password', 'required');\n $this->form->addRule('adminPassword_2', 'Please re-enter your password', 'required');\n\n // Custom validation. Checks if passwords match.\n $this->form->registerRule('match_field', 'function', 'validate_match_field', $this->validation);\n $this->form->addRule('adminPassword_1', 'Passwords do not match!', 'match_field', $this->formValues['adminPassword_2']);\n\n // If form passes validation install site.\n if ($this->form->validate()) {\n // First create the database.\n $this->createDatabase();\n // Then insert the admin user.\n $this->insertAdminUser();\n // Send user back to home page.\n $this->f3->reroute('/');\n }\n $renderer = new HTML_QuickForm_Renderer_ArraySmarty($this->smarty);\n $this->form->accept($renderer);\n\n $errors = Helper::checkErrors($renderer);\n\n // Add all form elements to the template.\n if (!empty($errors)) {\n $this->assign('errors', json_encode($errors));\n }\n $rendered = Helper::modifyRenderedOutput($renderer->toArray());\n\n $this->assign('elements', $rendered['elements']);\n $this->assign('formAttr', $rendered['attributes']);\n $this->assign('op', 'install');\n $this->assign('contentTitle', 'Install AngryGiant');\n\n $this->display('InstallForm.tpl');\n }", "abstract function form();", "protected function initializeForm()\n {\n $this->form = new Form();\n $this->form->add(Element::create(\"FieldSet\",\"Report Format\")->add\n (\n Element::create(\"SelectionList\", \"File Format\", \"report_format\")\n ->addOption(\"Hypertext Markup Language (HTML)\",\"html\")\n ->addOption(\"Portable Document Format (PDF)\",\"pdf\")\n ->addOption(\"Microsoft Excel (XLS)\",\"xls\")\n ->addOption(\"Microsoft Word (DOC)\",\"doc\")\n ->setRequired(true)\n ->setValue(\"pdf\"),\n Element::create(\"SelectionList\", \"Page Orientation\", \"page_orientation\")\n ->addOption(\"Landscape\", \"L\")\n ->addOption(\"Portrait\", \"P\")\n ->setValue(\"L\"),\n Element::create(\"SelectionList\", \"Paper Size\", \"paper_size\")\n ->addOption(\"A4\", \"A4\")\n ->addOption(\"A3\", \"A3\")\n ->setValue(\"A4\")\n )->setId(\"report_formats\")->addAttribute(\"style\",\"width:50%\")\n );\n $this->form->setSubmitValue(\"Generate\");\n $this->form->addAttribute(\"action\",Application::getLink($this->path.\"/generate\"));\n $this->form->addAttribute(\"target\",\"blank\");\n }", "public function CreateForm();", "function form( $instance )\n { \n }", "protected function form()\n {\n // return Admin::form(Campaign_setting_form::class, function (Form $form) {\n // });\n }", "function form( $instance ) {\r\n\t}", "function form( $instance ) {\r\n\t}", "public function form( $instance ) {\n\t}", "public function form( $instance ) {\n\t}", "function form( $instance ) {\n\t}", "function form( $instance ) {\n\t}", "function form( $instance ) {\n\t}", "function form( $instance ) {\n\t}", "function form( $instance ) {\n\t}", "function form( $instance ) {\n\t}", "function form( $instance ) {\n\t}", "function form( $instance ) {\n\t}", "function form( $instance ) {\n\t}", "function form( $instance ) {\n\t}", "function weldata_form_alter(&$form, &$form_state){\n\n}", "public function addForm() {\n $this->view->displayForm();\n }", "public function xadmin_createform() {\n\t\t\n\t\t$args = $this->getAllArguments ();\n\t\t\n\t\t/* get the form field title */\n\t\t$form_title = $args [1];\n\t\t$form_type = @$args [2] ? $args [2] : 'blank';\n\t\t\n\t\t/* Load Model */\n\t\t$form = $this->getModel ( 'form' );\n\t\t$this->session->returnto ( 'forms' );\n\t\t\n\t\t/* create the form */\n\t\t$form->createNewForm ( $form_title, $form_type );\n\t\t\n\t\t$this->loadPluginModel ( 'forms' );\n\t\t$plug = Plugins_Forms::getInstance ();\n\t\t\n\t\t$plug->_pluginList [$form_type]->onAfterCreateForm ( $form );\n\t\t\n\t\t/* set the view file (optional) */\n\t\t$this->_redirect ( 'xforms' );\n\t\n\t}", "public function form( $instace ){\n echo '<p><strong>Widget ini belum bisa diubag secara Manual!</strong><br> Hubungi developer untuk melakukan perubahan</p>'; \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 }", "private function loadForm()\n {\n // init settings form\n $this->frm = new Form('settings');\n\n // add festival year\n $this->frm->addText('year', $this->get('fork.settings')->get($this->URL->getModule(), 'year'));\n\n // add fields for pagination\n $this->frm->addDropdown(\n 'overview_num_items',\n array_combine(range(1, 30), range(1, 30)),\n $this->get('fork.settings')->get($this->URL->getModule(), 'overview_num_items', 10)\n );\n $this->frm->addDropdown(\n 'recent_festival_list_num_items',\n array_combine(range(1, 30), range(1, 30)),\n $this->get('fork.settings')->get($this->URL->getModule(), 'recent_festival_list_num_items', 5)\n );\n\n // add functions fields\n $this->frm->addCheckbox('cover_image_enabled', $this->get('fork.settings')->get($this->URL->getModule(), 'cover_image_enabled', false));\n $this->frm->addCheckbox('cover_image_required', $this->get('fork.settings')->get($this->URL->getModule(), 'cover_image_required', false));\n $this->frm->addCheckbox('multi_images_enabled', $this->get('fork.settings')->get($this->URL->getModule(), 'multi_images_enabled', false));\n\n // add god user only fields\n if ($this->godUser) {\n $this->frm->addText('image_size_limit', (float) $this->get('fork.settings')->get($this->URL->getModule(), 'image_size_limit', 10));\n }\n }", "function buildForm(){\n\t\t# menampilkan form\n\t}", "public function setupForm()\n {\n\n// if ($this->config['db_name'] != NO_DATABASE)\n // $this->redirect(\"login.php\");\n // login here?\n \n/* if ( !$this->ownerLoggedIn() )\n {\n $this->restricted();\n return;\n }\n*/\n require_once('views/SetupView.class.php'); \n \n $site = new SiteContainer($this->db);\n \n $sv = new SetupView();\n\n $site->printHeader();\n $site->printNav(\"owner\");\n $sv->printHtml();\n $site->printFooter(); \n }", "public function form( $instance ) {\n\t\t$args = array_merge( $this->defaults, $instance );\n\t\textract( $args );\n\t\tinclude( 'templates/pblw-requirements-widget-settings.php' );\n }", "abstract protected function getForm();", "function showForm() {\n \tglobal $pluginpath;\n \t\n \tif ($this->idt == \"\") {\n \t //user is creating new template\n \t\t$title = MF_NEW_TEMPLATE;\n \t\t$this->action = 'createtempl';\n\t\t$btnText = MF_CREATE_TEMPLATE_BUTTON; \n \t} else {\n \t //user is editing old template\n \t\t$title = \tMF_CHANGE_TEMPLATE;\n \t\t$this->action = 'changetempl';\n\t\t$btnText = MF_CHANGE_FORUM_BUTTON;\n \t}\n \t\n\t$this->doHtmlSpecChars();\n\t\t\n\tinclude \"admin/tempForm.php\";\n \t\n }", "public function cs_generate_form() {\n global $post;\n }", "public final function definition() {\n $mform = $this->_form;\n\n $mform->addElement('header', 'alternatesheading', get_string(\"alternatives\", constants::M_COMPONENT));\n\n //The alternatives declaration\n $mform->addElement('textarea', 'alternatives', get_string(\"alternatives\", constants::M_COMPONENT),\n 'wrap=\"virtual\" rows=\"20\" cols=\"50\"');\n $mform->setDefault('alternatives', '');\n $mform->setType('alternatives', PARAM_RAW);\n $mform->addElement('static', 'alternativesdescr', '',\n get_string('alternatives_descr', constants::M_COMPONENT));\n //('n'=>$moduleinstance->id, 'action'=>'machineregradeall'\n\n $mform->addElement('hidden', 'n');\n $mform->setType('n', PARAM_INT);\n\n //add the action buttons\n $this->add_action_buttons(get_string('cancel'), get_string('machineregradeall', constants::M_COMPONENT));\n\n }", "protected function Form_Run() {}", "protected function form()\n {\n $this->opt();\n $form = new Form(new ComDep);\n\n $form->text('alias', 'Alias');\n $form->text('name', 'Name');\n $form->select('company_id', 'Company')->options($this->optcom);\n $form->select('id_com_dep_admin', 'Company department admin')->options($this->optcomdep);\n $form->select('service_type_id', 'Service type')->options($this->optsertype);\n $form->textarea('info', 'Info');\n $form->textarea('info_for_vp_admin', 'Info for vp admin');\n $form->text('address', 'Address');\n $form->textarea('info_station', 'Info station');\n $form->text('telephone', 'Telephone');\n $form->text('e_mail', 'E mail');\n $form->text('class', 'Class');$form->saving(function (Form $form) {\n $form->model()->id_admin_add=Admin::user()->id;\n });\n\n return $form;\n }", "protected function createComponentEditForm() {\r\n\t\t$form = new Form;\r\n\t\t$form->getElementPrototype()->class(\"formWide\");\r\n\t\t$options = array(0 => \"Default\", 1 => \"Odkaz na obsah\", 3 => \"Odkaz na položku menu\");\r\n\t\t// easy way how to create url slug\r\n\t\t$form->addText(\"title\", \"Název:\")\r\n\t\t\t\t->setAttribute('onchange', '\r\n\t\t\t\t\t\t\tvar nodiac = { \"á\": \"a\", \"č\": \"c\", \"ď\": \"d\", \"é\": \"e\", \"ě\": \"e\", \"í\": \"i\", \"ň\": \"n\", \"ó\": \"o\", \"ř\": \"r\", \"š\": \"s\", \"ť\": \"t\", \"ú\": \"u\", \"ů\": \"u\", \"ý\": \"y\", \"ž\": \"z\" };\r\n\t\t\t\t\t\t\ts = $(\"#frmeditForm-title\").val().toLowerCase();\r\n\t\t\t\t\t\t\tvar s2 = \"\";\r\n\t\t\t\t\t\t\tfor (var i=0; i < s.length; i++) {\r\n\t\t\t\t\t\t\t\ts2 += (typeof nodiac[s.charAt(i)] != \"undefined\" ? nodiac[s.charAt(i)] : s.charAt(i));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tresult=s2.replace(/[^a-z0-9_]+/g, \"-\").replace(/^-|-$/g, \"\");\r\n\t\t\t\t\t\t\t$(\"#frmeditForm-url\").val(result);\r\n\t\t\t\t\t\t');\r\n\t\t$form->addText(\"url\", \"url:\")->setAttribute(\"readonly\", \"readonly\");\r\n\t\tif (!$this->onlyTree) {\r\n\t\t\t$form->addSelect(\"target_type\", \"Cíl:\", $options);\r\n\t\t\t$content = $this->prepareContentSelectBox();\r\n\t\t\t$menuContent = $this->prepareMenuContentSelectBox();\r\n\t\t\t$form->addSelect(\"target_id\", \"Odkazovaný obsah:\", $content)->setPrompt(\"Pouze při zvolení výše\");\r\n\t\t\t$form->addSelect(\"target_menu\", \"Odk. položka menu:\", $menuContent)->setPrompt(\"Pouze při zvolení výše\");\r\n\t\t}\r\n\t\t$form->addHidden(\"parent_id\", $this->parent_id);\r\n\t\t$form->addHidden(\"edit_id\", $this->edit_id);\r\n\t\t//filling form\r\n\t\tif ($this->edit_id or $this->edit_id === \"0\") {\r\n\t\t\t$defFromDb = $this->closureModel->getItemById($this->edit_id);\r\n\t\t\t$defaults = new \\Nette\\ArrayHash;\r\n\t\t\tforeach ($defFromDb as $key => $value) {\r\n\t\t\t\t$defaults->$key = $value;\r\n\t\t\t}\r\n\t\t\tif ($this->edit_id === \"0\") {\r\n\t\t\t\t$form[\"title\"]->setDisabled();\r\n\t\t\t}\r\n\t\t\tif (!$this->onlyTree) {\r\n\t\t\t\t$t = $defaults->target;\r\n\t\t\t\tif (!Validators::isNumericInt($t)) {\r\n\t\t\t\t\t$menuItem = $this->checkTargetMenuItemExists($t);\r\n\t\t\t\t\tif ($menuItem) {\r\n\t\t\t\t\t\t$defaults->target_type = 3;\r\n\t\t\t\t\t\t$defaults->target_menu = $menuItem;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$contentId = $this->checkTargetContentExists($t);\r\n\t\t\t\t\t\t$defaults->target_type = 1;\r\n\t\t\t\t\t\t$defaults->target_id = $contentId;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$form[\"target_menu\"]->getControlPrototype()->addClass(\"formFieldInvisible\");\r\n\t\t\t\t} elseif ($t <= 0) {\r\n\t\t\t\t\t$defaults->target_type = 0;\r\n\t\t\t\t\t$form[\"target_menu\"]->getControlPrototype()->addClass(\"formFieldInvisible\");\r\n\t\t\t\t\t$form[\"target_id\"]->getControlPrototype()->addClass(\"formFieldInvisible\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$defaults->target = null;\r\n\t\t\t$form->setDefaults($defaults);\r\n\t\t}\r\n\r\n\t\t$form->addSubmit('save', 'Save')\r\n\t\t\t\t\t\t->setAttribute('onclick', '$(\"#frmeditForm-title\").trigger(\"change\")')\r\n\t\t\t\t->onClick[] = callback($this, 'editFormSubmitted');\r\n\t\t$form->setRenderer(new \\Kdyby\\BootstrapFormRenderer\\BootstrapRenderer());\r\n\t\treturn $form;\r\n\t}", "protected function _prepareForm()\n {\n\n $form = new Varien_Data_Form();\n $this->setForm($form);\n $fieldset = $form->addFieldset('cron_form', array(\n 'legend' =>Mage::helper('aoe_scheduler')->__('Settings')\n ));\n\n $fieldset->addField('model', 'select', array(\n 'label' => Mage::helper('aoe_scheduler')->__('Model'),\n 'title' => Mage::helper('aoe_scheduler')->__('Model'),\n 'class' \t=> 'input-select',\n 'required' => true,\n 'name' => 'model',\n 'options' => Mage::helper('aoe_scheduler')->getModelOptions(),\n ));\n $continueButton = $this->getLayout()\n ->createBlock('adminhtml/widget_button')\n ->setData(array(\n 'label' => Mage::helper('aoe_scheduler')->__('Continue'),\n 'onclick' => \"setSettings('\".$this->getContinueUrl().\"', 'model')\",\n 'class' => 'save'\n ));\n $fieldset->addField('continue_button', 'note', array(\n 'text' => $continueButton->toHtml(),\n ));\n \n return parent::_prepareForm();\n }", "public function getEditForm();", "public function updateBillingForm($form) {\n // Change the form buttons\n if($this->owner->onlyDownloadable()) {\n $form->Actions()->removeByName(\"action_doSetDelivery\");\n\n // Add set delivery with different name\n $form\n ->Actions()\n ->add(FormAction::create(\n 'doContinue',\n _t(\"DownloadableProduct.Continue\", \"Continue\")\n )->addExtraClass('checkout-action-next'));\n }\n }", "public function renderForm()\n {\n $lang = $this->context->language;\n\n $inputs[] = [\n 'type' => 'switch',\n 'label' => $this->l(\"Active\"),\n 'name' => 'active',\n 'values' => [\n [\n 'id' => 'active_on',\n 'value' => 1,\n ],\n [\n 'id' => 'active_off',\n 'value' => 0,\n ],\n ]\n ];\n $inputs[] = [\n 'type' => 'text',\n 'label' => $this->l('Page Name'),\n 'name' => 'name',\n ];\n $inputs[] = [\n 'type' => 'text',\n 'label' => $this->l('Meta Title'),\n 'name' => 'meta_title_lang',\n 'required' => true,\n 'id' => 'name',\n 'lang' => true,\n 'class' => 'copyMeta2friendlyURL',\n 'hint' => $this->l('Invalid characters:').' &lt;&gt;;=#{}',\n ];\n $inputs[] = [\n 'type' => 'text',\n 'label' => $this->l('Meta Description'),\n 'name' => 'meta_description_lang',\n 'lang' => true,\n 'hint' => $this->l('Invalid characters:').' &lt;&gt;;=#{}',\n ];\n $inputs[] = [\n 'type' => 'tags',\n 'label' => $this->l('Meta Keywords'),\n 'name' => 'meta_keywords_lang',\n 'lang' => true,\n 'hint' => [\n $this->l('To add \"tags\" click in the field, write something, and then press \"Enter.\"'),\n $this->l('Invalid characters:').' &lt;&gt;;=#{}',\n ],\n ];\n $inputs[] = [\n 'type' => 'text',\n 'label' => $this->l('Friendly URL'),\n 'name' => 'url',\n 'required' => true,\n 'hint' => $this->l('Only letters and the hyphen (-) character are allowed.'),\n ];\n $inputs[] = [\n 'type' => 'text',\n 'label' => $this->l('Breadcrumb URL Parameters'),\n 'name' => 'breadcrumb_parameters',\n 'required' => false,\n 'hint' => $this->l('Parameters to be applied when rendering as a breadcrumb'),\n ];\n\n $inputs[] = [\n 'type' => 'code',\n 'mode' => 'css',\n 'label' => $this->l('Style'),\n 'name' => 'style',\n 'lang' => false,\n //'autoload_rte' => true,\n 'id' => 'style',\n 'enableBasicAutocompletion' => true,\n 'enableSnippets' => true,\n 'enableLiveAutocompletion' => true,\n 'maxLines' => 50,\n ];\n $inputs[] = [\n 'type' => 'code',\n 'mode' => 'html',\n 'label' => $this->l('Content'),\n 'name' => 'content_lang',\n 'lang' => true,\n //'autoload_rte' => true,\n 'id' => 'content',\n 'enableBasicAutocompletion' => true,\n 'enableSnippets' => true,\n 'enableLiveAutocompletion' => true,\n 'maxLines' => 70,\n ];\n\n\n $allPages = $this->module->getAllHTMLPages(true);\n array_unshift($allPages, '-');\n\n\n if ($this->display == 'edit') {\n $inputs[] = [\n 'type' => 'hidden',\n 'name' => 'id_page'\n ];\n $title = $this->l('Edit Page');\n $action = 'submitEditCustomHTMLPage';\n\n $pageId = Tools::getValue('id_page');\n\n $this->fields_value = $this->module->getHTMLPage($pageId);\n\n // Remove the current page from the list of pages\n foreach ($allPages as $i => $p) {\n if ($p != '-' && $p['id_page'] == $pageId) {\n unset($allPages[$i]);\n break;\n }\n }\n }\n else {\n\n }\n\n // Parent select\n $inputs[] = [\n 'type' => 'select',\n 'label' => $this->l('Parent'),\n 'name' => 'id_parent',\n 'options' => [\n 'query' => $allPages,\n 'id' => 'id_page',\n 'name' => 'name'\n ]\n ];\n //$this->fields_value['id_relatedTo'] = [];\n\n array_shift($allPages);\n\n // List of Pages this Page is related to\n $inputs[] = [\n 'type' => 'swap',\n 'label' => $this->l('Show On ($page->related[])'),\n 'multiple' => true,\n 'name' => 'id_relatedTo',\n 'options' => [\n 'query' => $allPages,\n 'id' => 'id_page',\n 'name' => 'name'\n ],\n 'hint' => $this->l('Makes this page show up on other pages (not as a child page but as a related page): $page->related[]')\n ];\n\n $inputs[] = [\n 'type' => 'html',\n 'html_content' => '<hr/>',\n 'name' => 'id_page',\n ];\n\n // List of Products\n $products = Product::getProducts($lang->id, 0, 1000, 'id_product', 'ASC');\n $inputs[] = [\n 'type' => 'swap',\n 'label' => $this->l('Products ($product or $products)'),\n 'name' => 'id_products',\n 'multiple' => true,\n 'options' => [\n 'query' => $products,\n 'id' => 'id_product',\n 'name' => 'name'\n ],\n 'hint' => $this->l('This will populate $products. If only one is selected then $product will be populated'),\n ];\n\n // List of Categories\n $categories = Category::getCategories($lang->id, true, false);\n $inputs[] = [\n 'type' => 'swap',\n 'label' => $this->l('Categories ($category or $categories)'),\n 'name' => 'id_categories',\n 'multiple' => true,\n 'options' => [\n 'query' => $categories,\n 'id' => 'id_category',\n 'name' => 'name'\n ],\n 'hint' => $this->l('This will populate $categories. If only one is selected then $category will be populated'),\n ];\n\n $this->fields_form = [\n 'legend' => [\n 'title' => $title,\n 'icon' => 'icon-cogs',\n ],\n 'input' => $inputs,\n 'buttons' => [\n 'save-and-stay' => [\n 'title' => $this->l('Save and Stay'),\n 'class' => 'btn btn-default pull-right',\n 'name' => $action.'AndStay',\n 'icon' => 'process-icon-save',\n 'type' => 'submit'\n ]\n\n ],\n 'submit' => [\n 'title' => $this->l('Save'),\n 'class' => 'btn btn-default pull-right',\n 'name' => $action,\n ],\n\n ];\n\n\n return parent::renderForm();\n }", "static function add_eb_form(): void {\r\n\t\tself::add_acf_inner_field(self::ebs, self::eb_form, [\r\n\t\t\t'label' => 'Nomination form',\r\n\t\t\t'type' => 'file',\r\n\t\t\t'instructions' => 'Upload the nomination form as a pdf.',\r\n\t\t\t'required' => 1,\r\n\t\t\t'conditional_logic' => [\r\n\t\t\t\t[\r\n\t\t\t\t\t[\r\n\t\t\t\t\t\t'field' => self::qualify_field(self::eb_finished),\r\n\t\t\t\t\t\t'operator' => '!=',\r\n\t\t\t\t\t\t'value' => '1',\r\n\t\t\t\t\t],\r\n\t\t\t\t],\r\n\t\t\t],\r\n\t\t\t'wrapper' => [\r\n\t\t\t\t'width' => '',\r\n\t\t\t\t'class' => '',\r\n\t\t\t\t'id' => '',\r\n\t\t\t],\r\n\t\t\t'return_format' => 'id',\r\n\t\t\t'library' => 'all',\r\n\t\t\t'min_size' => '',\r\n\t\t\t'max_size' => '',\r\n\t\t\t'mime_types' => '.pdf',\r\n\t\t]);\r\n\t}", "public function getSetupForm() {\n\n /**\n * @todo find a beter way to do this\n */\n\n if(!empty($_POST['nodeId'])){\n $this->id = $_POST['nodeId'];\n }\n\n if (empty($this->id)) {\n $table = new HomeNet_Model_DbTable_Nodes();\n $this->id = $table->fetchNextId($this->house);\n }\n // $this->id = 50;\n\n $form = new HomeNet_Form_Node();\n $sub = $form->getSubForm('node');\n $id = $sub->getElement('node');\n $id->setValue($this->id);\n \n $table = new HomeNet_Model_DbTable_Nodes();\n $rows = $table->fetchAllInternetNodes();\n\n $uplink = $sub->getElement('uplink');\n\n foreach($rows as $value){\n $uplink->addMultiOption($value->id, $value->id);\n }\n\n\n return $form;\n }", "function buildForm()\r\n {\r\n $this->buildTabs();\r\n // tab caption\r\n $this->addElement('header', null,\r\n 'Progress2 Generator - Control Panel: run demo');\r\n\r\n $this->addElement('static', 'progressBar',\r\n 'Your progress meter looks like:');\r\n\r\n // Buttons of the wizard to do the job\r\n $this->buildButtons(array('reset','process'));\r\n }", "function form( $instance ) {\r\n\t\t// Do Nothing\r\n\t}", "function ds_extras_vd_bundle_form($form, $form_state, $rows) {\n\n $options = array();\n $views = views_get_all_views();\n foreach ($views as $view_key => $view) {\n\n // Ignore disabled views.\n if (isset($view->disabled) && $view->disabled) {\n continue;\n }\n\n $get_view = views_get_view($view->name);\n\n // Loop through all displays.\n foreach ($view->display as $display_key => $display) {\n // Ignore default displays.\n if ($display_key == 'default') {\n continue;\n }\n\n $key = $view_key . '-' . $display_key;\n $name = drupal_ucfirst($view->name) . ': ' . $display->display_title;\n if (!isset($rows[$key])) {\n $options[$key] = $name . ' (Views template)';\n }\n $get_view->set_display($display_key);\n if ($get_view->display_handler->uses_fields() && !isset($rows[$key . '-fields'])) {\n $options[$key . '-fields'] = $name . ' (Fields)';\n }\n }\n }\n\n $form['vd'] = array(\n '#title' => t('Select view'),\n '#description' => t('Select a View that you want to manage with Display Suite. If a View uses fields you can also select that view to select a layout and position the fields. Note that html for the label and field are limited.'),\n '#type' => 'select',\n '#options' => $options,\n );\n\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Add'),\n );\n\n return $form;\n}", "function wck_show_update_form(){\r\n\t\tcheck_ajax_referer( \"wck-edit-entry\" );\t\t\r\n\t\t$meta = sanitize_text_field( $_POST['meta'] );\r\n\t\t$id = absint($_POST['id']);\r\n\t\t$element_id = absint( $_POST['element_id'] );\r\n\r\n do_action( \"wck_before_adding_form_{$meta}\", $id, $element_id );\r\n\r\n\t\techo self::mb_update_form($this->args['meta_array'], $meta, $id, $element_id);\r\n\t\t\r\n\t\tdo_action( \"wck_after_adding_form\", $meta, $id, $element_id );\r\n do_action( \"wck_after_adding_form_{$meta}\", $id, $element_id );\r\n\r\n\t\texit;\r\n\t}", "function goToFormReinit(){\n\n require('view/frontend/formReinitMdpView.php');\n }", "public function updateShopAccountForm()\n {\n // get fields\n $fields = $this->owner->Fields();\n // remove PayWay customer number from shop account page (auto-generated!)\n $fields->removeByName('PaywayCustomerNumber');\n }", "protected function form()\n {\n $form = new Form(new $this->currentModel);\n\n $form->tab('基本信息', function ($form) {\n\n //$form->display('id', 'ID');\n //$form->text('keyword', '关键词');\n $form->text('static_url', '静态地址')->help(\"如果输入:New-York-Downtown.html,则访问地址为:http://www.yinjispace.com/article/<span style='color:#F00;'>New-York-Downtown.html</span>\");\n $form->radio('article_status', '状态')->options(['0' => '草稿', '1' => '审核中', '2' => '已发布'])->default('0');\n $form->radio('display', '公开度')->options(['0' => '公开', '-1' => '保密'])->default('0');\n $form->datetime('release_time', '发布时间')->format('YYYY-MM-DD HH:mm:ss');\n // $form->datetime('created_at','发布时间')->format('YYYY-MM-DD HH:mm:ss');\n $form->multipleSelect('category_ids', '分类')->options(ArticleCategory::getSelectOptions());\n $form->multipleSelect('topic_ids', '专题')->options(Topic::getSelectOptions());\n $form->text('tag_ids', '标签(逗号分隔)');\n $form->text('view_num', '浏览数')->default(0);\n $form->text('like_num', '点赞数')->default(0);\n $form->text('favorite_num', '收藏数')->default(0);\n $form->text('vip_download', '下载地址');\n //$form->multipleSelect('designer_id', '设计师ID')->options(Designer::getSelectOptions());\n $form->multipleSelect('designer_id', '设计师')->options(function ($ids) {\n $designer = Designer::find($ids);\n if ($designer) {\n return $designer->pluck('title_cn', 'id');\n }\n\n })->ajax('/admin/article/get_designer_select_options');\n $form->text('article_source', '文章来源');\n $form->text('article_source_url', '文章来源URL');\n $form->image('custom_thum', '自定义封面')\n ->uniqueName()\n ->widen(880)\n ->move('public/photo/images/custom_thum/');\n $form->image('special_photo', '特色照片')\n ->uniqueName()\n ->widen(1920)\n ->move('public/photo/images/special_photo/');\n $form->text('seo_title', 'SEO标题');\n $form->text('seo_keyword', 'SEO关键词');\n $form->text('seo_desc', 'SEO描述');\n })->tab('中文', function ($form) {\n\n $form->text('title_designer_cn', '标题(设计师)');\n $form->text('title_name_cn', '标题(项目名称)');\n $form->text('title_intro_cn', '标题(项目介绍)');\n $form->text('description_cn', '自定义描述(中)');\n $form->text('location_cn', '地域(中)');\n $form->ckeditor('detail.content_cn', '正文(中)');\n\n })->tab('English', function ($form) {\n\n $form->text('title_designer_en', '标题(设计师)');\n $form->text('title_name_en', '标题(项目名称)');\n $form->text('title_intro_en', '标题(项目介绍)');\n $form->text('description_en', '自定义描述(英)');\n $form->text('location_en', '地域(英)');\n $form->ckeditor('detail.content_en', '正文(英)');\n\n });\n\n //保存前回调\n $form->saving(function (Form $form) {\n if (empty($form->model()->release_time)) {\n $form->release_time = date('Y-m-d H:i:s');\n }\n });\n\n $form->saved(function (Form $form) {\n $tags = explode(',', $form->tag_ids);\n foreach ($tags as $tag) {\n echo $tag;\n $ret = ArticleTag::firstOrCreate(['name_cn' => trim($tag)]);\n }\n\n });\n\n\n return $form;\n }", "abstract public function getForm() : void;", "protected function _prepareForm()\r\n {\r\n $form = new Varien_Data_Form(array(\r\n 'id' => 'edit_form',\r\n 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),\r\n 'method' => 'post',\r\n 'enctype' => 'multipart/form-data',\r\n )\r\n );\r\n\r\n $fieldSet = $form->addFieldset('magento_form', array('legend' => $this->helper->__('Webhook information')));\r\n\r\n $fieldSet->addField('code', 'select', array(\r\n 'label' => $this->helper->__('Code'),\r\n 'class' => 'required-entry',\r\n 'name' => 'code',\r\n 'values' => ApiExtension_Magento_Block_Adminhtml_Webhooks_Grid::getAvailableHooks()\r\n ));\r\n\r\n $fieldSet->addField('url', 'text', array(\r\n 'label' => $this->helper->__('Callback URL'),\r\n 'class' => 'required-entry',\r\n 'name' => 'url',\r\n ));\r\n\r\n $fieldSet->addField('description', 'textarea', array(\r\n 'label' => $this->helper->__('Description'),\r\n 'name' => 'description',\r\n ));\r\n\r\n $fieldSet->addField('data', 'textarea', array(\r\n 'label' => $this->helper->__('Data'),\r\n 'name' => 'data',\r\n ));\r\n\r\n $fieldSet->addField('token', 'text', array(\r\n 'label' => $this->helper->__('Token'),\r\n 'name' => 'token',\r\n ));\r\n\r\n $fieldSet->addField('active', 'select', array(\r\n 'label' => $this->helper->__('Active'),\r\n 'values' => ApiExtension_Magento_Block_Adminhtml_Webhooks_Grid::getOptionsForActive(),\r\n 'name' => 'active',\r\n ));\r\n\r\n if ($this->session->getWebhooksData()) {\r\n $form->setValues($this->session->getWebhooksData());\r\n $this->session->setWebhooksData(null);\r\n } elseif (Mage::registry('webhooks_data')) {\r\n $form->setValues(Mage::registry('webhooks_data')->getData());\r\n }\r\n\r\n $form->setUseContainer(true);\r\n $this->setForm($form);\r\n return parent::_prepareForm();\r\n }", "protected function form()\n {\n $form = new Form(new Goodss);\n $form->switch('is_enable','状态')->options([\n 'on' => ['value' => 1, 'text' => '正常', 'color' => 'primary'],\n 'off' => ['value' => 0, 'text' => '禁止', 'color' => 'default'],\n ]);\n $form->tools(function (Form\\Tools $tools) {\n // 去掉`删除`按钮\n $tools->disableDelete();\n // 去掉`查看`按钮\n $tools->disableView();\n });\n $form->footer(function ($footer) {\n\n // 去掉`重置`按钮\n //$footer->disableReset();\n\n // 去掉`提交`按钮\n //$footer->disableSubmit();\n\n // 去掉`查看`checkbox\n $footer->disableViewCheck();\n\n // 去掉`继续编辑`checkbox\n $footer->disableEditingCheck();\n\n // 去掉`继续创建`checkbox\n $footer->disableCreatingCheck();\n\n });\n return $form;\n }", "protected function _prepareForm()\n {\n $form = new Varien_Data_Form(array(\n 'id' => 'edit_form',\n // 'action' => $this->getUrl('*/*/courseOrder'),\n 'method' => 'post',\n 'enctype' => 'multipart/form-data'\n )\n );\n\n\n\n $fieldset = $form->addFieldset('base_fieldset', array('legend' => Mage::helper('adminhtml')->__('设置订单价格')));\n\n $fieldset->addField('money', 'text', array(\n 'name' => 'money',\n 'label' => Mage::helper('adminhtml')->__('设置价格'),\n 'value' => Mage::registry('current_order')->getFinancialMoney(),\n\n\n\n ));\n\n /* $fieldset->addField('startDate', 'text', array(\n 'name' => 'startDate',\n 'label' => Mage::helper('adminhtml')->__('开始日期'),\n 'title' => Mage::helper('adminhtml')->__('开始日期'),\n //'style' => 'width:600px;height:350px;',\n 'required' => true,\n 'after_element_html' => '<br/>请选择一个开始日期',\n )\n );\n\n $fieldset->addField('endtDate', 'text', array(\n 'name' => 'endtDate',\n 'label' => Mage::helper('adminhtml')->__('结束日期'),\n 'title' => Mage::helper('adminhtml')->__('结束日期'),\n //'style' => 'width:600px;height:350px;',\n 'required' => true,\n 'after_element_html' => '<br/>请选择一个开结束日期',\n )\n );*/\n /* $fieldset->addField('psubmit', 'submit', array(\n 'name' => 'psubmit',\n 'label' => '',\n 'value' => '检查数据',\n 'after_element_html' => '',\n )\n );*/\n // $form->setMethod('post');\n\n $form->setUseContainer(true);\n // $form->setAction(true);\n // $form->setEnctype('multipart/form-data');\n\n $this->setForm($form);\n\n return parent::_prepareForm();\n\n }", "abstract public function forms();", "public function ShowForm()\n\t\t{\n\t\t\tif (!$this->HasPermission()) {\n\t\t\t\t$this->NoPermission();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$GLOBALS['AddonId'] = $this->GetId();\n\t\t\t$GLOBALS['Message'] = GetFlashMessageBoxes();\n\t\t\t$this->ParseTemplate('emailchange.form');\n\t\t}", "function form($instance) {\n //Defaults\n $instance = wp_parse_args( \n (array) $instance,\n array(\n 'title'=>'No Apontador',\n 'howMany'=>'5',\n 'showReviewGrade' => 2,\n 'maxChars' => 160\n )\n );\n\n include dirname(__FILE__) . \"/form.php\";\n }", "function createForm(){\n\t\t$this->createFormBase();\n\t\t$this->addElement('reset','reset','Reset');\t\t\t\n\t\t$tab['seeker_0'] = '0';\n\t\t$this->setDefaults($tab);\n\t\t$this->addElement('submit','bouton_add_pi','Add a contact',array('onclick' => \"document.getElementById('frmvadataset').action += '#a_contact'\"));\n\t\t$this->createVaFormResolution();\n\t\t$this->createFormGeoCoverage();\n\t\t$this->createFormGrid();\t\n\t\t//Required format\n\t\t$dformat = new data_format;\n\t\t$dformat_select = $dformat->chargeFormDestFormat($this,'required_data_format','Required data format','NetCDF');\n\t\t$this->addElement($dformat_select);\n\t\t$this->getElement('organism_0')->setLabel(\"Organism short name\");\n\t\t$this->getElement('project_0')->setLabel(\"Useful in the framework of\");\n\t\t$this->getElement('dats_abstract')->setLabel(\"Abstract \");\n\t\t$this->getElement('dats_purpose')->setLabel(\"Purpose\");\n\t\t$this->getElement('database')->setLabel(\"Data center\");\n\t\t$this->getElement('new_db_url')->setLabel(\"Data center url\");\n\t\t$this->getElement('dats_use_constraints')->setLabel(\"Access and use constraints\");\t\t\t\n\t\t$this->getElement('sensor_resol_tmp')->setLabel('Temporal (hh:mm:ss)');\t\t\t\n\t\t$this->getElement('place_alt_min_0')->setLabel(\"Altitude min\");\n\t\t$this->getElement('place_alt_max_0')->setLabel(\"Altitude max\");\n\t\t$this->getElement('data_format_0')->setLabel(\"Original data format\");\n\t\t$this->addElement('file','upload_doc','Attached document');\n\t\t$this->addElement('submit','upload','Upload');\n\t\t$this->addElement('submit','delete','Delete');\n\t\t\n\t\tfor ($i = 0; $i < $this->dataset->nbVars; $i++){\n\t\t\t$this->getElement('methode_acq_'.$i)->setLabel(\"Parameter processing related information\");\n\t\t}\n\t\t$this->addElement('submit','bouton_add_variable','Add a parameter',array('onclick' => \"document.getElementById('frmvadataset').action += '#a_param'\"));\n\t\t\n\t\t$this->addElement('submit','bouton_add_projet','Add a project',array('onclick' => \"document.getElementById('frmvadataset').action += '#a_general'\"));\n\t\t$option = array();\n\t\t$option['default'] = \"\";\n\t\t$option['model'] = \"Model\";\n\t\t$option['instrument'] = \"Instrument\";\n\t\t$option['satellite'] = \"Satellite\";\n\t\t$this->addElement('select','source_type','source type :',$option,array('onchange' => \"DeactivateButtonAddSource()\",'onclick' => \"DeactivateButtonAddSource();\",'onmouseover' => 'DeactivateButtonAddSource();' ));\n\t\t$this->addElement('submit','bouton_add_source','Add a source',array('disabled' => 'true','onclick' => \"document.getElementById('frmvadataset').action += '#a_source'\",'onmouseout' => 'DeactivateButtonAddSource();'));\n\t\t\n\t\tif (isset ( $this->dataset->dats_sensors ) && ! empty ( $this->dataset->dats_sensors )) {\n\t\t\t$this->dats_sensors = array();\n\t\t\t$this->dats_sensors = $this->dataset->dats_sensors ;\n\t\t}\n\t\tif (isset ( $this->dataset->sites ) && ! empty ( $this->dataset->sites )) {\n\t\t\t$this->sites = array();\n\t\t\t$this->sites = $this->dataset->sites;\n\t\t}\n\t\t\n\t\tif ( isset ( $this->dataset->dats_id ) && $this->dataset->dats_id > 0) {\n\t\t\tif (isset ( $this->dataset->nbModFormSensor )){\n\t\t\t\tif($this->dataset->nbModForm <= $this->dataset->nbModFormSensor ){\n\t\t\t\t\t$this->dataset->nbModForm = $this->dataset->nbModFormSensor;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isset ( $this->dataset->nbSatFormSensor )){\n\t\t\t\t//$this->dataset->nbSatFormSensor = $this->dataset->nbSatFormSensor - 1;\n\t\t\t\tif($this->dataset->nbSatForm <= $this->dataset->nbSatFormSensor){\n\t\t\t\t\t$this->dataset->nbSatForm = $this->dataset->nbSatFormSensor;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isset ( $this->dataset->nbInstruFormSensor )){\n\t\t\t\tif($this->dataset->nbInstruForm <= $this->dataset->nbInstruFormSensor){\n\t\t\t\t\t$this->dataset->nbInstruForm = $this->dataset->nbInstruFormSensor;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif($this->dataset->nbModForm > 0)\n\t\t\t$this->addMod();\n\t\tif($this->dataset->nbInstruForm > 0)\n\t\t\t$this->addInstru();\t\n\t\tif($this->dataset->nbSatForm > 0)\n\t\t\t$this->addSat();\n\t\t\n\t\t$this->dataset->dats_sensors = null ;\n\t\t$this->dataset->sites = null;\n\t}", "public function admin_add_new() {\n ?>\n <div class=\"wrap\">\n <h2><?php _e('Add New Form', 'swpm-form-builder'); ?></h2>\n <?php\n include_once( SWPM_FORM_BUILDER_PATH . 'includes/admin-new-form.php' );\n ?>\n </div>\n <?php\n }", "public function form( $instance ) {\n \t// outputs the options form on admin\n }", "function form( $instance ) {\n\t\t\n\t\tTrends()->view->load(\n\t\t\t'/view/backend',\n\t\t\tarray(\n\t\t\t\t'widget' => $this,\n\t\t\t\t'instance' => $instance\n\t\t\t),\n\t\t\tfalse,\n\t\t\tdirname( __FILE__ )\n\t\t);\n\t\t\n\t}" ]
[ "0.75978506", "0.7379924", "0.70084774", "0.69097036", "0.68845403", "0.67466086", "0.65925187", "0.6582674", "0.658066", "0.6537475", "0.6535787", "0.65276563", "0.6486324", "0.6476459", "0.6469732", "0.6447737", "0.64404964", "0.6434073", "0.64327484", "0.64327484", "0.6428", "0.6391198", "0.6387361", "0.63384026", "0.63268924", "0.63263583", "0.63263583", "0.6315399", "0.63137907", "0.63023204", "0.6301722", "0.6292667", "0.6292665", "0.62924117", "0.6291063", "0.6290379", "0.6279741", "0.6278262", "0.627463", "0.6273683", "0.6250131", "0.6236802", "0.62315977", "0.62309337", "0.62306", "0.6226647", "0.6222782", "0.6222782", "0.621676", "0.621676", "0.6208556", "0.6208556", "0.6208556", "0.6208556", "0.6208556", "0.6208556", "0.6208556", "0.6208556", "0.6208556", "0.6208556", "0.62079346", "0.620579", "0.6198268", "0.61862934", "0.61839724", "0.6171676", "0.61611825", "0.61543566", "0.6149609", "0.6145825", "0.6144899", "0.61425984", "0.6135892", "0.6118749", "0.61173767", "0.6106713", "0.6106488", "0.6098119", "0.60894525", "0.6088983", "0.60846525", "0.6083774", "0.6073922", "0.6069084", "0.6068445", "0.60664254", "0.6065584", "0.6063323", "0.6055486", "0.60549825", "0.603617", "0.6034714", "0.60343295", "0.6020382", "0.6019796", "0.6017345", "0.60152066", "0.6009348", "0.60005337", "0.60000235" ]
0.6646932
6
Cancel braintree recurring billing by uid and plan id
function commerce_braintree_subscription_cancel_form($form, &$form_state, $pid) { $sub = commerce_braintree_subscription_local_get(array('pid' => $pid)); $form['sid'] = array('#type' => 'value', '#value' => $sub['sid']); $profile = node_load($pid); $output = confirm_form($form, t('Are you sure you want to cancel the subscription %title?', array('%title' => $profile->title)), 'user/' . $GLOBALS['user']->uid . '/subscription', t('This action cannot be undone.'), t('Yes'), t('Cancel'), 'confirm' ); return $output; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionCancelPlan(){\n // Redirect back to billing page if doesnt have a plan active\n $isBillingActive = Yii::$app->user->identity->getBillingDaysLeft();\n if(!$isBillingActive){\n return $this->redirect(['billing/index']);\n }\n\n $customerName = Yii::$app->user->identity->agent_name;\n $latestInvoice = Yii::$app->user->identity->getInvoices()->orderBy('invoice_created_at DESC')->limit(1)->one();\n\n if($latestInvoice){\n Yii::error(\"[Requested Cancel Billing #\".$latestInvoice->billing->twoco_order_num.\"] Customer: $customerName\", __METHOD__);\n // Cancel the recurring plan\n $latestInvoice->billing->cancelRecurring();\n }\n\n Yii::$app->getSession()->setFlash('warning', \"[Plan Cancelled] Billing plan has been cancelled as requested.\");\n\n return $this->redirect(['billing/index']);\n }", "public function cancelRecurringChargeAction()\n\t\t{\n\t\t\t// Save parameters in session.\n\t\t\t$session = new Zend_Session_Namespace( 'cancel-recurring-charge' );\n\t\t\tif ( $this->_getParam( 'shopify_form' ) ) {\n\t\t\t\t$session->charge->id = $this->_getParam( 'charge_id' );\n\t\t\t\tif ( $returnUrl = $this->_getParam( 'return_url' ) ) {\n\t\t\t\t\t$session->returnUrl = $returnUrl;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Charge data.\n\t\t\t$charge = Table::_( 'charges' )->get( $session->charge->id );\n\t\t\t$shop = Table::_( 'shops' )->get( $charge->shop_id );\n\t\t\t$plugin = Table::_( 'plugins' )->get( $charge->plugin_id );\n\t\t\t$user = Table::_( 'users' )->getUserByShop( $shop->id );\n\t\t\t$token = Table::_( 'credentials' )->getForPlugin( $plugin->id, $user->id )->api_key;\n\t\t\t// Cancel recurrence.\n\t\t\t$response = $this->getHelper( 'ShopifyApi' )\n\t\t\t\t->initialize( $shop->name, $token )\n\t\t\t\t->delete( 'recurring_application_charges', $charge->charge_id )\n\t\t\t\t;\n\t\t\t// Update a charge.\n\t\t\tif ( $response === true ) {\n\t\t\t\t$charge->status = 'cancelled';\n\t\t\t\t$charge->save();\n\t\t\t}\n\t\t\t// Back to return url.\n\t\t\tif ( isset ( $session->returnUrl ) ) {\n\t\t\t\t$this->getHelper( 'Redirector' )\n\t\t\t\t\t->gotoUrl( base64_decode( $session->returnUrl ), array (\n\t\t\t\t\t\t'prependBase' => false\n\t\t\t\t\t) );\n\t\t\t} else { // Back to payment tab.\n\t\t\t\t$this->getHelper( 'Shopify' )\n\t\t\t\t\t->gotoPlugin( $plugin->name );\n\t\t\t}\n\t\t}", "function cancelSubscription($subscriptionId) {\n\t // require 'vendor/autoload.php';\n // define(\"AUTHORIZENET_LOG_FILE\", \"phplog\");\n\t global $wpdb;\n\t \n\t $current_user = wp_get_current_user();\n $username = $current_user->user_login;\n\t$user_email = $current_user->user_email;\n\t$user_firstname = $current_user->user_firstname;\n\t$user_lastname = $current_user->user_lastname;\n\t$user_id = $current_user->ID;\n // get ID and trans key from db\n\t//--------------------------------------------\n\t$authorize_login_id = get_option('authorize_login_id');\n\t$authorize_transaction_key = get_option('authorize_transaction_key');\n\n // Common Set Up for API Credentials\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName($authorize_login_id);/////////////////------ MERCHANT_LOGIN_ID 7RFn23t2BJ6\n $merchantAuthentication->setTransactionKey($authorize_transaction_key);//------ MERCHANT_TRANSACTION_KEY 8p429Y7Cq4h9sQBS\n $refId = 'ref' . time();\n\n $request = new AnetAPI\\ARBCancelSubscriptionRequest();\n $request->setMerchantAuthentication($merchantAuthentication);\n $request->setRefId($refId);\n $request->setSubscriptionId($subscriptionId);\n\n $controller = new AnetController\\ARBCancelSubscriptionController($request);\n\n $response = $controller->executeWithApiResponse( \\net\\authorize\\api\\constants\\ANetEnvironment::SANDBOX);\n\n if (($response != null) && ($response->getMessages()->getResultCode() == \"Ok\"))\n {\n $successMessages = $response->getMessages()->getMessage();\n //echo \"SUCCESS : \" . $successMessages[0]->getCode() . \" \" .$successMessages[0]->getText() . \"\\n\";\n\t\techo '<h2 style=\"color:#7066ce\">Thank you! Your request has been processed</h2>';\n\t\techo '<p>You have been unsubscribe successfully</p>';\n\t\t$monthpaid = !empty(get_option('authorize_monthly_paid')) ? get_option('authorize_monthly_paid') : 75;\n\t\techo '<p>Your credit card will not be automatically debited $'.$monthpaid.' a month.</p>';\n\t\techo '<br /><br /><p><a href=\"'.site_url().'/dashboard\">Click here</a> to go to your dashboard</p>';\n\t\t\n\t\t$table_name = $wpdb->prefix . 'payment';\n\t\t$wpdb->update( \n\t\t\t\t$table_name, \n\t\t\t\tarray( \n\t\t\t\t\t'status' => 'Inactive',\t// string\n\t\t\t\t), \n\t\t\t\tarray( 'subscribe' => $subscriptionId ), \n\t\t\t\tarray( \n\t\t\t\t\t'%s',\t// value1\n\t\t\t\t), \n\t\t\t\tarray( '%d' ) \n\t\t\t);\n\t\techo '<script>function hideFrm() { document.getElementById(\"jkfrm\").style.display=\"none\"; }</script>';\t\n \n }\n else\n {\n echo \"ERROR : Invalid response\\n\";\n $errorMessages = $response->getMessages()->getMessage();\n echo \"Response : \" . $errorMessages[0]->getCode() . \" \" .$errorMessages[0]->getText() . \"\\n\";\n \n }\n\n return $response;\n\n }", "function create_new_listing_actions_cancel_subscription($uid) {\r\n \r\n if (!is_numeric($uid)) {\r\n drupal_set_message(t('Invalid user id specified'), 'error');\r\n return;\r\n }\r\n\r\n // Find all recurring open orders\r\n $query = new EntityFieldQuery();\r\n\r\n $query\r\n ->entityCondition('entity_type', 'commerce_order')\r\n ->propertyCondition('type', 'recurring')\r\n ->propertyCondition('status', 'recurring_open')\r\n ->propertyCondition('uid', $uid);\r\n\r\n $result = $query->execute()['commerce_order'];\r\n\r\n if (count($result) != 1) {\r\n drupal_set_message(t('Unable to find open billing cycle.'), 'error');\r\n return;\r\n }\r\n\r\n $order = commerce_order_load(array_shift($result)->order_id);\r\n $order->status = 'canceled';\r\n commerce_order_save($order);\r\n\r\n drupal_set_message(t('Your subscription has been cancelled.'));\r\n}", "public function cancelrecurring($id,$userid)\n {\n if($userid!='')\n {\n if(Options::getoptionmatch3('paypal_mode')=='0')\n { \n $username = Options::getoptionmatch3('sandbox_username');\n $password = Options::getoptionmatch3('sandbox_password');\n $signature = Options::getoptionmatch3('sandbox_signature');\n }else\n {\n $username = Options::getoptionmatch3('live_username');\n $password = Options::getoptionmatch3('live_password');\n $signature = Options::getoptionmatch3('live_signature');\n }\n $curl = curl_init();\n $user_id=$userid;\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($curl, CURLOPT_POST, true);\n curl_setopt($curl, CURLOPT_URL, 'https://api-3t.sandbox.paypal.com/nvp');\n curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query(array(\n 'USER' => $username, //Your API User\n 'PWD' => $password, //Your API Password\n 'SIGNATURE' => $signature, //Your API Signature\n\n 'VERSION' => '108',\n 'METHOD' => 'ManageRecurringPaymentsProfileStatus',\n 'PROFILEID' => $id, //here add your profile id \n 'ACTION' => 'Cancel' //this can be selected in these default paypal variables (Suspend, Cancel, Reactivate)\n )));\n\n $response = curl_exec($curl);\n\n curl_close($curl);\n\n $nvp = array();\n\n if (preg_match_all('/(?<name>[^\\=]+)\\=(?<value>[^&]+)&?/', $response, $matches)) {\n foreach ($matches['name'] as $offset => $name) {\n $nvp[$name] = urldecode($matches['value'][$offset]);\n }\n }\n \n\n //printf(\"<pre>%s</pre>\",print_r($nvp, true)); die; \n if($nvp['ACK']=='Success')\n {\n Transaction::updateoption2(array('recurring'=>'0'),array('transaction_id'=>$id,'user_id'=>$userid));\n $messags['message'] = \"Recurring has been canceled successfully.\";\n $messags['status']= 1; \n }else\n {\n $messags['message'] = \"Error to cancel a recurring.\";\n $messags['status']= 0; \n }\n }\n \n echo json_encode($messags);\n die;\n }", "function charge_credit_card() {\n\nif ( is_user_logged_in() ) {\n\t\n\t require 'vendor/autoload.php';\n\n define(\"AUTHORIZENET_LOG_FILE\", \"phplog\");\n \n ///////////////////////------- FUNCTION CANCEL SUBSCRIPTION --------////////////////////////////\n \n function cancelSubscription($subscriptionId) {\n\t // require 'vendor/autoload.php';\n // define(\"AUTHORIZENET_LOG_FILE\", \"phplog\");\n\t global $wpdb;\n\t \n\t $current_user = wp_get_current_user();\n $username = $current_user->user_login;\n\t$user_email = $current_user->user_email;\n\t$user_firstname = $current_user->user_firstname;\n\t$user_lastname = $current_user->user_lastname;\n\t$user_id = $current_user->ID;\n // get ID and trans key from db\n\t//--------------------------------------------\n\t$authorize_login_id = get_option('authorize_login_id');\n\t$authorize_transaction_key = get_option('authorize_transaction_key');\n\n // Common Set Up for API Credentials\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName($authorize_login_id);/////////////////------ MERCHANT_LOGIN_ID 7RFn23t2BJ6\n $merchantAuthentication->setTransactionKey($authorize_transaction_key);//------ MERCHANT_TRANSACTION_KEY 8p429Y7Cq4h9sQBS\n $refId = 'ref' . time();\n\n $request = new AnetAPI\\ARBCancelSubscriptionRequest();\n $request->setMerchantAuthentication($merchantAuthentication);\n $request->setRefId($refId);\n $request->setSubscriptionId($subscriptionId);\n\n $controller = new AnetController\\ARBCancelSubscriptionController($request);\n\n $response = $controller->executeWithApiResponse( \\net\\authorize\\api\\constants\\ANetEnvironment::SANDBOX);\n\n if (($response != null) && ($response->getMessages()->getResultCode() == \"Ok\"))\n {\n $successMessages = $response->getMessages()->getMessage();\n //echo \"SUCCESS : \" . $successMessages[0]->getCode() . \" \" .$successMessages[0]->getText() . \"\\n\";\n\t\techo '<h2 style=\"color:#7066ce\">Thank you! Your request has been processed</h2>';\n\t\techo '<p>You have been unsubscribe successfully</p>';\n\t\t$monthpaid = !empty(get_option('authorize_monthly_paid')) ? get_option('authorize_monthly_paid') : 75;\n\t\techo '<p>Your credit card will not be automatically debited $'.$monthpaid.' a month.</p>';\n\t\techo '<br /><br /><p><a href=\"'.site_url().'/dashboard\">Click here</a> to go to your dashboard</p>';\n\t\t\n\t\t$table_name = $wpdb->prefix . 'payment';\n\t\t$wpdb->update( \n\t\t\t\t$table_name, \n\t\t\t\tarray( \n\t\t\t\t\t'status' => 'Inactive',\t// string\n\t\t\t\t), \n\t\t\t\tarray( 'subscribe' => $subscriptionId ), \n\t\t\t\tarray( \n\t\t\t\t\t'%s',\t// value1\n\t\t\t\t), \n\t\t\t\tarray( '%d' ) \n\t\t\t);\n\t\techo '<script>function hideFrm() { document.getElementById(\"jkfrm\").style.display=\"none\"; }</script>';\t\n \n }\n else\n {\n echo \"ERROR : Invalid response\\n\";\n $errorMessages = $response->getMessages()->getMessage();\n echo \"Response : \" . $errorMessages[0]->getCode() . \" \" .$errorMessages[0]->getText() . \"\\n\";\n \n }\n\n return $response;\n\n }\n \n///////////////////------------- SUBSCRIPTION USERS -----------------/////////////////////\n function createSubscription($peram){\n\t global $wpdb;\n // get ID and trans key from db\n\t//--------------------------------------------\n\t$authorize_login_id = get_option('authorize_login_id');\n\t$authorize_transaction_key = get_option('authorize_transaction_key');\n\tif(!empty($peram[4])) {\n\t\t$namarr = explode(\" \",$peram[4]);\n\t\t$fname = $namarr[0];\n\t\t$lname = $namarr[1];\n\t} else {\n\t\t$fname = \"\";\n\t\t$lname = \"\";\n\t\t}\n\t$intervalLength = $peram[0];\n\t//------------------------------------\n\t$current_user = wp_get_current_user();\n $username = $current_user->user_login;\n\t$user_email = $current_user->user_email;\n\t$user_firstname = $current_user->user_firstname;\n\t$user_lastname = $current_user->user_lastname;\n\t$user_id = $current_user->ID;\t\n\t//--------------------------------------------\n\t// Common setup for API credentials\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName($authorize_login_id);/////////////////------ MERCHANT_LOGIN_ID 7RFn23t2BJ6\n $merchantAuthentication->setTransactionKey($authorize_transaction_key);//------ MERCHANT_TRANSACTION_KEY 8p429Y7Cq4h9sQBS\n $refId = 'ref' . time();\n\n // Subscription Type Info\n $subscription = new AnetAPI\\ARBSubscriptionType();\n $subscription->setName(\"Cnanny Monthly Subscription\");\n\n $interval = new AnetAPI\\PaymentScheduleType\\IntervalAType();\n $interval->setLength($intervalLength);\n $interval->setUnit(\"days\");\n\n $paymentSchedule = new AnetAPI\\PaymentScheduleType();\n $paymentSchedule->setInterval($interval);\n $paymentSchedule->setStartDate(new DateTime(date('Y-m-d')));\n $paymentSchedule->setTotalOccurrences(\"12\");\n $paymentSchedule->setTrialOccurrences(\"10\");\n\n $subscription->setPaymentSchedule($paymentSchedule);\n $subscription->setAmount($peram[0]);\n $subscription->setTrialAmount(\"0.00\");\n \n $creditCard = new AnetAPI\\CreditCardType();\n $creditCard->setCardNumber($peram[1]); //////--- card no e.g. 4111111111111111\n $creditCard->setExpirationDate($peram[2]); //////////////--- expiry 1220\n\n $payment = new AnetAPI\\PaymentType();\n $payment->setCreditCard($creditCard);\n $subscription->setPayment($payment);\n\n $order = new AnetAPI\\OrderType();\n $order->setInvoiceNumber(\"1234354\"); \n $order->setDescription(\"Cnanny Monthly Subscription\"); \n $subscription->setOrder($order); \n \n $billTo = new AnetAPI\\NameAndAddressType();\n $billTo->setFirstName($fname);\n $billTo->setLastName($lname);\n\n $subscription->setBillTo($billTo);\n\n $request = new AnetAPI\\ARBCreateSubscriptionRequest();\n $request->setmerchantAuthentication($merchantAuthentication);\n $request->setRefId($refId);\n $request->setSubscription($subscription);\n $controller = new AnetController\\ARBCreateSubscriptionController($request);\n\n $response = $controller->executeWithApiResponse( \\net\\authorize\\api\\constants\\ANetEnvironment::SANDBOX);\n \n if (($response != null) && ($response->getMessages()->getResultCode() == \"Ok\") )\n {\n\t\t//$response->getSubscriptionId()\n\t\techo '<h2 class=\"page-heading\">Thank you! Your payment has been processed</h2>';\n\t\t$monthpaid = !empty(get_option('authorize_monthly_paid')) ? get_option('authorize_monthly_paid') : 75;\n\t\techo '<div class=\"clearfix charged\"><span>Your credit card has been charged <span class=\"text-green\">$'.$monthpaid.'</span></span><br />';\n\t\t\n\t\t$oncepaid = !empty(get_option('authorize_once_paid')) ? get_option('authorize_once_paid') : 1500;\n\t\techo '<div class=\"clearfix charged\">\n\t\t\t\t\t\t\t<p>Your credit card will be automatically debited $'.$monthpaid.' a month until you hire a cNanny or <a href=\"'.site_url().'/subscription-cancellation\" class=\"text-black text-underline\">cancel your subscription</a>.</p>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\tWhen you hire your perfect cNanny, you will be charged a one-time placement fee of $'.$oncepaid.' only after she accepts the offer.\n\t\t\t\t\t\t\t\tYour monthly subscription will then be automatically cancelled.\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</div>';\n\t\techo '<br /><br /><p><a href=\"'.site_url().'/dashboard\">Click here</a> to go to your dashboard</p>';\n\t\t\n\t\t$subscrId = $response->getSubscriptionId();\n\t\t\n\t\t$table_name = $wpdb->prefix . 'payment';\t\n\t\t\t$ins = $wpdb->insert($table_name, array(\n\t\t\t'fname' => $fname,\n\t\t\t'lname' => $lname,\n\t\t\t'user_id' => $user_id,\n\t\t\t'amount' => $peram[0],\n\t\t\t'card' => base64_encode($peram[1]),\n\t\t\t'expiry' => $peram[2],\n\t\t\t'code' => '',\n\t\t\t'date_created' => current_time('mysql', 1),\n\t\t\t'status' => 'Active',\n\t\t\t'subscribe' => $subscrId,\n\t\t\t'res_code' => '-',\n\t\t\t'auth_code' => '-',\n\t\t\t'trans_code' => '-',\n\t\t\t'gcode' => '-',\n\t\t\t'res_des' => 'Success',\n\t\t));\t\n\t\t$paymentsuccess = 1;\n\t\techo '<script>function hideFrm() { document.getElementById(\"jkfrm\").style.display=\"none\"; }</script>';\n }\n else\n {\n echo \"ERROR : Invalid response\\n\";\n $errorMessages = $response->getMessages()->getMessage();\n echo \"Response : \" . $errorMessages[0]->getCode() . \" \" .$errorMessages[0]->getText() . \"\\n\";\n\t\t$paymentsuccess = 1;\n }\n\n return $paymentsuccess;\n }\n ///////////////////------------- ONCE PAID USERS -----------------/////////////////////\n function chargeCreditCard($peram){\n\t global $wpdb;\n // get ID and trans key from db\n\t//--------------------------------------------\n\t$authorize_login_id = get_option('authorize_login_id');\n\t$authorize_transaction_key = get_option('authorize_transaction_key');\n\tif(!empty($peram[4])) {\n\t\t$namarr = explode(\" \",$peram[4]);\n\t\t$fname = $namarr[0];\n\t\t$lname = $namarr[1];\n\t} else {\n\t\t$fname = \"\";\n\t\t$lname = \"\";\n\t\t}\n\t$current_user = wp_get_current_user();\n $username = $current_user->user_login;\n\t$user_email = $current_user->user_email;\n\t$user_firstname = $current_user->user_firstname;\n\t$user_lastname = $current_user->user_lastname;\n\t$user_id = $current_user->ID;\n\t//--------------------------------------------\n\t// Common setup for API credentials\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName($authorize_login_id);/////////////////------ MERCHANT_LOGIN_ID 7RFn23t2BJ6\n $merchantAuthentication->setTransactionKey($authorize_transaction_key);//------ MERCHANT_TRANSACTION_KEY 8p429Y7Cq4h9sQBS\n $refId = 'ref' . time();\n\n // Create the payment data for a credit card\n $creditCard = new AnetAPI\\CreditCardType();\n $creditCard->setCardNumber($peram[1]); //////--- card no e.g. 4111111111111111\n $creditCard->setExpirationDate($peram[2]); //////////////--- expiry 1220\n $creditCard->setCardCode($peram[3]);//////////////////////--- card code 123\n $paymentOne = new AnetAPI\\PaymentType();\n $paymentOne->setCreditCard($creditCard);\n\n $order = new AnetAPI\\OrderType();\n $order->setDescription(\"Monthly Payment\");\n\n // Set the customer's Bill To address\n $customerAddress = new AnetAPI\\CustomerAddressType();\n $customerAddress->setFirstName($fname);\n $customerAddress->setLastName($lname);\n $customerAddress->setCompany(\"\");\n $customerAddress->setAddress(\"\");\n $customerAddress->setCity(\"\");\n $customerAddress->setState(\"\");\n $customerAddress->setZip(\"\");\n $customerAddress->setCountry(\"\");\n\n // Set the customer's identifying information\n $customerData = new AnetAPI\\CustomerDataType();\n $customerData->setType(\"individual\");\n $customerData->setId(\"\"); // Customer ID \n $customerData->setEmail(\"\");\n\n //Add values for transaction settings\n $duplicateWindowSetting = new AnetAPI\\SettingType();\n $duplicateWindowSetting->setSettingName(\"duplicateWindow\");\n $duplicateWindowSetting->setSettingValue(\"600\");\n\n // Create a TransactionRequestType object\n $transactionRequestType = new AnetAPI\\TransactionRequestType();\n $transactionRequestType->setTransactionType( \"authCaptureTransaction\"); \n $transactionRequestType->setAmount($peram[0]);\n $transactionRequestType->setOrder($order);\n $transactionRequestType->setPayment($paymentOne);\n $transactionRequestType->setBillTo($customerAddress);\n $transactionRequestType->setCustomer($customerData);\n $transactionRequestType->addToTransactionSettings($duplicateWindowSetting);\n\n $request = new AnetAPI\\CreateTransactionRequest();\n $request->setMerchantAuthentication($merchantAuthentication);\n $request->setRefId( $refId);\n $request->setTransactionRequest( $transactionRequestType);\n\n $controller = new AnetController\\CreateTransactionController($request);\n $response = $controller->executeWithApiResponse( \\net\\authorize\\api\\constants\\ANetEnvironment::SANDBOX);\n \n\n if ($response != null)\n {\n if($response->getMessages()->getResultCode() == 'Ok')\n {\n $tresponse = $response->getTransactionResponse();\n \n if ($tresponse != null && $tresponse->getMessages() != null) \n {\n\t\t\t$res_code = $tresponse->getResponseCode();\n\t\t\t$auth_code = $tresponse->getAuthCode();\n\t\t\t$trans_code = $tresponse->getTransId();\n\t\t\t$gcode = $tresponse->getMessages()[0]->getCode();\n\t\t\t$res_des = $tresponse->getMessages()[0]->getDescription();\n \n\t\t /* echo \" Transaction Response Code : \" . $res_code . \"\\n\";\n echo \" Successfully created an authCapture transaction with Auth Code : \" . $auth_code . \"\\n\";\n echo \" Transaction ID : \" . $trans_code . \"\\n\";\n echo \" Code : \" . $ccode . \"\\n\"; \n echo \" Description : \" . $res_des . \"\\n\";*/\n\t\t \n\t\techo '<h2 style=\"color:#7066ce\">Thank you! Your payment has been processed</h2>';\n\t\t$oncepaid = !empty(get_option('authorize_once_paid')) ? get_option('authorize_once_paid') : 1500;\n\t\techo '<p>Your credit card has been charged <span style=\"color:#6dcd62; font-size:28px\">$'.$oncepaid.'</span></p>';\n\t\techo '<p>you have been hired your perfect cNanny successfully.</p>';\n\t\techo '<br /><br /><p><a href=\"'.site_url().'/dashboard\">Click here</a> to go to your dashboard</p>';\n\n\n\t\t //---------------------------------------------------\n\t\t\n\t\t\t$table_name = $wpdb->prefix . 'payment';\t\n\t\t\t$wpdb->insert($table_name, array(\n\t\t\t'fname' => $fname,\n\t\t\t'lname' => $lname,\n\t\t\t'user_id' => $user_id,\n\t\t\t'amount' => $peram[0],\n\t\t\t'card' => base64_encode($peram[1]),\n\t\t\t'expiry' => $peram[2],\n\t\t\t'code' => base64_encode($peram[3]),\n\t\t\t'date_created' => current_time('mysql', 1),\n\t\t\t'status' => 'Active',\n\t\t\t'subscribe' => '-',\n\t\t\t'res_code' => $res_code,\n\t\t\t'auth_code' => $auth_code,\n\t\t\t'trans_code' => $trans_code,\n\t\t\t'gcode' => $gcode,\n\t\t\t'res_des' => $res_des,\n\t\t));\t\n\t\t\n\t\techo '<script>function hideFrm() { document.getElementById(\"jkfrm\").style.display=\"none\"; }</script>';\n\t\t //------------------------------------------------------\n\t\t \n }\n else\n {\n echo \"Transaction Failed \\n\";\n if($tresponse->getErrors() != null)\n {\n echo \" Error code : \" . $tresponse->getErrors()[0]->getErrorCode() . \"\\n\";\n echo \" Error message : \" . $tresponse->getErrors()[0]->getErrorText() . \"\\n\"; \n }\n }\n }\n else\n {\n echo \"Transaction Failed \\n\";\n $tresponse = $response->getTransactionResponse();\n \n if($tresponse != null && $tresponse->getErrors() != null)\n {\n echo \" Error code : \" . $tresponse->getErrors()[0]->getErrorCode() . \"\\n\";\n echo \" Error message : \" . $tresponse->getErrors()[0]->getErrorText() . \"\\n\"; \n }\n else\n {\n echo \" Error code : \" . $response->getMessages()->getMessage()[0]->getCode() . \"\\n\";\n echo \" Error message : \" . $response->getMessages()->getMessage()[0]->getText() . \"\\n\";\n }\n } \n }\n else\n {\n echo \"No response returned \\n\";\n }\n\n return $response;\n }\n \n ///////////////////////////////--------- FUNCTION END -----------/////////////////////////////////// \nif(!empty($_POST['amount'])) {\n $payment_type = $_POST['payment_type'];\n $card = $_POST['card'];\n $mn = $_POST['mn'];\n $yr = $_POST['yr'];\n $exp = $mn.''.$yr;\n $code = $_POST['code'];\n $fullname = $_POST['fullname'];\n $interval = 30; // 30 days interval\n // monthly subscription $75 (run on authorize live mode only)\n if(isset($payment_type) && $payment_type == \"monthly\") {\n\t $monthpaid = !empty(get_option('authorize_monthly_paid')) ? get_option('authorize_monthly_paid') : 75;\n\t \t $amount = $monthpaid;\n \t\t$peramaters = array($amount,$card,$exp,$code,$fullname,$interval);\n \t$ret = createSubscription($peramaters);\n\t\t\n\t\t//print_r($ret); exit(0);\n \t } \n else { \n // cancel monthly subscription first\n global $wpdb;\n \t$current_user = wp_get_current_user();\n\t$user_id = $current_user->ID;\n \t$table_name = $wpdb->prefix . 'payment'; \n\t$subscribe = $wpdb->get_var( \"SELECT subscribe FROM $table_name where user_id = \".$user_id.\" and status = 'Active' and subscribe != '-' order by id desc\" );\n\t\tif($subscribe > 0)\n\t\tcancelSubscription($subscribe);\n // pay once $1500 (run on both authorize live and test mode)\n $oncepaid = !empty(get_option('authorize_once_paid')) ? get_option('authorize_once_paid') : 1500;\n \t\t$amount = $oncepaid;\n\t \t$peramaters = array($amount,$card,$exp,$code,$fullname);\n \t\tchargeCreditCard($peramaters);\n \t\t}\n\n}\n/////////////////////////////////////////////////////////////////////////\n\nif(isset($_GET['subid']) && $_GET['subid'] > 0) { \n \n\t$subid = $_GET['subid'];\n\tcancelSubscription($subid); \n}\n\n\n\n\n/* global $wpdb;\n $table_name = $wpdb->prefix . 'payment';\n $sql = \"DROP TABLE IF EXISTS $table_name\";\n $wpdb->query($sql);\t*/\n\t\n$current_user = wp_get_current_user();\n$username = $current_user->user_login;\n$user_email = $current_user->user_email;\n$user_firstname = $current_user->user_firstname;\n$user_lastname = $current_user->user_lastname;\n$user_id = $current_user->ID;\n$thefullname = $user_firstname?$user_firstname.' '.$user_lastname:'';\t\n ?>\n <style>\n\t #sjkfrm input[type=text] {\n\t\t border:solid 1px #666666;\n\t\tborder-radius: 15px;\n\t\tborder: 2px solid #666666;\n\t\tpadding: 5px; \n\t\theight: 50px; \n\t\t }\n\t.form-control{\n\t\tborder: 2px solid #999 !important;\n\t\tborder-radius: 8px;\n\t\theight:40px !important;\n\t\twidth: 70%;\n\t\t}\n\t.thimg{\n\t\twidth: 70%;\n\t\t}\t\n\t@media only screen and (max-width: 700px) {\n\t\t.form-control{\n\t\t\twidth: 100%;\n\t\t}\n\t\t.thimg{\n\t\twidth: 100%;\n\t\t}\n\t\t}\t\n\t.selbx{\n\t\tborder: 2px solid #999 !important;\n\t\theight:40px !important;\n\t\t}\t \n\t.sbmt{\n\t\tbackground-color:#6dcd62;\n\t\tcolor:#FFF;\n\t\tpadding:12px 35px;\n\t\tborder-radius: 8px;\n\t\tborder: none 0px;\n\t\tmargin-bottom: 20px;\n\t\t}\n\t.sbmt:hover{\n\t\tbackground-color:#090;\n\t\t}\t\n </style>\n <?php \n /* global $wpdb;\n $table_name = $wpdb->prefix . 'payment';\n $oncePaid = $wpdb->get_var( \"SELECT amount FROM $table_name where user_id = \".$user_id.\" and status = 'Active' and subscribe == '-' order by id desc\" );\n echo $oncePaid; exit(0);\n if($oncePaid == 1000) {\n\t ?>\n <h2 style=\"color:#7066ce\">You have already paid $1500 for perfect cNanny</h2><br />\n <p>You have already paid $1500 for perfect cNanny. so you need not to be subscribed again</p>\n <?php\n\t $disp = 'style=\"display:none\"';\n\t } else {\n\t$disp = 'style=\"display:block\"';\t \n\t}*/\n ?> \n<form action=\"\" id=\"jkfrm\" method=\"post\" enctype=\"multipart/form-data\" name=\"payment\" autocomplete=\"off\" onsubmit=\"check_exp()\" <?php //echo $disp; ?>>\n\t<style type=\"text/css\">\n #checkout_card_number {\n background-image: url('<?php echo WP_PLUGIN_URL; ?>/authorizejk/cards.png');\n background-position: 3px 3px;\n background-size: 40px 252px; /* 89 x 560 */\n background-repeat: no-repeat;\n padding-left: 48px !important;\n }\n\tlabel span {\n\t\tfont-size:12px;\n\t\tfont-weight:600 !important;\n\t\tcolor:#666 !important;\n\t\t}\n\t/*input.pw {\n -webkit-text-security: disc;\n\t}*/\n\t\n\t\n\t\n\n\n#username,\n#pw {\n display: inline-block;\n width: 150px;\n background: #FFF;\n \tborder: 2px solid #999 !important;\n border-radius: 8px;\n height: 40px !important;\n\tline-height: 40px;\n padding: 0px 5px;\n letter-spacing: 2px;\n\toverflow:hidden;\n}\n#pw {\n -webkit-text-security: disc;\n\t\n}\n\n\n </style>\n <?php\n\t global $wpdb;\n $table_name = $wpdb->prefix . 'payment'; \n\t$subscribe = $wpdb->get_var( \"SELECT subscribe FROM $table_name where user_id = \".$user_id.\" and status = 'Active' and subscribe != '-' order by id desc\" );\n\t?>\n <!--<h2 style=\"color:#6dcd62; font-weight:bold;\">$75/month</h2><br />-->\n <?php if(!empty($subscribe)) { \n\tif(empty($ret)) {\n\t\twp_redirect(site_url().'/already-subscribe'); exit(0);\n\t}\n\t?>\n\n <small>Don't worry, you can <a href=\"?subid=<?php echo $subscribe; ?>\" onclick=\"return confirm('Are you sure that you want to cancel monthly subscription from Cnanny?')\">cancel</a> at any time</small><br />\n \n <?php $oncepaid = !empty(get_option('authorize_once_paid')) ? get_option('authorize_once_paid') : 1500; ?>\n <input type=\"radio\" name=\"payment_type\" value=\"yearly\" checked=\"checked\" style=\"clear:both\" /> <label style=\"margin-top:20px;\"> Pay Once $<?php echo $oncepaid; ?> for hiring perfect cNanny</label>\n <?php } else { ?>\n <?php $monthpaid = !empty(get_option('authorize_monthly_paid')) ? get_option('authorize_monthly_paid') : 75; ?>\n <br />\n <input type=\"radio\" name=\"payment_type\" value=\"monthly\" checked=\"checked\" /> <label> Monthly Subscribe $<?php echo $monthpaid; ?></label>\n <?php } ?>\n <br /><br />\n <img src=\"<?php echo WP_PLUGIN_URL; ?>/authorizejk/cclogos.gif\" class=\"thimg\" /><br /><br />\n <label style=\"\">Full Name <span>(as it appears on your card)</span></label> <input type=\"text\" name=\"fullname\" maxlength=\"80\" required=\"required\" class=\"input-text form-control validate-alpha required\" placeholder=\"\" autocomplete=\"off\" value=\"<?php echo $thefullname; ?>\" />\n <input type=\"hidden\" name=\"amount\" value=\"<?php echo $monthpaid; ?>\" /><br />\n <label>Card Number <span>(no dashes or spaces)</span></label><input id=\"checkout_card_number\" name=\"card\" required=\"required\" class=\"input-text form-control validate-creditcard required\" type=\"text\" maxlength=\"16\" data-stripe=\"number\" placeholder=\"\" autocomplete=\"off\"><br />\n <script type=\"text/javascript\">\n\t$ = jQuery.noConflict();\n var $cardinput = $('#checkout_card_number');\n $('#checkout_card_number').validateCreditCard(function(result)\n {\t\t\n //console.log(result);\n if (result.card_type != null)\n {\t\t\t\t\n switch (result.card_type.name)\n {\n case \"visa\":\n $cardinput.css('background-position', '3px -34px');\n $cardinput.addClass('card_visa');\n break;\n \n case \"visa_electron\":\n $cardinput.css('background-position', '3px -72px');\n $cardinput.addClass('card_visa_electron');\n break;\n \n case \"mastercard\":\n $cardinput.css('background-position', '3px -110px');\n $cardinput.addClass('card_mastercard');\n break;\n \n case \"maestro\":\n $cardinput.css('background-position', '3px -148px');\n $cardinput.addClass('card_maestro');\n break;\n \n case \"discover\":\n $cardinput.css('background-position', '3px -186px');\n $cardinput.addClass('card_discover');\n break;\n \n case \"amex\":\n $cardinput.css('background-position', '3px -223px');\n $cardinput.addClass('card_amex');\n break;\n \n default:\n $cardinput.css('background-position', '3px 3px');\n break;\t\t\t\t\t\n }\n } else {\n $cardinput.css('background-position', '3px 3px');\n }\n \n // Check for valid card numbere - only show validation checks for invalid Luhn when length is correct so as not to confuse user as they type.\n if (result.length_valid || $cardinput.val().length > 16)\n {\n if (result.luhn_valid) {\n $cardinput.parent().removeClass('has-error').addClass('has-success');\n } else {\n $cardinput.parent().removeClass('has-success').addClass('has-error');\n }\n } else {\n $cardinput.parent().removeClass('has-success').removeClass('has-error');\n }\n });\n\t//------------------------------------------------------\n\tfunction check_exp() {\n\tvar yr = document.getElementById(\"yrt\").value;\t\n\tvar currentTime = new Date();\n\tvar curr_month = currentTime.getMonth() + 1;\n\tvar theyear = <?php echo date('y'); ?>;\n\tif(yr == theyear) {\n\t\tvar mnt = document.getElementById(\"mnt\").value;\n\t\tif(mnt < curr_month) {\n\t\t\talert('Please select a valid Expiry Date');\n\t\t\t}\n\t}\n\t\n}\n\nfunction set_type() { //\n\tvar pw = $('#pw').text();\n\tdocument.getElementById(\"code\").value = pw;\n\t//alert(pw);\n\t}\n \n </script>\n \n <label>Expiry Date</label><br />\n <select name=\"mn\" class=\"selbx required\" id=\"mnt\" required>\n <option value=\"\">Select Month</option>\n <option value=\"01\">January</option>\n <option value=\"02\">February</option>\n <option value=\"03\">March</option>\n <option value=\"04\">April</option>\n <option value=\"05\">May</option>\n <option value=\"06\">June</option>\n <option value=\"07\">July</option>\n <option value=\"08\">August</option>\n <option value=\"09\">September</option>\n <option value=\"10\">October</option>\n <option value=\"11\">November</option>\n <option value=\"12\">December</option>\n </select>\n <select name=\"yr\" class=\"selbx required\" id=\"yrt\" required onchange=\"check_exp()\">\n <option value=\"\">Select Year</option>\n \n\n <?php \n $y = date('y');\n for($i=1;$i<=12;$i++) {\n ?>\n <option value=\"<?php echo $y; ?>\"><?php echo '20'.$y; ?></option>\n <?php $y++; } ?>\n </select>\n <br />\n <input type=\"text\" name=\"card_number\" value=\"0000 0000 0000 0000\" style=\"display:none\" /><br />\n \n <?php\n if (strlen(strstr($_SERVER['HTTP_USER_AGENT'], 'Firefox')) > 0) { // Firefox\n ?>\n\t <label>Security Code <span>(3 digits on the back / Amex - 4 digits on the front)</span></label> <input type=\"password\" id=\"codeff\" name=\"code\" maxlength=\"4\" class=\"pw input-text form-control validate-digits required\" placeholder=\"\" required=\"required\" value=\"\" style=\"width:150px;\" autocomplete=\"off\" /><br />\n\t<?php\n} else { // other browsers\n ?>\n <label>Security Code <span>(3 digits on the back / Amex - 4 digits on the front)</span></label> <input type=\"hidden\" id=\"code\" name=\"code\" maxlength=\"4\" class=\"pw input-text form-control validate-digits required\" placeholder=\"\" required=\"required\" value=\"\" style=\"width:150px;\" autocomplete=\"off\" /> <br /><div contenteditable id=\"pw\"></div><br /><br />\n <?php\n}\n ?> \n\n\n \n\n \n \n <?php if(!empty($subscribe)) { \n\t\n\t $oncepaid = !empty(get_option('authorize_once_paid')) ? get_option('authorize_once_paid') : 1500; ?>\n <strong id=\"st\">You will be charged $<?php echo $oncepaid; ?> for hiring perfect cNanny</strong><br /><br />\n <?php } else { \n\t$monthpaid = !empty(get_option('authorize_monthly_paid')) ? get_option('authorize_monthly_paid') : 75;\n\t?>\n <strong id=\"st\">You will be charged $<?php echo $monthpaid; ?> every month</strong><br /><br />\n <?php } ?>\n \n <!-- prevent auto save in browser-->\n <div style=\"display:none\">\n <input type=\"text\" name=\"cardinfo\" id=\"txtUserName\" value=\"0000 0000 0000 0000\"/>\n\t<input type=\"text\" name=\"txtPass\" id=\"txtPass\" value=\"9999999999\"/>\n </div>\n \n \n <input type=\"submit\" class=\"sbmt\" value=\"Pay Now\" onclick=\"set_type();\" /><br />\n <strong>Don't want to pay right now?</strong> <a href=\"<?php echo site_url(); ?>/parent-search\">Continue browsing</a><br />\n <strong>Questions?</strong> <a href=\"<?php echo site_url(); ?>/contact-us\">Contact us</a>\n <script>document.addEventListener('contextmenu', event => event.preventDefault());\n payment.setAttribute( \"autocomplete\", \"off\" ); payment.code.setAttribute( \"autocomplete\", \"off\" );\n\thideFrm(); //hide form and show success massage\n </script>\n</form><br />\n<script>\nhideFrm(); //hide form and show success massage\n</script>\n <?php\n\t} else {\n\t\twp_redirect('login');\n\t\t}\n}", "function cancel_subscription(){\n\t\t$sub_id = $this->input->post('sub_id');\n\t\tif(!empty($sub_id)){\n\t\t\\Stripe\\Stripe::setApiKey(\"sk_test_NSDNftNd6HhWAxCJczahG70h\");\n\t\t$subscription = \\Stripe\\Subscription::retrieve($sub_id);\n\t\t //return $subscription->cancel();\n\t\t if($subscription->cancel()){\n\t\t\t$this->InteractModal->subscription_suspend($sub_id);\t\t\n\t\t }\t\t \n\t\t}else{\n\t\t\techo \"subcripition id not found\";\n\t\t}\n\t}", "private function process_cancel_subscription( ){\n\t\t$subscription_id = $_POST['ec_account_subscription_id'];\n\t\t$subscription_row = $this->mysqli->get_subscription_row( $subscription_id );\n\t\t$stripe = new ec_stripe( );\n\t\t$cancel_success = $stripe->cancel_subscription( $this->user, $subscription_row->stripe_subscription_id );\n\t\tif( $cancel_success ){\n\t\t\t$this->mysqli->cancel_subscription( $subscription_id );\n\t\t\theader( \"location: \" . $this->account_page . $this->permalink_divider . \"ec_page=subscriptions&account_success=subscription_canceled\" );\n\t\t}else{\n\t\t\theader( \"location: \" . $this->account_page . $this->permalink_divider . \"ec_page=subscription_details&subscription_id=\" . $subscription_id . \"&account_error=subscription_cancel_failed\" );\n\t\t}\n\t}", "function bankopen_cancelSubscription($params)\n{\n // Gateway Configuration Parameters\n $APIKey = $params['APIKey'];\n $APISecret = $params['APISecret'];\n $testMode = $params['testMode'];\n $dropdownField = $params['dropdownField'];\n $radioField = $params['radioField'];\n $textareaField = $params['textareaField'];\n\n // Subscription Parameters\n $subscriptionIdToCancel = $params['subscriptionID'];\n\n // System Parameters\n $companyName = $params['companyname'];\n $systemUrl = $params['systemurl'];\n $langPayNow = $params['langpaynow'];\n $moduleDisplayName = $params['name'];\n $moduleName = $params['paymentmethod'];\n $whmcsVersion = $params['whmcsVersion'];\n\n // perform API call to cancel subscription and interpret result\n\n return array(\n // 'success' if successful, any other value for failure\n 'status' => 'success',\n // Data to be recorded in the gateway log - can be a string or array\n 'rawdata' => $responseData,\n );\n}", "public function cancel()\n {\n $post = $_REQUEST;\n $model = & $this->getModel('jms');\n $model->cancelSubscription($post);\n $this->setRedirect('index.php?option=com_jms&view=jms&layout=cancel&id=' . $post['id'] . '&plan_id=' . $post['plan_id']);\n }", "public function cancelBoleto(){\n $cancelamento = Mage::getStoreConfig( 'payment/gwap_boleto/cancelamento' );\n if( is_numeric($cancelamento) && $cancelamento > 0 ){ \n $cancelamento++;\n $due_date = Mage::getModel('core/date')->timestamp( '-'.$cancelamento.' days' );\n }else{\n $due_date = Mage::getModel('core/date')->timestamp( '-2 days' );\n }\n \n $mGwap = Mage::getModel('gwap/order')->getCollection()\n ->addExpireFilter( $due_date )\n ->addTypeFilter('boleto')\n ->addStatusFilter(Indexa_Gwap_Model_Order::STATUS_CAPTUREPAYMENT);\n \n if( $mGwap->count() ){\n foreach ($mGwap as $mGwapitem){\n \n $mGwapitem->setStatus('canceled');\n $mGwapitem->save();\n \n $can_cancel = Mage::getStoreConfig( 'payment/gwap_boleto/cancelar_expirado' );\n \n if( $can_cancel ){\n \n $order = Mage::getModel('sales/order')->load( $mGwapitem->getOrderId() );\n /* var $order Mage_Sales_Model_Order */\n $order->cancel();\n $order->save();\n \n }\n \n }\n }\n return $this;\n }", "abstract public function cancel_payment( Payment $payment );", "function cancel() {\n\t\t\tglobal $wpdb;\n\t\t\t\n\t\t\t//only need to cancel on the gateway if there is a subscription id\n\t\t\tif(empty($this->subscription_transaction_id)) {\n\t\t\t\t//just mark as cancelled\n\t\t\t\t$this->updateStatus(\"cancelled\");\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\t//get some data\n\t\t\t\t$order_user = get_userdata($this->user_id);\n\n\t\t\t\t//cancel orders for the same subscription\n\t\t\t\t//Note: We do this early to avoid race conditions if and when the\n\t\t\t\t//gateway send the cancel webhook after cancelling the subscription.\t\t\t\t\n\t\t\t\t$sqlQuery = $wpdb->prepare(\n\t\t\t\t\t\"UPDATE $wpdb->pmpro_membership_orders \n\t\t\t\t\t\tSET `status` = 'cancelled' \n\t\t\t\t\t\tWHERE user_id = %d \n\t\t\t\t\t\t\tAND membership_id = %d \n\t\t\t\t\t\t\tAND gateway = %s \n\t\t\t\t\t\t\tAND gateway_environment = %s \n\t\t\t\t\t\t\tAND subscription_transaction_id = %s \n\t\t\t\t\t\t\tAND `status` IN('success', '') \",\t\t\t\t\t\n\t\t\t\t\t$this->user_id,\n\t\t\t\t\t$this->membership_id,\n\t\t\t\t\t$this->gateway,\n\t\t\t\t\t$this->gateway_environment,\n\t\t\t\t\t$this->subscription_transaction_id\n\t\t\t\t);\t\t\t\t\t\t\t\t\n\t\t\t\t$wpdb->query($sqlQuery);\n\t\t\t\t\n\t\t\t\t//cancel the gateway subscription first\n\t\t\t\tif (is_object($this->Gateway)) {\n\t\t\t\t\t$result = $this->Gateway->cancel( $this );\n\t\t\t\t} else {\n\t\t\t\t\t$result = false;\n\t\t\t\t}\n\n\t\t\t\tif($result == false) {\n\t\t\t\t\t//there was an error, but cancel the order no matter what\n\t\t\t\t\t$this->updateStatus(\"cancelled\");\n\n\t\t\t\t\t//we should probably notify the admin\n\t\t\t\t\t$pmproemail = new PMProEmail();\n\t\t\t\t\t$pmproemail->template = \"subscription_cancel_error\";\n\t\t\t\t\t$pmproemail->data = array(\"body\"=>\"<p>\" . sprintf(__(\"There was an error canceling the subscription for user with ID=%s. You will want to check your payment gateway to see if their subscription is still active.\", 'paid-memberships-pro' ), strval($this->user_id)) . \"</p><p>Error: \" . $this->error . \"</p>\");\n\t\t\t\t\t$pmproemail->data[\"body\"] .= '<p>' . __('User Email', 'paid-memberships-pro') . ': ' . $order_user->user_email . '</p>';\n\t\t\t\t\t$pmproemail->data[\"body\"] .= '<p>' . __('User Display Name', 'paid-memberships-pro') . ': ' . $order_user->display_name . '</p>';\n\t\t\t\t\t$pmproemail->data[\"body\"] .= '<p>' . __('Order', 'paid-memberships-pro') . ': ' . $this->code . '</p>';\n\t\t\t\t\t$pmproemail->data[\"body\"] .= '<p>' . __('Gateway', 'paid-memberships-pro') . ': ' . $this->gateway . '</p>';\n\t\t\t\t\t$pmproemail->data[\"body\"] .= '<p>' . __('Subscription Transaction ID', 'paid-memberships-pro') . ': ' . $this->subscription_transaction_id . '</p>';\n\t\t\t\t\t$pmproemail->sendEmail(get_bloginfo(\"admin_email\"));\n\t\t\t\t} else {\n\t\t\t\t\t//Note: status would have been set to cancelled by the gateway class. So we don't have to update it here.\n\n\t\t\t\t\t//remove billing numbers in pmpro_memberships_users if the membership is still active\t\t\t\t\t\n\t\t\t\t\t$sqlQuery = \"UPDATE $wpdb->pmpro_memberships_users SET initial_payment = 0, billing_amount = 0, cycle_number = 0 WHERE user_id = '\" . $this->user_id . \"' AND membership_id = '\" . $this->membership_id . \"' AND status = 'active'\";\n\t\t\t\t\t$wpdb->query($sqlQuery);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t}", "function ciniki_tenants_subscriptionCancel($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 )); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n $args = $rc['args'];\n \n // \n // Make sure this module is activated, and\n // check permission to run this function for this tenant\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'checkAccess');\n $rc = ciniki_tenants_checkAccess($ciniki, $args['tnid'], 'ciniki.tenants.subscriptionCancel'); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbAddModuleHistory');\n //\n // Get the billing information from the subscription table\n //\n $strsql = \"SELECT id, status, currency, paypal_subscr_id, paypal_payer_email, paypal_payer_id, paypal_amount, \"\n . \"stripe_customer_id, stripe_subscription_id \"\n . \"FROM ciniki_tenant_subscriptions \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"\";\n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQuery');\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.tenants', 'subscription');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['subscription']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.tenants.64', 'msg'=>'No active subscriptions'));\n } \n $subscription = $rc['subscription'];\n\n //\n // Cancel a stripe subscription\n //\n if( $subscription['stripe_customer_id'] != '' && $subscription['stripe_subscription_id'] != '' ) {\n require_once($ciniki['config']['ciniki.core']['lib_dir'] . '/Stripe/init.php');\n \\Stripe\\Stripe::setApiKey($ciniki['config']['ciniki.tenants']['stripe.secret']);\n\n //\n // Issue the stripe customer create\n //\n try {\n $sub = \\Stripe\\Subscription::retrieve($subscription['stripe_subscription_id']);\n $sub->cancel();\n } catch( Exception $e) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.tenants.65', 'msg'=>'Unable to cancel subscription. Please contact us for help.'));\n }\n\n //\n // If active subscription, then update at paypal will be required\n //\n if( $subscription['status'] < 60 ) {\n $strsql = \"UPDATE ciniki_tenant_subscriptions \"\n . \"SET status = 60 \"\n . \"WHERE id = '\" . ciniki_core_dbQuote($ciniki, $subscription['id']) . \"' \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbUpdate');\n $rc = ciniki_core_dbUpdate($ciniki, $strsql, 'ciniki.tenants');\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.tenants.66', 'msg'=>'Unable to cancel subscription', 'err'=>$rc['err']));\n }\n ciniki_core_dbAddModuleHistory($ciniki, 'ciniki.tenants', 'ciniki_tenant_history', $args['tnid'], \n 2, 'ciniki_tenant_subscriptions', $subscription['id'], 'status', '61');\n return $rc;\n }\n }\n\n //\n // Cancel a paypal subscription\n //\n elseif( $subscription['paypal_subscr_id'] != '' ) {\n // \n // Send cancel to paypal\n //\n $paypal_args = 'PROFILEID=' . $subscription['paypal_subscr_id'] . '&ACTION=Cancel&Note=' . urlencode('Cancel requested by ' . $ciniki['session']['user']['email']);\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'paypalPost');\n $rc = ciniki_core_paypalPost($ciniki, 'ManageRecurringPaymentsProfileStatus', $paypal_args);\n if( $rc['stat'] !='ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.tenants.67', 'msg'=>'Unable to process cancellation, please try again or contact support', 'err'=>$rc['err']));\n }\n\n //\n // If active subscription, then update at paypal will be required\n //\n if( $subscription['status'] < 60 ) {\n $strsql = \"UPDATE ciniki_tenant_subscriptions \"\n . \"SET status = 61 \"\n . \"WHERE id = '\" . ciniki_core_dbQuote($ciniki, $subscription['id']) . \"' \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbUpdate');\n $rc = ciniki_core_dbUpdate($ciniki, $strsql, 'ciniki.tenants');\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.tenants.68', 'msg'=>'Unable to cancel subscription', 'err'=>$rc['err']));\n }\n ciniki_core_dbAddModuleHistory($ciniki, 'ciniki.tenants', 'ciniki_tenant_history', $args['tnid'], \n 2, 'ciniki_tenant_subscriptions', $subscription['id'], 'status', '61');\n return $rc;\n }\n } \n\n\n return array('stat'=>'ok');\n}", "public function actionPaypalCancel($payment_id) {\n /*Do what you want*/ \n }", "public function cancelsubscription($data)\n\t{\n\t\t$subid = $data['0'];\n\t\t$id = $data['1'];\n\t\t$gateway = $data['2'];\n\t\t$ad_id = $data['3'];\n\t\t$db = JFactory::getDBO();\n\n\t\tif ($subid)\n\t\t{\n\t\t\trequire_once dirname(__FILE__) . '/authorizenet/lib/AuthorizeNet.php';\n\t\t\t$auth_net_login_id = $this->params->get('login_id', '1');\n\t\t\t$auth_net_tran_key = $this->params->get('tran_key', '1');\n\n\t\t\t$plgPaymentAuthorizenetHelper = new plgPaymentAuthorizenetHelper;\n\t\t\t$auth_net_url = $plgPaymentAuthorizenetHelper->buildAuthorizenetUrl();\n\t\t\tdefine(\"AUTHORIZENET_API_LOGIN_ID\", $auth_net_login_id);\n\t\t\tdefine(\"AUTHORIZENET_TRANSACTION_KEY\", $auth_net_tran_key);\n\n\t\t\t$refId = $id;\n\n\t\t\t// Cancel the subscription.\n\t\t\t$cancellation = new AuthorizeNetARB;\n\t\t\t$cancellation->setRefId($refId);\n\t\t\t$response = $cancellation->cancelSubscription($subid);\n\n\t\t\tif ($response->xml->messages->resultCode != 'Ok')\n\t\t\t{\n\t\t\t\t$payment_status = \"P\";\n\t\t\t\t$error = JText::_('AUTH_SUB_CANCEL_FAIL') . $response->xml->messages->message->text;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$payment_status = \"C\";\n\t\t\t\t$success = JText::_('AUTH_SUB_CANCEL_SUCCESS');\n\t\t\t\t$paymentdata = new stdClass;\n\t\t\t}\n\n\t\t\t$result = array(\n\n\t\t\t\t'transaction_id' => $refId,\n\t\t\t\t'subscription_id' => $subid,\n\t\t\t\t'order_id' => $data['order_id'],\n\t\t\t\t'status' => $payment_status,\n\t\t\t\t'total_paid_amt' => $data['amount'],\n\t\t\t\t'raw_data' => $response,\n\t\t\t\t'payment_type' => 'recurring',\n\t\t\t\t'error' => $error,\n\t\t\t\t'success' => $success,\n\t\t\t\t'return' => $data['return']\n\t\t\t);\n\n\t\t\treturn $result;\n\t\t}\n\t}", "public function cancelMyReserved($id);", "function cancelExistingSubscription(string $id){\nreturn $this->delete(\"/subscription/{$id}\");\n}", "public static function billingCanceled($callback)\n {\n static::listenForSubscriptionEvents();\n static::registerModelEvent('billingCanceled', $callback);\n }", "function paypal_cancel()\n {\n $payment_id = $this->session->userdata('payment_id');\n $this->db->where('package_payment_id', $payment_id);\n $this->db->delete('package_payment');\n recache();\n $this->session->set_userdata('payment_id', '');\n $this->session->set_flashdata('alert', 'paypal_cancel');\n redirect(base_url() . 'home/plans', 'refresh');\n }", "function cancel() {\n if($this->request->isAsyncCall()) {\n if($this->active_invoice->isLoaded()) {\n if($this->active_invoice->canCancel($this->logged_user)) {\n if($this->request->isSubmitted()) {\n try {\n $this->active_invoice->markAsCanceled($this->logged_user);\n \n $issued_to_user = $this->active_invoice->getIssuedTo();\n if ($issued_to_user instanceof User && Invoices::getNotifyClientAboutCanceledInvoice()) {\n $notify_users = array($issued_to_user);\n \t if ($issued_to_user->getId() != $this->logged_user->getId()) {\n \t $notify_users[] = $this->logged_user;\n \t } // if\n\n AngieApplication::notifications()\n ->notifyAbout('invoicing/invoice_canceled', $this->active_invoice, $this->logged_user)\n ->sendToUsers($notify_users);\n } // if\n \n \t\t\t\t\t\t$this->response->respondWithData($this->active_invoice, array(\n \t \t'as' => 'invoice', \n \t 'detailed' => true,\n \t ));\n } catch (Error $e) {\n \t$this->response->exception($e);\n } // try\n } // if\n } else {\n $this->response->forbidden();\n } // if\n } else {\n $this->response->notFound();\n } // if\n } else {\n $this->response->badRequest();\n } // if\n }", "function cancelSubscriptionAPI($subscriptionid, $userid, $relid) {\n\t$urlsubscriptionid = urlencode($subscriptionid);\n\t$nvpStr=\"ProfileID=$urlsubscriptionid&Action=Cancel&Note=Automated+cancellation.\";\n\t$httpParsedResponseAr = paypalCURLL('ManageRecurringPaymentsProfileStatus', $nvpStr);\n\tif(\"SUCCESS\" == strtoupper($httpParsedResponseAr[\"ACK\"]) || \"SUCCESSWITHWARNING\" == strtoupper($httpParsedResponseAr[\"ACK\"])) {\n\n\t\t//remove subcription id\n\t\t$update_qry = \"UPDATE tblhosting SET subscriptionid = '' WHERE id = $relid\";\n\n\t\ttry {\n\t\t $status = mysql_query($update_qry);\n\t\t if(!$status) {\n\t\t\t $error = mysql_error();\n\t\t\t\tthrow new Exception('Update subscriptionid to null is not successful :'.$error);\n\t\t }\n\t\t} catch (Exception $e) {\n\t\t echo 'Caught exception: ', $e->getMessage(), \"\\n\";\n\t\t}\n\t\t// Log success to WHMCS activity log\n\t\tlogactivity(\"MYWORKS DEBUG: Successfully terminated Paypal Subscription ID: $subscriptionid attached to Service ID: $relid and User ID: $userid\");\n\t} \n\telse {\n\t\t// Build failure message\n\t\tforeach ($httpParsedResponseAr as $key => $value) {\n\t\t\t$message .= \"Key: $key - Value: $value. \";\n\t\t}\n\t\t// Log failure to WHMCS activity log\n\t\tlogactivity(\"MYWORKS DEBUG: Failed to terminate Paypal Subscription ID: $subscriptionid attached to Service ID: $relid and User ID: $userid. Response was $message.\");\n\t}\n}", "public function cancel(Token $token): Payment;", "public function cancel()\n {\n dd('Your payment is canceled. You can create cancel page here.');\n }", "function auto_cancel($subscription_id)\n\t{\n\t\treturn NULL;\n\t}", "public function cancelOrdersInPending()\n {\n //Etape 1 : on recupere pour chaque comptes le nombre de jours pour l'annulation\n $col = Mage::getModel('be2bill/merchandconfigurationaccount')->getCollection();\n $tabLimitedTime = array();\n foreach ($col as $obj) {\n $tabLimitedTime[$obj->getData('id_b2b_merchand_configuration_account')] = $obj->getData('order_canceled_limited_time') != null ? $obj->getData('order_canceled_limited_time') : 0;\n }\n\n //Etape 2\n $collection = Mage::getResourceModel('sales/order_collection')\n ->addFieldToFilter('main_table.state', Mage_Sales_Model_Order::STATE_NEW)\n ->addFieldToFilter('op.method', 'be2bill');\n $select = $collection->getSelect();\n $select->joinLeft(array(\n 'op' => Mage::getModel('sales/order_payment')->getResource()->getTable('sales/order_payment')), 'op.parent_id = main_table.entity_id', array('method', 'additional_information')\n );\n\n Mage::log((string)$collection->getSelect(), Zend_Log::DEBUG, \"debug_clean_pending.log\");\n\n // @var $order Mage_Sales_Model_Order\n foreach ($collection as $order) {\n $addInfo = unserialize($order->getData('additional_information'));\n $accountId = $addInfo['account_id'];\n $limitedTime = (int)$tabLimitedTime[$accountId];\n\n if ($limitedTime <= 0) {\n continue;\n }\n\n $store = Mage::app()->getStore($order->getStoreId());\n $currentStoreDate = Mage::app()->getLocale()->storeDate($store, null, true);\n $createdAtStoreDate = Mage::app()->getLocale()->storeDate($store, strtotime($order->getCreatedAt()), true);\n\n $difference = $currentStoreDate->sub($createdAtStoreDate);\n\n $measure = new Zend_Measure_Time($difference->toValue(), Zend_Measure_Time::SECOND);\n $measure->convertTo(Zend_Measure_Time::MINUTE);\n\n if ($limitedTime < $measure->getValue() && $order->canCancel()) {\n try {\n $order->cancel();\n $order->addStatusToHistory($order->getStatus(),\n // keep order status/state\n Mage::helper('be2bill')->__(\"Commande annulée automatique par le cron car la commande est en 'attente' depuis %d minutes\", $limitedTime));\n $order->save();\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }\n }\n\n return $this;\n }", "public function cancelAndRefund(Plan $plan, $price = 0)\n {\n // If there is a user on subscription\n if ($user = $this->user) {\n // Get left amount after coupon and subscription discount\n $subscriptionDiscount = $this->onTrial() ? 0 : $this->balanceLeft;\n $leftAmount = $subscriptionDiscount - $price;\n\n // If there is left some difference, add to previous user's balance and get the price after these all\n if ($leftAmount > 0) {\n $user->balance = $user->balance + $leftAmount;\n $user->save();\n $price = 0;\n } else {\n $price = 0 - $leftAmount;\n }\n\n // If previous user is the current user, update current user's balance\n if ($plan->user->id == $user->id) {\n $plan->user->balance = $user->balance;\n }\n }\n\n // Deactivate previous subscription's package if it is not the same as plan's one\n if ($this->package->id != $plan->package->id) {\n $this->package->deactivate($plan->host);\n }\n\n return $price;\n }", "function __cancel_purchase($id) {\n\t\treturn $this -> db -> query('update purchase_order_tab set pstatus=0 where pid=' . $id);\n\t}", "public function cancel()\n {\n session()->flash('warning', trans('saassubscription::app.super-user.plans.payment-cancel'));\n\n return redirect()->route($this->_config['redirect']);\n }", "function it_exchange_authorizenet_addon_cancel_subscription( $details ) {\n\n\tif ( empty( $details['subscription'] ) || ! $details['subscription'] instanceof IT_Exchange_Subscription ) {\n\t\treturn;\n\t}\n\n\tif ( ! $details['subscription']->get_subscriber_id() ) {\n\t\treturn;\n\t}\n\n\t$settings = it_exchange_get_option( 'addon_authorizenet' );\n\n\t$api_url = ! empty( $settings['authorizenet-sandbox-mode'] ) ? AUTHORIZE_NET_AIM_API_SANDBOX_URL : AUTHORIZE_NET_AIM_API_LIVE_URL;\n\t$api_username = ! empty( $settings['authorizenet-sandbox-mode'] ) ? $settings['authorizenet-sandbox-api-login-id'] : $settings['authorizenet-api-login-id'];\n\t$api_password = ! empty( $settings['authorizenet-sandbox-mode'] ) ? $settings['authorizenet-sandbox-transaction-key'] : $settings['authorizenet-transaction-key'];\n\n\t$request = array(\n\t\t'ARBCancelSubscriptionRequest' => array(\n\t\t\t'merchantAuthentication' => array(\n\t\t\t\t'name'\t\t\t => $api_username,\n\t\t\t\t'transactionKey' => $api_password,\n\t\t\t),\n\t\t\t'subscriptionId' => $details['subscription']->get_subscriber_id()\n\t\t),\n\t);\n\n\t$query = array(\n\t\t'headers' => array(\n\t\t\t'Content-Type' => 'application/json',\n\t\t),\n\t\t'body' => json_encode( $request ),\n\t);\n\n\t$response = wp_remote_post( $api_url, $query );\n\n\tif ( ! is_wp_error( $response ) ) {\n\t\t$body = preg_replace('/\\xEF\\xBB\\xBF/', '', $response['body']);\n\t\t$obj = json_decode( $body, true );\n\n\t\tif ( isset( $obj['messages'] ) && isset( $obj['messages']['resultCode'] ) && $obj['messages']['resultCode'] == 'Error' ) {\n\t\t\tif ( ! empty( $obj['messages']['message'] ) ) {\n\t\t\t\t$error = reset( $obj['messages']['message'] );\n\t\t\t\tit_exchange_add_message( 'error', $error['text'] );\n\t\t\t}\n\t\t}\n\t} else {\n\t\tthrow new Exception( $response->get_error_message() );\n\t}\n}", "public function cancelPayDebt($id, $clientId){\n\t\t\t$this->pd->history_cancelDebt($id);\n\t\t\t$this->pd->clients_setDebtHold($clientId, false);\n\t\t}", "public function cancel_booking_payment()\n\t{\n\t\tif ($this->checkLogin('A') == ''){\n\t\t\tredirect('admin');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->data['heading'] = 'Rental Cancellation Payments';\n\t\t\t$condition = array('cancelled','Yes');\n\t\t\t$CustomerDetails = $this->product_model->get_all_cancelled_users();\n\t\t\t\n\t\t\t\n\t\t\tforeach($CustomerDetails->result() as $customer)\n\t\t\t{\n $booking_no = $customer->Bookingno;\n\t\t\t\t$cancel[] = $this->product_model->get_all_commission_tracking_user($booking_no);\n\t\t\t\t//$this->data['paypalData'][$HostEmail] = $customer->paypal_email;\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\t$this->data['trackingDetails'] = $cancel;\n\t\t\t// echo \"<pre>\";\n\t\t\t// print_r($this->data['trackingDetails']); exit;\n\t\t\t$this->load->view('admin/dispute/display_cancel_payment_lists',$this->data);\n\t\t}\n\t}", "function cancelSubscription($userid) {\n\tif(!$userid) {\n\t\treturn false;\n\t}\n\t// Check if we have a subscription ID entered in WHMCS:\n\t$q = \"SELECT id AS relid, subscriptionid FROM tblhosting WHERE userid = {$userid} AND subscriptionid != '' AND paymentmethod = 'paypal'\";\n\t$r = mysql_query($q) or die(\"Error in query \" . mysql_error());\n\t// If we do, cancel it in PayPal:\n\tif (mysql_num_rows($r) > 0) {\n\n\t\twhile($row = mysql_fetch_assoc($r)) {\n\t\t\t$subscriptionid = $row['subscriptionid']; \n\t\t\t$relid = $row['relid'];\n\t\t\t// Do PayPal Cancellation\n\t\t\tcancelSubscriptionAPI($subscriptionid, $userid, $relid);\n\t\t}\n\t}\n\telse {\n\t\tlogactivity(\"MYWORKS DEBUG: No PayPal Subscription ID detected for this service - not attempting to cancel.\");\n\t}\n}", "private function merchantPageCancel()\n {\n $cart = $this->context->cart;\n\n $customer = new Customer($cart->id_customer);\n\n if (!Validate::isLoadedObject($customer) || !isset($this->module->currentOrder)) {\n $error_message = $this->module->l('You have cancelled the payment, please try again.');\n\n $id_order = $this->module->currentOrder;\n if (! $id_order || null == $id_order || empty($id_order)) {\n $id_order = Context::getContext()->cookie->__get('aps_apple_order_id');\n $this->aps_payment->refillCart($id_order);\n $this->aps_helper->log('refill cart and merchantPageCancel called');\n }\n Context::getContext()->cookie->apsErrors = $error_message;\n Tools::redirect('index.php?controller=order&step=1');\n }\n $this->aps_payment->merchantPageCancel();\n $objOrder = new Order($this->module->currentOrder);\n if ($objOrder) {\n $this->aps_payment->refillCart($objOrder->id);\n $error_message = $this->module->l('You have cancelled the payment, please try again.');\n Context::getContext()->cookie->apsErrors = $error_message;\n $this->aps_helper->log('merchantPageCancel called');\n\n Tools::redirect('index.php?controller=order&step=1');\n } else {\n $error_message = $this->module->l('You have cancelled the payment, please try again.');\n Context::getContext()->cookie->__set('aps_error_msg', $error_message);\n Tools::redirect(\n 'index.php?fc=module&module=amazonpaymentservices&controller=error&action=displayError'\n );\n }\n }", "function cancel(&$order) {\n\t\t\t$order->updateStatus(\"cancelled\");\n\n\t\t\t// If we're processing an IPN request for this subscription, it's already cancelled at PayPal\n\t\t\tif( !empty( $_POST['subscr_id'] ) && $_POST['subscr_id'] == $order->subscription_transaction_id ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// Build the nvp string for PayPal API\n\t\t\t$nvpStr = \"\";\n\t\t\t$nvpStr .= \"&PROFILEID=\" . urlencode($order->subscription_transaction_id) . \"&ACTION=Cancel&NOTE=\" . urlencode(\"User requested cancel.\");\n\n\t\t\t$nvpStr = apply_filters(\"pmpro_manage_recurring_payments_profile_status_nvpstr\", $nvpStr, $order);\n\n\t\t\t$this->httpParsedResponseAr = $this->PPHttpPost('ManageRecurringPaymentsProfileStatus', $nvpStr);\n\n\t\t\tif(\"SUCCESS\" == strtoupper($this->httpParsedResponseAr[\"ACK\"]) || \"SUCCESSWITHWARNING\" == strtoupper($this->httpParsedResponseAr[\"ACK\"])) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\t$order->status = \"error\";\n\t\t\t\t$order->errorcode = $this->httpParsedResponseAr['L_ERRORCODE0'];\n\t\t\t\t$order->error = urldecode($this->httpParsedResponseAr['L_LONGMESSAGE0']) . \". \" . __(\"Please contact the site owner or cancel your subscription from within PayPal to make sure you are not charged going forward.\", 'paid-memberships-pro' );\n\t\t\t\t$order->shorterror = urldecode($this->httpParsedResponseAr['L_SHORTMESSAGE0']);\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public function cancel_membership() {\n \t$membership_id = $this->uri->segment(3);\n\n \t$data = [\n \t\t'id' => $membership_id,\n \t\t'status' => 'Cancelled'\n \t];\n\n \t$this->Member_Model->update_membership($data);\n\n \tredirect('members/list/active');\n }", "function cancelPending() {\n\t\tself::$_db->saveQry(\"SELECT `ID` FROM `#_reservations` \".\n\t\t\t\t\"WHERE (`status` = 'pending' OR `status` = 'prefered') \".\n\t\t\t\t\"AND ? >= `startTime` \",\n\t\t\t\tCalendar::startCancel());\n\t\t\n\n\t\twhile($res = self::$_db->fetch_assoc())\n\t\t\tReservation::load($res['ID'])->failed();\n\t\t\n\t\t\n\t\t// TagesEnde - BuchungsCancelZeit ist kleiner als Aktueller Zeitblock\n\t\tif(Calendar::calculateTomorrow()) {\n\t\t\t$opening = Calendar::opening(date('Y-m-d', strtotime(\"tomorrow\")));\n\t\t\tself::$_db->saveQry(\"SELECT * FROM `#_reservations` \".\n\t\t\t\t\t\"WHERE (`status` = 'pending' OR `status` = 'prefered') \".\n\t\t\t\t\t\"AND ? <= `startTime` AND `startTime` <= ? \",\n\t\t\t\t\t$opening->format(\"Y-m-d H:i\"), \n\t\t\t\t\tCalendar::startCancel($opening));\n\t\t\t\n\t\t\twhile($res = self::$_db->fetch_assoc())\n\t\t\t\tReservation::load($res['ID'])->failed();\n\t\t}\n\t\t\n\t}", "public function paypal_cancel() {\n\t\t\t// on va donc chercher son adresse mail\n\t\t\t$user = $this->User->find('first', array(\n\t\t\t\t'conditions'=>array('id'=>$this->Auth->user('id')),\n\t\t\t\t'fields'=>array('mail')\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t// et on lui envoie le mail de confirmation pour son annulation\n\t\t\tApp::uses('CakeEmail', 'Network/Email');\n\t\t\t$email = new CakeEmail('gmail');\n\t\t\t$email->to($user['User']['mail']) // à qui ? $this->Auth->user('mail')\n\t\t\t\t ->from(Configure::read('Site_Contact.mail')) // par qui ?\n\t\t\t\t ->subject('Votre demande a été annulée') // sujet du mail\n\t\t\t\t ->emailFormat('html') // le format à utiliser\n\t\t\t\t ->template('paypal_cancel') // le template à utiliser\n\t\t\t\t ->send(); // envoi du mail\n\n\t\t\t$this->Session->setFlash(__(\"Votre demande a été annulée\"), 'success');\n\t\t\t$this->redirect(array('controller'=>'posts', 'action'=>'index'));\n\t\t}", "public function cancelOrderReference($requestParameters = array());", "function woocommerce_stripe_cancel_payment( $order_id ) {\n\t\t$order = new WC_Order( $order_id );\n\n\t\tif ( $order->payment_method == 'stripe' ) {\n\t\t\t$charge = get_post_meta( $order_id, '_stripe_charge_id', true );\n\n\t\t\tif ( $charge ) {\n\t\t\t\t$stripe = new WC_Gateway_Stripe();\n\n\t\t\t\t$result = $stripe->stripe_request( array(\n\t\t\t\t\t'amount' => $order->order_total * 100\n\t\t\t\t), 'charges/' . $charge . '/refund' );\n\n\t\t\t\tif ( is_wp_error( $result ) ) {\n\t\t\t\t\t$order->add_order_note( __( 'Unable to refund charge!', 'wc_stripe' ) . ' ' . $result->get_error_message() );\n\t\t\t\t} else {\n\t\t\t\t\t$order->add_order_note( sprintf( __('Stripe charge refunded (Charge ID: %s)', 'wc_stripe' ), $result->id ) );\n\t\t\t\t\tdelete_post_meta( $order->id, '_stripe_charge_captured' );\n\t\t\t\t\tdelete_post_meta( $order->id, '_stripe_charge_id' );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function unsubscribe()\n {\n echo \"<br>\";\n echo \"Action: Cancelling Subscription !\";\n unset($this->plan);\n unset($this->server);\n unset($this->serverList);\n\n }", "public function declineSingle(){\n\t\tif(isset($_SESSION['admin_email'])){\n\t\t$this->model(\"AdminApproveModel\");\n\t\tif(isset($_POST['admin_decline'])){\n\t\t\t$this->sanitizeString($_POST['admin_decline']);\n\t\t\t$id = $this->sanitizeString($_POST['id']);\n\t\t\tAdminApproveModel::where('id', $id)->delete();\n\t\t}\n\t}\n\n\t}", "public function cancelAction()\n {\n $event = Mage::getModel('payanyway/event')\n ->setEventData($this->getRequest()->getParams());\n $message = $event->cancelEvent();\n\n // set quote to active\n $session = $this->_getCheckout();\n if ($quoteId = $session->getPayanywayQuoteId()) {\n $quote = Mage::getModel('sales/quote')->load($quoteId);\n if ($quote->getId()) {\n $quote->setIsActive(true)->save();\n $session->setQuoteId($quoteId);\n }\n }\n $session->addError($message);\n $this->_redirect('checkout/cart');\n }", "public function actionUnsubscribe(){\n $perfil = \\app\\models\\PerfilUsuario::find()->where(['fk_usuario'=>Yii::$app->user->id])->one();\n $igualas_user_viejo = \\app\\models\\IgualasUsers::find()->where(['fk_users_cliente'=>$perfil->id, 'estatus'=>'concretado'])->one();\n if ($igualas_user_viejo){\n $plan_viejo = \\app\\models\\Igualas::find()->where(['id'=>$igualas_user_viejo->fk_iguala])->one();\n try {\n $agreement_viejo = paypalSuspendPlanToUser($igualas_user_viejo->subscription_id);\n }catch(\\Exception $e){\n Yii::$app->getSession()->setFlash('danger',$e->getMessage());\n return $this->redirect(['update', 'id' => Yii::$app->user->id]);\n }\n // $igualas_user_viejo->delete();\n if ($agreement_viejo){\n $igualas_user_viejo->estatus = \"cancelado\";\n $igualas_user_viejo->save();\n Yii::$app->session->setFlash('success', 'Usted ha cancelado la subscripción correctamente.');\n }\n else{\n Yii::$app->session->setFlash('error', 'Problemas al cancelar la subscripción');\n }\n }\n return $this->redirect(['update', 'id' => Yii::$app->user->id]);\n }", "protected function cancelPayments()\n {\n $i = 0;\n $sql = \"SELECT `vendorTxCode` FROM payment WHERE status = ? AND \" .\n \"((cardType='MAESTRO' AND created <= ?) OR created <= ?)\";\n $params = array(SAGEPAY_REMOTE_STATUS_AUTHENTICATED, date('Y-m-d H:i:s', strtotime('-30 days')), date('Y-m-d H:i:s',\n strtotime('-90 days')));\n $cancelStatus = array('Status' => SAGEPAY_REMOTE_STATUS_CANCELLED);\n\n $payment = new ModelPayment();\n $paymentStm = $this->dbHelper->execute($sql, $params);\n if (!$paymentStm)\n {\n exit('Invalid query');\n }\n $payments = $paymentStm->fetchAll(PDO::FETCH_ASSOC);\n foreach ($payments as $row)\n {\n if ($payment->update($row['vendorTxCode'], $cancelStatus))\n {\n $i++;\n }\n }\n printf('Updated %d payments', $i);\n }", "function cancelOrder($sourceAccount, $orderId) {\n\techo \"Canceling Order: \" . $orderId . \" from: \" . $sourceAccount . \"</br>\";\n\t$response = putRequest('/api/order/' . $sourceAccount . '/' . $orderId . '/cancel');\n\tprintInfo($response);\n}", "public function actionCancel() {\n $token = trim($_GET['token']);\n// $payerId = trim($_GET['PayerID']);\n $criteria = new CDbCriteria;\n $criteria->condition = 'token=:Tokenw';\n $criteria->params = array(':Tokenw' => $token);\n $orders = Orders::model()->find($criteria);\n if ($orders->status_id == '4') {\n $orders->status_id = '2';\n $orders->save();\n// need to clear cart\n//Yii::app()->shoppingCart->clear();\n }\n $this->render('cancel');\n }", "function remove_creditcard($ccid = 0, $userid = 0)\n {\n global $ilance, $ilconfig, $ilpage, $phrase;\n $ilance->db->query(\"\n DELETE FROM \" . DB_PREFIX . \"creditcards\n WHERE cc_id = '\" . intval($ccid) . \"'\n AND user_id = '\" . intval($userid) . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n // change paymethod to online account\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"subscription_user\n SET paymethod = 'account'\n WHERE user_id = '\" . intval($userid) . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $ilance->email->mail = fetch_user('email', intval($userid));\n $ilance->email->slng = fetch_user_slng(intval($userid));\n\t\t$ilance->email->get('member_removed_creditcard');\t\t\n\t\t$ilance->email->set(array(\n\t\t\t'{{member}}' => fetch_user('username', intval($userid)),\n\t\t));\n\t\t$ilance->email->send();\n return true;\n }", "function TestCase_unlink_plan($case_id, $plan_id) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestCase.unlink_plan', array(new xmlrpcval($case_id, \"int\"), new xmlrpcval($plan_id, \"int\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}", "function cancelCampaign ($id) {\n\t\treturn $this->gateway->execCommad('cancelCampaign',array('id' => $id));\n\t}", "function _cancel($info)\n\t{\n\t // Gan trang thai xac thuc\n\t $data = array();\n\t $data['status'] = mod('order')->status('canceled');\n\t\n\t // Cap nhat du lieu vao data\n\t model('user_bank')->update($info->id, $data);\n\t // Gui thong bao\n\t set_message(lang('notice_update_success'));\n\t return TRUE;\n\t}", "function cancel_booking_approve($id)\n {\n $useremail = $this->userinfo_by_bookingid($id);\n $this->emails_model->booking_approve_cancellation_email($useremail);\n $this->cancel_booking($id);\n // $this->delete_booking($id);\n }", "public function payment_status_canceled_reversal()\n {\n do_action(\n 'wc_paypal_plus__ipn_payment_update',\n 'canceled_reversal',\n $this->settingRepository\n );\n }", "protected function _processTransactionSubscriptionCanceled($parameters) {\n\t\t\t$subscriptionData = array(\n\t\t\t\tarray(\n\t\t\t\t\t'created' => $parameters['transaction_date'],\n\t\t\t\t\t'id' => $parameters['subscription_id'],\n\t\t\t\t\t'invoice_id' => $parameters['invoice_id'],\n\t\t\t\t\t'interval_type' => $parameters['interval_type'],\n\t\t\t\t\t'interval_value' => $parameters['interval_value'],\n\t\t\t\t\t'payment_method_id' => $parameters['payment_method_id'],\n\t\t\t\t\t'plan_id' => $parameters['plan_id'],\n\t\t\t\t\t'price' => $parameters['payment_amount'],\n\t\t\t\t\t'status' => 'canceled',\n\t\t\t\t\t'user_id' => $parameters['user_id']\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tif (\n\t\t\t\t!empty($parameters['user']) &&\n\t\t\t\t$this->save('subscriptions', $subscriptionData)\n\t\t\t) {\n\t\t\t\t$paymentMethod = $this->fetch('payment_methods', array(\n\t\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t'id' => $subscriptionData[0]['payment_method_id']\n\t\t\t\t\t),\n\t\t\t\t\t'fields' => array(\n\t\t\t\t\t\t'name'\n\t\t\t\t\t)\n\t\t\t\t));\n\n\t\t\t\tif (!empty($paymentMethod['count'])) {\n\t\t\t\t\t$subscriptionData[0]['payment_method_name'] = $paymentMethod['data'][0];\n\t\t\t\t\t$mailParameters = array(\n\t\t\t\t\t\t'from' => $this->settings['from_email'],\n\t\t\t\t\t\t'subject' => 'Subscription #' . $subscriptionData[0]['id'] . ' canceled',\n\t\t\t\t\t\t'template' => array(\n\t\t\t\t\t\t\t'name' => 'subscription_canceled',\n\t\t\t\t\t\t\t'parameters' => array(\n\t\t\t\t\t\t\t\t'subscription' => $subscriptionData[0],\n\t\t\t\t\t\t\t\t'transaction' => $parameters,\n\t\t\t\t\t\t\t\t'user' => $parameters['user']\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'to' => $parameters['user']['email']\n\t\t\t\t\t);\n\t\t\t\t\t$this->_sendMail($mailParameters);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn;\n\t\t}", "public function cancelThis($id, $data) {\n $this->db->update('tbl_order', array('deliver' => 3, 'cancel_comments' => $data), array('id' => $id));\n }", "function make_cancel_button($purchase_id)\n\t{\n\t\treturn do_template('ECOM_CANCEL_BUTTON_VIA_PAYPAL',array('PURCHASE_ID'=>$purchase_id));\n\t}", "public function cancelorder($order,$rmaid){\n $flag = 0;\n if ($order->canCancel()) {\n $order->getPayment()->cancel();\n $flag = $this->mpregisterCancellation($order,$rmaid);\n }\n\n return $flag;\n }", "public function setCancelbycustomer($id){\n \t\t$rma = Mage::getModel(\"mprmasystem/rmarequest\")->load($id);\n \t\t$rma->setStatus(\"Cancelled\")->save();\n Mage::getModel(\"mprmasystem/rmamail\")->CancelRMAMailbycustomer($id);\n \t}", "public function cancel($reason)\n {\n $this->cancel_time = Format::timestamp2datetime(Format::timestamp());\n\n if ($this->state == self::STATE_COMPLETED) {\n $this->state = self::STATE_CANCELLED_AFTER_COMPLETE;\n } else {\n $this->state = self::STATE_CANCELLED;\n }\n\n if (!$reason) {\n $reason = (($this->state == self::STATE_CANCELLED_AFTER_COMPLETE) ?\n self::REASON_FUND_RETURNED : self::REASON_PROCESSING_EXECUTION_FAILED);\n }\n $this->reason = $reason;\n\n Log::log('transactions_payme', $this->id, 'Reason: '.$reason.PHP_EOL.\n ', State: '.$this->state , 'cancel');\n $this->update(['cancel_time', 'state', 'reason']);\n }", "function eve_api_subtask_cancel(&$form_state) {\n // Clear our ctools cache object. It's good housekeeping.\n eve_api_clear_page_cache('signup');\n}", "public function cancelAction() {\n $this->chekcingForMarketplaceSellerOrNot ();\n $orderId = $this->getRequest ()->getParam ( 'id' );\n $produtId = $this->getRequest ()->getParam ( 'item' );\n $sellerId = Mage::getSingleton ( 'customer/session' )->getId ();\n /**\n * Prepare product collection for cancel\n */\n $products = Mage::getModel ( 'marketplace/commission' )->getCollection ();\n $products->addFieldToSelect ( '*' );\n $products->addFieldToFilter ( 'seller_id', $sellerId );\n $products->addFieldToFilter ( 'order_id', $orderId );\n $products->addFieldToFilter ( 'product_id', $produtId );\n $collectionId = $products->getFirstItem ()->getId ();\n $orderStatusFlag = Mage::getStoreConfig ( 'marketplace/admin_approval_seller_registration/order_manage' );\n if (! empty ( $collectionId ) && $orderStatusFlag == 1) {\n try {\n $data = array (\n 'order_status' => 'canceled',\n 'customer_id' => 0,\n 'credited' => 1,\n 'item_order_status' => 'canceled'\n );\n $commissionModel = Mage::getModel ( 'marketplace/commission' )->load ( $collectionId )->addData ( $data );\n $commissionModel->setId ( $collectionId )->save ();\n\n /**\n * Load order details based on the order id.\n */\n $_order = Mage::getModel ( 'sales/order' )->load ( $orderId );\n /**\n * Update order items to cancel status\n */\n foreach ( $_order->getAllItems () as $item ) {\n if ($this->getRequest ()->getParam ( 'item' ) == $item->getId ()) {\n $item->cancel ();\n }\n }\n /**\n * Send cancel notification for admin\n */\n Mage::helper('marketplace/general')->sendCancelOrderAdminNotification($orderId,$produtId,$sellerId);\n\n Mage::helper('marketplace/general')->sendCancelOrderBuyerNotification($_order);\n /**\n * Redirect to order view page\n */\n Mage::getSingleton ( 'core/session' )->addSuccess ( $this->__ ( $this->__ ( 'The item has been cancelled.' ) ) );\n $this->_redirect ( 'marketplace/order/vieworder/orderid/' . $orderId );\n } catch ( Exception $e ) {\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( $e->getMessage () ) );\n $this->_redirect ( 'marketplace/order/vieworder/orderid/' . $orderId );\n }\n } else {\n /**\n * Return to order manage page\n */\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( 'You do not have permission to access this page' ) );\n $this->_redirect ( 'marketplace/order/manage' );\n return false;\n }\n }", "public function cancel_request() {\n\n $pending_request_exists = $this->micro_relation_exists($this->from, $this->to, \"P\");\n\n if($pending_request_exists) {\n $this->delete_relation(\"P\");\n }\n }", "public function cancel() : self\n {\n $subscription = $this->asStripeSubscription();\n $subscription->cancel_at_period_end = true;\n $subscription->save();\n\n $this->stripe_status = $subscription->status;\n\n // If the user was on trial, we will set the grace period to end when the trial\n // would have ended. Otherwise, we'll retrieve the end of the billing period\n // period and make that the end of the grace period for this current user.\n if ($this->onTrial()) {\n $this->ends_at = $this->trial_ends_at;\n } else {\n $this->ends_at = Carbon::createFromTimestamp(\n $subscription->current_period_end\n )->toDayDateTimeString();\n }\n\n $this->save();\n\n return $this;\n }", "public function cancelApproval(InvoiceInterface $invoice): void;", "public function cancelRequest(){\n //the other users Id\n $otherUserId = $_POST[\"otherUserId\"];\n //deletes the record in the database\n $this->individualGroupModel->cancelGroupRequestInvitation($otherUserId); \n //redirects\n $path = '/IndividualGroupController/individualGroup?groupId=' . $_SESSION['current_group']; \n redirect($path);\n }", "public function cancelGroupTransactionOrder()\n {\n if(\n isset($this->postData['brq_invoicenumber']) &&\n is_string($this->postData['brq_invoicenumber'])\n ) {\n $this->cancelOrder(\n $this->postData['brq_invoicenumber'],\n 'Inline giftcard order was canceled'\n );\n }\n }", "public function testPaymentSecupayCreditcardsCancelById()\n {\n try {\n $response = $this->api->cancelPaymentTransactionById('secupaycreditcards', self::$creditCardTransactionId, null);\n } catch (ApiException $e) {\n print_r($e->getResponseBody());\n throw $e;\n }\n\n $this->assertNotEmpty($response);\n $this->assertTrue($response['result']);\n $this->assertTrue($response['demo']);\n }", "public function cancel(Request $request)\n{\n// Get the payment token ID submitted by the form:\n $token = $_POST['stripeToken'];\n \n $customer = \\Stripe\\Customer::create([\n 'source' => $token,\n 'email' => '[email protected]',\n ]);\n $charge = \\Stripe\\Charge::create([\n 'amount' => 1000,\n 'currency' => 'usd',\n 'customer' => $customer->id,\n ]);\n print_r($charge);\n die;\n\n return redirect()->back()->with('message', 'Payment Successfully Updated.');\n \n\n\n\n}", "private function cancelOrder($order){\r\n $this->log('Cancelling order #'.$order->get_order_number());\r\n $this->addOrderNote($order, 'La orden fue cancelada por Flow');\r\n $order->update_status('cancelled');\r\n }", "public function annul(User $user, planuser $plan)\n {\n $plan->update(['plan_status_id' => PlanStatus::CANCELED]);\n\n if ($plan->postpone) {\n $plan->postpone->delete();\n }\n\n return redirect()->route('users.show', $user->id)\n ->with('success', 'Se canceló el plan correctamente');\n }", "public function cancelInvoice(Request $request, $uid)\n {\n $invoice = \\Acelle\\Model\\Invoice::findByUid($uid);\n $subscription = $request->user()->customer->subscription;\n\n if (!$request->user()->customer->can('delete', $invoice)) {\n return $this->notAuthorized();\n }\n\n // if subscription is new -> cancel now subscription.\n // Make sure a new subscription must have a pending invoice\n if ($subscription->isNew()) {\n $subscription->abortNew();\n } else {\n $invoice->delete();\n }\n\n // Redirect to my subscription page\n $request->session()->flash('alert-success', trans('messages.invoice.cancelled'));\n return redirect()->action('AccountSubscriptionController@index');\n }", "public function autorenewal_cancel(Request $request) {\n\n $user_payment = UserSubscription::where('user_id', $request->id)->where('status', DEFAULT_TRUE)->orderBy('created_at', 'desc')->first();\n\n if($user_payment) {\n\n // Check the subscription is already cancelled\n\n if($user_payment->is_cancelled == AUTORENEWAL_CANCELLED) {\n\n $response_array = ['success' => 'false' , 'error_messages' => Helper::error_message(164) , 'error_code' => 164];\n\n return response()->json($response_array , 200);\n\n }\n\n $user_payment->is_cancelled = AUTORENEWAL_CANCELLED;\n\n $user_payment->cancel_reason = $request->cancel_reason;\n\n $user_payment->save();\n\n $subscription = $user_payment->subscription;\n\n $data = ['id'=>$request->id, \n 'subscription_id'=>$user_payment->subscription_id,\n 'user_subscription_id'=>$user_payment->id,\n 'title'=>$subscription ? $subscription->title : '',\n 'description'=>$subscription ? $subscription->description : '',\n 'popular_status'=>$subscription ? $subscription->popular_status : '',\n 'plan'=>$subscription ? $subscription->plan : '',\n 'amount'=>$user_payment->amount,\n 'status'=>$user_payment->status,\n 'expiry_date'=>date('d M Y', strtotime($user_payment->expiry_date)),\n 'created_at'=>$user_payment->created_at,\n 'currency'=>Setting::get('currency'),\n 'payment_mode'=>$user_payment->payment_mode,\n 'is_coupon_applied'=>$user_payment->is_coupon_applied,\n 'coupon_code'=>$user_payment->coupon_code,\n 'coupon_amount'=>$user_payment->coupon_amount,\n 'subscription_amount'=>$user_payment->subscription_amount,\n 'coupon_reason'=>$user_payment->coupon_reason,\n 'is_cancelled'=>$user_payment->is_cancelled,\n 'cancel_reason'=>$user_payment->cancel_reason,\n 'show_autorenewal_options'=> DEFAULT_TRUE,\n 'show_pause_autorenewal'=> DEFAULT_FALSE,\n 'show_enable_autorenewal'=> DEFAULT_TRUE,\n ];\n\n $response_array = ['success'=> true, 'message'=>tr('cancel_subscription_success'), 'data'=>$data];\n\n } else {\n\n $response_array = ['success'=> false, 'error_messages'=>Helper::error_message(163), 'error_code'=>163];\n\n }\n\n return response()->json($response_array);\n\n }", "public function cancelOrder($param) { \n if (!$this->aaa->has_right('openruth', 500))\n $res->cancelOrderError->_value = 'authentication_error';\n else {\n $agencyId = self::strip_agency($param->agencyId->_value);\n $targets = $this->config->get_value('ruth', 'ztargets');\n if ($tgt = $targets[$agencyId]) {\n $ord = &$order->ReservationDelete->_value;\n $ord->LibraryNo->_value = $agencyId;\n $ord->DisposalID->_value = $param->orderId->_value;\n $xml = '<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?'.'>' . utf8_decode($this->objconvert->obj2xml($order));\n $z = new z3950();\n $z->set_target($tgt['host']);\n $z->set_database($tgt['database'].'-ophelia');\n $z->set_authentication($tgt['authentication']);\n if ($tgt['proxy']) {\n $z->set_proxy($tgt['proxy']);\n }\n $xml_ret = $z->z3950_xml_update($xml, $tgt['timeout']);\n//echo 'error: ' . $z->get_errno();\n//print_r($xml);\n//print_r($xml_ret);\n if ($z->get_errno() == 0 && $xml_ret['xmlUpdateDoc']) {\n $dom = new DomDocument();\n $dom->preserveWhiteSpace = false;\n if ($dom->loadXML($xml_ret['xmlUpdateDoc'])) {\n if ($err = $dom->getElementsByTagName('ReservationDeleteResponse')->item(0)->nodeValue) {\n verbose::log(ERROR, __FUNCTION__ . ' (' . __LINE__ . ') errno: ' . $err);\n if (!($res->cancelOrderError->_value = $this->errs[$err])) \n $res->cancelOrderError->_value = 'unspecified error (' . $err . '), order not possible';\n } else {\n $res->cancelOrderOk->_value = $param->orderId->_value;\n }\n } else {\n verbose::log(ERROR, __FUNCTION__ . ' (' . __LINE__ . ') loadXML error of: ' . $xml_ret['xmlUpdateDoc']);\n $res->cancelOrderError->_value = 'system error';\n }\n } else {\n self::log_z_error(__FUNCTION__, __LINE__, $agencyId, $z->get_errno(), $z->get_error_string());\n $res->cancelOrderError->_value = 'system error';\n }\n } else\n $res->cancelOrderError->_value = 'unknown agencyId';\n }\n\n $ret->cancelOrderResponse->_value = $res;\n //var_dump($param); print_r($res); die();\n return $ret;\n }", "public function cancelCustomer($customerid) {\n global $mwAdminDB; // db connection \n\n return ($mwAdminDB->cancelCustomer($customerid));\n }", "public function massCancelAction()\n {\n $this->_ratepayMassEvent('cancel');\n \n $this->_redirect('*/*/index');\n }", "function delete_plan()\n {\n #check user access\n check_user_access($this, 'delete_procurement_plan', 'redirect');\n\n # Get the passed details into the url data array if any\n $urldata = $this->uri->uri_to_assoc(3, array('m', 's'));\n\n # Pick all assigned data\n $data = assign_to_data($urldata);\n\n if(!empty($data['i'])){\n $result = $this->db->query($this->Query_reader->get_query_by_code('deactivate_item', array('item'=>' procurement_plans', 'id'=>decryptValue($data['i'])) ));\n \n #deactivate the entries\n if($result)\n {\n $this->db->where('procurement_plan_id', decryptValue($data['i']));\n $this->db->update('procurement_plan_entries', array('isactive'=>'N'));\n }\n }\n\n if(!empty($result) && $result){\n $this->session->set_userdata('dbid', \"The plan and it's entries have been successfully deleted.\");\n }\n else if(empty($data['msg']))\n {\n $this->session->set_userdata('dbid', \"ERROR: The procurement plan could not be deleted or were not deleted correctly.\");\n }\n\n if(!empty($data['t']) && $data['t'] == 'super'){\n $tstr = \"/t/super\";\n }else{\n $tstr = \"\";\n }\n redirect(base_url().\"procurement/page/m/dbid\".$tstr);\n }", "public function cancelAction() {\n /**\n * Admin configuration for order cancel request active status.\n */\n $orderCancelStatusFlag = Mage::getStoreConfig ( 'marketplace/admin_approval_seller_registration/order_cancel_request' );\n $data = $this->getRequest ()->getPost ();\n $emailSent = '';\n /**\n * Get order id\n * @var int\n */\n $orderId = $data ['order_id'];\n $loggedInCustomerId = '';\n /**\n * Check that customer login or not.\n */\n if (Mage::getSingleton ( 'customer/session' )->isLoggedIn () && isset ( $orderId )) {\n /**\n * Get customer data\n * @var id\n */\n $customerData = Mage::getSingleton ( 'customer/session' )->getCustomer ();\n $loggedInCustomerId = $customerData->getId ();\n $customerid = Mage::getModel ( 'sales/order' )->load ( $data ['order_id'] )->getCustomerId ();\n } else {\n /**\n * Error message for the when unwanted person access these request.\n */\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( \"You do not have permission to access this page\" ) );\n $this->_redirect ( 'sales/order/history' );\n return;\n }\n if ($orderCancelStatusFlag == 1 && ! empty ( $loggedInCustomerId ) && $customerid == $loggedInCustomerId) {\n $shippingStatus = 0;\n try {\n /**\n * Get templete id for the order cancel request notification.\n */\n $templateId = ( int ) Mage::getStoreConfig ( 'marketplace/admin_approval_seller_registration/order_cancel_request_notification_template_selection' );\n if ($templateId) {\n /**\n * Load email templete.\n */\n $emailTemplate = Mage::helper ( 'marketplace/marketplace' )->loadEmailTemplate ( $templateId );\n } else {\n $emailTemplate = Mage::getModel ( 'core/email_template' )->loadDefault ( 'marketplace_cancel_order_admin_email_template_selection' );\n }\n /**\n * Load order product details based on the orde id.\n */\n $_order = Mage::getModel ( 'sales/order' )->load ( $orderId );\n /**\n * Get increment id\n * @var int\n */\n $incrementId = $_order->getIncrementId ();\n $sellerProductDetails = array ();\n $selectedProducts = $data ['products'];\n $selectedItemproductId = '';\n /**\n * Get the order item from the order.\n */\n foreach ( $_order->getAllItems () as $item ) {\n /**\n * Get Product id\n * @var int\n */\n $itemProductId = $item->getProductId ();\n $orderItem = $item;\n if (in_array ( $itemProductId, $selectedProducts )) {\n $shippingStatus = $this->getShippingStatus ( $orderItem );\n\n $sellerId = Mage::getModel ( 'catalog/product' )->load ( $itemProductId )->getSellerId ();\n $selectedItemproductId = $itemProductId;\n $sellerProductDetails [$sellerId] [] = $item->getName ();\n }\n }\n /**\n * Get seller product details.\n */\n foreach ( $sellerProductDetails as $key => $productDetails ) {\n $productDetailsHtml = \"<ul>\";\n /**\n * Increment foreach loop\n */\n foreach ( $productDetails as $productDetail ) {\n $productDetailsHtml .= \"<li>\";\n $productDetailsHtml .= $productDetail;\n $productDetailsHtml .= \"</li>\";\n }\n $productDetailsHtml .= \"</ul>\";\n $customer = Mage::getModel ( 'customer/customer' )->load ( $loggedInCustomerId );\n $seller = Mage::getModel ( 'customer/customer' )->load ( $key );\n /**\n * Get customer name and customer email id.\n */\n $buyerName = $customer->getName ();\n $buyerEmail = $customer->getEmail ();\n $sellerEmail = $seller->getEmail ();\n $sellerName = $seller->getName ();\n $recipient = $sellerEmail;\n if (empty ( $sellerEmail )) {\n $adminEmailIdVal = Mage::getStoreConfig ( 'marketplace/marketplace/admin_email_id' );\n /**\n * Get the to mail id\n */\n $getToMailId = Mage::getStoreConfig ( \"trans_email/ident_$adminEmailIdVal/email\" );\n $recipient = $getToMailId;\n }\n $emailTemplate->setSenderName ( $buyerName );\n $emailTemplate->setSenderEmail ( $buyerEmail );\n /**\n * To set cancel/refund request sent\n */\n if ($shippingStatus == 1) {\n $requestedType = $this->__ ( 'cancellation' );\n Mage::getModel ( 'marketplace/order' )->updateSellerRequest ( $selectedItemproductId, $orderId, $loggedInCustomerId, $sellerId, 0 );\n } else {\n $requestedType = $this->__ ( 'return' );\n Mage::getModel ( 'marketplace/order' )->updateSellerRequest ( $selectedItemproductId, $orderId, $loggedInCustomerId, $sellerId, 1 );\n }\n $emailTemplateVariables = array (\n 'ownername' => $sellerName,'productdetails' => $productDetailsHtml, 'order_id' => $incrementId,\n 'customer_email' => $buyerEmail,'customer_firstname' => $buyerName,\n 'reason' => $data ['reason'],'requesttype' => $requestedType,\n 'requestperson' => $this->__ ( 'Customer' )\n );\n $emailTemplate->setDesignConfig ( array ('area' => 'frontend') );\n /**\n * Sending email to admin\n */\n $emailTemplate->getProcessedTemplate ( $emailTemplateVariables );\n $emailSent = $emailTemplate->send ( $recipient, $sellerName, $emailTemplateVariables );\n }\n if ($shippingStatus == 1) {\n Mage::getSingleton ( 'core/session' )->addSuccess ( $this->__ ( \"Item cancellation request has been sent successfully.\" ) );\n } else {\n Mage::getSingleton ( 'core/session' )->addSuccess ( $this->__ ( \"Item return request has been sent successfully.\" ) );\n }\n $this->_redirect ( 'sales/order/view/order_id/' . $data ['order_id'] );\n } catch ( Exception $e ) {\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( $e->getMessage () ) );\n $this->_redirect ( 'sales/order/view/order_id/' . $data ['order_id'] );\n }\n } else {\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( \"You do not have permission to access this page\" ) );\n $this->_redirect ( 'sales/order/view/order_id/' . $orderId );\n }\n }", "function create_new_listing_actions_renew_subscription($uid) {\r\n \r\n if (!is_numeric($uid)) {\r\n drupal_set_message(t('Invalid user id specified'), 'error');\r\n return;\r\n }\r\n\r\n // Find all recurring open orders\r\n $query = db_query('SELECT order_id FROM commerce_order WHERE status = :status AND type = :type AND uid = :uid ORDER BY order_id DESC LIMIT 1', array(':status' => 'canceled', ':type' => 'recurring', ':uid' => $uid));\r\n\r\n $result = $query->fetchField();\r\n\r\n if (!$result) {\r\n drupal_set_message(t('Unable to find billing cycle.'), 'error');\r\n return;\r\n }\r\n\r\n $order = commerce_order_load($result);\r\n $order->status = 'recurring_open';\r\n commerce_order_save($order);\r\n\r\n drupal_set_message(t('Your subscription will be renewed automatically.'));\r\n}", "public function destroy($id) \n {\n try {\n\n // Get plan subscribers count\n $subscribers = PlanSubscription::where(['plan_id' => $id, 'canceled_immediately' => null, 'canceled_at' => null])->count();\n $plan = Plan::find($id);\n\n // Only delete if the plan has no subscribers\n if ( $subscribers >= 1 ) {\n \n $plan->active = 0;\n $plan->save();\n\n $message = 'This plan currently have active subscribers therefore it was only disabled';\n\n } \n else {\n\n // Delete from Stripe\n if ( config('services.stripe.key') && config('services.stripe.secret') ) {\n Stripe::plans()->delete($id);\n }\n\n\n // Delete From PayPal\n if ( config('services.paypal.enable') ) {\n\n $paypalPlan = \\PayPal\\Api\\Plan::get($plan->paypal_plan_id, $this->paypalApiContext);\n $paypalPlan->delete($this->paypalApiContext);\n \n }\n\n\n // Delete DB plan\n $plan->delete();\n\n\n $message = 'The plan was successfully deleted';\n\n }\n \n\n return response(['message' => $message], 200);\n \n } catch (Exception $e) {\n return response(['message' => $e->getMessage()], 500);\n }\n }", "public function cancel_experience_booking_payment()\n\t{\t\n\t\tif ($this->checkLogin('A') == ''){\n\t\t\tredirect('admin');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\n\t\t\t$this->data['heading'] = 'Experience Cancellation Payments';\n\t\t\t\n\t\t\t$condition = array('cancelled','Yes');\n\t\t\t$CustomerDetails = $this->review_model->get_all_experienced_cancelled_users();\t\t\n\t\t\t\n\t\t\tforeach($CustomerDetails->result() as $customer)\n\t\t\t{\n\t\t\t\t$customer_id = $customer->id;\n\t\t\t\t$cancel[] = $this->review_model->get_all_experience_commission_tracking($customer_id);\n\t\t\t\t$this->data['paypalData'][$HostEmail] = $customer->paypal_email;\t\t\t\t\n\t\t\t}\n\n\t\t\t$this->data['trackingDetails'] = $cancel;\n\t\t\t$this->load->view('admin/dispute/display_experience_cancel_payment_lists',$this->data);\n\t\t}\n\t}", "public function cancelReservation($id) {\n $reservations = Reservation::find($id);\n $reservations->status = \"Cancelled\";\n $reservations->save();\n\n $customer_token = CustomersToken::where(['customer_id' => $reservations->customer_id])->first();\n\n if(!empty($customer_token)) {\n $pm = new PushMessage();\n $fcm = new FirebaseMessage();\n\n $pm->setTitle(\"Your reservation has been cancelled\");\n $pm->setMessage(\"Reservation schedule : Date:\".$reservations->reservation_date.\", Time: \".$reservations->reservation_time.\" \");\n $pm->setId($reservations->id);\n $pm->setImage(\"\");\n $pm->setIntent(\"Reservation\");\n\n $jsonMessage = $pm->getPushMessage();\n $response = $fcm->send($customer_token->token_id,$jsonMessage);\n\n }\n\n return redirect('/admin/range-rental/pending/list')->with('flash_message_success','Reservation successfully updated!');\n\n }", "public function cancelNow(Request $request)\n {\n $customer = $request->user()->customer;\n $subscription = $customer->subscription;\n \n if ($request->user()->customer->can('cancelNow', $subscription)) {\n $subscription->cancelNow();\n }\n\n // Redirect to my subscription page\n $request->session()->flash('alert-success', trans('messages.subscription.cancelled_now'));\n return redirect()->action('AccountSubscriptionController@index');\n }", "public function cancel();", "public function cancelOrder($external_id)\n {\n $data = array(\n 'canceled' => true\n );\n $url = \"https://chronos.burst.com.co/api/v1/orders/$external_id/update/\";\n $curl = curl_init($url);\n $json_data=json_encode($data);\n curl_setopt($curl, CURLOPT_URL, $url);\n // Set options necessary for request.\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'PATCH');\n curl_setopt($curl, CURLOPT_HTTPHEADER, array('Authorization: Token 926c272af5f4ac15eb773502632312822af1e30c', 'Content-Type: application/json', 'Content-Length: ' . strlen($json_data)));\n curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 10);\n \n curl_setopt($curl, CURLOPT_POSTFIELDS, $json_data);\n \n // Send request\n $response = curl_exec($curl);\n return $response;\n }", "public function cancel()\n {\n }", "public function cancel()\n {\n }", "function recurringdowntime_cancel_pending_changes($cbtype, &$cbargs)\n{\n if ($cbargs['command'] != COMMAND_RESTORE_NAGIOSQL_SNAPSHOT || $cbargs['return_code'] != 0) {\n return;\n }\n\n recurringdowntime_update_pending_changes(array());\n}", "public function closePending()\n {\n $cutOff = Carbon::now()->subMinutes(30);\n $rows = $this->storageTable()\n ->where('status', '=', 'approval_pending')\n ->whereDate('created_at', '<', $cutOff)\n ->get();\n foreach ($rows as $row) {\n $subscription = $this->buildSubscriptionFromRow($row);\n if ($subscription->open()) {\n Log::info(\"Closing Payment Subscription \" . $subscription->id\n . \" created at \" . $subscription->createdAt . \" because user never accepted it.\");\n $this->closeSubscription($subscription, 'user_declined');\n }\n }\n }", "public function reactivate() : self\n {\n $subscription = $this->asStripeSubscription();\n\n if ($subscription->status === 'canceled') {\n $appPlan = $this->getPlans('apps_plans_id > 0')->getFirst()->appPlan;\n $companyGroup = $this->companyGroup;\n $company = $this->company;\n $branch = $this->branch;\n $options = [];\n $customerOptions = [];\n\n //we need to recreate the subscription\n $newSubscription = new SubscriptionBuilder(\n $appPlan,\n $this->getDI()->get('app'),\n $companyGroup,\n $company,\n $branch\n );\n $newSubscriptionModel = $newSubscription\n ->withMetadata(['appPlan' => $appPlan->getId()])\n ->skipTrial()\n ->create($options, $customerOptions);\n\n $this->softDelete();\n\n return $newSubscriptionModel;\n }\n\n $subscription->cancel_at_period_end = false;\n $subscription->save();\n\n return $this;\n }", "public function postCancelRecurring($order) {\n Auth::user()\n ->requires('delete')\n ->ofScope('Subscriber',Subscriber::current()->id)\n ->orScope('Protocol')\n ->orScope('Client',$order->client->id)\n ->over('Order',$order->id);\n\n $order->autoship->delete();\n\n return Redirect::route('order',array($order->id));\n }", "function jx_cancel_paf()\r\n\t{\r\n\t\t$this->auth(PAF_ROLE);\r\n\t\tif(!$_POST)\r\n\t\t\tdie();\r\n\t\t$output = array();\r\n\t\t$user = $this->auth(true);\r\n\t\t \r\n\t\t$id = $this->input->post('id');\r\n\t\t$this->db->query('update t_paf_list set paf_status=3,cancelled_on=?,cancelled_by=? where id = ? and paf_status = 1',array(date('Y-m-d H:i:s'),$user['userid'],$id));\r\n\t\tif($this->db->affected_rows())\r\n\t\t{\r\n\t\t\t$output['status'] = 'success';\r\n\t\t\t$output['message'] = 'Cancelled Successfully';\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$output['status'] = 'error';\r\n\t\t\t$output['message'] = 'Unable to cancel this paf';\r\n\t\t}\r\n\t\techo json_encode($output);\r\n\t}", "function cancel(){\n\t\t//echo \"In Cancel\";\n\t\t\n\t\t//echo 'Das aktuelle Datum und die aktuelle Zeit ist: ';\n\t\t//echo JFactory::getDate('now', JFactory::getApplication()->getCfg('offset'))->toFormat() . \"\\n<br/><br/>\";\n\t\t\n\t\t//$date = JFactory::getDate();\n\t\t//$date->setOffset(JFactory::getApplication()->getCfg('offset'));\n\t \n\t \t//echo \"Offset: \" . JFactory::getApplication()->getCfg('offset');\n\t\t//echo 'Das aktuelle Datum und die aktuelle Zeit ist: ' . $date->toFormat() . \"\\n\";\n\t\t$date =& JFactory::getDate($time= 'now', $tzOffset=0);\n\n\t\t//$date->setOffset($mainframe->getCfg('offset'));\n\t\t//echo 'Das aktuelle Datum und die aktuelle Zeit ist: ' . $date->toFormat();\n\t\t\n\t\t//echo \"New date: \" . date('Y-m-d H:i:s');\n\n\t\t//return false;\n\t\t\n\t\t$insData =new stdClass();\n\t\t$insData->idt_drivin_event_apply = $_POST['appCanId'];\n\n\t\t//$date = new DateTime();\n\t\t$insData->dt_cancel = date('Y-m-d H:i:s'); //'CURRENT_TIMESTAMP';//$date->getTimestamp();\n\t\t\n\t\t$db = JFactory::getDBO();\n\t\tif(!$db->updateObject( '#__jevent_events_apply', $insData, 'idt_drivin_event_apply' )){\n\t\t\techo $database->stderr();\n\t\t\treturn false;\n\t\t}\n\t\treturn true;//resendCancelEmailById($insData->idt_drivin_event_apply);\n\t}", "public function cancelAction()\n {\n \n $po_order_id = $this->getRequest()->getParam('po_order_id');\n \n Mage::dispatchEvent('purchase_order_stockmovement_cancel_po', array('po_order_id'=>$po_order_id)); \n \n //move to 'purchase_order_stockmovement_cancel' event to handle.\n /*$collection = mage::getModel('Purchase/StockMovement')\n ->getCollection()\n ->addFieldToFilter('sm_po_num', $po_num);\n foreach ($collection as $item)\n {\n $item->delete();\n }\n */\n /*\n $order = mage::getModel('Purchase/Order')->load($po_num);\n foreach ($order->getProducts() as $item)\n {\n $productId = $item->getpop_product_id();\n Mage::dispatchEvent('purchase_update_supply_needs_for_product', array('product_id'=>$productId));\n }\n */\n \n //Move to order cancel funciton.\n /*$collection = mage::getModel('purchase/orderitem')\n ->getCollection()\n ->addFieldToFilter('pop_order_num', $po_num);\n foreach ($collection as $item)\n {\n $item->delete();\n } */\n \n \n $purchaseOrder = Mage::getModel('purchase/order')->load($po_order_id);\n\n $purchaseOrder->cancel();\n \n Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Purchase order successfully Canceled'));\n \n $this->_redirect('purchase/orders/list');\n }", "public function setCancelbyadmin($id){\n $rma = Mage::getModel(\"mprmasystem/rmarequest\")->load($id);\n $rma->setStatus(\"Cancelled\")->save();\n Mage::getModel(\"mprmasystem/rmamail\")->CancelRMAMailbyadmin($id);\n }", "static function cancelPaymentHistory($id, $user_id)\r\n\t{\r\n\t\t$id = funcs::check_input($id);\r\n\t\t$user_id = funcs::check_input($user_id);\r\n\r\n\t\t$username = DBConnect::retrieve_value(\"SELECT username FROM \".TABLE_MEMBER.\" WHERE id='\".$user_id.\"'\");\r\n\r\n\t\t$sql = \"SELECT username FROM \".TABLE_PAY_LOG.\" WHERE ID=\".$id;\r\n\t\tif(DBConnect::retrieve_value($sql) == $username)\r\n\t\t{\r\n\t\t\tDBConnect::execute_q(\"UPDATE \".TABLE_PAY_LOG.\" SET cancelled=1, cancelled_date=NOW() WHERE ID >=\".$id.\" AND username='\".$username.\"'\");\r\n\t\t\t//DBConnect::execute_q(\"UPDATE \".TABLE_MEMBER.\" SET type=4 WHERE id=\".$user_id);\r\n\r\n\t\t\t//logout ang login again.\r\n\t\t\t//$info = DBConnect::assoc_query_1D(\"SELECT * FROM \".TABLE_MEMBER.\" WHERE id=\".$user_id);\r\n\t\t\t//$_SESSION = null;\r\n\t\t\t//funcs::loginSite($info['username'], $info['password']);\r\n\t\t}\r\n\t}", "public function testCancelPayment()\n {\n $this->mockPaymentMapping(\n MiraklMock::ORDER_COMMERCIAL_CANCELED,\n StripeMock::CHARGE_STATUS_AUTHORIZED,\n 8472\n );\n $this->executeCommand();\n $this->assertCount(0, $this->validateReceiver->getSent());\n $this->assertCount(0, $this->captureReceiver->getSent());\n $this->assertCount(1, $this->cancelReceiver->getSent());\n }", "public function cancel($id)\n {\n $reservation = $this->repository->makeModel()->find($id);\n\n $reservation->is_canceled = true;\n $reservation->canceled_at = Carbon::now();\n\n $reservation->is_confirmed = null;\n $reservation->confirmed_at = null;\n\n $history = $reservation->history;\n\n $log = [\n 'full_name' => \\Auth::user()->full_name,\n 'action' => 'cancel',\n 'label' => 'Cancelou a reserva',\n 'date' => Carbon::now()->format('Y-m-d H:i:s')\n ];\n\n if (!$history) {\n $history = [$log];\n }else{\n $history = array_prepend($history, $log);\n }\n\n $reservation->history = $history;\n\n $reservation->save();\n\n if (request()->wantsJson()) {\n\n return response()->json([\n 'message' => 'PlaceReservations canceled.',\n 'canceled' => $reservation->load('client'),\n ]);\n }\n\n return redirect()->back()->with('message', 'PlaceReservations deleted.');\n }", "public function billingPlan($id)\n {\n $this->shellshock(request(), [\n 'number' => 'required|numeric',\n 'exp_month' => 'required|numeric',\n 'exp_year' => 'required|numeric',\n 'cvc' => 'required|numeric',\n ]);\n\n Stripe::setApiKey(config('turtle.billing.stripe_secret_key'));\n\n // create card token\n $token = Token::create([\n 'card' => [\n 'number' => request()->input('number'),\n 'exp_month' => request()->input('exp_month'),\n 'exp_year' => request()->input('exp_year'),\n 'cvc' => request()->input('cvc'),\n ],\n ]);\n\n // create/update customer\n if (!auth()->user()->billing_customer) {\n $customer = Customer::create([\n 'source' => $token->id,\n 'email' => auth()->user()->email,\n ]);\n }\n else {\n $customer = Customer::retrieve(auth()->user()->billing_customer);\n $customer->source = $token->id;\n $customer->save();\n }\n\n // create/update subscription\n if (!auth()->user()->billing_subscription) {\n $subscription = Subscription::create([\n 'customer' => $customer->id,\n 'items' => [['plan' => $id]],\n ]);\n }\n else {\n $subscription = Subscription::retrieve(auth()->user()->billing_subscription);\n Subscription::update($subscription->id, [\n 'items' => [[\n 'id' => $subscription->items->data[0]->id,\n 'plan' => $id,\n ]],\n ]);\n }\n\n // update user\n auth()->user()->update([\n 'billing_customer' => $customer->id,\n 'billing_subscription' => $subscription->id,\n 'billing_plan' => $id,\n 'billing_cc_last4' => $token->card->last4,\n 'billing_period_ends' => Carbon::createFromTimestamp($subscription->current_period_end),\n ]);\n\n activity('Subscribed to '.$id);\n flash('success', 'Thanks for subscribing!');\n\n return response()->json(['reload_page' => true]);\n }", "public function cancel(Project $project) {\n }", "public function cancel()\n {\n $this->canceled = true;\n\n $this->save();\n\n $this->user->notify(new OrderCanceled($this));\n\n }" ]
[ "0.74262434", "0.6874576", "0.6780779", "0.67579454", "0.6710917", "0.651445", "0.64713717", "0.64287424", "0.63761187", "0.6306149", "0.6300137", "0.62079364", "0.6185434", "0.61298984", "0.6123062", "0.6113287", "0.60566247", "0.60446393", "0.60444564", "0.6041576", "0.60336053", "0.6029513", "0.5996548", "0.59826446", "0.59799695", "0.5961137", "0.596032", "0.5952302", "0.5898822", "0.58750224", "0.5873995", "0.5873009", "0.5844866", "0.58130246", "0.58121663", "0.58023137", "0.57800114", "0.576899", "0.5757848", "0.5754205", "0.57493514", "0.57367724", "0.573616", "0.5719637", "0.57084817", "0.57047284", "0.5690408", "0.56809914", "0.5678327", "0.56781393", "0.56774175", "0.56735265", "0.56660944", "0.566517", "0.5657944", "0.56500024", "0.56347805", "0.5620491", "0.5608078", "0.56077147", "0.5602403", "0.5597872", "0.5597681", "0.55947053", "0.5591291", "0.5577962", "0.5573658", "0.5564694", "0.55534846", "0.5534638", "0.5530788", "0.55266404", "0.5519079", "0.55167556", "0.5516463", "0.55148923", "0.5508676", "0.55070907", "0.5498521", "0.5495246", "0.5493574", "0.5488891", "0.54831606", "0.54824185", "0.5475628", "0.5475628", "0.5471363", "0.5463594", "0.54630053", "0.54576945", "0.5456927", "0.5456598", "0.5451628", "0.5437155", "0.54364824", "0.5432626", "0.5429873", "0.5427774", "0.5424677", "0.5408856" ]
0.6133777
13
Creates a model builder class.
public static function createModelBuilder( string $table, array $columns = [], string $namespace = 'App\\Models', string $primaryKey = 'id', bool $increments = true, $isViewModel = false, array $hidden = [], array $appends = [], ?string $comments = null ) { $component = EloquentORMModelBuilder( new ORMModelDefinition( $primaryKey, null, $table, array_map( static function ($definition) { $name = Str::before('|', $definition); $least = explode(',', Str::after('|', $definition) ?? ''); $type = Arr::first($least) ?? null; return new ORMColumnDefinition($name, empty($type) ? null : $type); }, array_filter(array_map(static function ($column) { if (\is_string($column) && !Str::contains($column, '|')) { $column = sprintf('%s|', $column); } return $column; }, $columns), static function ($definition) { return null !== $definition && Str::contains($definition, '|'); }) ), $increments, $namespace, $comments, ) )->setHiddenColumns($hidden ?? []) ->setAppends($appends ?? []); if ($isViewModel) { $component = $component->asViewModel(); } return $component; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createBuilder();", "public static function builder() {\n\t\treturn new Builder();\n\t}", "protected function createModel()\n {\n $class = $this->getModelClass();\n\n $attributes = $this->getModelAttributes();\n\n return new $class($attributes);\n }", "static public function builder(): Builder\n {\n return new Builder;\n }", "public static function builder() {\n return new self();\n }", "public function builder()\n {\n return new Builder($this);\n }", "private function modelBuilder() {\n // Create model\n $model = '<?php\n class ' . ucfirst($this->formName) . '_model extends CI_Model {\n\n private $table;\n\n // Constructor\n function __construct() {\n\n parent::__construct();\n $this->table = \"' . $this->formName . '\";\n }\n\n /**\n * Insert datas in ' . $this->formName . '\n *\n * @param array $data\n * @return bool\n */\n function save($data = array()) {\n // Insert\n $this->db->insert($this->table, $data);\n\n // If error return false, else return inserted id\n if (!$this->db->affected_rows()) {\n\t return false;\n } else {\n\t\treturn $this->db->insert_id();\n }\n }\n\n }\n ?>';\n\n return array(str_replace('<', '&lt;', $model), $model);\n }", "public function getBuilder()\n {\n $class = '\\ReneDeKat\\Quickbooks\\Builders\\\\'.$this->getClassName();\n\n return new $class($this);\n }", "private function createBuilder()\n {\n $class = get_class($this->data->getModel());\n\n $this->name = strtolower(class_basename($class));\n\n $result = $this->callEvent($class, [$class => $this->data]);\n\n if ($result instanceof $this->data) {\n $this->data = $result;\n }\n\n $this->makePaginator();\n }", "public static function build() {\n return new Builder();\n }", "public function createModel()\n {\n $class = '\\\\' . ltrim($this->model, '\\\\');\n\n return new $class;\n }", "public function createModel()\n {\n $class = '\\\\' . ltrim($this->model, '\\\\');\n\n return new $class;\n }", "protected function createBuilder()\n\t{\n\t\treturn new Db_CompiledBuilder($this);\n\t}", "public function newBuilder()\n {\n $builder = new Builder;\n $builder->setModel($this);\n\n return $builder;\n }", "protected function createModel()\n {\n $this->call('make:model', array_filter([\n 'name' => $this->getNameInput(),\n '--factory' => $this->option('factory'),\n '--migration' => $this->option('migration'),\n ]));\n }", "public function createModel()\n\t{\n\t\t$class = '\\\\'.ltrim($this->model, '\\\\');\n\t\treturn new $class;\n\t}", "public static function newModel()\n {\n $model = static::$model;\n\n return new $model;\n }", "public static function builder();", "protected function make(): Model\n {\n $model = new $this->model;\n $this->modelPk = $model->getKeyName();\n\n return $model;\n }", "public function getModel(): Builder\n {\n return $this->model;\n }", "public function getBuilder();", "public function buildModel() {}", "public function make($modelClass);", "public function builder()\n\t{\n\t\t$builder = new Builder($this->request);\n\t\treturn $builder;\n\t}", "protected function factoryBuilder($model)\n { if (class_exists('Illuminate\\Database\\Eloquent\\Factory')) {\n return factory($model);\n }\n\n return (new $model)->factory();\n }", "protected function createCommandBuilder()\n\t{\n\t\treturn new CSqliteCommandBuilder($this);\n\t}", "public function newBuilder()\n {\n return new Builder();\n }", "public static function model()\n {\n return new self;\n }", "public function testModelReturnsBuilder(): void\n {\n $builder = Builder::model(ModelTest::class);\n $this->assertInstanceOf(Builder::class, $builder);\n }", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }", "private function createQueryBuilder(): QueryBuilder\n {\n $queryBuilder = new QueryBuilder();\n $queryBuilder->table(($this->model)::TABLE);\n $this->applyCriteria($queryBuilder);\n $this->applyQueryBuilderUses($queryBuilder);\n return $queryBuilder;\n }", "public function model(Model $model)\n {\n return new ModelBuilder($model, $this->pdo, $this->handler);\n }", "public function createModel()\n\t{\n\t\treturn $this->getModelConfiguration()->createModel();\n\t}", "protected function createCommandBuilder()\n {\n return new CFirebirdCommandBuilder($this);\n }", "public static function make(): self\n\t{\n\t\treturn static::builder()->build();\n\t}", "public static function make(): self\n\t{\n\t\treturn static::builder()->build();\n\t}", "public static function make(): self\n\t{\n\t\treturn static::builder()->build();\n\t}", "public static function make(): self\n\t{\n\t\treturn static::builder()->build();\n\t}", "protected function buildModel()\n {\n $columns = collect($this->columns)->pluck('column')->implode('|');\n $foreigns = $this->module->tables->where('is_foreign', true);\n\n $this->model = [\n 'name' => $this->class,\n '--table' => $this->table,\n '--columns' => $columns,\n '--pk' => $this->primaryKey,\n '--module' => $this->module->id,\n ];\n\n if ($foreigns->count()) {\n $this->model['--relationships'] = $foreigns->transform(function ($foreign) {\n return $foreign->column.':'.$foreign->table_foreign;\n })->implode('|');\n }\n }", "protected function createModel()\n {\n $model = $this->info['model'];\n\n $modelName = basename(str_replace('\\\\', '/', $model));\n\n // make it singular\n $modelName = Str::singular($modelName);\n\n $this->info['modelName'] = $modelName;\n\n $modelOptions = [\n 'model' => $this->info['model'],\n '--module' => $this->moduleName,\n ];\n $options = $this->setOptions([\n 'index',\n 'unique',\n 'data',\n 'uploads',\n 'float',\n 'bool',\n 'int',\n 'data',\n 'parent'\n ]);\n\n $this->call('engez:model', array_merge($modelOptions, $options));\n }", "protected function newBuilder($class)\n {\n return new Builder($class);\n }", "public function create()\n {\n return new $this->class;\n }", "public function model()\n {\n $model = $this->_model;\n return new $model;\n\n }", "protected function makeModel()\n {\n return factory(Employee::class)->create();\n }", "public function form_builder()\n {\n // ToDo run checks when form is being created, please.\n// if(!empty($this->check())):\n// throw new ValidationError(checks_html_output($this->check()));\n//\n// endif;\n\n return new form\\ModelForm($this, $this->_field_values());\n }", "public function create(){\r\n\treturn new $this->class();\r\n }", "public function builder()\n {\n return null;\n }", "public function builder()\n {\n return $this->builder;\n }", "private function makeModel()\n {\n\n $this->model = $this->app->make($this->model());\n\n if (!$this->model instanceof Model)\n throw new Exception(\"Class \".$this->model.\" must be an instance of Illuminate\\\\Database\\\\Eloquent\\\\Model\");\n\n\n return $this->model;\n }", "private function getBuilder(): \\LoyaltyCorp\\ApiDocumenter\\SchemaBuilders\\ObjectSchemaBuilder\n {\n $phpDocExtractor = new PhpDocExtractor();\n $reflectionExtractor = new ReflectionExtractor(\n null,\n null,\n null,\n true,\n ReflectionExtractor::ALLOW_PRIVATE |\n ReflectionExtractor::ALLOW_PROTECTED |\n ReflectionExtractor::ALLOW_PUBLIC\n );\n $propertyInfo = new PropertyInfoExtractor(\n [$reflectionExtractor],\n [$phpDocExtractor, $reflectionExtractor],\n [$phpDocExtractor],\n [],\n []\n );\n\n return new ObjectSchemaBuilder(\n new CamelCaseToSnakeCaseNameConverter(),\n new WrappedPropertyInfoExtractor($propertyInfo),\n new PropertyTypeToSchemaConverter(new OpenApiTypeResolver())\n );\n }", "protected function makeModel()\n {\n new MakeModel($this, $this->files);\n }", "public function builder()\n {\n if ($this->parent) {\n return $this->parent->builder();\n }\n\n if (is_null($this->builder)) {\n $this->builder = new Builder($this);\n }\n\n return $this->builder;\n }", "private function makeModel() {\n \n $model = $this->app->make( $this->model() );\n\n if ( !$model instanceof Model )\n throw new RepositoryException(\"Class {$this->model} must be an instance of Illuminate\\\\Database\\\\Eloquent\\\\Model\");\n\n $this->model = $model;\n\n return $this;\n }", "public function createBuilder($name, $data = null);", "public function build()\n {\n if (empty($this->tables)) {\n throw new \\InvalidArgumentException('Please define your tables first using the tables() method');\n }\n\n if (empty($this->fields)) {\n throw new \\InvalidArgumentException('Please define your fields first using the fields() method');\n }\n\n $tables = $this->getTableCollection();\n $usedTables = new TableCollection();\n\n $fields = $this->getFieldCollection();\n $columns = $this->columns ? $this->columns : array('*');\n\n $this->criteria->build(\n $this->builder,\n $tables,\n $usedTables,\n $fields,\n $columns\n );\n\n return $this->builder;\n }", "protected function getBuilderClass()\n {\n return 'tx_t3socials_network_facebook_MessageBuilder';\n }", "public function create_model($name, $controller, $action){\n\t\t$models_dir = Kumbia::$active_models_dir;\n\t\tif(file_exists(\"$models_dir/$name.php\")){\n\t\t\tFlash::error(\"Error: El modelo '$name' ya existe\\n\");\n\t\t} else {\n\t\t\t$model_name = str_replace(\" \", \"\", ucwords(strtolower(str_replace(\"_\", \"\", $name))));\n\t\t\t$file = \"<?php\\n\t\t\t\\n\tclass $model_name extends ActiveRecord {\\n\n\t}\\n\t\\n?>\\n\";\n\t\t\tfile_put_contents(\"$models_dir/$name.php\", $file);\n\t\t\tFlash::success(\"Se cre&oacute; correctamente el modelo '$name' en models/$name.php\\n\");\n\t\t\t$model = $name;\n\t\t\trequire_once \"$models_dir/$model.php\";\n\t\t\t$objModel = str_replace(\"_\", \" \", $model);\n\t\t\t$objModel = ucwords($objModel);\n\t\t\t$objModel = str_replace(\" \", \"\", $objModel);\n\t\t\tif(!class_exists($objModel)){\n\t\t\t\tthrow new BuilderControllerException(\"No se encontr&oacute; la Clase \\\"$objModel\\\" Es necesario definir una clase en el modelo\n\t\t\t\t\t\t\t'$model' llamado '$objModel' para que esto funcione correctamente.\");\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\tKumbia::$models[$objModel] = new $objModel($model, false);\n\t\t\t\tKumbia::$models[$objModel]->source = $model;\n\t\t\t}\n\t\t\t$this->route_to(\"controller: $controller\", \"action: $action\");\n\t\t}\n\t}", "public function createBuilder(array $data = array(), array $options = array());", "public static function Create() {\r\n\t\t$cls = get_called_class();\r\n\t\t$model = new $cls();\r\n\t\t$record = new Dbi_Record($model, array());\r\n\t\treturn $record;\r\n\t}", "public function newFromBuilder($attributes = [], $connection = null)\n {\n $model = $this->newInstance([], true);\n\n $model->setRawAttributes((array) $attributes, true);\n\n $model->setConnection($connection ?: $this->getConnectionName());\n\n return $model;\n }", "protected function getNewModel()\n {\n $modelName = $this->getModelName();\n return new $modelName;\n }", "public static function create()\n {\n return new JsonBuilder(array());\n }", "public static function create($params = array())\n {\n $model = new static();\n static::getSchema();\n if (!empty($params)) {\n $model->setProperties($params);\n }\n\n return $model;\n }", "protected function newBuilder(): Builder\n {\n return $this->builder = $this->game_play->newQuery();\n }", "protected function getModelInstance()\n {\n return new $this->model();\n }", "public function getSchemaBuilder() : BuilderInterface;", "protected function getBuilderClass(): string\n {\n return FromDegrees::class;\n }", "public function getItemBuilder() {\n $class = '\\Rangka\\Quickbooks\\Builders\\Items\\\\' . $this->getEntityName();\n return new $class($this);\n }", "public function getSchemaBuilder()\n {\n return new Schema\\Builder($this);\n }", "public function create()\n {\n return $this->modelManager->instance($this->model);\n }", "protected function _newModel($class)\n {\n // instantiate\n $model = new $class($this);\n \n // done!\n return $model;\n }", "public function createModel()\n {\n }", "private function _makeModel($controller_name, $storage_type)\n\t{\n\t\t$model\t\t= $controller_name . 'Model';\n\t\t\t\t\n\t\t$storage\t= $this->_makeTemplateStorage($storage_type);\n\t\t$log\t\t= $this->makeLogger();\n\t\t$db\t\t\t= $this->_makeDatabase();\n\t\t\n\t\treturn new $model($storage, $storage_type, $log, $db);\n\t}", "public static function create()\n {\n return new QueryConfigurationBuilder();\n }", "public function getSchemaBuilder()\n {\n if (is_null($this->schemaGrammar)) { $this->useDefaultSchemaGrammar(); }\n\n //return new Schema\\Builder($this);\n return new FBBuilder($this);\n }", "public function getBuilder() {\n if (!isset($this->builder)) {\n if (empty($this->configuration['builder'])) {\n $this->builder = $this->builderManager->createInstance('standard', []);\n }\n else {\n $this->builder = $this->builderManager->createInstance($this->configuration['builder'], []);\n }\n }\n return $this->builder;\n }", "public function of($class): FactoryBuilder\n {\n return new FactoryBuilder(\n $class,\n $this->definitions,\n $this->states,\n $this->afterMaking,\n $this->afterCreating,\n $this->orm,\n $this->faker\n );\n }", "public function create(): Model;", "public function newQueryBuilder()\n {\n return new Builder($this->config);\n }", "public function createModel()\n {\n return \\Model::factory(Group::class)->create();\n }", "public static function createModel($type)\n {\n $className = 'app'.d_S.'models'.d_S.ucfirst($type).\"Model\";\n if($className!=NULL)\n {\n return new $className($type);\n }\n else\n {\n echo \"$className Not Found!\";\n }\n }", "public function getModel()\n {\n return new $this->model;\n }", "public function newFromBuilder($attributes = [], $connection = null)\n {\n $model = $this->newInstance(Arr::only((array) $attributes, [$this->getTypeColumn()]), true);\n $model->setRawAttributes((array) $attributes, true);\n $model->setConnection($connection ?: $this->getConnectionName());\n $model->fireModelEvent('retrieved', false);\n return $model;\n }", "public function getMockBuilder($className)\n {\n if (empty($this->unitTestCase)) {\n $this->unitTestCase = new FunctionalTestCase(get_class($this));\n }\n\n return new MockBuilder($this->unitTestCase, $className);\n }", "protected function createModel()\n {\n return new LeafModel();\n }", "protected function create()\n {\n return new $this->entityClass();\n }", "public function makeModel()\n {\n return $this->model;\n }", "public function getSchemaBuilder()\n {\n if ($this->schemaGrammar === null) {\n $this->useDefaultSchemaGrammar();\n }\n\n return new Builder($this);\n }", "protected function model()\n {\n $model = new $this->className;\n foreach ($this->conditions as $cond) {\n if (is_array($cond)) {\n if (count($cond) === 3) {\n // Convert to whereIn()\n if ($cond[1] === 'in') {\n $model = $model->whereIn($cond[0], $cond[2]);\n }\n // Typical 3 params where()\n else {\n $model = $model->where($cond[0], $cond[1], $cond[2]);\n }\n }\n elseif (count($cond) === 2) {\n // Typical 2 params where()\n $model = $model->where($cond[0], $cond[1]);\n }\n else {\n throw new \\Exception('Invalid number of parameters.');\n }\n }\n }\n $this->model = $model;\n return $this->model;\n }", "protected function createModelInstance($options = [])\n {\n if (isset($options['model']) && !is_bool($options['model'])) {\n if (is_object($options['model'])) {\n return $options['model'];\n }\n $class = $this->getModelClass($options['model']);\n } else {\n $class = $this->getModelClass();\n }\n\n return new $class();\n }", "public static function model() {\n //here __CLASS__ or self does not work because these will return coreModel class name but this is an abstract class so php will generate an error.\n //get_called_class() will return the class name where model is called.It may be the child.\n $class = get_called_class();\n return new $class;\n }", "private function createModel()\n {\n $class = get_class($this->data);\n\n $this->name = strtolower(class_basename($class));\n\n $result = $this->callEvent($class, [$class => $this->data]);\n\n if ($result instanceof $this->data) {\n $this->data = $result;\n }\n\n $this->makePaginator();\n }", "abstract protected function modelFactory();", "public function getModel()\n {\n $model = new $this->versionable_type();\n $model->unguard();\n $model->fill(unserialize($this->model_data));\n $model->exists = true;\n $model->reguard();\n return $model;\n }", "public function make($class)\n {\n return Kant::createObject($class);\n }", "public function buildNew(array $attributes = array())\n {\n return $this->model->newInstance($attributes);\n }", "protected function createModel()\n {\n $this->call('wizard:model', [\n 'name' => $this->argument('name'),\n ]);\n }", "public static function builder(): SetAutoAttachRequestBuilder\n\t{\n\t\treturn new SetAutoAttachRequestBuilder();\n\t}", "public function getSchemaBuilder()\n {\n if ( is_null ( $this->schemaGrammar ) ) {\n $this->useDefaultSchemaGrammar ();\n }\n return new Schema\\Builder ( $this );\n }", "public function __construct()\n {\n $this ->model = $this ->makeModel($this ->model());\n }" ]
[ "0.7481317", "0.70406914", "0.69813335", "0.6977667", "0.6952941", "0.688451", "0.6822975", "0.6731978", "0.66376424", "0.65945333", "0.6547654", "0.6547654", "0.6519032", "0.6505329", "0.6492836", "0.6433839", "0.64254665", "0.64061856", "0.6405782", "0.63888323", "0.6388629", "0.63716584", "0.6326831", "0.62985003", "0.62454545", "0.62366235", "0.6154687", "0.6125042", "0.6113019", "0.61020476", "0.6066494", "0.60603845", "0.6037159", "0.60262746", "0.6006108", "0.6006108", "0.6006108", "0.6006108", "0.5947171", "0.5943196", "0.59306616", "0.5926158", "0.59146756", "0.58717376", "0.5860874", "0.5798829", "0.57885724", "0.578123", "0.57647127", "0.57622105", "0.57354975", "0.5702199", "0.569028", "0.56890106", "0.5686435", "0.56862843", "0.56795883", "0.5677286", "0.56590563", "0.56384546", "0.56312513", "0.56266195", "0.5620488", "0.5616292", "0.55943173", "0.5587813", "0.5587055", "0.55864155", "0.5577641", "0.5577115", "0.55751705", "0.55539715", "0.5538964", "0.5525858", "0.55221224", "0.5508388", "0.55012953", "0.5497853", "0.5485561", "0.54740536", "0.54701746", "0.5466031", "0.5444503", "0.5433285", "0.5409202", "0.53959036", "0.538141", "0.53775567", "0.53726125", "0.5372342", "0.53710586", "0.5362778", "0.53546375", "0.53535116", "0.53243977", "0.5315758", "0.53086555", "0.5297703", "0.52830917", "0.52818066" ]
0.57001126
52
Creates a service builder class.
public static function createServiceBuilder( bool $asCRUD = false, ?string $name = null, ?string $namespace = null, ?string $model = null ) { return ($component = \is_string($model) ? MVCServiceBuilder($name, $namespace)->bindModel($model) : MVCServiceBuilder($name, $namespace)) && $asCRUD ? $component->asCRUDService() : $component; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createBuilder();", "function __construct($service) {\n // return new $class;\n }", "public function createService($serviceClass);", "public static function getInstance() {\n if( !isset( self::$_instance ) ) {\n self::$_instance = new ServicesBuilder();\n }\n\n return self::$_instance;\n }", "public static function builder() {\n\t\treturn new Builder();\n\t}", "public static function builder() {\n return new self();\n }", "static public function builder(): Builder\n {\n return new Builder;\n }", "public static function builder();", "protected function getValidator_BuilderService()\n {\n $this->services['validator.builder'] = $instance = \\Symfony\\Component\\Validator\\Validation::createValidatorBuilder();\n\n $instance->setConstraintValidatorFactory(new \\Symfony\\Bundle\\FrameworkBundle\\Validator\\ConstraintValidatorFactory($this, array('validator.expression' => 'validator.expression', 'Symfony\\\\Component\\\\Validator\\\\Constraints\\\\ExpressionValidator' => 'validator.expression', 'Symfony\\\\Component\\\\Validator\\\\Constraints\\\\EmailValidator' => 'validator.email', 'security.validator.user_password' => 'security.validator.user_password', 'Symfony\\\\Component\\\\Security\\\\Core\\\\Validator\\\\Constraints\\\\UserPasswordValidator' => 'security.validator.user_password', 'doctrine.orm.validator.unique' => 'doctrine.orm.validator.unique', 'Symfony\\\\Bridge\\\\Doctrine\\\\Validator\\\\Constraints\\\\UniqueEntityValidator' => 'doctrine.orm.validator.unique')));\n $instance->setTranslator($this->get('translator.default'));\n $instance->setTranslationDomain('validators');\n $instance->addXmlMappings(array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/config/validation.xml'), 1 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/config/validation.xml')));\n $instance->enableAnnotationMapping($this->get('annotation_reader'));\n $instance->addMethodMapping('loadValidatorMetadata');\n $instance->setMetadataCache(new \\Symfony\\Component\\Validator\\Mapping\\Cache\\Psr6Cache(\\Symfony\\Component\\Cache\\Adapter\\PhpArrayAdapter::create((__DIR__.'/validation.php'), ${($_ = isset($this->services['cache.validator']) ? $this->services['cache.validator'] : $this->getCache_ValidatorService()) && false ?: '_'})));\n $instance->addObjectInitializers(array(0 => $this->get('doctrine.orm.validator_initializer'), 1 => new \\FOS\\UserBundle\\Validator\\Initializer(${($_ = isset($this->services['fos_user.util.canonical_fields_updater']) ? $this->services['fos_user.util.canonical_fields_updater'] : $this->getFosUser_Util_CanonicalFieldsUpdaterService()) && false ?: '_'})));\n $instance->addXmlMapping(($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/DependencyInjection/Compiler/../../Resources/config/storage-validation/orm.xml'));\n\n return $instance;\n }", "protected function service()\n {\n return new Service();\n }", "public static function build() {\n return new Builder();\n }", "abstract protected function _setRequestServiceBuilder();", "protected function getVictoireCore_CacheBuilderService()\n {\n return $this->services['victoire_core.cache_builder'] = new \\Victoire\\Bundle\\CoreBundle\\Cache\\Builder\\CacheBuilder($this->get('victoire_core.cache'));\n }", "public function creating(Service $Service)\n {\n //code...\n }", "public function builder()\n {\n return new Builder($this);\n }", "public static function factory(): ServiceInterface\n {\n return new static();\n }", "protected function getVictoireViewReference_BuilderService()\n {\n return $this->services['victoire_view_reference.builder'] = new \\Victoire\\Bundle\\ViewReferenceBundle\\Builder\\ViewReferenceBuilder($this->get('victoire_view_reference.builder_chain'));\n }", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }", "public function getBuilder();", "private function createService(ServiceDefinition $serviceDefinition)\n\t{\n\t\t// fetch the persistence manager from the container\n\t\t$crudManager = $this->container->get($serviceDefinition->getCrudManagerClassname());\n\t\t// create service as defined in servicemodel.yml\n\t\t$serviceClassname = $serviceDefinition->getServiceClassname();\n\t\tif (!class_exists($serviceClassname)) {\n\t\t\tthrow new Exception('Unknown business service class: ' . $serviceClassname);\n\t\t}\n\t\treturn new $serviceClassname(\n\t\t\t$crudManager,\n\t\t\t$serviceDefinition->getBusinessObjectClassname()\n\t\t);\n\t}", "public function generate($className)\n\t{\n\t\t$this->builder->complete();\n\n\t\t$this->generatedClasses = [];\n\t\t$this->className = $className;\n\t\t$containerClass = $this->generatedClasses[] = new Nette\\PhpGenerator\\ClassType($this->className);\n\t\t$containerClass->setExtends(Container::class);\n\t\t$containerClass->addMethod('__construct')\n\t\t\t->addBody('$this->parameters = $params;')\n\t\t\t->addBody('$this->parameters += ?;', [$this->builder->parameters])\n\t\t\t->addParameter('params', [])\n\t\t\t\t->setTypeHint('array');\n\n\t\t$definitions = $this->builder->getDefinitions();\n\t\tksort($definitions);\n\n\t\t$meta = $containerClass->addProperty('meta')\n\t\t\t->setVisibility('protected')\n\t\t\t->setValue([Container::TYPES => $this->builder->getClassList()]);\n\n\t\tforeach ($definitions as $name => $def) {\n\t\t\t$meta->value[Container::SERVICES][$name] = $def->getImplement() ?: $def->getType() ?: null;\n\t\t\tforeach ($def->getTags() as $tag => $value) {\n\t\t\t\t$meta->value[Container::TAGS][$tag][$name] = $value;\n\t\t\t}\n\t\t}\n\n\t\tforeach ($definitions as $name => $def) {\n\t\t\ttry {\n\t\t\t\t$name = (string) $name;\n\t\t\t\t$methodName = Container::getMethodName($name);\n\t\t\t\tif (!PhpHelpers::isIdentifier($methodName)) {\n\t\t\t\t\tthrow new ServiceCreationException('Name contains invalid characters.');\n\t\t\t\t}\n\t\t\t\t$containerClass->addMethod($methodName)\n\t\t\t\t\t->addComment(PHP_VERSION_ID < 70000 ? '@return ' . ($def->getImplement() ?: $def->getType()) : '')\n\t\t\t\t\t->setReturnType(PHP_VERSION_ID >= 70000 ? ($def->getImplement() ?: $def->getType()) : null)\n\t\t\t\t\t->setBody($name === ContainerBuilder::THIS_CONTAINER ? 'return $this;' : $this->generateService($name))\n\t\t\t\t\t->setParameters($def->getImplement() ? [] : $this->convertParameters($def->parameters));\n\t\t\t} catch (\\Exception $e) {\n\t\t\t\tthrow new ServiceCreationException(\"Service '$name': \" . $e->getMessage(), 0, $e);\n\t\t\t}\n\t\t}\n\n\t\t$aliases = $this->builder->getAliases();\n\t\tksort($aliases);\n\t\t$meta->value[Container::ALIASES] = $aliases;\n\n\t\treturn $this->generatedClasses;\n\t}", "private function createBuilder()\n {\n $class = get_class($this->data->getModel());\n\n $this->name = strtolower(class_basename($class));\n\n $result = $this->callEvent($class, [$class => $this->data]);\n\n if ($result instanceof $this->data) {\n $this->data = $result;\n }\n\n $this->makePaginator();\n }", "public function serviceType(ServiceType $serviceType): StationDetailsBuilder;", "public function getBuilder()\n {\n $class = '\\ReneDeKat\\Quickbooks\\Builders\\\\'.$this->getClassName();\n\n return new $class($this);\n }", "public function builder()\n\t{\n\t\t$builder = new Builder($this->request);\n\t\treturn $builder;\n\t}", "private function initBuilder()\n {\n $this->modx->loadClass('transport.modPackageBuilder', '', false, true);\n $this->builder = new \\modPackageBuilder($this->modx);\n }", "protected function getVictoireWidgetMap_BuilderService()\n {\n return $this->services['victoire_widget_map.builder'] = new \\Victoire\\Bundle\\WidgetMapBundle\\Builder\\WidgetMapBuilder($this->get('victoire_widget_map.contextual_view_warmer'), $this->get('victoire_widget_map.children_resolver'));\n }", "protected function getVictoireBusinessPage_BusinessPageBuilderService()\n {\n return $this->services['victoire_business_page.business_page_builder'] = new \\Victoire\\Bundle\\BusinessPageBundle\\Builder\\BusinessPageBuilder($this->get('victoire_core.helper.business_entity_helper'), $this->get('victoire_core.url_builder'), $this->get('victoire_business_entity.converter.parameter_converter'), $this->get('victoire_business_entity.provider.entity_proxy_provider'), $this->get('victoire_view_reference.builder'));\n }", "public static function make(): self\n\t{\n\t\treturn static::builder()->build();\n\t}", "public static function make(): self\n\t{\n\t\treturn static::builder()->build();\n\t}", "public static function make(): self\n\t{\n\t\treturn static::builder()->build();\n\t}", "public static function make(): self\n\t{\n\t\treturn static::builder()->build();\n\t}", "private function createService(array $service)\n {\n if (isset($service['constructor'])) {\n $instance = $service['constructor']();\n return $instance;\n }\n\n if (!isset($service['class'])) {\n throw new ContainerException('Service hasn\\'t field class');\n }\n\n if (!class_exists($service['class'])) {\n throw new ContainerException(\"Class {$service['class']} doesn't exists\");\n }\n\n $class = $service['class'];\n if (isset($service['arguments'])) {\n $newService = new $class(...$service['arguments']);\n } else {\n $newService = new $class();\n }\n\n if (isset($service['calls'])) {\n foreach ($service['calls'] as $call) {\n if (!method_exists($newService, $call['method'])) {\n throw new ContainerException(\"Method {$call['method']} from {$service['class']} class not found\");\n }\n\n $arguments = $call['arguments'] ?? [];\n\n call_user_func_array([$newService, $call['method']], $arguments);\n }\n }\n\n return $newService;\n }", "protected function getVictoireWidget_WidgetFormBuilderService()\n {\n return $this->services['victoire_widget.widget_form_builder'] = new \\Victoire\\Bundle\\WidgetBundle\\Builder\\WidgetFormBuilder($this);\n }", "public function createBuilder($name, $data = null);", "public static function factory($config = array())\n {\n $default = array(\n 'base_url' => 'http://api.wordpress.org',\n 'curl.options' => array(\n CURLOPT_CONNECTTIMEOUT => 30,\n CURLOPT_TIMEOUT => 120,\n 'body_as_string' => true,\n ),\n );\n\n $required = array('base_url');\n $config = Collection::fromConfig($config, $default, $required);\n $description = ServiceDescription::factory(__DIR__.'/service.json');\n\n $client = new self($config->get('base_url'), $config);\n $client->setDescription($description);\n\n return $client;\n }", "protected function getVictoireBusinessPage_Manager_BusinessPageReferenceBuilderService()\n {\n return $this->services['victoire_business_page.manager.business_page_reference_builder'] = new \\Victoire\\Bundle\\BusinessPageBundle\\Builder\\BusinessPageReferenceBuilder();\n }", "protected function getVictoireBlog_Manager_BlogReferenceBuilderService()\n {\n return $this->services['victoire_blog.manager.blog_reference_builder'] = new \\Victoire\\Bundle\\BlogBundle\\Builder\\BlogReferenceBuilder();\n }", "private function generateService($name)\n\t{\n\t\t$def = $this->builder->getDefinition($name);\n\n\t\tif ($def->isDynamic()) {\n\t\t\treturn PhpHelpers::formatArgs('throw new Nette\\\\DI\\\\ServiceCreationException(?);',\n\t\t\t\t[\"Unable to create dynamic service '$name', it must be added using addService()\"]\n\t\t\t);\n\t\t}\n\n\t\t$entity = $def->getFactory()->getEntity();\n\t\t$serviceRef = $this->builder->getServiceName($entity);\n\t\t$factory = $serviceRef && !$def->getFactory()->arguments && !$def->getSetup() && $def->getImplementMode() !== $def::IMPLEMENT_MODE_CREATE\n\t\t\t? new Statement(['@' . ContainerBuilder::THIS_CONTAINER, 'getService'], [$serviceRef])\n\t\t\t: $def->getFactory();\n\n\t\t$this->currentService = null;\n\t\t$code = '$service = ' . $this->formatStatement($factory) . \";\\n\";\n\n\t\tif (\n\t\t\t(PHP_VERSION_ID < 70000 || $def->getSetup())\n\t\t\t&& ($type = $def->getType())\n\t\t\t&& !$serviceRef && $type !== $entity\n\t\t\t&& !(is_string($entity) && preg_match('#^[\\w\\\\\\\\]+\\z#', $entity) && is_subclass_of($entity, $type))\n\t\t) {\n\t\t\t$code .= PhpHelpers::formatArgs(\"if (!\\$service instanceof $type) {\\n\"\n\t\t\t\t. \"\\tthrow new Nette\\\\UnexpectedValueException(?);\\n}\\n\",\n\t\t\t\t[\"Unable to create service '$name', value returned by factory is not $type type.\"]\n\t\t\t);\n\t\t}\n\n\t\t$this->currentService = $name;\n\t\tforeach ($def->getSetup() as $setup) {\n\t\t\t$code .= $this->formatStatement($setup) . \";\\n\";\n\t\t}\n\n\t\t$code .= 'return $service;';\n\n\t\tif (!$def->getImplement()) {\n\t\t\treturn $code;\n\t\t}\n\n\t\t$factoryClass = (new Nette\\PhpGenerator\\ClassType)\n\t\t\t->addImplement($def->getImplement());\n\n\t\t$factoryClass->addProperty('container')\n\t\t\t->setVisibility('private');\n\n\t\t$factoryClass->addMethod('__construct')\n\t\t\t->addBody('$this->container = $container;')\n\t\t\t->addParameter('container')\n\t\t\t\t->setTypeHint($this->className);\n\n\t\t$rm = new \\ReflectionMethod($def->getImplement(), $def->getImplementMode());\n\n\t\t$factoryClass->addMethod($def->getImplementMode())\n\t\t\t->setParameters($this->convertParameters($def->parameters))\n\t\t\t->setBody(str_replace('$this', '$this->container', $code))\n\t\t\t->setReturnType(PHP_VERSION_ID >= 70000 ? (Reflection::getReturnType($rm) ?: $def->getType()) : null);\n\n\t\tif (PHP_VERSION_ID < 70000) {\n\t\t\t$this->generatedClasses[] = $factoryClass;\n\t\t\t$factoryClass->setName(str_replace(['\\\\', '.'], '_', \"{$this->className}_{$def->getImplement()}Impl_{$name}\"));\n\t\t\treturn \"return new {$factoryClass->getName()}(\\$this);\";\n\t\t}\n\n\t\treturn 'return new class ($this) ' . $factoryClass . ';';\n\t}", "private function createService($partialMock = false) {\n $this->mockConfig([]);\n $this->mock(['registrations' => RegistrationService::class, 'groups' => GroupRepository::class,\n 'lessons' => LessonRepository::class, 'offdays' => OffdayRepository::class]);\n $this->courseService = $partialMock\n ? Mockery::mock(CourseServiceImpl::class . '[coursePossible,obligatoryPossible]',\n [$this->getMocked('configService'), $this->getMocked('registrations'), $this->getMocked('groups'),\n $this->getMocked('lessons'), $this->getMocked('offdays'), $this->app->make(CourseValidator::class)])\n : $this->app->make(CourseService::class);\n }", "public function create(string $service, array $options = []): CircuitBreaker;", "protected function createBuilder()\n\t{\n\t\treturn new Db_CompiledBuilder($this);\n\t}", "public function __construct(BuildingService $buildingService)\n {\n // Dependencies automatically resolved by service container...\n $this->buildingService = $buildingService;\n }", "protected function getVictoireCore_ViewCssBuilderService()\n {\n return $this->services['victoire_core.view_css_builder'] = new \\Victoire\\Bundle\\CoreBundle\\Builder\\ViewCssBuilder($this, array('xs' => array('min' => 0, 'max' => 767), 'sm' => array('min' => 768, 'max' => 991), 'md' => array('min' => 992, 'max' => 1199), 'lg' => array('min' => 1200)), ($this->targetDirs[3].'/app'));\n }", "function componentBuilder() { $this->__construct(); }", "public function __construct($builder)\n {\n $this->builder = $builder;\n }", "public function create()\n\t{\n\t\t$scope = new \\ReflectionClass( $this -> className );\n\t\t$new_scope = $scope -> newInstanceArgs( $this -> arguments );\n\t\treturn $new_scope;\n\t}", "public function __construct()\n {\n //$builder->addDefinitions('ConfigDI.php');\n //self::$container = $builder->build();\n }", "private function instantiate_service( $class ) {\n\t\tif ( ! class_exists( $class ) ) {\n\t\t\tthrow Exception\\InvalidService::from_service( $class );\n\t\t}\n\n\t\t$service = new $class();\n\n\t\tif ( ! $service instanceof Service ) {\n\t\t\tthrow Exception\\InvalidService::from_service( $service );\n\t\t}\n\n\t\tif ( $service instanceof AssetsAware ) {\n\t\t\t$service->with_assets_handler( $this->assets_handler );\n\t\t}\n\n\t\treturn $service;\n\t}", "public static function create() {}", "public static function create() {}", "public static function create() {}", "public function create(string $class);", "public function create(){\r\n\treturn new $this->class();\r\n }", "public function configureBuilder();", "protected function getVictoirePage_PageReferenceBuilderService()\n {\n return $this->services['victoire_page.page_reference_builder'] = new \\Victoire\\Bundle\\PageBundle\\Builder\\PageReferenceBuilder();\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 }", "protected function getVictoireCore_AdminMenuBuilderService()\n {\n return $this->services['victoire_core.admin_menu_builder'] = new \\Victoire\\Bundle\\CoreBundle\\Menu\\MenuBuilder($this->get('knp_menu.factory'), $this->get('security.authorization_checker'));\n }", "protected function getVictoireCore_UrlBuilderService()\n {\n return $this->services['victoire_core.url_builder'] = new \\Victoire\\Bundle\\CoreBundle\\Helper\\UrlBuilder();\n }", "public function create()\n {\n return new $this->class;\n }", "public function build() {}", "public function build() {}", "public function build() {}", "public function of($class): FactoryBuilder\n {\n return new FactoryBuilder(\n $class,\n $this->definitions,\n $this->states,\n $this->afterMaking,\n $this->afterCreating,\n $this->orm,\n $this->faker\n );\n }", "public static function create()\n {\n return new JsonBuilder(array());\n }", "public function builder()\n {\n return null;\n }", "public function getBuilder() {\n if (!isset($this->builder)) {\n if (empty($this->configuration['builder'])) {\n $this->builder = $this->builderManager->createInstance('standard', []);\n }\n else {\n $this->builder = $this->builderManager->createInstance($this->configuration['builder'], []);\n }\n }\n return $this->builder;\n }", "protected function resourceService(){\n return new $this->resourceService;\n }", "public function newBuilder()\n {\n return new Builder();\n }", "protected function getVictoireBusinessPage_Manager_VirtualBusinessPageReferenceBuilderService()\n {\n return $this->services['victoire_business_page.manager.virtual_business_page_reference_builder'] = new \\Victoire\\Bundle\\BusinessPageBundle\\Builder\\VirtualBusinessPageReferenceBuilder();\n }", "public function build( $class ) {\n\t\t$full_class_name = $this->namespace . $class;\n\t\treturn new $full_class_name();\n\t}", "public function testGetBuilder()\n\t{\n\t\t$serviceContainer = new TheServiceContainer();\n\t\t$container = new FeatureContainer($serviceContainer, $this->getWPDB());\n\t\t$this->assertTrue(is_object($serviceContainer->make(MySqlBuilder::class)));\n\t\t$this->assertTrue(is_object($container->getBuilder()));\n\n\t\t$this->assertTrue(\n\t\t\tis_a(\n\t\t\t\t$container->getBuilder(),\n\t\t\t\tBuilderInterface::class\n\t\t\t)\n\t\t);\n\n\t\t$this->assertEquals(\n\t\t\t$serviceContainer->make(MySqlBuilder::class),\n\t\t\t$container->getBuilder()\n\t\t);\n\t}", "public function make() {}", "private function createForm()\n\t{\n\t\t$builder = $this->getService('form')->create();\n\t\t$builder->setValidatorService($this->getService('validator'));\n\t\t$builder->setFormatter(new BasicFormFormatter());\n\t\t$builder->setDesigner(new DoctrineDesigner($this->getDoctrine(), 'Entity\\User',array('location')));\n\n\t\t$builder->getField('location')->setRequired(true);\n\t\t$builder->submit($this->getRequest());\n\n\t\treturn $builder;\n\t}", "public function createNamedBuilder($name, array $data = array(), array $options = array());", "public function createBuilder(array $data = array(), array $options = array());", "protected function getBuilderClass(): string\n {\n return FromDegrees::class;\n }", "protected function newBuilder($class)\n {\n return new Builder($class);\n }", "public function create_service(array $credential=[]){\n \n if(!$credential) {\n $credential = \\Drupal::service('ml_engine.project')->get_credential();\n }\n $client = new \\Google_Client();\n $client->setAuthConfig($credential);\n $client->addScope(\\Google_Service_CloudMachineLearningEngine::CLOUD_PLATFORM);\n $service = new \\Google_Service_CloudMachineLearningEngine($client);\n return $service;\n }", "function hook_get_builder_factory($hook, array $args = array()) {\n require_once 'src/classes/factories/EntityToolboxDependentHookBuilderFactory.inc';\n $args += array('hook' => $hook);\n $hook_info = entity_toolbox_hook_get_info($hook);\n $factoryClass = $hook_info['factory class'];\n $factory = new $factoryClass($args);\n\n return $factory;\n}", "protected static function getFacadeAccessor()\n {\n return \\MonthlyCloud\\Sdk\\Builder::class;\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 }", "public function create($serviceManager);", "public static function buildServiceDefinition(\n bool $asCRUD = false,\n ?string $name = null,\n ?string $namespace = null,\n ?string $model = null\n ) {\n return self::createServiceBuilder($asCRUD, $name, $namespace, $model)->build();\n }", "protected function createCommandBuilder()\n {\n return new CFirebirdCommandBuilder($this);\n }", "public function createService(AccountServiceManagerInterface $sl);", "protected function createContainer()\n {\n $container = new ContainerBuilder();\n // Load the services that are provided by the bundle.\n $extension = new WebfactoryIcuTranslationExtension();\n $extension->load([], $container);\n\n return $container;\n }", "public function testCreateService()\n {\n\n }", "private function getBuilder(): \\LoyaltyCorp\\ApiDocumenter\\SchemaBuilders\\ObjectSchemaBuilder\n {\n $phpDocExtractor = new PhpDocExtractor();\n $reflectionExtractor = new ReflectionExtractor(\n null,\n null,\n null,\n true,\n ReflectionExtractor::ALLOW_PRIVATE |\n ReflectionExtractor::ALLOW_PROTECTED |\n ReflectionExtractor::ALLOW_PUBLIC\n );\n $propertyInfo = new PropertyInfoExtractor(\n [$reflectionExtractor],\n [$phpDocExtractor, $reflectionExtractor],\n [$phpDocExtractor],\n [],\n []\n );\n\n return new ObjectSchemaBuilder(\n new CamelCaseToSnakeCaseNameConverter(),\n new WrappedPropertyInfoExtractor($propertyInfo),\n new PropertyTypeToSchemaConverter(new OpenApiTypeResolver())\n );\n }", "private function createFormDefinition()\n {\n $id = $this->getServiceId('form_type');\n if (!$this->container->has($id)) {\n $definition = new Definition($this->getServiceClass('form'));\n $definition\n ->setArguments([$this->options['entity']])\n ->addTag('form.type', [\n 'alias' => sprintf('%s_%s', $this->prefix, $this->resourceName)]\n )\n ;\n $this->container->setDefinition($id, $definition);\n }\n }", "public function __construct(Builder $builder)\n\t{\n\t\t$this->builder = $builder;\n\t}", "protected function getVictoireCore_EntityProxy_FieldsBuilderService()\n {\n return $this->services['victoire_core.entity_proxy.fields_builder'] = new \\Victoire\\Bundle\\CoreBundle\\Form\\Builder\\EntityProxyFieldsBuilder($this->get('victoire_business_entity.cache_reader'), $this->get('translator.default'));\n }", "public function __construct()\n {\n $this->botService = new BotService();\n }", "public function builder()\n {\n return $this->builder;\n }", "public function __construct()\n {\n $this->services = $this->privates = [];\n $this->parameters = [\n 'viserio' => [\n 'console' => [\n 'name' => 'test',\n 'version' => '1',\n ],\n ],\n 'console.command.ids' => [],\n ];\n $this->methodMapping = [\n \\Symfony\\Component\\Console\\CommandLoader\\CommandLoaderInterface::class => 'getce817e8bdc75399a693ba45b876c457a0f7fd422258f7d4eabc553987c2fbd31',\n \\Viserio\\Component\\Config\\Command\\ConfigDumpCommand::class => 'get88001f5d55ce57598db2e5b80611a49d605be7b037e634e18ca2493683a114ee',\n \\Viserio\\Component\\Config\\Command\\ConfigReaderCommand::class => 'get91fd613885c83bb4b00b29ee3e879446444b7ecad7fdd0292ef1df30bdfa3884',\n \\Viserio\\Component\\Console\\Application::class => 'get206058a713a7172158e11c9d996f6a067c294ab0356ae6697060f162e057445a',\n ];\n $this->aliases = [\n \\Symfony\\Component\\Console\\Application::class => \\Viserio\\Component\\Console\\Application::class,\n 'cerebro' => \\Viserio\\Component\\Console\\Application::class,\n 'console' => \\Viserio\\Component\\Console\\Application::class,\n ];\n }", "public function service()\n {\n }", "public function build(): Client\n {\n $this->validateBuilder();\n\n if (\n null !== $this->authenticator &&\n null !== $this->requestTransformer &&\n null !== $this->requestTransformer->getHandler()\n ) {\n $this->requestTransformer->getHandler()->append($this->authenticator);\n }\n\n if (null === $this->requestTransformer) {\n $this->requestTransformer = $this->buildRequestTransformer();\n }\n\n if (null === $this->responseTransformer) {\n $this->responseTransformer = $this->buildResponseTransformer();\n }\n\n $this->appendAdditionalRequestHandlers();\n $this->appendAdditionalResponseHandlers();\n\n return new Client(\n $this->apiUrl,\n $this->httpClient ?: Psr18ClientDiscovery::find(),\n $this->requestTransformer, // @phpstan-ignore-line\n $this->responseTransformer, // @phpstan-ignore-line\n $this->streamFactory ?: Psr17FactoryDiscovery::findStreamFactory(),\n $this->eventDispatcher,\n $this->debugLogger\n );\n }", "public function build()\n {\n }", "public static function factory($config = array())\n {\n $default = array('base_url' => 'http://api.zoopla.co.uk/api/v1/');\n\n // The following values are required when creating the client\n $required = array(\n 'base_url',\n 'api_key', \n );\n\n // Merge in default settings and validate the config\n $config = Collection::fromConfig($config, $default, $required);\n\n // Create a new Zoopla client\n $client = new self($config->get('base_url'), $config);\n\n // Always append the API key to each request\n $client->setDefaultOption('query', array('api_key' => $config['api_key']));\n\n // Set the Service Description using the supplied JSON config file\n $client->setDescription(ServiceDescription::factory(__DIR__.'/../../../service.json'));\n\n return $client;\n }", "public function build();", "public function build();" ]
[ "0.6937244", "0.65150565", "0.64406854", "0.64283574", "0.6390292", "0.6371195", "0.6337419", "0.63161004", "0.62856436", "0.62622833", "0.6232667", "0.61645585", "0.609025", "0.6084413", "0.6072725", "0.60652244", "0.6044519", "0.59891725", "0.5980313", "0.5946925", "0.593862", "0.59182733", "0.591005", "0.5876871", "0.58061576", "0.57826823", "0.5768277", "0.57517046", "0.57052577", "0.57052577", "0.57052577", "0.57052577", "0.5694672", "0.5663783", "0.56499654", "0.5646012", "0.5644894", "0.56389385", "0.5628611", "0.5611486", "0.56093645", "0.56044084", "0.5561812", "0.5560049", "0.5559471", "0.55538476", "0.5552313", "0.55459225", "0.5543772", "0.55228394", "0.55228394", "0.55228394", "0.55214405", "0.55080533", "0.54985976", "0.5467267", "0.54609615", "0.54506797", "0.54469943", "0.5441029", "0.5438208", "0.5438208", "0.543724", "0.5420686", "0.54156256", "0.5415394", "0.5412769", "0.5409729", "0.54083973", "0.53989685", "0.5398877", "0.5394887", "0.5386727", "0.53718275", "0.5369178", "0.53668374", "0.5365038", "0.5364871", "0.53630793", "0.53612936", "0.5351498", "0.5348205", "0.53371686", "0.5329639", "0.5322649", "0.5322315", "0.53223145", "0.53128123", "0.53062147", "0.5302292", "0.5290432", "0.5287487", "0.52870005", "0.5280929", "0.52789676", "0.52747023", "0.5268662", "0.5268171", "0.5263876", "0.52631897", "0.52631897" ]
0.0
-1
Create a view model builder class.
public static function createViewModelBuilder( bool $single = false, array $rules = [], array $updateRules = [], ?string $name = null, ?string $namespace = null, ?string $path = null, ?string $model = null, ?bool $hasHttpHandlers = false ) { $rulesParserFunc = static function ($definitions) { $definitions_ = []; foreach ($definitions as $key => $value) { if (\is_string($value) && !Str::contains($value, '=')) { continue; } if (is_numeric($key) && \is_string($value)) { $k = Str::before('=', $value); $v = Str::after('=', $value); $definitions_[$k] = $v; continue; } $definitions_[$key] = $value; } foreach ($definitions_ ?? [] as $key => $definition) { yield $key => $definition; } }; $component = ViewModelBuilder($name, $namespace, $path); if (\is_string($model)) { $component = $component->bindModel($model); } if (!$single) { $component = $component->setUpdateRules( iterator_to_array( $rulesParserFunc($updateRules) ) ); } else { $component = $component->asSingleActionValidator(); } if ($hasHttpHandlers) { $component = $component->withHttpHandlers(); } return $component ->addInputsTraits() ->setRules(iterator_to_array($rulesParserFunc($rules))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createBuilder();", "public static function builder() {\n return new self();\n }", "public static function builder() {\n\t\treturn new Builder();\n\t}", "public function builder()\n {\n return new Builder($this);\n }", "public function makeNew()\n\t{\n\t\treturn new static($this->view);\n\t}", "static public function builder(): Builder\n {\n return new Builder;\n }", "private function createBuilder()\n {\n $class = get_class($this->data->getModel());\n\n $this->name = strtolower(class_basename($class));\n\n $result = $this->callEvent($class, [$class => $this->data]);\n\n if ($result instanceof $this->data) {\n $this->data = $result;\n }\n\n $this->makePaginator();\n }", "public function createView();", "public static function builder();", "public function setBuilder(ViewBuilder $builder): View;", "public function buildModel() {}", "public static function build() {\n return new Builder();\n }", "public function createView(){\n\t\t$vue = new View(\"Create\");\n\t\t$vue->generer();\n\t}", "public static function make(): self\n\t{\n\t\treturn static::builder()->build();\n\t}", "public static function make(): self\n\t{\n\t\treturn static::builder()->build();\n\t}", "public static function make(): self\n\t{\n\t\treturn static::builder()->build();\n\t}", "public static function make(): self\n\t{\n\t\treturn static::builder()->build();\n\t}", "public function makeView() {\n\t\treturn \n\t\t\t$this->getView()\n\t\t\t\t->with('option', $this);\n\t}", "public function make($modelClass);", "public function form_builder()\n {\n // ToDo run checks when form is being created, please.\n// if(!empty($this->check())):\n// throw new ValidationError(checks_html_output($this->check()));\n//\n// endif;\n\n return new form\\ModelForm($this, $this->_field_values());\n }", "public function create()\n\t{\n\t\treturn View::make($this->createView, array(\n\t\t\t'model' => $this->decorator->getModel(),\n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'fields' => FieldMapper::getFields($this->decorator->getFields()),\n\t\t\t'method' => 'POST',\n\t\t\t'action' => get_class($this) . '@store',\n\t\t\t'listingAction' => get_class($this) . '@index'\n\t\t));\n\t}", "private function modelBuilder() {\n // Create model\n $model = '<?php\n class ' . ucfirst($this->formName) . '_model extends CI_Model {\n\n private $table;\n\n // Constructor\n function __construct() {\n\n parent::__construct();\n $this->table = \"' . $this->formName . '\";\n }\n\n /**\n * Insert datas in ' . $this->formName . '\n *\n * @param array $data\n * @return bool\n */\n function save($data = array()) {\n // Insert\n $this->db->insert($this->table, $data);\n\n // If error return false, else return inserted id\n if (!$this->db->affected_rows()) {\n\t return false;\n } else {\n\t\treturn $this->db->insert_id();\n }\n }\n\n }\n ?>';\n\n return array(str_replace('<', '&lt;', $model), $model);\n }", "protected function buildView()\n {\n $table = $this->columns;\n\n $columns = $table->map(function ($column) {\n return $column->column.':'.$column->method.','.$column->caption;\n })->implode('|');\n\n $dropdown = $table->filter(function ($column) {\n return true == $column->is_foreign;\n })->transform(function ($column) {\n return $column->column.':'.$column->table_foreign;\n })->implode('|');\n\n $this->view = [\n 'name' => $this->module->name,\n '--columns' => $columns,\n '--controller' => $this->class,\n '--request' => $this->class,\n '--module' => $this->module->id,\n '--dropdown' => $dropdown,\n '--icon' => $this->module->icon,\n ];\n }", "public function getBuilder();", "public static function model()\n {\n return new self;\n }", "protected function createModel()\n {\n $class = $this->getModelClass();\n\n $attributes = $this->getModelAttributes();\n\n return new $class($attributes);\n }", "public function builder()\n\t{\n\t\t$builder = new Builder($this->request);\n\t\treturn $builder;\n\t}", "protected function buildView()\n {\n $view = new FusionView();\n\n $httpRequest = Request::createFromEnvironment();\n $request = $httpRequest->createActionRequest();\n\n $uriBuilder = new UriBuilder();\n $uriBuilder->setRequest($request);\n\n $this->controllerContext = new ControllerContext(\n $request,\n new Response(),\n new Arguments([]),\n $uriBuilder\n );\n\n $view->setControllerContext($this->controllerContext);\n $view->disableFallbackView();\n $view->setPackageKey('Flowpack.Listable');\n $view->setFusionPathPattern(__DIR__ . '/Fixtures/');\n\n return $view;\n }", "public function model()\n {\n $model = $this->_model;\n return new $model;\n\n }", "private function _makeView($controller_name)\n\t{\n\t\t$view = $controller_name . 'View';\n\n\t\treturn new $view();\n\t}", "public function create(): View\n {\n //\n }", "public function create()\n {\n return view($this->_config['view']);\n }", "protected function createModel()\n {\n $this->call('make:model', array_filter([\n 'name' => $this->getNameInput(),\n '--factory' => $this->option('factory'),\n '--migration' => $this->option('migration'),\n ]));\n }", "public function getBuilder()\n {\n $class = '\\ReneDeKat\\Quickbooks\\Builders\\\\'.$this->getClassName();\n\n return new $class($this);\n }", "public function create()\n {\n return view(\"gasto.gastofijo.create\");\n }", "public function create(): object\n {\n if (!Bouncer::can('create', $this->model)) {\n abort(403);\n }\n $form = $this->form($this->form, [\n 'method' => 'POST',\n 'route' => [$this->routeWithModulePrefix . '.' . 'store']\n ]);\n\n $item = new $this->model;\n return $this->view($this->baseView . '.create', ['form' => $form, 'item' => $item]);\n }", "protected function createView()\n {\n return new IndexView();\n }", "public function builder()\n {\n return null;\n }", "public static function newModel()\n {\n $model = static::$model;\n\n return new $model;\n }", "public function create(){\r\n\treturn new $this->class();\r\n }", "protected function createBuilder()\n\t{\n\t\treturn new Db_CompiledBuilder($this);\n\t}", "public function builder()\n {\n return $this->builder;\n }", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }", "function __construct()\n {\n $this->view = new View();\n }", "public function create()\n\t{\n\t\t//\n\t\treturn View::make('mockups.pelanggan');\n\t}", "public function newBuilder()\n {\n $builder = new Builder;\n $builder->setModel($this);\n\n return $builder;\n }", "public function create()\n\t{\n\t\t//load a form to make an artobj\n\t\treturn View::make('artobjs.create');\n\t}", "public function create()\n {\n return view($this->view());\n }", "public function createModel()\n {\n $class = '\\\\' . ltrim($this->model, '\\\\');\n\n return new $class;\n }", "public function createModel()\n {\n $class = '\\\\' . ltrim($this->model, '\\\\');\n\n return new $class;\n }", "function __construct()\r\n {\r\n $this->view = new View();\r\n }", "public function createModel()\n\t{\n\t\t$class = '\\\\'.ltrim($this->model, '\\\\');\n\t\treturn new $class;\n\t}", "private function setModelViewTemplateCreateViewPath()\n\t\t{\n\n\t\t\t$this->modelViewTemplateCreateViewPath = stubs_path('ModelView/views');\n\n\t\t\treturn $this;\n\n\t\t}", "public function create() {\r\n\t\r\n\t$form = new Form();\r\n\t$form->setTranslator($this->translator);\r\n\treturn $form;\r\n }", "public function classView()\n\t{\n\t\treturn new ClassView(10);\n\t}", "protected function createCommandBuilder()\n\t{\n\t\treturn new CSqliteCommandBuilder($this);\n\t}", "public function __construct()\n {\n $this->view = new View($this);\n }", "public function create()\n {\n //\n return $this->formView( new Admin() );\n }", "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 }", "public function create()\n {\n $obj = new Obj();\n $this->authorize('create', $obj);\n\n return view('appl.'.$this->app.'.'.$this->module.'.createedit')\n ->with('stub','Create')\n ->with('obj',$obj)\n ->with('editor',true)\n ->with('datetimepicker',true)\n ->with('app',$this);\n }", "function __construct()\n {\n $this->view = new View(); \n }", "public static function makeViewModelFromTemplate($template);", "function view($name_view){\n return new View($name_view);\n}", "function componentBuilder() { $this->__construct(); }", "protected function make(): Model\n {\n $model = new $this->model;\n $this->modelPk = $model->getKeyName();\n\n return $model;\n }", "public function build()\n {\n $this->validate_attributes();\n\n $attributes = [];\n foreach (static::$object_attributes as $key => $value) {\n $attributes[$key] = $this->{$key};\n }\n\n // Construct a vcalendar object based on the templated\n return (new Build(\n static::VTEMPLATE\n ))->build(\n $attributes\n );\n }", "public function create()\n {\n return view(parent::commonData($this->view_path.'.create'));\n }", "protected function factoryBuilder($model)\n { if (class_exists('Illuminate\\Database\\Eloquent\\Factory')) {\n return factory($model);\n }\n\n return (new $model)->factory();\n }", "public function builder()\n {\n if ($this->parent) {\n return $this->parent->builder();\n }\n\n if (is_null($this->builder)) {\n $this->builder = new Builder($this);\n }\n\n return $this->builder;\n }", "public function create() {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function create() {\n return view($this->viewfolder . '.create', ['j' => $this->j]);\n }", "public function createView(FormView $parent = null);", "public function create()\n {\n $model = $this->getClassName();\n $config = $this->getCrudConfig('create');\n $item = app('App\\\\' . $model);\n $viewVars = [\n 'model' => $model,\n $config['viewVar'] => $item,\n 'viewVar' => $config['viewVar']\n ];\n foreach ($config['relatedModels'] as $var => $relatedModel) {\n $viewVars[$var] = app($relatedModel)::pluck('name', 'id');\n }\n return view(strtolower($model) . '.form', $viewVars);\n }", "public function create()\n {\n //\n $view = '';\n return view('backend.admin.class.create', compact('view'));\n }", "function build() {\n $this->to_usd = new view_field(\"To USD\");\n $this->to_local = new view_field(\"To local\");\n $this->timestamp = new view_field(\"Created\");\n $this->expire_date_time = new view_field(\"Expired\");\n parent::build();\n }", "protected function createView() {\n return parent::createView()\n ->with('singleResultView', 'partials.test-result-single-textarea');\n }", "public function __construct()\n {\n $this ->model = $this ->makeModel($this ->model());\n }", "public function create()\n\t{\n\t\t//$admin_config = get_class_vars($this->Model)['admin_config'] ? : [];\n\t\t$class = $this->Model;\n\t\t$admin_config = $class::getConfig() ? : [];\n\t\t$template = isset($admin_config['template_edit']) ? $admin_config['template_edit'] : 'crud.edit';\n\n\t\treturn View::make($template, [\n\t\t\t'page' => [\n\t\t\t\t'action_path' => $admin_config['router'],\n\t\t\t\t'action_method' => 'post',\n\t\t\t\t'scripts' => [\n\t\t\t\t\t'markdown/markdown.min.js',\n\t\t\t\t\t'markdown/bootstrap-markdown.min.js',\n\t\t\t\t\t'jquery.hotkeys.min.js',\n\t\t\t\t\t'uncompressed/bootstrap-wysiwyg.js',\n\t\t\t\t],\n\t\t\t],\n\t\t\t'data' => Request::all(),\n\t\t\t'config' => $admin_config,\n\t\t]);\n\t}", "protected function createLayoutModel()\n {\n return new LayoutModel();\n }", "public function __construct()\n {\n $this->model = app()->make($this->model());\n }", "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(): View|Factory|Application\n {\n return view('blood-types.create');\n }", "private function setModelViewTemplateCreateFormPath()\n\t\t{\n\n\t\t\t$this->modelViewTemplateCreateFormPath = stubs_path('ModelView/forms');\n\n\t\t\treturn $this;\n\n\t\t}", "function __construct(){\n $this->view=new View(); \n }", "public function testModelReturnsBuilder(): void\n {\n $builder = Builder::model(ModelTest::class);\n $this->assertInstanceOf(Builder::class, $builder);\n }", "public function create()\n {\n return new $this->class;\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function getViewModel( $params ) {\n\n $breadCrumbParams = array(\n 'regionName' => $this->getUriParameter('region_name'),\n 'neighborhoodName' => $this->getUriParameter('neighborhood_name'),\n );\n\n $newParams = array_merge($breadCrumbParams,$params);\n return new ViewModel( $newParams );\n }", "public static function createInstance()\n {\n return new Form('serializableInstance', '');\n }", "public static function make($view, $data = array())\n {\n return new static($view, $data);\n }", "public function __construct(){\n //l'intensification de la classe view\n $this->view=new View();\n }", "protected function createListView()\n {\n return new TableListView($this->getOption('list_view_options'));\n }", "protected function form()\n {\n $form = new Form(new Milestone);\n\n $form->display('id', __('ID'));\n $form->text('version', __('Version'));\n $form->text('content', __('Content'));\n $form->textarea('detail', __('Detail'));\n $form->select('type', __('Type'))->options(Milestone::TYPE_MAP);\n\n return $form;\n }", "public function build();", "public function build();", "public function build();", "public function build();", "public function build();", "public function build();", "public function build();", "function store_form($model = null, $prefix = null)\n {\n return new FormBuilder($model, $prefix);\n }" ]
[ "0.6689931", "0.6450339", "0.63651925", "0.6285216", "0.6209547", "0.61825854", "0.61818117", "0.61240727", "0.609202", "0.6081169", "0.6072973", "0.605122", "0.5965128", "0.59614736", "0.59614736", "0.59614736", "0.59614736", "0.5935618", "0.5919159", "0.58988273", "0.588349", "0.5844778", "0.58436805", "0.58366483", "0.58347446", "0.5794395", "0.57474095", "0.5690603", "0.5662324", "0.5660628", "0.5658745", "0.5635962", "0.56120795", "0.5605238", "0.5604725", "0.55926645", "0.5585338", "0.55802864", "0.5578964", "0.55783284", "0.5573354", "0.55727607", "0.5569973", "0.55444765", "0.55414134", "0.5534789", "0.55258816", "0.55214775", "0.5517191", "0.5517191", "0.55158544", "0.54963726", "0.5488856", "0.5475398", "0.5471589", "0.5466533", "0.5464887", "0.5406994", "0.5406535", "0.54038256", "0.53892666", "0.5385038", "0.5377112", "0.5366552", "0.53461677", "0.53403544", "0.533965", "0.5337455", "0.5316241", "0.53131807", "0.5308795", "0.53076494", "0.530733", "0.53058666", "0.530258", "0.5294673", "0.5288504", "0.5288471", "0.52856636", "0.5264814", "0.525983", "0.5255353", "0.5250344", "0.5248977", "0.52470547", "0.5245882", "0.5234578", "0.5230805", "0.52305365", "0.5230148", "0.52187586", "0.5210551", "0.5208423", "0.5197498", "0.5197498", "0.5197498", "0.5197498", "0.5197498", "0.5197498", "0.5197498", "0.51969093" ]
0.0
-1
Create a Data Transfer builder class.
public static function createDtoBuilder( array $attributes = [], array $hidden = [], ?string $name = null, ?string $namespace = null, ?string $model = null ) { $component = DataTransfertClassBuilder($attributes, $name, $namespace); if (\is_string($model)) { $component = $component->bindModel($model); } return $component->setHidden($hidden ?? []); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createBuilder();", "private function createBuilder()\n {\n $class = get_class($this->data->getModel());\n\n $this->name = strtolower(class_basename($class));\n\n $result = $this->callEvent($class, [$class => $this->data]);\n\n if ($result instanceof $this->data) {\n $this->data = $result;\n }\n\n $this->makePaginator();\n }", "public function createBuilder(array $data = array(), array $options = array());", "public function createBuilder($name, $data = null);", "public static function builder();", "public static function builder() {\n return new self();\n }", "public static function builder() {\n\t\treturn new Builder();\n\t}", "public function build()\n {\n return new EntityDataObject(\n $this->name,\n $this->type,\n $this->data,\n $this->linkedEntities,\n null,\n $this->vars\n );\n }", "static public function builder(): Builder\n {\n return new Builder;\n }", "public function getBuilder();", "public function builder()\n {\n return new Builder($this);\n }", "protected function createCommandBuilder()\n\t{\n\t\treturn new CSqliteCommandBuilder($this);\n\t}", "public function getDataRequest()\n {\n /** @var Core_Entity_Request $dataRequest */\n $dataRequest = $this->_requestClass;\n return new $dataRequest(\n array(\n Core_Entity_Model_Abstract::CONSTRUCT_STORAGE => $this->getStorage()\n )\n );\n }", "public static function build() {\n return new Builder();\n }", "public function builder()\n\t{\n\t\t$builder = new Builder($this->request);\n\t\treturn $builder;\n\t}", "public function create($data = null) {\n\t\t$class = $this->type->getModelClassname();\n\t\t$object = new $class($data);\n\t\t$object->setModelStorage($this->type->getStorage());\n\t\treturn $object;\n\t}", "public function toDto(): ObjectData\n {\n $transporterClass = $this->getDto();\n\n /** @var ObjectData $transporter */\n $transporter = new $transporterClass($this);\n\n return $transporter;\n }", "public function createNamedBuilder($name, array $data = array(), array $options = array());", "public function createData()\n {\n // TODO: Implement createData() method.\n }", "function create(DataHolder $holder);", "protected function createBuilder()\n\t{\n\t\treturn new Db_CompiledBuilder($this);\n\t}", "public static function build(): self\n {\n $localChargers = Charger :: with( 'connector_types' ) -> get();\n $localConnectorTypes = ConnectorType :: all();\n \n return (new self) \n -> setLocalChargers ( $localChargers )\n -> setLocalConnectorTypes( $localConnectorTypes );\n }", "public function createData() {\n\t\t\tthrow new \\Exception('Not supported yet.'); \n\t\t}", "protected function createCommandBuilder()\n {\n return new CFirebirdCommandBuilder($this);\n }", "static function newOptsData($builder = null)\n {\n $options = new DataOptionsOpen;\n if ($builder !== null)\n $options->import($builder);\n\n return $options;\n }", "abstract protected function _setRequestServiceBuilder();", "public function newBuilder()\n {\n return new Builder();\n }", "public static function Create(){\n return new ConnectionData();\n }", "public function build(): SetDOMStorageItemRequest\n\t{\n\t\t$instance = new SetDOMStorageItemRequest();\n\t\tif ($this->storageId === null) {\n\t\t\tthrow new BuilderException('Property [storageId] is required.');\n\t\t}\n\t\t$instance->storageId = $this->storageId;\n\t\tif ($this->key === null) {\n\t\t\tthrow new BuilderException('Property [key] is required.');\n\t\t}\n\t\t$instance->key = $this->key;\n\t\tif ($this->value === null) {\n\t\t\tthrow new BuilderException('Property [value] is required.');\n\t\t}\n\t\t$instance->value = $this->value;\n\t\treturn $instance;\n\t}", "public function contruct()\n {\n $this->mBuilder->setTemplate();\n $this->mBuilder->setToUsers($this->mUser, $this->mUserConfig);\n $this->mBuilder->setFromEmail($this->mXoopsConfig);\n $this->mBuilder->setSubject($this->mUser, $this->mXoopsConfig);\n $this->mBuilder->setBody($this->mUser, $this->mXoopsConfig);\n }", "public static function make(): self\n\t{\n\t\treturn static::builder()->build();\n\t}", "public static function make(): self\n\t{\n\t\treturn static::builder()->build();\n\t}", "public static function make(): self\n\t{\n\t\treturn static::builder()->build();\n\t}", "public static function make(): self\n\t{\n\t\treturn static::builder()->build();\n\t}", "public function build() {}", "public function build() {}", "public function build() {}", "public function build( $data );", "public function dataBodyRange(): DataBodyRangeRequestBuilder {\n return new DataBodyRangeRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "private function makeBuilder(ConfigDTO $configDTO, LogInterface $log): DatabaseBuilder\n {\n return (new BootRemoteBuildLaravel())\n ->log($log)\n ->ensureStorageDirsExist()\n ->makeNewBuilder($configDTO);\n }", "public function newBuilder()\n {\n $builder = new Builder;\n $builder->setModel($this);\n\n return $builder;\n }", "public function __construct($builder, $data)\n {\n $this->data = $data;\n\n // If a model's name is injected.\n if (is_string($builder) === true) {\n $model = new $builder;\n\n $builder = $model->query();\n }\n\n $this->builder = $builder;\n }", "private function getBuilder(): RequestBuilder\n {\n return new RequestBuilder(new StreamFactory());\n }", "public static function createSelf()\n {\n $dataTypeFactory = new self();\n\n $dataTypeFactory->addFactoryTypeHandler('bit', new BitTypeFactory());\n // Integer type mappers.\n $dataTypeFactory->addFactoryTypeHandler('tinyint', new TinyIntTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('smallint', new SmallIntTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('mediumint', new MediumIntTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('int', new IntTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('bigint', new BigIntTypeFactory());\n // Numeric-point type mappers.\n $dataTypeFactory->addFactoryTypeHandler('double', new DoubleTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('float', new FloatTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('decimal', new DecimalTypeFactory());\n // Date and time mappers.\n $dataTypeFactory->addFactoryTypeHandler('date', new DateTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('time', new TimeTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('timestamp', new TimestampTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('datetime', new DateTimeTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('year', new YearTypeFactory());\n // Char type mappers.\n $dataTypeFactory->addFactoryTypeHandler('char', new CharTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('varchar', new VarCharTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('binary', new BinaryTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('varbinary', new VarBinaryTypeFactory());\n // Blob type mappers.\n $dataTypeFactory->addFactoryTypeHandler('tinyblob', new TinyBlobTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('blob', new BlobTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('mediumblob', new MediumBlobTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('longblob', new LongBlobTypeFactory());\n // Text type mappers.\n $dataTypeFactory->addFactoryTypeHandler('tinytext', new TinyTextTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('text', new TextTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('mediumtext', new MediumTextTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('longtext', new LongTextTypeFactory());\n // Option type mappers.\n $dataTypeFactory->addFactoryTypeHandler('enum', new EnumTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('set', new SetTypeFactory());\n // Other type mappers.\n $dataTypeFactory->addFactoryTypeHandler('json', new JsonTypeFactory());\n\n return $dataTypeFactory;\n }", "public function create(){}", "public function create( $data = array() );", "public static function create() {}", "public static function create() {}", "public static function create() {}", "protected function getDataHandlerInstance() {\n\t\t$dataHandler = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\DataHandling\\DataHandler');\n\t\t$dataHandler->stripslashes_values = 0;\n\t\t$dataHandler->copyTree = $this->parentObject->copyTree;\n\t\t$dataHandler->cachedTSconfig = $this->parentObject->cachedTSconfig;\n\t\t$dataHandler->dontProcessTransformations = 1;\n\t\treturn $dataHandler;\n\t}", "public static function create()\n {\n return new JsonBuilder(array());\n }", "public function build();", "public function build();", "public function build();", "public function build();", "public function build();", "public function build();", "public function build();", "public static function create($data=array())\n {\n return new self($data);\n }", "public function __construct() {\n parent::__construct();\n\n //kapcsolódás a db-hez:\n $this->db = db_connect();\t//\\Config\\Database::connect();\n $this->builder = $this->db->table(\"feladatok\");\n\n }", "public function create(){\r\n\treturn new $this->class();\r\n }", "public function make() {}", "public function youCanUseABuilderAsData()\n {\n // Arrange...\n $fruit = $this->createTestModel()->newQuery();\n\n // Act...\n $response = $this->responder->success( $fruit );\n\n // Assert...\n $this->assertEquals( $response->getData( true ), [\n 'status' => 200,\n 'success' => true,\n 'data' => [\n [\n 'name' => 'Mango',\n 'price' => 10,\n 'isRotten' => false\n ]\n ]\n ] );\n }", "public function builder()\n {\n return null;\n }", "public abstract function build();", "public abstract function build();", "static function create(): self;", "public function create() {}", "abstract public function build();", "abstract public function build();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function make();", "protected function newBuilder($class)\n {\n return new Builder($class);\n }", "abstract public function create (ParameterBag $data);", "private function field_declaration_builder_from_data( $env, $field_data ) {\n\t\t$field_name = $field_data['name'];\n\t\t$field_builder = $env->field( $field_name );\n\t\t$default_value = isset( $field_data['std'] ) ? $field_data['std'] : $this->default_for_attribute( $field_data, 'std' );\n\t\t$label = isset( $field_data['label'] ) ? $field_data['label'] : $field_name;\n\t\t$description = isset( $field_data['desc'] ) ? $field_data['desc'] : $label;\n\t\t$setting_type = isset( $field_data['type'] ) ? $field_data['type'] : null;\n\t\t$choices = isset( $field_data['options'] ) ? array_keys( $field_data['options'] ) : null;\n\t\t$field_type = 'string';\n\n\t\tif ( 'checkbox' === $setting_type ) {\n\t\t\t$field_type = 'boolean';\n\t\t\tif ( $default_value ) {\n\t\t\t\t// convert our default value as well.\n\t\t\t\t$default_value = $this->bit_to_bool( $default_value );\n\t\t\t}\n\t\t\t$field_builder\n\t\t\t\t->with_serializer( array( $this, 'bool_to_bit' ) )\n\t\t\t\t->with_deserializer( array( $this, 'bit_to_bool' ) );\n\n\t\t} elseif ( 'select' === $setting_type ) {\n\t\t\t$field_type = 'string';\n\t\t} else {\n\t\t\t// try to guess numeric fields, although this is not perfect.\n\t\t\tif ( is_numeric( $default_value ) ) {\n\t\t\t\t$field_type = is_float( $default_value ) ? 'float' : 'integer';\n\t\t\t}\n\t\t}\n\n\t\tif ( $default_value ) {\n\t\t\t$field_builder->with_default( $default_value );\n\t\t}\n\t\t$field_builder\n\t\t\t->with_description( $description )\n\t\t\t->with_dto_name( $field_name )\n\t\t\t->with_type( $env->type( $field_type ) );\n\t\tif ( $choices ) {\n\t\t\t$field_builder->with_choices( $choices );\n\t\t}\n\n\t\t$this->on_field_setup( $field_name, $field_builder, $field_data, $env );\n\n\t\treturn $field_builder;\n\t}", "public static function create($data) {\n\t\t$className = get_called_class();\n\t\t$object = new $className($data);\n\t\t$object->save();\n\t\treturn $object;\n\t}", "public function __construct($builder)\n {\n $this->builder = $builder;\n }", "function __buildGDL()\n {\n $gdl = new SwimTeamJobsAdminGUIDataList('Swim Team Jobs',\n '100%', 'jobstatus, jobposition', false) ;\n\n $gdl->set_alternating_row_colors(true) ;\n $gdl->set_show_empty_datalist_actionbar(true) ;\n\n return $gdl ;\n }", "function __construct()\n\t{\n\t\t$this->db = new dbHelper();\n\t\t$this->cb = new CombosData();\n\t\treturn;\n\t}", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }", "public function build() {\n\t\tif (is_null($this->name)) {\n\t\t\t$this->name = \"\";\n\t\t}\n\t\tif (!is_string($this->name)) {\n\t\t\tthrow new Exception(\"name must be a string\");\n\t\t}\n\n\t\tif (!is_string($this->value)) {\n\t\t\t$this->value = (string)$this->value;\n\t\t}\n\n\t\tif (is_null($this->text)) {\n\t\t\t$this->text = \"\";\n\t\t}\n\t\tif (!is_string($this->text)) {\n\t\t\t$this->text = (string)$this->text;\n\t\t}\n\n\t\tif (is_null($this->link)) {\n\t\t\t$this->link = \"\";\n\t\t}\n\t\tif (!is_string($this->link)) {\n\t\t\tthrow new Exception(\"type must be a string\");\n\t\t}\n\n\t\tif ($this->behavior && !($this->behavior instanceof IDataTableBehavior)) {\n\t\t\tthrow new Exception(\"change_behavior must be instance of IDataTableBehavior\");\n\t\t}\n\t\tif (is_null($this->placement)) {\n\t\t\t$this->placement = IDataTableWidget::placement_top;\n\t\t}\n\t\tif ($this->placement != IDataTableWidget::placement_top && $this->placement != IDataTableWidget::placement_bottom) {\n\t\t\tthrow new Exception(\"placement must be 'top' or 'bottom'\");\n\t\t}\n\n\t\tif (is_null($this->title)) {\n\t\t\t$this->title = \"\";\n\t\t}\n\t\tif (!is_string($this->title)) {\n\t\t\tthrow new Exception(\"title must be a string\");\n\t\t}\n\n\t\treturn new DataTableLink($this);\n\t}", "protected function buildDomainObject($row) {\n\t\t$dataflow = new Dataflow();\n\t\t$dataflow->setId($row['id_dataflow']);\n\t\t$dataflow->setName($row['name']);\n\t\t$dataflow->setEnable($row['enable']);\n\t\t$dataflow->setType($row['type']);\n\t\t$dataflow->setInConnectionType($row['in_connection_type']);\n\t\t$dataflow->setOutConnectionType($row['out_connection_type']);\n\t\t$dataflow->setInterface($row['interface']);\n\t\t$dataflow->setMapping($row['mapping']);\n\t\t$dataflow->setObserver($row['observer']);\n\t\treturn $dataflow;\n\t}", "private function createDataHelper() {\n // initialize the data helper when this API is firstly called.\n $this->isDataHelperInitialized = true;\n\n $helperClass = ucfirst($this->controller) . 'DataHelper';\n $helperClassPath = APPLICATION_ROOT_PATH . \"/data-helper/$helperClass.php\";\n if (!file_exists($helperClassPath)) {\n return null;\n }\n \n require_once $helperClassPath;\n return new $helperClass($this->action, $this->request, $this->session);\n }", "public function build(): ExecuteSQLRequest\n\t{\n\t\t$instance = new ExecuteSQLRequest();\n\t\tif ($this->databaseId === null) {\n\t\t\tthrow new BuilderException('Property [databaseId] is required.');\n\t\t}\n\t\t$instance->databaseId = $this->databaseId;\n\t\tif ($this->query === null) {\n\t\t\tthrow new BuilderException('Property [query] is required.');\n\t\t}\n\t\t$instance->query = $this->query;\n\t\treturn $instance;\n\t}", "public function create() {\n\t \n }", "public function builder()\n {\n return $this->builder;\n }", "public static function create(array $data)\n {\n $command = new static();\n $command->exchangeArray($data);\n return $command;\n }", "public function creating(Dataset $dataset)\n {\n }", "private function initBuilder()\n {\n $this->modx->loadClass('transport.modPackageBuilder', '', false, true);\n $this->builder = new \\modPackageBuilder($this->modx);\n }", "public abstract function make();" ]
[ "0.67591774", "0.632981", "0.6280425", "0.6232141", "0.61357385", "0.6012401", "0.5996179", "0.5910993", "0.5877127", "0.5814176", "0.57210565", "0.56718546", "0.5638489", "0.56243616", "0.5608432", "0.558763", "0.5566619", "0.5541478", "0.5537386", "0.55156857", "0.5485655", "0.5467552", "0.5453077", "0.5446542", "0.54387546", "0.5410099", "0.5405774", "0.54029", "0.5394845", "0.53839546", "0.53661275", "0.53661275", "0.53661275", "0.53661275", "0.53633296", "0.53633296", "0.536269", "0.53549033", "0.5341384", "0.53400034", "0.5338009", "0.53314835", "0.53265864", "0.5317682", "0.53130084", "0.53008157", "0.5298602", "0.5298602", "0.5298602", "0.52921736", "0.5283595", "0.5276932", "0.5276932", "0.5276932", "0.5276932", "0.5276932", "0.5276932", "0.5276932", "0.52411443", "0.5240144", "0.5216008", "0.5209733", "0.52001965", "0.5194962", "0.51930475", "0.51930475", "0.51903844", "0.5188018", "0.5183155", "0.5183155", "0.51819193", "0.51819193", "0.51819193", "0.51819193", "0.51819193", "0.51819193", "0.51819193", "0.51819193", "0.51819193", "0.51819193", "0.51819193", "0.5173126", "0.51487625", "0.5136459", "0.51348287", "0.51347005", "0.5120469", "0.5101505", "0.5081322", "0.5077599", "0.50769234", "0.50710994", "0.5063139", "0.50596553", "0.50540245", "0.5053415", "0.5052076", "0.5050886", "0.50498414", "0.5047639" ]
0.51907384
66
Build a model class script.
public static function buildModelDefinitionSourceFile( string $table, array $columns = [], string $namespace = 'App\\Models', string $primaryKey = 'id', bool $increments = true, $vm = false, array $hidden = [], array $appends = [], ?string $comments = null ) { return static::createModelBuilder( $table, $columns, $namespace, $primaryKey, $increments, $vm, $hidden, $appends, $comments )->build(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function build()\n\t{\n\t\t$script = \"\";\n\t\t$this->addTable($script);\n\t\t$this->addIndices($script);\n\t\t$this->addForeignKeys($script);\n\t\treturn $script;\n\t}", "private function model()\n {\n $location = $this->args[\"location\"] . DIRECTORY_SEPARATOR . 'models' . DIRECTORY_SEPARATOR;\n $relative_location = $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'models' . DIRECTORY_SEPARATOR;\n $class_name = '';\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 $tmp = explode(DIRECTORY_SEPARATOR, $this->args['subdirectories']);\n $tmp = join('_', $tmp);\n $class_name .= ApplicationHelpers::camelize($tmp);\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 $class_name .= ucfirst(strtolower($this->args['name']));\n\n $args = array(\n \"class_name\" => ucfirst(strtolower($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_model'],\n \"extra\" => $this->extra,\n 'relative_location' => $relative_location,\n );\n\n $template = new TemplateScanner(\"model\", $args);\n $model = $template->parse();\n\n $message = \"\\t\";\n if (file_exists($filename))\n {\n $message .= 'Model 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, $model))\n {\n $message .= 'Created model: ';\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 model: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'red');\n }\n $message .= $relative_location;\n }\n\n fwrite(STDOUT, $message . PHP_EOL);\n\n // Create the migration for the new model\n $this->migration();\n\n return;\n }", "public function buildModel() {}", "private function _model_generation()\n\t{\n\t\t$prefix = ($this->bundle == DEFAULT_BUNDLE) ? '' : Str::classify($this->bundle).'_';\n\n\t\t// set up the markers for replacement within source\n\t\t$markers = array(\n\t\t\t'#CLASS#'\t\t=> $prefix.$this->class_prefix.$this->class,\n\t\t\t'#LOWER#'\t\t=> $this->lower,\n\t\t\t'#TIMESTAMPS#'\t=> $this->_timestamps\n\t\t);\n\n\t\t// loud our model template\n\t\t$template = Utils::load_template('model/model.tpl');\n\n\t\t// holder for relationships source\n\t\t$relationships_source = '';\n\n\t\t// loop through our relationships\n\t\tforeach ($this->arguments as $relation)\n\t\t{\t\n\n\t\t\t// if we have a valid relation\n\t\t\tif(strstr($relation, ':')) :\n\n\t\t\t\t// split\n\t\t\t\t$relation_parts = explode(':', Str::lower($relation));\n\n\t\t\t\t// we need two parts\n\t\t\t\tif(! count($relation_parts) == 2) continue;\n\n\t\t\t\t$method = $this->method($relation_parts[1]);\n\n\t\t\t\t// markers for relationships\n\t\t\t\t$rel_markers = array(\n\t\t\t\t\t'#CLASS#'\t\t\t=> $prefix.$this->class_prefix.$this->class,\n\t\t\t\t\t'#SINGULAR#'\t\t=> Str::lower(Str::singular($relation_parts[1])),\n\t\t\t\t\t'#PLURAL#'\t\t\t=> Str::lower(Str::plural($relation_parts[1])),\n\t\t\t\t\t'#METHOD#'\t\t\t=> $method,\n\t\t\t\t\t'#WORD#'\t\t\t=> Str::classify(Str::singular($relation_parts[1])),\n\t\t\t\t\t'#WORDS#'\t\t\t=> Str::classify(Str::plural($relation_parts[1]))\n\t\t\t\t);\n\n\t\t\t\t// start with blank\n\t\t\t\t$relationship_template = '';\n\n\t\t\t\t// use switch to decide which template\n\t\t\t\tswitch ($relation_parts[0])\n\t\t\t\t{\n\t\t\t\t\tcase \"has_many\":\n\t\t\t\t\tcase \"hm\":\n\t\t\t\t\t\t$relationship_template = Utils::load_template('model/has_many.tpl');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"belongs_to\":\n\t\t\t\t\tcase \"bt\":\n\t\t\t\t\t\t$relationship_template = Utils::load_template('model/belongs_to.tpl');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"has_one\":\n\t\t\t\t\tcase \"ho\":\n\t\t\t\t\t\t$relationship_template = Utils::load_template('model/has_one.tpl');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"has_many_and_belongs_to\":\n\t\t\t\t\tcase \"hbm\":\n\t\t\t\t\t\t$relationship_template = Utils::load_template('model/has_many_and_belongs_to.tpl');\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\telse:\n\n\t\t\t\t$method = $this->method($relation);\n\n\t\t\t\t// markers for relationships\n\t\t\t\t$rel_markers = array(\n\t\t\t\t\t'#METHOD#'\t\t=> $method,\n\t\t\t\t);\n\n\t\t\t\t$relationship_template = Utils::load_template('model/method.tpl');\n\n\t\t\tendif;\t\n\n\t\t\t// add it to the source\n\t\t\t$relationships_source .= Utils::replace_markers($rel_markers, $relationship_template);\n\t\t}\n\n\t\t// add a marker to replace the relationships stub\n\t\t// in the model template\n\t\t$markers['#RELATIONS#'] = $relationships_source;\n\n\t\t// add the generated model to the writer\n\t\t$this->writer->create_file(\n\t\t\t'Model',\n\t\t\t$prefix.$this->class_prefix.$this->class,\n\t\t\t$this->bundle_path.'models/'.$this->class_path.$this->lower.EXT,\n\t\t\tUtils::replace_markers($markers, $template)\n\t\t);\n\t}", "function genClass()\r\n {\r\n $this->_file->file_name = GEN_DIR.\"/\".$this->db_name.\"/\".$this->table_name.\"/\".$this->table_name.\".php\";\r\n $this->_file->open(\"w\");\r\n\r\n $string = $this->_genClassHead();\r\n $string .= $this->_genConstructor();\r\n $string .= $this->_genInsert();\r\n $string .= $this->_genUpdate(); \r\n $string .= $this->_genDelete();\r\n $string .= $this->_genSelect();\r\n $string .= $this->_genSelectAll();\r\n $string .= $this->_genClassFoot();\r\n $this->_file->write($string);\r\n }", "private function modelBuilder() {\n // Create model\n $model = '<?php\n class ' . ucfirst($this->formName) . '_model extends CI_Model {\n\n private $table;\n\n // Constructor\n function __construct() {\n\n parent::__construct();\n $this->table = \"' . $this->formName . '\";\n }\n\n /**\n * Insert datas in ' . $this->formName . '\n *\n * @param array $data\n * @return bool\n */\n function save($data = array()) {\n // Insert\n $this->db->insert($this->table, $data);\n\n // If error return false, else return inserted id\n if (!$this->db->affected_rows()) {\n\t return false;\n } else {\n\t\treturn $this->db->insert_id();\n }\n }\n\n }\n ?>';\n\n return array(str_replace('<', '&lt;', $model), $model);\n }", "public function getContent(){\n\t\t$this->modelname = sprintf($this->format, $this->classname);\n\t\t$this->date = date('Y-m-d H:i:s');\n\t\t\n\t\t$templateFile = LUMINE_INCLUDE_PATH . '/lib/Templates/Model.tpl';\n\t\t$tpl = file_get_contents($templateFile);\n\t\t\n\t\t$start = \"### START AUTOCODE\";\n\t\t$end = \"### END AUTOCODE\";\n\t\t\n\t\t$originalFile = $this->getFullFileName();\n\t\t\n\t\t$class = '';\n\t\t$tpl = preg_replace('@\\{(\\w+)\\}@e','$this->$1',$tpl);\n\t\t\n\t\tif(file_exists($originalFile)){\n\t\t\t\n\t\t\t$content = file_get_contents($originalFile);\n\t\t\t$autoCodeOriginal = substr($content, strpos($content,$start)+strlen($start), strpos($content,$end)+strlen($end) - (strpos($content,$start)+strlen($start)));\n\t\t\t\n\t\t\t$autoCodeGenerated = substr($tpl, strpos($tpl,$start)+strlen($start), strpos($tpl,$end)+strlen($end) - (strpos($tpl,$start)+strlen($start)));\n\t\t\t\n\t\t\t$class = str_replace($autoCodeOriginal, $autoCodeGenerated, $content);\n\t\t\t\n\t\t} else {\n\t\t\t$class = $tpl;\n\t\t}\n\t\t\n\t\t\n\t\treturn $class;\n\t}", "public abstract function build();", "public abstract function build();", "abstract public function build();", "abstract public function build();", "public function build();", "public function build();", "public function build();", "public function build();", "public function build();", "public function build();", "public function build();", "private function buildClassDefinition()\n {\n $reflection = new \\ReflectionClass($this->context->getFullClassName());\n $haxeClass = new HaxeClass();\n $haxeClass\n ->setName($this->context->getClassName())\n ->setPackage(implode('.', explode('\\\\', $this->context->getCurrentNamespace())))\n ;\n\n $this->parseProperties($reflection, $haxeClass);\n $this->parseMethods($reflection, $haxeClass);\n\n return $haxeClass->transpile();\n }", "abstract function build();", "public function generate()\n {\n $placeHolders = [\n '<nameSpace>',\n '<useSpace>',\n '<annotation>',\n '<className>',\n '<body>',\n ];\n\n $replacements = [\n $this->generateNameSpace(),\n $this->generateUseStatements(),\n $this->generateAnnotation(),\n $this->generateClassName(),\n $this->generateBody(),\n ];\n\n $code = str_replace($placeHolders, $replacements, self::$classTemplate);\n\n return str_replace('<spaces>', $this->baseClass->getSpaces(), $code);\n }", "public function build() {}", "public function build() {}", "public function build() {}", "public function createMvcCode() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get input\n\t\t$componentName = KRequest::getKeyword('component_name');\n\t\t$nameSingular = KRequest::getKeyword('name_singular');\n\t\t$namePlural = KRequest::getKeyword('name_plural');\n\n\t\t// Validate input\n\t\tif (empty($componentName)) {\n\t\t\tKLog::log(\"Component name is not specified.\", 'custom_code_creator');\n\t\t\techo \"Component name is not specified.\";\n\t\t\treturn;\n\t\t}\n\n\t\tif (empty($nameSingular)) {\n\t\t\tKLog::log(\"Singular name is not specified.\", 'custom_code_creator');\n\t\t\techo \"name_singular is empty.\";\n\t\t\treturn;\n\t\t}\n\n\t\tif (empty($namePlural)) {\n\t\t\tKLog::log(\"Plural name is not specified.\", 'custom_code_creator');\n\t\t\techo \"Parameter name_plural is empty.\";\n\t\t\treturn;\n\t\t}\n\n\t\t// Prepare the table name and\n\t\t$tableName = strtolower('configbox_external_' . $namePlural);\n\t\t$model = KenedoModel::getModel('ConfigboxModelAdminmvcmaker');\n\n\t\t// Make all files\n\t\t$model->createControllerFile($componentName, $nameSingular, $namePlural);\n\t\t$model->createModelFile($componentName, $namePlural, $tableName);\n\t\t$model->createViewFiles($componentName, $nameSingular, $namePlural, 'form');\n\t\t$model->createViewFiles($componentName, $nameSingular, $namePlural, 'list');\n\n\t\techo 'All done';\n\n\t}", "public function build()\n {\n }", "public function generateEntityCode()\n {\n $tables = $this->getTables();\n \n $code = \" require_once 'grandprix.data.php';\";\n foreach ($tables as $table)\n {\n $columns = $this->getColumns($table['tableName']);\n $children = $this->getChildren($table['tableName']);\n \n $code .=\n\"\n /**\n * \" . ucfirst($table['tableName']) . \" Data Entity class.\n * \n * @package Grandprix\n * @subpackage Data\n */\n class \" . ucfirst($table['tableName']) . \" extends DataEntity\n { \n\";\n \n foreach ($columns as $column)\n {\n $code .=\n\"\n /**\n * @var \" . self::getPhpType($column['dataType']) . \"\n */\n public \\$\" . ucfirst($column['columnName']) . \";\n\";\n }\n\n $code .=\n\"\n /**\n * Creates an empty instance of this class.\n * \n * @return \" . ucfirst($table['tableName']) . \"\n */\n public static function createInstance()\n {\n \\$className = __CLASS__; return new \\$className();\n }\n \n /**\n * Creates an instance of this class based on the provided data array.\n *\n * @param array \\$data The keyed array containing the data\n * @return \" . ucfirst($table['tableName']) . \"\n */\n public static function fromData(&\\$data)\n {\n \\$entity = self::createInstance();\n \\$entity->setObjectData(\\$data);\n return \\$entity;\n }\n }\n\";\n \n }\n \n return $code;\n }", "public function model()\n\t{\n\t\tif($this->input->post('generate'))\n\t\t{\n\t\t\t//get model details\n\t\t\t$model_class = $this->input->post('model_class'); //model class name\n\t\t\t$model_table = $this->input->post('model_table'); //model table name\n\t\t\t$model_dir = $this->input->post('model_dir'); //models directory\n\t\t\t$bmodel_prefx = $this->input->post('bmodel_prefix');//base model prefix\n\t\t\t$model_api_class = $this->input->post('model_api_class');//base model class\n\t\t\t\n\t\t\t//check if all requirements have been provided\n\t\t\tif(isset($model_class, $model_table, $model_dir))\n\t\t\t{\n\t\t\t //check if the database table exists\n\t\t\t\t if($this->db->table_exists($model_table))\n\t\t\t\t {\n\t\t\t\t \t //get the table fields\n\t\t\t\t \t $table_fields = $this->db->list_fields($model_table);\n\t\t\t\t \t \n\t\t\t\t \t //model template data\n\t\t\t\t \t $properties_array = \"array(\\r\\n\";\n\t\t\t\t \t $properties = '';\n\t\t\t\t \t \n\t\t\t\t \t //create the model properties arrays and model properties template list\n\t\t\t\t \t foreach($table_fields as $field)\n\t\t\t\t \t {\n\t\t\t\t \t \t if(strtolower($field) === 'id') continue;\n\t\t\t\t \t \t $properties .=\"public $\".$field.\";\\r\\n\\t\";\n\t\t\t\t \t \t $properties_array .= \"\\t\\t\\t'\".$field.\"'=>array(),\\r\\n\";\n\t\t\t\t \t }\n\t\t\t\t \t \n\t\t\t\t \t //close the properties array\n\t\t\t\t \t $properties_array .=\"\\t\\t);\";\n\t\t\t\t \t \n\t\t\t\t \t \n\t\t\t\t \t //read in the model template file\n\t\t\t\t \t $template_file = APPPATH.'third_party/assci-gen/assets/templates/model-template.txt';\n\t\t\t\t \t \n\t\t\t\t \t //read in the model template file\n\t\t\t\t \t $api_template_file = APPPATH.'third_party/assci-gen/assets/templates/model-api-template.txt';\n\t\t\t\t \t \n\t\t\t\t \t //check if the template file is readable\n\t\t\t\t \t if(is_readable($template_file) && is_readable($api_template_file))\n\t\t\t\t \t {\n\t\t\t\t \t \t $model_api_path = $model_api_template = '';\n\n\t\t\t\t \t \t $model_template = read_file($template_file);\n\n\t\t\t\t \t \t if($model_api_class) \n\t\t\t\t \t \t \t$model_api_template = read_file($api_template_file);\n\t\t\t\t \t\t \n\t\t\t\t \t\t $model_dir = $model_dir ?: APPPATH.'models/';\n\t\t\t\t \t\t \n\t\t\t\t \t\t $model_path = $model_dir.strtolower($model_class).'.php';\n\t\t\t\t \t\t \n\t\t\t\t \t\t if($model_api_class) \n\t\t\t\t \t\t \t$model_api_path = $model_dir.strtolower($model_api_class).'.php';\n\t\t\t\t \t\t \n\t\t\t\t \t\t //replace template placeholders\n\t\t\t\t \t \t $model = str_replace('{class}', ucfirst(strtolower($model_class)), $model_template);\n\t\t\t\t \t \t $model = str_replace('{class-prefix}', ($bmodel_prefx ?: 'CI_'), $model);\n\t\t\t\t \t \t $model = str_replace('{properties}', $properties, $model);\n\t\t\t\t \t \t $model = str_replace('{table}', $model_table, $model);\n\t\t\t\t \t \t $model = str_replace('{errors}', $properties_array, $model);\n\t\t\t\t \t \t $model = str_replace('{relations}', $properties_array, $model);\n\t\t\t\t \t \t $model = str_replace('{rules}', $properties_array, $model);\n\t\t\t\t \t \t \n\t\t\t\t \t \tif($model_api_class) \n\t\t\t\t \t \t{\n\t\t\t\t \t \t\t $model_api_template = str_replace('{include-file}', strtolower($model_class), $model_api_template);\n\t\t\t\t\t \t \t $model_api_template = str_replace('{class}', $model_api_class, $model_api_template);\n\t\t\t\t\t \t \t $model_api_template = str_replace('{parent-class}', ucfirst(strtolower($model_class)), $model_api_template);\n\t\t\t\t \t \t\t $done = write_file($model_api_path, $model_api_template);\n\t\t\t\t \t \t}\n\t\t\t\t \t \t //write model out to file\n\t\t\t\t \t \t $done = write_file($model_path, $model);\n\n\t\t\t\t \t \t if($done && $done)\n\t\t\t\t \t \t {\n\t\t\t\t \t \t \t$this->data = array(\n\t\t\t\t \t \t \t\t'message'=>'Success!. Model Generated successfully. Path=>'.$model_path,\n\t\t\t\t \t \t \t\t'type'=>'success'\n\t\t\t\t \t \t \t);\n\t\t\t\t \t \t }\n\t\t\t\t \t \t else\n\t\t\t\t \t \t {\t\n\t\t\t\t \t \t \t $this->data = array(\n\t\t\t\t \t \t \t \t'message'=>'Error!. Error writing to model file. PATH=>'.$model_path,\n\t\t\t\t \t \t \t \t'type'=>'danger'\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 else\n\t\t\t\t\t {\n\t\t\t\t\t \t $this->data = array(\n\t\t\t\t\t \t \t'message'=>'Error!. Model template file not found or is unreadable. \n\t\t\t\t\t \t \t Check if template file exists or is readable by the server daemon\n\t\t\t\t\t \t \t. PATH=>'.$template_file,\n\t\t\t\t\t \t \t'type'=>'danger'\n\t\t\t\t\t \t );\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t else\n\t\t\t\t {\n\t\t\t\t \t$this->data = array(\n\t\t\t\t \t\t'message'=>'Error!. Model table doesn\\'t exist',\n\t\t\t\t \t\t'type'=>'danger'\n\t\t\t\t \t);\n\t\t\t\t }\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->data = array(\n\t\t\t\t\t'message'=>'Error!. Generating models requires atleast, model class name and table name',\n\t\t\t\t\t'type'=>'warning'\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->send_response($this->data, array(\n\t\t\t'generators'\n\t\t));\n\t}", "protected function createModel()\n {\n $this->call('make:model', array_filter([\n 'name' => $this->getNameInput(),\n '--factory' => $this->option('factory'),\n '--migration' => $this->option('migration'),\n ]));\n }", "public function modelGenerate($trainingSet)\n\t{\t\n\t\tif(!is_array($trainingSet))\n\t\t{\n\t\t\ttrigger_error(__('Training set must be an array', true), E_USER_ERROR);\n\t\t}\n\t\t\n\t\tif( $this->_settings['output']['types'] == 'both' || $this->_settings['output']['types'] == 'tab' )\n\t\t{\n\t\t\t// formata as instancias para salvar como arquivo '.tab'\n\t\t\t$modelContent = $this->_entriesFormatTab($trainingSet, true);\n\t\t\t\n\t\t\t// salva arquivo '.tab' com as entradas (instancias)\n\t\t\tif( !$this->_writeFile($this->_model['name'] . '.tab', $modelContent) )\n\t\t\t{\n\t\t\t\ttrigger_error(__('Model file can\\'t be saved. Check system permissions', true), E_USER_ERROR);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif( $this->_settings['output']['types'] == 'both' || $this->_settings['output']['types'] == 'arff')\n\t\t{\n\t\t\t// formata as instancias para salvar como arquivo '.arff'\n\t\t\t$modelContent = $this->_entriesFormatArff($trainingSet);\n\t\t\t\n\t\t\t// salva arquivo '.arff' com as entradas (instancias)\n\t\t\tif( !$this->_writeFile($this->_model['name'] . '.arff', $modelContent) )\n\t\t\t{\n\t\t\t\ttrigger_error(__('Model file can\\'t be saved. Check system permissions', true), E_USER_ERROR);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// array auxiliar que armazenará a saída do último binário executado via 'exec'\n\t\t$exec_out = array();\n\t\t\n\t\t// cria o domínio dos dados\n\t\texec(\n\t\t\t$this->_settings['binaryPath'] .\n\t\t\tsprintf(\n\t\t\t\t$this->_settings['domain'],\n\t\t\t\t$this->_model['name'] . '.tab',\n\t\t\t\t$this->_model['name'] . '.dom'), \n\t\t\t$exec_out,\n\t\t\t$status\n\t\t);\n\t\t\n\t\tif($status !== 0)\n\t\t{\n\t\t\ttrigger_error(__('Can\\'t generate domain.', true), E_USER_ERROR);\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tunset($exec_out); // limpa array de controle\n\t\t\n\t\t// induz o classificador (modelo)\n\t\texec(\n\t\t\t$this->_settings['binaryPath'] .\n\t\t\tsprintf(\n\t\t\t\t$this->_settings['inductor'],\n\t\t\t\t$this->_model['name'] . '.dom',\n\t\t\t\t$this->_model['name'] . '.tab', \n\t\t\t\t$this->_model['name'] . '.nbc'), \n\t\t\t$exec_out,\n\t\t\t$status\n\t\t);\n\t\t\n\t\tif($status !== 0)\n\t\t{\n\t\t\ttrigger_error(__('Can\\'t generate classifier model.', true), E_USER_ERROR);\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// compacta arquivos gerados\n\t\texec(\n\t\t\tsprintf(\n\t\t\t\t$this->_settings['compact'],\n\t\t\t\t$this->_model['name'],\n\t\t\t\t$this->_model['name'] . '.tab ' . $this->_model['name'] . '.nbc ' . $this->_model['name'] . '.arff'\n\t\t\t),\n\t\t\t$exec_out,\n\t\t\t$status\n\t\t);\n\t\t\n\t\treturn true;\n\t}", "protected function build()\n\t{\n\t}", "public function generate($params = array())\n {\n if (!isset($params['model_class']))\n {\n $error = 'You must specify a \"model_class\"';\n $error = sprintf($error, $entry);\n\n throw new sfParseException($error);\n }\n $modelClass = $params['model_class'];\n\n if (!class_exists($modelClass))\n {\n $error = 'Unable to scaffold unexistant model \"%s\"';\n $error = sprintf($error, $modelClass);\n\n throw new sfInitializationException($error);\n }\n \n $tmp = new $modelClass;\n if($tmp instanceof BaseObject)\n {\n $this->generator = new sfPropelAdminGenerator();\n $this->orm = self::PROPEL;\n }\n elseif($tmp instanceof Doctrine_Record)\n {\n $this->generator = new sfDoctrineAdminGenerator();\n $this->orm = self::DOCTRINE;\n }\n $this->generator->initialize($this->generatorManager);\n $this->generator->setGeneratorClass('DbFinderAdmin');\n $this->generator->DbFinderAdminGenerator = $this;\n return $this->generator->generate($params);\n }", "public static function createModel($modelFile,$modelName,$content,$contentClassAnnotations=''){\n\t\tfile_put_contents(dirname($modelFile->srcFile()->getPath()).'/'.$modelName.'.php',\n\t\t\t'<?php /* CLASS GENERATED BY '.get_called_class().' FOR MODEL '.$modelFile->_className.' | PLEASE DO NOT EDIT */ '\n\t\t\t.\"\\n\".(empty($contentClassAnnotations)?'':'/** '.$contentClassAnnotations.' */')\n\t\t\t.\"\\n\".'class '.$modelName.' extends SSqlModel{'\n\t\t\t\t.\"\\n\".$content\n\t\t\t.\"\\n\".'}');\n\t}", "public function build ()\n {\n }", "protected function createModel()\n {\n $model = $this->info['model'];\n\n $modelName = basename(str_replace('\\\\', '/', $model));\n\n // make it singular\n $modelName = Str::singular($modelName);\n\n $this->info['modelName'] = $modelName;\n\n $modelOptions = [\n 'model' => $this->info['model'],\n '--module' => $this->moduleName,\n ];\n $options = $this->setOptions([\n 'index',\n 'unique',\n 'data',\n 'uploads',\n 'float',\n 'bool',\n 'int',\n 'data',\n 'parent'\n ]);\n\n $this->call('engez:model', array_merge($modelOptions, $options));\n }", "protected function buildModel()\n {\n $columns = collect($this->columns)->pluck('column')->implode('|');\n $foreigns = $this->module->tables->where('is_foreign', true);\n\n $this->model = [\n 'name' => $this->class,\n '--table' => $this->table,\n '--columns' => $columns,\n '--pk' => $this->primaryKey,\n '--module' => $this->module->id,\n ];\n\n if ($foreigns->count()) {\n $this->model['--relationships'] = $foreigns->transform(function ($foreign) {\n return $foreign->column.':'.$foreign->table_foreign;\n })->implode('|');\n }\n }", "public function build()\n {\n $this->classMetadata->appendExtension($this->getExtensionName(), [\n 'groups' => [\n $this->fieldName,\n ],\n ]);\n }", "protected function build()\n {\n $this->global_variables = (new GlobalVariablesGenerator)->generate();\n }", "public function run()\n {\n $type = new ClassType();\n $type->name = 'K-3 Grades';\n $type->alt_name = 'Elementary';\n $type->slug = 'elementary';\n $type->save();\n\n $type = new ClassType();\n $type->name = '4-5 Grades';\n $type->alt_name = 'Elementary';\n $type->slug = 'elementary';\n $type->save();\n\n $type = new ClassType();\n $type->name = '6-8 Grades';\n $type->alt_name = 'Middle School';\n $type->slug = 'middle-school';\n $type->save();\n\n $type = new ClassType();\n $type->name = '9-12+ Grades';\n $type->alt_name = 'High School';\n $type->slug = 'high-school';\n $type->save();\n }", "public function generate() \r\n\t{\t\r\n\t\tparent::generate();\r\n\t\r\n\t\t$this->schemaXml = new SimpleXMLElement(file_get_contents( $this->_xmlFile ));\r\n\t\t\r\n\t\t//parse object types\r\n\t\tforeach ($this->schemaXml->children() as $reflectionType) \r\n\t\t{\r\n\t\t\tswitch($reflectionType->getName())\r\n\t\t\t{\r\n\t\t\t\tcase \"enums\":\r\n\t\t\t\t\t//create enum classes\r\n\t\t\t\t\tforeach($reflectionType->children() as $enums_node)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->writeEnum($enums_node);\r\n\t\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"classes\":\r\n\t\t\t\t\t//create object classes\r\n\t\t\t\t\tforeach($reflectionType->children() as $classes_node)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->writeObjectClass($classes_node);\r\n\t\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"services\":\r\n\t\t\t\t\t//implement services (api actions)\r\n\t\t\t\t\tforeach($reflectionType->children() as $services_node)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->writeService($services_node);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//write main class (if needed, this can also be included in the static sources folder if not dynamic)\r\n\t\t\t\t\t$this->writeMainClass($reflectionType->children());\r\n\t\t\t\tbreak;\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->addFile('KalturaTypes.js', $this->enumTypes);\r\n\t\t$this->addFile('KalturaVO.js', $this->voClasses);\r\n\t\t$this->addFile('KalturaServices.js', $this->serviceClasses);\r\n\t\t$this->addFile('KalturaClient.js', $this->mainClass);\r\n\t\t//write project file (if needed, this can also be included in the static sources folder if not dynamic)\r\n\t\t$this->writeProjectFile();\r\n\t}", "protected function _writeAppClass()\n {\n // emit feedback\n $this->_outln(\"App class '{$this->_class}' extends '{$this->_extends}'.\");\n $this->_outln(\"Preparing to write to '{$this->_target}'.\");\n \n // using app, or app-model?\n if ($this->_model_name) {\n $tpl_key = 'app-model';\n } else {\n $tpl_key = 'app';\n }\n \n // get the app class template\n $text = $this->_parseTemplate($tpl_key);\n \n // write the app class\n if (file_exists($this->_class_file)) {\n $this->_outln('App class already exists.');\n } else {\n $this->_outln('Writing app class.');\n file_put_contents($this->_class_file, $text);\n }\n }", "public function make($modelClass);", "public function generate() {\n\t\t$args = $this->args;\n\t\t$this->args = array_map('strtolower', $this->args);\n\t\t$modelAlias = ucfirst($args[0]);\n\t\t$pluginName = ucfirst($this->args[1]);\n\t\t$modelId = isset($args[2]) ? $args[2] : null;\n\t\t$len = isset($args[3]) ? $args[3] : null;\n\t\t$extensions = $this->_CroogoPlugin->getPlugins();\n\t\t$active = CakePlugin::loaded($pluginName);\n\n\t\tif (!empty($pluginName) && !in_array($pluginName, $extensions) && !$active) {\n\t\t\t$this->err(__('plugin \"%s\" not found.', $pluginName));\n\t\t\treturn false;\n\t\t}\n\t\tif (empty($len)) {\n\t\t\t$len = 5;\n\t\t}\n\n\t\t$options = array();\n\t\tif (!empty($modelId)) {\n\t\t\t$options = Set::merge($options, array(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t$modelAlias.'.id' => $modelId\n\t\t\t\t)\n\t\t\t));\n\t\t}\n\n\t\t$Model = ClassRegistry::init($pluginName.'.'.$modelAlias);\n\t\t$Model->recursive = -1;\n\t\t$results = $Model->find('all', $options);\n\t\tforeach ($results as $result) {\n\t\t\t$Model->id = $result[$modelAlias]['id'];\n\t\t\tif (!empty($modelId)) {\n\t\t\t\t$foreignKey = $modelId;\n\t\t\t} else {\n\t\t\t\t$foreignKey = $Model->id;\n\t\t\t}\n\t\t\t$token = $this->Token->find('first', array(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t'Token.model' => $modelAlias,\n\t\t\t\t\t'Token.foreign_key' => $foreignKey,\n\t\t\t\t)\n\t\t\t));\n\t\t\tif (empty($token)) {\n\t\t\t\t$Model->Behaviors->attach('Givrate.Tokenable');\n\t\t\t\t$token = $Model->Behaviors->Tokenable->__GenerateUniqid($len);\n\t\t\t\tif ($Model->Behaviors->Tokenable->__isValidToken($token)) {\n\t\t\t\t\tif ($Model->Behaviors->Tokenable->__saveToken($Model, $token)) {\n\t\t\t\t\t\t$this->out(sprintf(__('Successful generate token for model <success>%s</success> id <bold>%d</bold>', $Model->alias, $Model->id)));\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->out(sprintf(__('Failed generate token for model <failed>%s</failed> id <bold>%d</bold>', $Model->alias, $Model->id)));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->out(sprintf(__('Model <failed>%s</failed> id <bold>%d</bold> already have token', $Model->alias, $Model->id)));\n\t\t\t}\n\t\t}\n\t}", "protected function buildClass($name)\n {\n $stub = $this->files->get($this->getStub());\n\n $table = $this->option('table');\n $prefix = $this->option('prefix');\n if (!$name || !$table) {\n $this->comment('Command: crud-model {name} {--table=} {--prefix=}');\n exit;\n }\n\n return $this->replaceNamespace($stub, $name)\n ->compile($stub, $table, $prefix)\n ->generate($stub)\n ->replaceClass($stub, $name);\n }", "public static function model($source='', $options=[]) {\n if (empty($source)) return false;\n\n $force = $options['force'] ?? false;\n\n $source = file_get_contents(\"{$source}\");\n //Storage::disk('base')->get($source);\n $template = \"<?php namespace App\\Models;\n\nclass [SOURCECLASS] extends \\[SOURCENAMESPACE]\\[SOURCECLASS]\n{\n\n}\n\";\n\n $sourceNamespace = self::extract($source, 'namespace ', ';');\n $sourceClass = self::extract($source, 'class ', ' ');\n\n $template = str_replace('[SOURCECLASS]', $sourceClass, $template);\n $template = str_replace('[SOURCENAMESPACE]', $sourceNamespace, $template);\n\n $destination = \"app/Models/{$sourceClass}.php\";\n if (!Storage::disk('base')->exists($destination) || $force) Storage::disk('base')->put($destination, $template);\n\n return true;\n\n }", "private function make($arg, $className = null) {\n $arrayClass = explode('/', $className);\n if(count($arrayClass) > 1) {\n if(!@end($arrayClass)) {\n die(\"\\n Please specify any name of `{$className}?`. \\n\");\n }\n }\n // switch make case\n switch($make = explode(':', $arg)[1]) {\n /**\n * @make:entry\n * \n */\n case 'entry':\n // check entry store exists.\n if(!file_exists(\".\\\\databases\\\\entry\")) {\n die(\"\\n fatal: The `.\\\\databases\\\\entry` folder not found, please initiate entry by `init` command. \\n\");\n }\n // check specify entry name\n if(!$className) {\n die(\"\\n Please specify entry name. \\n\");\n }\n // check class is duplicate\n foreach (scandir(\".\\\\databases\\\\entry\") as $fileName) {\n if(explode('.', $fileName)[0] === ucfirst($className)) {\n die(\"\\n The entry `{$className}` is duplicate. \\n\");\n }\n }\n // Read file content\n $fileContent = file_get_contents(__DIR__.'./tmpEntry.php');\n // do the replacements, modifications, etc. on $fileContent\n // This is just an example\n $fileContent = str_replace('{{className}}', ucfirst($className), $fileContent);\n // write the content to a new file\n if(file_put_contents(\".\\\\databases\\\\entry\\\\\". ucfirst($className) .\".php\", $fileContent)) {\n die(\"\\n make the entry `{$className}` is successfully. \\n\");\n } else {\n die(\"\\n make the entry failed. Please try again. \\n\");\n }\n break;\n /**\n * @make:controller\n * \n */\n case 'controller':\n // check controller store exists.\n if(!file_exists(\".\\\\modules\\\\controllers\")) {\n die(\"\\n fatal: The `.\\\\modules\\\\controllers` folder not found. \\n\");\n }\n // check specify controller name\n if(!$className) {\n die(\"\\n Please specify controller name. \\n\");\n }\n // explode when asign subfolder\n $masterName = explode('/', $className);\n $newClassName = ucfirst(end($masterName));\n // check don't asign conroller wording\n if(!strpos($newClassName, \"Controller\")) {\n $newClassName = $newClassName . \"Controller\";\n }\n // check include subfolder\n if(count($masterName) > 1) {\n array_pop($masterName);\n $subfolder = implode('\\\\', $masterName);\n if(!file_exists(\".\\\\modules\\\\controllers\\\\{$subfolder}\")) {\n if(!mkdir(\".\\\\modules\\\\controllers\\\\{$subfolder}\", 0777, true)) {\n die(\"\\n fatal: something error please try again. \\n\");\n }\n }\n // next new className\n $newClassName = $subfolder .\"\\\\\". $newClassName;\n }\n // check class is duplicate\n foreach (scandir(\".\\\\modules\\\\controllers\\\\\". @$subfolder) as $fileName) {\n $file = explode('.php', $fileName);\n $file = trim(@$subfolder .\"\\\\\". current($file), \"\\\\\");\n if($file === $newClassName) {\n die(\"\\n The class `{$newClassName}` is duplicate. \\n\");\n }\n }\n // Read file content\n $fileContent = file_get_contents(__DIR__.'./tmpController.php');\n // do the replacements, modifications, etc. on $fileContent\n // This is just an example\n $classNameReplace = explode(\"\\\\\", $newClassName);\n $fileContent = str_replace('{{className}}', end($classNameReplace), $fileContent);\n // write the content to a new file\n if(file_put_contents(\".\\\\modules\\\\controllers\\\\{$newClassName}.php\", $fileContent)) {\n die(\"\\n make the controller `{$newClassName}` is successfully. \\n\");\n } else {\n die(\"\\n make the controller failed. Please try again. \\n\");\n }\n break;\n /**\n * @make:model\n * \n */\n case 'model':\n // check model store exists.\n if(!file_exists(\".\\\\modules\\\\models\")) {\n die(\"\\n fatal: The `.\\\\modules\\\\models` folder not found. \\n\");\n }\n // check specify model name\n if(!$className) {\n die(\"\\n Please specify model name. \\n\");\n }\n // check include subfolder\n $masterName = explode('/', $className);\n $newClassName = ucfirst(end($masterName));\n if(count($masterName) > 1) {\n array_pop($masterName);\n $subfolder = implode('\\\\', $masterName);\n if(!file_exists(\".\\\\modules\\\\models\\\\{$subfolder}\")) {\n if(!mkdir(\".\\\\modules\\\\models\\\\{$subfolder}\", 0777, true)) {\n die(\"\\n fatal: something error please try again. \\n\");\n }\n }\n // next new className\n $newClassName = $subfolder .\"\\\\\". $newClassName;\n }\n // check class is duplicate\n foreach (scandir(\".\\\\modules\\\\models\\\\\". @$subfolder) as $fileName) {\n $file = explode('.php', $fileName);\n $file = trim(@$subfolder .\"\\\\\". current($file), \"\\\\\");\n if($file === $newClassName) {\n die(\"\\n The class `{$newClassName}` is duplicate. \\n\");\n }\n }\n // Read file content\n $fileContent = file_get_contents(__DIR__.'./tmpModel.php');\n // do the replacements, modifications, etc. on $fileContent\n // This is just an example\n $classNameReplace = explode(\"\\\\\", $newClassName);\n $fileContent = str_replace('{{className}}', end($classNameReplace), $fileContent);\n // write the content to a new file\n if(file_put_contents(\".\\\\modules\\\\models\\\\{$newClassName}.php\", $fileContent)) {\n die(\"\\n make the model `{$newClassName}` is successfully. \\n\");\n } else {\n die(\"\\n make the model failed. Please try again. \\n\");\n }\n break;\n /**\n * @make:view\n * \n */\n case 'view':\n // check view store exists.\n if(!file_exists(\".\\\\views\")) {\n die(\"\\n fatal: The `.\\\\views` folder not found. \\n\");\n }\n // check specify view name\n if(!$className) {\n die(\"\\n Please specify view name. \\n\");\n }\n // check include subfolder\n $masterName = explode('/', $className);\n if(count($masterName) > 1) {\n $endClassName = end($masterName);\n array_pop($masterName);\n $subfolder = implode('\\\\', $masterName);\n if(!file_exists(\".\\\\views\\\\{$subfolder}\")) {\n if(!mkdir(\".\\\\views\\\\{$subfolder}\", 0777, true)) {\n die(\"\\n fatal: something error please try again. \\n\");\n }\n }\n // next new className\n $className = $subfolder .\"\\\\\". $endClassName;\n }\n // include .view\n $className = $className.'.view';\n // check view is duplicate\n foreach (scandir(\".\\\\views\\\\\". @$subfolder) as $fileName) {\n $file = explode('.php', $fileName);\n $file = trim(@$subfolder .\"\\\\\". current($file), \"\\\\\");\n if($file === $className) {\n die(\"\\n The view `{$className}` is duplicate. \\n\");\n }\n }\n // argument passer\n if(self::$argument == '--blog') {\n // Read file content (bootstrap)\n $fileContent = file_get_contents(__DIR__.'./tmpViewBootstrap.php');\n } elseif(self::$argument == '--html') {\n // Read file content\n $fileContent = file_get_contents(__DIR__.'./tmpViewHtml.php');\n } else {\n // Read file content\n $fileContent = file_get_contents(__DIR__.'./tmpViewBlank.php');\n }\n // do the replacements, modifications, etc. on $fileContent\n // This is just an example\n $fileContent = str_replace('{{className}}', $className, $fileContent);\n // write the content to a new file\n if(file_put_contents(\".\\\\views\\\\{$className}.php\", $fileContent)) {\n die(\"\\n make the view `{$className}` is successfully. \\n\");\n } else {\n die(\"\\n make the view failed. Please try again. \\n\");\n }\n break;\n default:\n die(\"\\n command `make:{$make}` is incorrect. \\n\\n The most similar command is: \\n make:entry \\n make:controller \\n make:model \\n make:view \\n\");\n break;\n }\n }", "public function main()\n {\n $options = array(\n 'server' => $this->host,\n 'database' => $this->name,\n 'username' => $this->user,\n 'password' => $this->password\n );\n\n ORM_Connection_Manager::add(new ORM_Adapter_Mysql($options));\n\n $gen = new ORM_Generator_Models();\n $gen->generateFromDb(ORM_Connection_Manager::getConnection(), $this->out, $this->table);\n\n $this->log('SQL write into file \"' . $this->out . '\"');\n //print($this->message);\n }", "protected function buildClass($name)\n {\n $namespace = $this->getNamespace($name);\n $default_replace = str_replace(\"use $namespace\\Controller;\\n\", '', parent::buildClass($name));\n //return str_replace(\"Now_Entity\", \"Creator_\" . $this->argument(\"name\"), $default_replace);\n return str_replace(\"Now_Entity\", $this->argument(\"name\"), $default_replace);\n }", "public function create($args){\n\n if($args[0] == 'model'){\n\n if(!isset($args[1])){\n echo 'You must specify a table to build the model from' . PHP_EOL;\n exit;\n }//if\n\n $table = $args[1];\n\n $templatePath = isset($args[2]) ? $args[2] : 'app/config/model.format';\n $outputPath = isset($args[3]) ? $args[3] : 'app/model';\n\n if($table=='all'){\n $result = $this->getDBSchema();\n while($row = $result->fetch()){\n $model = \\Disco\\manage\\Manager::buildModel($row['table_name']);\n \\Disco\\manage\\Manager::writeModel($row['table_name'],$model,$templatePath,$outputPath);\n }//while\n }//if\n else {\n $model = \\Disco\\manage\\Manager::buildModel($table);\n \\Disco\\manage\\Manager::writeModel($table,$model,$templatePath,$outputPath);\n }//el\n\n }//if\n else if($args[0] == 'record'){\n\n if(!isset($args[1])){\n echo 'You must specify a table to build the record from' . PHP_EOL;\n exit;\n }//if\n\n $table = $args[1];\n\n $templatePath = isset($args[2]) ? $args[2] : 'app/config/record.format';\n $outputPath = isset($args[3]) ? $args[3] : 'app/record';\n\n if($table=='all'){\n $result = $this->getDBSchema();\n while($row = $result->fetch()){\n $record = \\Disco\\manage\\Manager::buildRecord($row['table_name']);\n \\Disco\\manage\\Manager::writeRecord($row['table_name'],$record,$templatePath,$outputPath);\n }//while\n }//if\n else {\n $record = \\Disco\\manage\\Manager::buildRecord($table);\n \\Disco\\manage\\Manager::writeRecord($table,$record,$templatePath,$outputPath);\n }//el\n\n }//elif\n\n }", "public function main()\n {\n $className = $this->fullyQualifiedClassName();\n $templatePath = $this->template();\n $destinationDir = $this->destinationDir();\n $destinationFile = $this->destinationFile();\n\n if (!file_exists($templatePath)) {\n $this->error(sprintf('Given template file path does not exists [%s]', $templatePath));\n return 1;\n }\n \n if ($this->opt('force') === false && file_exists($destinationFile)) {\n $this->error(sprintf(\n '\\'%s\\' already exists. Use --force to directly replaces it.', \n $className\n ));\n return 2;\n }\n\n $name = $this->name();\n $namespace = $this->fullNamespace();\n\n $placeholders = $this->preparedPlaceholders();\n $placeholders['{{name}}'] = $name;\n $placeholders['{{namespace}}'] = $namespace;\n \n $template = file_get_contents($templatePath);\n\n $constructor = $this->opt('constructor') === true ? $this->constructor() : '';\n $template = str_replace('{{constructor}}', $constructor, $template);\n\n $template = str_replace(\n array_keys($placeholders), array_values($placeholders), $template\n );\n\n if (!is_dir($destinationDir)) {\n mkdir($destinationDir, '0755', true);\n }\n file_put_contents($destinationFile, $template);\n\n $this->info(sprintf('%s created with success!', $className));\n $this->info(sprintf('File: %s', $destinationFile));\n\n return 0;\n }", "public function main() {\n $nameArr = explode(\".\", $this->name);\n $name = $nameArr[0];\n $xml = SimpleXml_load_file(\"../domain/base/\".$name.\".xml\");\n\n $path = $xml->path[\"name\"];\n\n $template = file_get_contents(\"generateDomain/DomainObjectTemplate\");\n $vars = array();\n $vars[\"class_name\"] = \"Base\".ucfirst($name);\n $template = $this->replaceTokens($vars, $template);\n\n// print_r($xml);\n if($xml->parentClass) {\n $template = $this->replaceToken(\"parent_class\", $xml->parentClass[\"name\"], $template);\n $template = $this->replaceToken(\"super_call\", file_get_contents(\"generateDomain/SuperCallTemplate\"), $template);\n $template = $this->replaceToken(\"register_new\", \"\", $template);\n } else {\n $template = $this->replaceToken(\"parent_class\", \"\\\\domain\\\\DomainObject\", $template);\n $template = $this->replaceToken(\"super_call\", \"\", $template);\n $template = $this->replaceToken(\"register_new\", file_get_contents(\"generateDomain/RegisterNewTemplate\"), $template);\n }\n\n $constantsPiece = \"\";\n $addAttributePiece = \"\";\n $gettersAndSettersPiece = \"\";\n foreach($xml->attributes->attribute as $attr) {\n // constants\n $constantsPiece.= 'const '. strtoupper($attr[\"name\"]). ' = \"'.$attr[\"name\"].'\";\n ' ;\n\n // AddAttributes method\n $vars = array();\n $vars[\"class_name\"] = \"Base\".ucfirst($name);\n $vars[\"constant\"] = strtoupper($attr[\"name\"]);\n\n $attrTemplate = file_get_contents(\"generateDomain/AddAttributesTemplate\");\n $addAttributePiece .= $this->replaceTokens($vars, $attrTemplate);\n\n // getters and setters\n $vars = array();\n $vars[\"class_name\"] = \"Base\".ucfirst($name);\n $vars[\"constant\"] = strtoupper($attr[\"name\"]);\n $vars[\"constant_name\"] = ucfirst($attr[\"name\"]);\n $vars[\"constant_normal_case\"] = $attr[\"name\"];\n\n $getterSetterTemplate = file_get_contents(\"generateDomain/GettersAndSettersTemplate\");\n $gettersAndSettersPiece .= $this->replaceTokens($vars, $getterSetterTemplate);\n }\n $template = $this->replaceToken(\"constants\", $constantsPiece, $template);\n $template = $this->replaceToken(\"attributes_to_add\", $addAttributePiece, $template);\n $template = $this->replaceToken(\"getters_and_setters\", $gettersAndSettersPiece, $template);\n\n\n if($xml->mapper) {\n $mapper = $xml->mapper[\"name\"];\n $klass = $xml->mapper[\"class\"];\n $table = $xml->mapper[\"table\"];\n $idField = $xml->mapper[\"idField\"];\n\n\n\n if($mapper !== null && $klass !== null && $table !== null && $idField !== null) {\n $t = file_get_contents(\"generateDomain/MapperTemplate\");\n $vars = array();\n $vars[\"class_name\"] = $klass;\n $vars[\"table_name\"] = $table;\n $vars[\"id_field\"] = $idField;\n echo \"MADE IT HERE!\";\n print_r($xml->mapper->joins);\n\n if($xml->mapper->joins) {\n echo \"Had Joins!\";\n $joinsTemplate = file_get_contents(\"generateDomain/MapperJoinTemplate\");\n $joinsPiece = \"\";\n foreach($xml->mapper->joins->join as $join) {\n\n $joinVars = array();\n $joinVars[\"join_name\"] = $join[\"name\"];\n $joinVars[\"join_table\"] = $join[\"table\"];\n $joinsPiece .= $this->replaceTokens($joinVars, $joinsTemplate);\n }\n $vars[\"joins\"] = $joinsPiece;\n } else {\n $vars[\"joins\"] = \"\";\n }\n\n\n $t = $this->replaceTokens($vars, $t);\n\n if(file_exists(\"../mapper/\".$mapper.\".php\")) {\n $mapperContent = file_get_contents(\"../mapper/\".$mapper.\".php\");\n if(preg_match('@(p)ublic function loadDataMap\\(\\) {[\\s\\S]*?(})@i', $mapperContent, $matches, PREG_OFFSET_CAPTURE)) {\n $mapperContent = substr_replace($mapperContent, $t, $matches[1][1], ($matches[2][1] - $matches[1][1]) + 1);\n\n $fh = fopen(\"../mapper/\".$mapper.\".php\", \"w\");\n fwrite($fh, $mapperContent);\n fclose($fh);\n } else {\n if(preg_match('@class\\s*'.$klass.'[\\s\\S]*(})[\\s\\S]*\\?>@i', $mapperContent, $matches, PREG_OFFSET_CAPTURE)) {\n $mapperContent = substr_replace($mapperContent, $t, $matches[1][1] - 1, 0);\n\n $fh = fopen(\"../mapper/\".$mapper.\".php\", \"w\");\n fwrite($fh, $mapperContent);\n fclose($fh);\n } else {\n throw new BuildException(\"Could not match regular expression in: \".$mapper);\n }\n }\n\n\n\n } else {\n throw new BuildException(\"Mapper file did not exist \". $mapper);\n }\n }\n }\n\n\n $fh = fopen(\"../domain/base/\".\"Base\".ucfirst($name).\".php\", \"w\");\n fwrite($fh, $template);\n fclose($fh);\n }", "protected function buildClass($name)\n {\n $model = $this->argument('model') ?? 'Model';\n\n return str_replace(\n 'DummyModel', $model, parent::buildClass($name)\n );\n }", "public function run()\n {\n $classification = new \\App\\Models\\Classification();\n\n $classification->description = 'Camara';\n $classification->save();\n\n $classification = new \\App\\Models\\Classification();\n\n $classification->description = 'Portero';\n $classification->save();\n\n $classification = new \\App\\Models\\Classification();\n\n $classification->description = 'Cerradura';\n $classification->save();\n\n $classification = new \\App\\Models\\Classification();\n\n $classification->description = 'Pantalla';\n $classification->save();\n\n $classification = new \\App\\Models\\Classification();\n\n $classification->description = 'Luz';\n $classification->save();\n }", "private function scaffold()\n {\n if (isset($this->args['extra']))\n {\n $extra = $this->args['extra'];\n unset($this->args['extra']);\n }\n else\n {\n $extra = array();\n }\n\n $this->args['name'] = Inflector::pluralize($this->args['name']);\n $this->args['filename'] = $this->args['name'] . '.php';\n $this->args['extra'] = array('index', 'create', 'view', 'edit', 'delete');\n $this->extra = $this->generate_controller_actions($this->args['name'], $this->args['extra']);\n $this->controller();\n\n $this->args['name'] = Inflector::singularize($this->args['name']);\n $this->args['filename'] = $this->args['name'] . '.php';\n $this->args['extra'] = $extra;\n $this->extra = $this->generate_migration_statement($this->args['name'], $this->args['extra']);\n $this->model();\n }", "protected function makeCommand(): string\n {\n // make all required dirs and validate attributes\n parent::makeCommand();\n\n $path = app()->basePath() . DIRECTORY_SEPARATOR . 'scripts' . DIRECTORY_SEPARATOR;\n $fake = __DIR__ . DIRECTORY_SEPARATOR . 'log.txt';\n\n return \"{$path}fake.sh $fake 0.1\";\n }", "public function generate()\n {\n AnnotationRegistry::registerFile(\n __DIR__ . '/../vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php'\n );\n\n $driver = new AnnotationDriver(\n new CachedReader(new AnnotationReader(), new ArrayCache()),\n array(\n __DIR__ . '/../library/Xi/Filelib/Backend/Adapter/DoctrineOrm/Entity',\n )\n );\n\n $config = new Configuration();\n $config->setMetadataDriverImpl($driver);\n $config->setProxyDir(ROOT_TESTS . '/data/temp');\n $config->setProxyNamespace('Proxies');\n\n $em = EntityManager::create($this->connectionOptions, $config);\n\n $st = new SchemaTool($em);\n $metadata = $st->getCreateSchemaSql($em->getMetadataFactory()->getAllMetadata());\n\n return join(\";\\n\", $metadata) . \";\\n\";\n }", "protected function makeModel()\n {\n new MakeModel($this, $this->files);\n }", "public function build()\n\t{\n\t\t// Get our output filename\n\t\t$this->name = $this->hashName();\n\t\t\n\t\t// Save the source if it doesn't already exist\n\t\t$output = $this->path.$this->name;\n\t\tif ( ! file_exists($output) ) {\n\n\t\t\t// Load our asset sources\n\t\t\tforeach ($this->files as $asset) {\n\t\t\t\tif (file_exists($asset)) {\n\t\t\t\t\t$this->source .= file_get_contents($asset);\n\t\t\t\t\tif (!$this->minified) { $this->source .= \"\\n\\n\"; }\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Minify the source if needed\n\t\t\tif ($this->minified) {\n\t\t\t\t$this->source = Minify::minify($this->source);\n\t\t\t}\n\n\t\t\t// Output the file\n\t\t\tfile_put_contents($output, $this->source);\n\t\t}\n\t}", "protected function buildClass($name)\n {\n $model = $this->argument('name');\n\n $stub = $this->files->get($this->getStub());\n\n $bindings = $this->option('bindings') ?: [\n $model . '.viewer' => [\n $model . '.read'\n ],\n $model . '.editor' => [\n $model . '.create',\n $model . '.update',\n $model . '.delete',\n ]\n ];\n\n if ($this->option('admin-role') == 'yes') {\n $bindings['admin'] = [\n $model . '.create',\n $model . '.read',\n $model . '.update',\n $model . '.delete',\n ];\n }\n\n $ret = $this->replaceBindings($stub, $bindings)\n ->replaceClassName($stub, ucwords($model));\n\n return $ret->replaceClass($stub, $name);\n }", "public function run()\n {\n Building::create([\n 'name' => 'CCS',\n ]);\n\n Building::create([\n 'name' => 'CBAA',\n ]);\n\n Building::create([\n 'name' => 'CASS',\n ]);\n\n Building::create([\n 'name' => 'SET',\n ]);\n\n Building::create([\n 'name' => 'CED',\n ]);\n\n Building::create([\n 'name' => 'COE',\n ]);\n\n Building::create([\n 'name' => 'CSM',\n ]);\n\n Building::create([\n 'name' => 'Gymnasium',\n ]);\n }", "public function createCommand()\r\n\t{\r\n\t\t//start the string\r\n\t\t$command = '';\r\n\t\t\r\n\t\t//add the java command or the path to java\r\n\t\t$command .= $this->java_path;\r\n\t\t\r\n\t\t//add the class path\r\n\t\t$command .= ' -cp \"'. $this->stanford_path . $this->seperator . '*\" ';\r\n\t\t\r\n\t\t//add options\r\n\t\t$options = implode(' ', $this->java_options);\r\n\t\t$command .= '-'.$options;\r\n\t\t\r\n\t\t//add the call to the pipeline object\r\n\t\t$command .= ' edu.stanford.nlp.pipeline.StanfordCoreNLP ';\r\n\r\n\t\t//add the annotators\r\n\t\t$command .= '-annotators '. $this->listAnnotators();\r\n\t\t\r\n\t\t//add the input and output directors\r\n\t\t$command .= ' -file '. $this->tmp_file . ' -outputDirectory '. $this->tmp_path;\r\n\t\t\r\n\t\t//this is for testing purposes\r\n\t\t//$command .= ' -file '. $this->tmp_path .'\\\\nlp3F25.tmp' . ' -outputDirectory '. $this->tmp_path;\r\n\t\t\r\n\t\t//if using regexner add this to the command string\r\n\t\tif($this->annotators['regexner'] === true)\r\n\t\t{\r\n\t\t\t$command .=' -regexner.mapping '. $this->regexner_path . $this->seperator . $this->regexner_file;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn $command;\r\n\t}", "function generateConstructor($type, $fullClassName) {\n\t\t$type = strtolower($type);\n\t\tif ($type == 'model') {\n\t\t\treturn \"ClassRegistry::init('$fullClassName');\\n\";\n\t\t}\n\t\tif ($type == 'controller') {\n\t\t\t$className = substr($fullClassName, 0, strlen($fullClassName) - 10);\n\t\t\treturn \"new Test$fullClassName();\\n\\t\\t\\$this->{$className}->constructClasses();\\n\";\n\t\t}\n\t\treturn \"new $fullClassName();\\n\";\n\t}", "public function run()\n {\n DocumentType::create(['name' => 'DNI', 'digits' => '8', 'code' => '1']);\n DocumentType::create(['name' => 'Carnet Ext.', 'digits' => '12', 'code' => '4']);\n DocumentType::create(['name' => 'RUC', 'digits' => '11', 'code' => '5']);\n DocumentType::create(['name' => 'Pasaporte', 'digits' => '12', 'code' => '7']);\n DocumentType::create(['name' => 'Cedula diplomatica de identidad.', 'digits' => '15', 'code' => 'A']);\n DocumentType::create(['name' => 'No domiciliado.', 'digits' => '15', 'code' => '0']);\n DocumentType::create(['name' => 'Otros', 'digits' => '15', 'code' => '-']);\n }", "public static function generate()\n\t{\n\t\t//get the Name of the SourceFolder\n\t\t\techo \"First you need to give the name of the SourceFolder you want to generate.\\n\";\n\t\t\techo \"The SourceFolder name: \";\n\t\t\t$line = trim(fgets(STDIN));\n\t\t\t$dir = 'src/'.$line;\n\t\t//controll when the Folder already exist\n\t\t\twhile(is_dir($dir)){\n\t\t\t\techo \"This SourceFolder already exist! Do you want to overwrite this File?\\npress y for yes and another for no:\";\n\t\t\t\t$answer = trim(fgets(STDIN));\n\t\t\t\tif($answer === 'y'){\n\t\t\t\t\tFolder::delete($dir);\n\t\t\t\t\tbreak;\n\t\t\t\t}else{\n\t\t\t\t\techo \"The SourceFolder name: \";\n\t\t\t\t\t$line = trim(fgets(STDIN));\n\t\t\t\t\t$dir = 'src/'.$line;\n\t\t\t\t}\n\t\t\t}\t\n\t\t//create dirs\n\t\t\tmkdir($dir);\n\t\t\tmkdir($dir.'/Controller');\n\t\t\tmkdir($dir.'/Entity');\n\t\t\tmkdir($dir.'/Resources');\n\t\t\tmkdir($dir.'/Resources/views');\n\t\t//set controllerValue\n\t\t\t$controllerValue = \"<?php \\n\\n\";\n\t\t\t$controllerValue .='namespace '.$line.\"\\\\Controller;\\n\\n\";\n\t\t\t$controllerValue .='use Kernel\\Controller;'.\"\\n\\n\";\t\t\t\t\t\t\n\t\t\t$controllerValue .='class '.$line.\"Controller extends Controller\\n{\\n\";\n\t\t\t$controllerValue .='\tpublic function '.$line.'()'.\"\\n\";\n\t\t\t$controllerValue .=\"\t{\\n\";\n\t\t\t$controllerValue .='\t\treturn $this->render(\"'.$line.':default.html\");'.\"\\n\";\n\t\t\t$controllerValue .=\"\t}\\n\";\n\t\t\t$controllerValue .=\"}\\n\";\n\t\t//generate Controller\n\t\t\t$controller = fopen($dir.'/Controller/'.$line.'Controller.php', \"w\") or die(\"Unable to open file!\\n\");\n\t\t\tfwrite($controller, '');\n\t\t\tfwrite($controller, trim($controllerValue));\n\t\t\tfclose($controller);\n\t\t//generate template\n\t\t\t$templateValue = \"<div>hello</div>\";\n\t\t\t$template = fopen($dir.'/Resources/views/default.html', \"w\") or die(\"Unable to open file!\\n\");\n\t\t\tfwrite($template, '');\n\t\t\tfwrite($template, trim($templateValue));\n\t\t\tfclose($template);\n\t\t//amend srcInit\n\t\t\tif(!array_key_exists($line, Config::srcInit())){\n\t\t\t\t$content = $line.': '.$line;\n\t\t\t\tfile_put_contents('Config/SrcInit.yml', \"\\n\".$content, FILE_APPEND);\n\t\t\t}\n\t}", "private function build(array $options)\n\t{\n\t\tUtils::assertDatabaseAccess();\n\n\t\t$cli = $this->getCli();\n\t\t$all = (bool) $options['a'];\n\t\t$class_only = (bool) $options['c'];\n\t\t$namespace = $options['n'];\n\n\t\t$structure = DbManager::getProjectDbDirectoryStructure();\n\n\t\t$db = DbManager::getDb();\n\t\t$oz_db_ns = $structure['oz_db_namespace'];\n\t\t$project_db_ns = $structure['project_db_namespace'];\n\t\t$default_dir = [\n\t\t\t$oz_db_ns => $structure['oz_db_folder'],\n\t\t\t$project_db_ns => $structure['project_db_folder'],\n\t\t];\n\n\t\t$map = [];\n\t\t$plugins_out_dir = $structure['project_db_folder'];\n\n\t\tif ($namespace) {\n\t\t\t$map[$namespace] = 1;\n\t\t\t$found = $db->getTables($namespace);\n\n\t\t\tif (empty($found)) {\n\t\t\t\tthrow new KliInputException(\\sprintf(\n\t\t\t\t\t'There is no tables declared in the namespace: \"%s\".',\n\t\t\t\t\t$namespace\n\t\t\t\t));\n\t\t\t}\n\t\t} else {\n\t\t\t$map[$project_db_ns] = 1;\n\n\t\t\tif ($all) {\n\t\t\t\t$map[$oz_db_ns] = 1;\n\n\t\t\t\t// for plugins\n\t\t\t\t$tables = $db->getTables();\n\n\t\t\t\tforeach ($tables as $table) {\n\t\t\t\t\t$ns = $table->getNamespace();\n\n\t\t\t\t\tif (isset($map[$ns]) || $ns === $oz_db_ns || $ns === $project_db_ns) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$map[$ns] = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$gen = new GeneratorORM($db, false, false);\n\n\t\tforeach ($map as $ns => $ok) {\n\t\t\tif ($ok) {\n\t\t\t\t$dir = isset($default_dir[$ns]) ? $default_dir[$ns] : $plugins_out_dir;\n\n\t\t\t\t// we (re)generate classes only for tables\n\t\t\t\t// in the given namespace\n\t\t\t\t$tables = $db->getTables($ns);\n\t\t\t\t$gen->generate($tables, $dir);\n\n\t\t\t\t$cli->success(\\sprintf('database classes generated: \"%s\".', $ns));\n\t\t\t}\n\t\t}\n\n\t\t$queries = '';\n\n\t\tif (!$class_only) {\n\t\t\ttry {\n\t\t\t\t$queries = $db->buildDatabase();\n\t\t\t\t$db->executeMulti($queries);\n\n\t\t\t\t$cli->success('database queries executed.');\n\t\t\t} catch (Exception $e) {\n\t\t\t\t$cli->error('database queries execution failed. Open log file.')\n\t\t\t\t\t->log($e);\n\n\t\t\t\tif (!empty($queries)) {\n\t\t\t\t\t$queries_file = \\sprintf('%s.sql', Hasher::genRandomFileName('debug-db-query'));\n\n\t\t\t\t\t\\file_put_contents($queries_file, $queries);\n\n\t\t\t\t\t$msg = \\sprintf('see queries in: %s', $queries_file);\n\t\t\t\t\t$cli->info($msg)\n\t\t\t\t\t\t->log($msg);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private function createModel($table){\n\n // Filtering file name\n $fileName = $this::cleanToName($table[\"name\"]) . '.php';\n \n // Prepare the Class scheme inside the model\n $contents = '<?php echo \"Hello World\"; ?>';\n\n // Return a boolean to process completed\n return Storage::disk('models')->put($this->appNamePath.'/'.$fileName, $contents);\n\n }", "protected function buildClass($name)\n {\n\n $stub = $this->files->get($this->getStub());\n $tableName = $this->argument('name');\n $className = 'Create' . str_replace(' ', '', ucwords(str_replace('_', ' ', $tableName))) . 'Table';\n\n $fieldsToIndex = trim($this->option('indexes')) != '' ? explode(',', $this->option('indexes')) : [];\n $foreignKeys = trim($this->option('foreign-keys')) != '' ? explode(',', $this->option('foreign-keys')) : [];\n\n $schema = rtrim($this->option('schema'), ';');\n $fields = explode(';', $schema);\n\n $data = array();\n\n if ($schema) {\n $x = 0;\n foreach ($fields as $field) {\n\t\t\t\t\n $fieldArray = explode('#', $field);\n $data[$x]['name'] = trim($fieldArray[0]);\n\t\t\t\t$types = explode('|',$fieldArray[1]);\n\t\t\t\t$type = array_shift($types);\n $data[$x]['type'] = $type;\n if ((Str::startsWith($type, 'select')|| Str::startsWith($type, 'enum')) && isset($fieldArray[2])) {\n $options = trim($fieldArray[2]);\n $data[$x]['options'] = str_replace('options=', '', $options);\n }\n\t\t\t\t//string:30|default:'ofumbi'|nullable\n\t\t\t\t$data[$x]['modifiers'] = [];\n\t\t\t\tif(count($types)){\n\t\t\t\t\t$modifierLookup = [\n\t\t\t\t\t\t'comment',\n\t\t\t\t\t\t'default',\n\t\t\t\t\t\t'first',\n\t\t\t\t\t\t'nullable',\n\t\t\t\t\t\t'unsigned',\n\t\t\t\t\t\t'unique',\n\t\t\t\t\t\t'charset',\n\t\t\t\t\t];\n\t\t\t\t\tforeach($types as $modification){\n\t\t\t\t\t\t$variables = explode(':',$modification);\n\t\t\t\t\t\t$modifier = array_shift($variables);\n\t\t\t\t\t\tif(!in_array(trim($modifier), $modifierLookup)) continue;\n\t\t\t\t\t\t$variables = $variables[0]??\"\";\n\t\t\t\t\t\t$data[$x]['modifiers'][] = \"->\" . trim($modifier) . \"(\".$variables.\")\";\n\t\t\t\t\t}\n\t\t\t\t}\n $x++;\n }\n }\n\n $tabIndent = ' ';\n\n $schemaFields = '';\n foreach ($data as $item) {\n\t\t\t$data_type = explode(':',$item['type']);\n\t\t\t$item_type = array_shift($data_type);\n\t\t\t$variables = isset($data_type[0])?\",\".$data_type[0]:\"\";\n if (isset($this->typeLookup[$item_type ])) {\n $type = $this->typeLookup[$item_type];\n if (!empty($item['options'])) {\n $enumOptions = array_keys(json_decode($item['options'], true));\n $enumOptionsStr = implode(\",\", array_map(function ($string) {\n return '\"' . $string . '\"';\n }, $enumOptions));\n $schemaFields .= \"\\$table->enum('\" . $item['name'] . \"', [\" . $enumOptionsStr . \"])\";\n } elseif($item['name']==\"uuid\") {\n $schemaFields .= \"\\$table->uuid('\" . $item['name'] . \"')\";\n }else {\n $schemaFields .= \"\\$table->\" . $type . \"('\" . $item['name'] . \"'\".$variables.\")\";\n }\n } else {\n \t if (!empty($item['options'])) {\n $enumOptions = array_keys(json_decode($item['options'], true));\n $enumOptionsStr = implode(\",\", array_map(function ($string) {\n return '\"' . $string . '\"';\n }, $enumOptions));\n $schemaFields .= \"\\$table->enum('\" . $item['name'] . \"', [\" . $enumOptionsStr . \"])\";\n } elseif($item['name']==\"uuid\") {\n $schemaFields .= \"\\$table->uuid('\" . $item['name'] . \"')\";\n }else {\n $schemaFields .= \"\\$table->string('\" . $item['name'] . \"'\".$variables.\")\";\n }\n }\n\n // Append column modifier\n $schemaFields .= implode(\"\",$item['modifiers']);\n $schemaFields .= \";\\n\" . $tabIndent . $tabIndent . $tabIndent;\n }\n\n // add indexes and unique indexes as necessary\n foreach ($fieldsToIndex as $fldData) {\n $line = trim($fldData);\n\n // is a unique index specified after the #?\n // if no hash present, we append one to make life easier\n if (strpos($line, '#') === false) {\n $line .= '#';\n }\n\n // parts[0] = field name (or names if pipe separated)\n // parts[1] = unique specified\n $parts = explode('#', $line);\n if (strpos($parts[0], '|') !== 0) {\n $fieldNames = \"['\" . implode(\"', '\", explode('|', $parts[0])) . \"']\"; // wrap single quotes around each element\n } else {\n $fieldNames = trim($parts[0]);\n }\n\n if (count($parts) > 1 && $parts[1] == 'unique') {\n $schemaFields .= \"\\$table->unique(\" . trim($fieldNames) . \")\";\n } else {\n $schemaFields .= \"\\$table->index(\" . trim($fieldNames) . \")\";\n }\n\n $schemaFields .= \";\\n\" . $tabIndent . $tabIndent . $tabIndent;\n }\n\n // foreign keys\n foreach ($foreignKeys as $fk) {\n $line = trim($fk);\n\n $parts = explode('#', $line);\n\n // if we don't have three parts, then the foreign key isn't defined properly\n // --foreign-keys=\"foreign_entity_id#id#foreign_entity#onDelete#onUpdate\"\n if (count($parts) == 3) {\n $schemaFields .= \"\\$table->foreign('\" . trim($parts[0]) . \"')\"\n . \"->references('\" . trim($parts[1]) . \"')->on('\" . trim($parts[2]) . \"')\";\n } elseif (count($parts) == 4) {\n $schemaFields .= \"\\$table->foreign('\" . trim($parts[0]) . \"')\"\n . \"->references('\" . trim($parts[1]) . \"')->on('\" . trim($parts[2]) . \"')\"\n . \"->onDelete('\" . trim($parts[3]) . \"')\" . \"->onUpdate('\" . trim($parts[3]) . \"')\";\n } elseif (count($parts) == 5) {\n $schemaFields .= \"\\$table->foreign('\" . trim($parts[0]) . \"')\"\n . \"->references('\" . trim($parts[1]) . \"')->on('\" . trim($parts[2]) . \"')\"\n . \"->onDelete('\" . trim($parts[3]) . \"')\" . \"->onUpdate('\" . trim($parts[4]) . \"')\";\n } else {\n continue;\n }\n\n $schemaFields .= \";\\n\" . $tabIndent . $tabIndent . $tabIndent;\n }\n\n $primaryKey = $this->option('pk');\n $softDeletes = $this->option('soft-deletes');\n\n $softDeletesSnippets = '';\n if ($softDeletes == 'yes') {\n $softDeletesSnippets = \"\\$table->softDeletes();\\n\" . $tabIndent . $tabIndent . $tabIndent;\n }\n\n $schemaUp =\n \"Schema::create('\" . $tableName . \"', function (Blueprint \\$table) {\n \\$table->bigIncrements('\" . $primaryKey . \"');\n \\$table->timestamps();\\n\" . $tabIndent . $tabIndent . $tabIndent .\n $softDeletesSnippets .\n $schemaFields .\n \"});\";\n\n $schemaDown = \"Schema::drop('\" . $tableName . \"');\";\n\n return $this->replaceSchemaUp($stub, $schemaUp)\n ->replaceSchemaDown($stub, $schemaDown)\n ->replaceClass($stub, $className);\n }", "private function generateTestClass()\n {\n $parts = explode('\\\\', $this->entity);\n $entityClass = array_pop($parts);\n $entityNamespace = implode('\\\\', $parts);\n\n $dir = $this->bundle->getPath() .'/Tests/Controller';\n $target = $dir .'/'. str_replace('\\\\', '/', $entityNamespace).'/'. $entityClass .'ControllerTest.php';\n\n $this->renderFile($this->skeletonDir, 'tests/test.php', $target, array(\n 'route_prefix' => $this->routePrefix,\n 'route_name_prefix' => $this->routeNamePrefix,\n 'entity' => $this->entity,\n 'entity_class' => $entityClass,\n 'namespace' => $this->bundle->getNamespace(),\n 'entity_namespace' => $entityNamespace,\n 'actions' => $this->actions,\n 'dir' => $this->skeletonDir,\n ));\n }", "public function build( $class ) {\n\t\t$full_class_name = $this->namespace . $class;\n\t\treturn new $full_class_name();\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}", "private function _generateModels() {\n\n $model = file_get_contents($this->_rootDir . '/' . self::TEMPLATE_DIR . '/model.mustache');\n $apiModel = file_get_contents($this->_rootDir . '/' . self::TEMPLATE_DIR . '/api_model.mustache');\n $link = file_get_contents($this->_rootDir . '/' . self::TEMPLATE_DIR . '/link.mustache');\n\n $baseModel = file_get_contents($this->_rootDir . '/' . self::TEMPLATE_DIR . '/base_model.mustache');\n $baseApiModel = file_get_contents($this->_rootDir . '/' . self::TEMPLATE_DIR . '/base_api_model.mustache');\n $baseLink = file_get_contents($this->_rootDir . '/' . self::TEMPLATE_DIR . '/base_link.mustache');\n\n $modelDir = $this->_rootDir . '/' . self::TARGET_PATH . '/';\n if (is_dir($modelDir)) {\n shell_exec('rm -rf ' . $modelDir);\n }\n\n foreach ($this->_definitions as $definition) {\n $dir = $modelDir . $definition->namespace . '/';\n $baseDir = $modelDir . '_Base/' . $definition->namespace . '/';\n $baseFile = 'Base' . $definition->name . '.php';\n $file = $definition->name . '.php';\n $basePath = $baseDir . $baseFile;\n $path = $dir . $file;\n\n if (!is_dir($dir)) {\n mkdir($dir, 0777, true);\n }\n\n if (!is_dir($baseDir)) {\n mkdir($baseDir, 0777, true);\n }\n\n if (file_exists($path)) {\n unlink($path);\n }\n\n if (file_exists($basePath)) {\n unlink($basePath);\n }\n\n if (in_array(strtolower($definition->name), $this->_paths)) {\n //ApiModel\n $content = $this->_mustache->render($apiModel, $definition->getArray());\n $baseContent = $this->_mustache->render($baseApiModel, $definition->getArray());\n } else if (substr($definition->name, -3) == 'Rel') {\n //Link\n $content = $this->_mustache->render($link, $definition->getArray());\n $baseContent = $this->_mustache->render($baseLink, $definition->getArray());\n } else {\n //Model\n $content = $this->_mustache->render($model, $definition->getArray());\n $baseContent = $this->_mustache->render($baseModel, $definition->getArray());\n }\n file_put_contents($path, $content);\n file_put_contents($basePath, $baseContent);\n }\n }", "protected static function buildCode(\n string $type,\n string $preparedClassName,\n string $preparedNamespace,\n string $preparedExtends\n ) {\n $code = [];\n if ($preparedNamespace) {\n $code[] = \"namespace $preparedNamespace;\";\n }\n $code[] = \"$type $preparedClassName\";\n if ($preparedExtends) {\n $code[] = \"extends \\\\$preparedExtends\";\n }\n $code[] = '{}';\n\n // echo PHP_EOL . '------------------------------------------------------------------' . PHP_EOL;\n // echo(implode(' ', $code));\n // echo PHP_EOL . '------------------------------------------------------------------' . PHP_EOL;\n\n eval(implode(' ', $code));\n }", "public function __construct()\n {\n self::build();\n }", "protected function buildClass()\n {\n return $this->files->get($this->getStub());\n }", "private function buildClassMeta()\n {\n // Search meta informations before going to reflection and then, ast parsing\n foreach ($this->data as $line) {\n $line = trim($line);\n\n // Namespace search\n if (preg_match(self::NAMESPACE_PATTERN, $line, $matches) === 1) {\n $this->context->setCurrentNamespace(trim($matches[1]));\n continue;\n }\n\n // Class name\n if (preg_match(self::DEFINITION_PATTERN, $line, $matches) === 1) {\n $this->context->setClassName(trim($matches[1]));\n break; // Stop after class found, let the reflection do the next job\n }\n\n // Uses\n if (preg_match(self::USE_PATTERN, $line, $matches) === 1) {\n $this->context->addUse($matches[1]);\n continue;\n }\n }\n }", "public function __construct($args)\n\t{\n\t\tparent::__construct($args);\n\n\t\t// we need a controller name\n\t\tif ($this->class == null)\n\t\t\tUtils::error('You must specify a model name.');\n\n\t\t// load any command line switches\n\t\t$this->_settings();\n\n\t\t// start the generation\n\t\t$this->_model_generation();\n\n\t\t// write filesystem changes\n\t\t$this->writer->write();\n\t}", "protected function buildClassnameConstraint() {\n\t\treturn 'doc.classname==\"' . addslashes($this->type) . '\"';\n\t}", "protected function cliModelInit()\n {\n }", "abstract protected function modelFactory();", "public function compileClass() {\n\t\t$parent = $this->_file->parent();\n\t\t$values = array(\n\t\t\t'{:name:}' => $this->_file->name(),\n\t\t\t'{:parent:}' => $parent ? $parent->name_space() . '/' . $parent->name() : 'foo',\n\t\t\t'{:contents:}' => $this->compileMethods(),\n\t\t\t'{:namespace:}' => $this->_file->name_space(),\n\t\t);\n\t\treturn str_replace(array_keys($values), $values, $this->_templates['class']);\n\t}", "private function _generateConstructBody($name)\n {\n $modelClassName = $this->_getClassName(\n $this->_opts->modelnamespace,\n $name\n );\n \n $body = '$hydrator = new ZendExt_Db_Dao_Hydrator_Constructor(' . PHP_EOL\n . self::TAB . \"'\" . $modelClassName . \"'\" . PHP_EOL\n . ');' . PHP_EOL;\n \n $body .= PHP_EOL;\n $body .= 'parent::__construct($hydrator);';\n \n return $body;\n }", "public function getModelClass(): string\n {\n return static::${'modelClass'};\n }", "public function run()\n {\n PropertyType::create([\n 'name' => 'Allgemein',\n ]);\n\n PropertyType::create([\n 'name' => 'Vitalwerte',\n ]);\n\n PropertyType::create([\n 'name' => 'Medikamente',\n ]);\n }", "protected function template() {\n\n\t\t$template = \"<?php \n\n/**\n *\n * PHP version 7.\n *\n * Generated with cli-builder gen.php\n *\n * Created: \" . date( 'm-d-Y' ) . \"\n *\n *\n * @author Your Name <email>\n * @copyright (c) \" . date( 'Y' ) . \"\n * @package $this->_namespace - {$this->_command_name}.php\n * @license\n * @version 0.0.1\n *\n */\n\n\";\n\t\tif ( ! empty( $this->_namespace ) ) {\n\t\t\t$template .= \"namespace cli_builder\\\\commands\\\\$this->_namespace;\";\n\t\t} else {\n\t\t\t$template .= \"namespace cli_builder\\\\commands;\";\n\t\t}\n\n\t\t$template .= \"\n\nuse cli_builder\\\\cli;\nuse cli_builder\\\\command\\\\builder;\nuse cli_builder\\command\\command;\nuse cli_builder\\\\command\\\\command_interface;\nuse cli_builder\\\\command\\\\receiver;\n\n/**\n * This concrete command calls \\\"print\\\" on the receiver, but an external.\n * invoker just knows that it can call \\\"execute\\\"\n */\nclass {$this->_command_name} extends command implements command_interface {\n\n\t\n\t/**\n\t * Each concrete command is built with different receivers.\n\t * There can be one, many or completely no receivers, but there can be other commands in the parameters.\n\t *\n\t * @param receiver \\$console\n\t * @param builder \\$builder\n\t * @param cli \\$cli\n\t */\n\tpublic function __construct( receiver \\$console, builder \\$builder, cli \\$cli ) {\n\t\tparent::__construct( \\$console, \\$builder, \\$cli );\n\t\t\n\t\t// Add the help lines.\n\t\t\\$this->_help_lines();\n\t\t\n\t\tif ( in_array( 'h', \\$this->_flags ) || isset( \\$this->_options['help'] ) ) {\n\t\t\t\\$this->help();\n\t\t\t\\$this->_help_request = true;\n\t\t} else {\n\t\t\t// Any setup you need.\n\t\t\t\n\t\t}\n\t}\n\n\n\t/**\n\t * Execute and output \\\"$this->_command_name\\\".\n\t *\n\t * @return mixed|void\n\t */\n\tpublic function execute() {\n\t\n\t\tif ( \\$this->_help_request ) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Get the args that were used in the command line input.\n\t\t\\$args = \\$this->_cli->get_args();\n\t\t\\$args = \\$this->_args;\n\t\t\n\t\t// Create the build directory tree. It will be 'build/' if \\$receiver->set_build_path() is not set in your root cli.php.\n\t\tif ( ! is_dir( \\$this->_command->build_path ) ) {\n\t\t\t\\$this->_builder->create_directory( \\$this->_command->build_path );\n\t\t}\n\n\t\t\\$this->_cli->pretty_dump( \\$args );\n\n\t\t\n\t\t// Will output all content sent to the write method at the end even if it was set in the beginning.\n\t\t\\$this->_command->write( __CLASS__ . ' completed run.' );\n\n\t\t// Adding completion of the command run to the log.\n\t\t\\$this->_command->log(__CLASS__ . ' completed run.');\n\t}\n\t\n\tprivate function _help_lines() {\n\t\t// Example\n\t\t//\\$this->add_help_line('-h, --help', 'Output this commands help info.');\n\n\t}\n\t\n\t/**\n\t * Help output for \\\"$this->_command_name\\\".\n\t *\n\t * @return string\n\t */\n\tpublic function help() {\n\t\n\t\t// You can comment this call out once you add help.\n\t\t// Outputs a reminder to add help.\n\t\tparent::help();\n\t\t\n\t\t//\\$help = \\$this->get_help();\n\n\t\t// Work with the array\n\t\t//print_r( \\$help );\n\t\t// Or output a table\n\t\t//\\$this->help_table();\n\t}\n}\n\";\n\n\t\treturn $template;\n\t}", "public function build()\n {\n $this->validate_attributes();\n\n $attributes = [];\n foreach (static::$object_attributes as $key => $value) {\n $attributes[$key] = $this->{$key};\n }\n\n // Construct a vcalendar object based on the templated\n return (new Build(\n static::VTEMPLATE\n ))->build(\n $attributes\n );\n }", "protected function addClassOpen(&$script)\n {\n $table = $this->getTable();\n $tableName = $table->getName();\n $script .= \"use Cungfoo\\\\Lib\\\\Listing\\\\Listing,\n\\tCungfoo\\\\Lib\\\\Listing\\\\Column;\n\nuse {$this->getParentNamespace()}\\\\Base{$this->getClassname()};\n\n/**\n * Listing class for '$tableName' table.\n *\n * @author Morgan Brunot <[email protected]>\n * Denis Roussel <[email protected]>\n * @package propel.generator.\".$this->getPackage().\"\n */\nclass {$this->getClassname()} extends Base{$this->getClassname()}\n{\n\";\n }", "protected function generateMapFile()\n {\n $namespace = $this->getNamespace();\n $class = $this->options['class'];\n\n $php = <<<EOD\n<?php\n\nnamespace $namespace;\n\nuse $namespace\\\\Base\\\\${class}Map as Base${class}Map;\nuse $namespace\\\\${class};\nuse \\\\Pomm\\\\Exception\\\\Exception;\nuse \\\\Pomm\\\\Query\\\\Where;\n\nclass ${class}Map extends Base${class}Map\n{\n}\n\nEOD;\n\n return $php;\n }", "protected function createMigration()\n {\n $migrationsOptions = [\n 'migrationName' => 'create_' . Str::plural(strtolower($this->info['modelName'])) . '_table',\n 'module' => $this->info['moduleName'],\n ];\n\n if ($this->optionHasValue('index')) {\n $migrationsOptions['--index'] = $this->option('index');\n }\n\n if ($this->optionHasValue('unique')) {\n $migrationsOptions['--unique'] = $this->option('unique');\n }\n\n if ($this->optionHasValue('data')) {\n $migrationsOptions['--data'] = $this->option('data');\n }\n\n if ($this->optionHasValue('uploads')) {\n $migrationsOptions['--uploads'] = $this->option('uploads');\n }\n\n if ($this->optionHasValue('int')) {\n $migrationsOptions['--int'] = $this->option('int');\n }\n\n if ($this->optionHasValue('bool')) {\n $migrationsOptions['--bool'] = $this->option('bool');\n }\n\n if ($this->optionHasValue('float')) {\n $migrationsOptions['--float'] = $this->option('float');\n }\n if ($this->optionHasValue('table')) {\n $migrationsOptions['--table'] = $this->option('table');\n }\n\n if (isset($this->info['parent'])) {\n $migrationsOptions['--parent'] = $this->info['parent'];\n }\n\n Artisan::call('engez:migration', $migrationsOptions);\n }", "abstract public function model();", "abstract public function model();", "abstract public function model();", "abstract public function model();", "function __autoload($className) {\n require_once \"../model/\" . $className . '.php';\n}", "public function Run()\n {\n $model = new GModel(\"Run\", false);\n echo \"Sample Data Generated\";\n exit();\n }", "public function getAsString(): string\n {\n $model = <<<MODEL\n<mujoco>\n <option timestep=\"0.02\" viscosity=\"0\" density=\"0\" gravity=\"0 0 -9.81\" collision=\"dynamic\"/>\n <compiler coordinate=\"global\" angle=\"degree\"/>\n <default>\n <geom rgba=\".8 .6 .4 1\"/>\n <joint limited=\"true\"/>\n </default>\n <asset>\n <texture type=\"skybox\" builtin=\"gradient\" rgb1=\"1 1 1\" rgb2=\".6 .8 1\" width=\"256\" height=\"256\"/>\n <texture type=\"2d\" name=\"checkers\" builtin=\"checker\" width=\"256\" height=\"256\" rgb1=\"0 0 0\" rgb2=\"1 1 1\"/>\n <material name=\"checker_mat\" texture=\"checkers\" texrepeat=\"15 15\"/>\n <!--<material name=\"spiral_mat\" texture=\"spiral\" texrepeat=\"1 1\"/>-->\n </asset>\n <visual>\n <global offwidth=\"1920\" offheight=\"1080\"/>\n <map stiffness=\"10\" stiffnessrot=\"20\"/>\n </visual>\n\n\n <worldbody>\n <camera name='targeting' pos='1 1 2' mode='targetbodycom' target='body_0'/>\n\n <geom name=\"floor\" material=\"checker_mat\" pos=\"30 50 -20\" size=\"420 420 .125\" rgba=\"1 1 1 1\" type=\"plane\"\n condim=\"6\" friction=\"5 0.5 0.1\"/>\n\n <site name=\"reference_0\" pos=\"130 0 -15\" size=\"5 5 5\" type=\"sphere\" rgba=\"255 255 0 1\"/>\n <site name=\"reference_1\" pos=\"180 0 -15\" size=\"5 5 5\" type=\"sphere\" rgba=\"255 255 0 1\"/>\n <site name=\"reference_2\" pos=\"230 0 -15\" size=\"5 5 5\" type=\"sphere\" rgba=\"255 255 0 1\"/>\n <site name=\"reference_3\" pos=\"280 0 -15\" size=\"5 5 5\" type=\"sphere\" rgba=\"255 255 0 1\"/>\n <site name=\"reference_4\" pos=\"330 0 -15\" size=\"5 5 5\" type=\"sphere\" rgba=\"255 255 0 1\"/>\n <site name=\"reference_5\" pos=\"380 0 -15\" size=\"5 5 5\" type=\"sphere\" rgba=\"255 255 0 1\"/>\n <site name=\"reference_6\" pos=\"430 0 -15\" size=\"5 5 5\" type=\"sphere\" rgba=\"255 255 0 1\"/>\n\n\n <body name=\"body_0\">\n <freejoint/>\n <site name=\"head\" size=\"2 2 2\" rgba=\"1 0 0 0.5\" pos=\"80 0 0\"/>\n <geom name=\"geom_0\" type=\"sphere\" pos=\"0.00 0.00 0.20\" size=\"0.3\"/>\n <body name=\"body_1\">\n <!--1st arms-->\n <geom name=\"geom_1\" type=\"capsule\" fromto=\"0.00 0.00 0.00 0.00 10.0 10.0\" size=\"01.00000\"/>\n <geom name=\"geom_2\" type=\"capsule\" fromto=\"0.00 0.00 0.00 0.00 -10.0 10.0\" size=\"01.00000\"/>\n <!--spine-->\n <geom name=\"geom_3\" type=\"capsule\" fromto=\"0.00 0.00 0.00 80.0 0.00 0.00\" size=\"01.00000\"/>\n <!--contact point which is used to create heading vector-->\n <geom name=\"contact_1\" type=\"sphere\" pos=\"0.00 0.00 0.00\" size=\"0.01\" rgba=\"1 0 1 0.5\" density=\"1\"/>\n\n <!--2nd arms-->\n <geom name=\"geom_4\" type=\"capsule\" fromto=\"40.0 0.00 0.00 40.0 10.0 10.0\" size=\"01.00000\"/>\n <geom name=\"geom_5\" type=\"capsule\" fromto=\"40.0 0.00 0.00 40.0 -10.0 10.0\" size=\"01.00000\"/>\n\n <!--3rd arms-->\n <geom name=\"geom_18\" type=\"capsule\" fromto=\"80.0 0.00 0.00 80.0 10.0 10.0\" size=\"01.00000\"/>\n <geom name=\"geom_19\" type=\"capsule\" fromto=\"80.0 0.00 0.00 80.0 -10.0 10.0\" size=\"01.00000\"/>\n\n <!--first leg pair-->\n <!--upper leg-->\n <body name=\"body_2\">\n <joint type=\"hinge\" pos=\"0 -10 10\" axis=\"0 0 1\" limited=\"true\" range=\"-45 45\" name=\"motor_0\"/>\n <geom name=\"geom_6\" type=\"capsule\" fromto=\"0.00 -10.0 10.0 0.00 -20.0 10.0\" size=\"01.00000\"/>\n <!--lower leg-->\n <body name=\"body_3\">\n <joint type=\"hinge\" pos=\"0 -20 10\" axis=\"1 0 0\" limited=\"true\" range=\"-20 45\" name=\"motor_1\"/>\n <geom name=\"geom_7\" type=\"capsule\" fromto=\"0.00 -20.0 10.0 0.00 -30.0 -5.0\" size=\"01.00000\"/>\n </body>\n </body>\n <!--upper leg-->\n <body name=\"body_4\">\n <joint type=\"hinge\" pos=\"0 10 10\" axis=\"0 0 1\" limited=\"true\" range=\"-45 45\" name=\"motor_2\"/>\n <geom name=\"geom_8\" type=\"capsule\" fromto=\"0.00 10.0 10.0 0.00 20.0 10.0\" size=\"01.00000\"/>\n <!--lower leg-->\n <body name=\"body_5\">\n <joint type=\"hinge\" pos=\"0 20 10\" axis=\"1 0 0\" limited=\"true\" range=\"-20 45\" name=\"motor_3\"/>\n <geom name=\"geom_9\" type=\"capsule\" fromto=\"0.00 20.0 10.0 0.00 30.0 -5\" size=\"01.00000\"/>\n </body>\n </body>\n\n <!--second leg pair-->\n <!--upper leg-->\n <body name=\"body_6\">\n <joint type=\"hinge\" pos=\"40 -10 10\" axis=\"0 0 1\" limited=\"true\" range=\"-45 45\" name=\"motor_4\"/>\n <geom name=\"geom_10\" type=\"capsule\" fromto=\"40.0 -10.0 10.0 40.0 -20.0 10.0\" size=\"01.00000\"/>\n <!--lower leg-->\n <body name=\"body_7\">\n <joint type=\"hinge\" pos=\"40 -20 10\" axis=\"1 0 0\" limited=\"true\" range=\"-20 45\" name=\"motor_5\"/>\n <geom name=\"geom_11\" type=\"capsule\" fromto=\"40.0 -20.0 10.0 40.0 -30.0 -5.0\" size=\"01.00000\"/>\n </body>\n </body>\n <!--upper leg-->\n <body name=\"body_8\">\n <joint type=\"hinge\" pos=\"40 10 10\" axis=\"0 0 1\" limited=\"true\" range=\"-45 45\" name=\"motor_6\"/>\n <geom name=\"geom_12\" type=\"capsule\" fromto=\"40.0 10.0 10.0 40.0 20.0 10.0\" size=\"01.00000\"/>\n <!--lower leg-->\n <body name=\"body_9\">\n <joint type=\"hinge\" pos=\"40 20 10\" axis=\"1 0 0\" limited=\"true\" range=\"-20 45\" name=\"motor_7\"/>\n <geom name=\"geom_13\" type=\"capsule\" fromto=\"40.0 20.0 10.0 40.0 30.0 -0.5\" size=\"01.00000\"/>\n </body>\n </body>\n\n <!--third leg pair-->\n <!--upper leg-->\n <body name=\"body_10\">\n <joint type=\"hinge\" pos=\"80 -10 10\" axis=\"0 0 1\" limited=\"true\" range=\"-45 45\" name=\"motor_8\"/>\n <geom name=\"geom_14\" type=\"capsule\" fromto=\"80 -10.0 10.0 80 -20.0 10.0\" size=\"01.00000\"/>\n <!--lower leg-->\n <body name=\"body_11\">\n <joint type=\"hinge\" pos=\"80 -20 10\" axis=\"1 0 0\" limited=\"true\" range=\"-20 45\" name=\"motor_9\"/>\n <geom name=\"geom_15\" type=\"capsule\" fromto=\"80 -20.0 10.0 80 -30.0 -5.0\" size=\"01.00000\"/>\n </body>\n </body>\n <!--upper leg-->\n <body name=\"body_12\">\n <joint type=\"hinge\" pos=\"80 10 10\" axis=\"0 0 1\" limited=\"true\" range=\"-45 45\" name=\"motor_10\"/>\n <geom name=\"geom_16\" type=\"capsule\" fromto=\"80 10.0 10.0 80 20.0 10.0\" size=\"01.00000\"/>\n <!--lower leg-->\n <body name=\"body_13\">\n <joint type=\"hinge\" pos=\"80 20 10\" axis=\"1 0 0\" limited=\"true\" range=\"-20 45\" name=\"motor_11\"/>\n <geom name=\"geom_17\" type=\"capsule\" fromto=\"80 20.0 10.0 80 30.0 -0.5\" size=\"01.00000\"/>\n </body>\n </body>\n </body>\n </body>\n </worldbody>\n\n <actuator>\n <motor name=\"motor_0\" joint=\"motor_0\" gear=\"100000\"/>\n <motor name=\"motor_1\" joint=\"motor_1\" gear=\"100000\"/>\n <motor name=\"motor_2\" joint=\"motor_2\" gear=\"100000\"/>\n <motor name=\"motor_3\" joint=\"motor_3\" gear=\"100000\"/>\n <motor name=\"motor_4\" joint=\"motor_4\" gear=\"100000\"/>\n <motor name=\"motor_5\" joint=\"motor_5\" gear=\"100000\"/>\n <motor name=\"motor_6\" joint=\"motor_6\" gear=\"100000\"/>\n <motor name=\"motor_7\" joint=\"motor_7\" gear=\"100000\"/>\n <motor name=\"motor_8\" joint=\"motor_8\" gear=\"100000\"/>\n <motor name=\"motor_9\" joint=\"motor_9\" gear=\"100000\"/>\n <motor name=\"motor_10\" joint=\"motor_10\" gear=\"100000\"/>\n <motor name=\"motor_11\" joint=\"motor_11\" gear=\"100000\"/>\n </actuator>\n</mujoco>\nMODEL;\n\n return $model;\n }", "public function main() {\n\n $fs = new Filesystem();\n\n $fs->touch($this->getTargetFile());\n\n $seedProperties = Yaml::parse(file_get_contents($this->getSeedFile()));\n $generatedProperties = [];\n\n $generatedProperties['label'] = $seedProperties['project_label'];\n $generatedProperties['machineName'] = $seedProperties['project_name'];\n $generatedProperties['group'] = $seedProperties['project_group'];\n $generatedProperties['basePath'] = '${current.basePath}';\n $generatedProperties['type'] = $seedProperties['project_type'];\n $generatedProperties['repository']['main'] = $seedProperties['project_git_repository'];\n $generatedProperties['php'] = $seedProperties['project_php_version'];\n\n // Add platform information.\n if (isset($generatedProperties['platform'])) {\n $generatedProperties['platform'] = $seedProperties['platform'];\n }\n\n $fs->dumpFile($this->getTargetFile(), Yaml::dump($generatedProperties, 5, 2));\n }", "public function GenerateStructure() {\n // WRITE CONSTRUCTOR\n $this->writeLine(\n sprintf(\n '$return = new pdoMap_Dao_Metadata_Table(\n \\'%1$s\\',\\'%2$s\\',\\'%3$s\\',\n \\'%4$s\\',\\'%5$s\\',\\'%6$s\\');',\n $this->name, // adapter name\n $this->getTableName(), // table name\n $this->entity->getClassName(), // entity class name\n $this->getInterface(), // interface service name\n $this->getAdapterClassName(), // adapter class name (if set)\n $this->getUse() // database connection\n )\n );\n // WRITE PROPERTIES\n $this->entity->GenerateProperties(); \n $this->writeLine('return $return;');\n }", "public function build() {\n $pref = new Pref(\"system\");\n $this->setMainTemplate($pref->template);\n\n\n if ($this->data['url']['application'] == \"admin\")\n $tpl = new Template(PATH_SITEADMIN_TEMPLATES);\n else\n $tpl = new Template(PATH_TEMPLATES);\n if (!USER_ID && !$this->isAllowed())\n header(\"location: \" . page(\"user\", \"login\"));\n\n if (!USER_ID && $this->isAllowed())\n $tpl->login = true;\n else\n $tpl->login = false;\n $tpl->loadFile(\"template.php\");\n $tpl->data = $this->data;\n $tpl->build();\n }", "public function run()\n {\n Type::create([\n 'name' => 'Prototype',\n 'speed' => 60,\n 'fuelUnits' => 10,\n 'milesPerUnit' => 10\n ]);\n Type::create([\n 'name' => 'Normal',\n 'speed' => 40,\n 'fuelUnits' => 20,\n 'milesPerUnit' => 5\n ]);\n Type::create([\n 'name' => 'TransContinental',\n 'speed' => 20,\n 'fuelUnits' => 50,\n 'milesPerUnit' => 30\n ]);\n }", "public function generate()\n\t{\n\t\tif ($this->init == false)\n\t\t\tthrow new Exception('Generator Error: Data must be initialized.');\n\t\t\n\t\t// table view\n\t\t$table = new Table($this->model->get_name(), $this->model->get_columns());\n\t\t$template = $this->files->read($this->tableTemplate->get_template());\n\t\t$table->set_body($template);\n\t\t$tbl = $table->generate();\n\t\t$table_view = $this->compiler->compile($tbl, $this->data);\n\t\t$table_view_path = $this->tableTemplate->get_path();\n\t\tif ($this->files->write($table_view_path, $table_view))\n\t\t\t$this->filenames[] = $table_view_path;\n\n\t\t// controller\n\t\t$template = $this->files->read($this->controllerTemplate->get_template());\n\t\t$controller = $this->compiler->compile($template, $this->data);\n\t\t$controller_path = $this->controllerTemplate->get_path();\n\t\tif ($this->files->write($controller_path, $controller))\n\t\t\t$this->filenames[] = $controller_path;\n\n\t\t// main view\n\t\t$template = $this->files->read($this->viewTemplate->get_template());\n\t\t$view = $this->compiler->compile($template, $this->data);\n\t\t$view_path = $this->viewTemplate->get_path();\n\t\tif ($this->files->write($view_path, $view))\n\t\t\t$this->filenames[] = $view_path;\n\n\t\t// model\n\t\t$template = $this->files->read($this->modelTemplate->get_template());\n\t\t$model = $this->compiler->compile($template, $this->data);\n\t\t$model_path = $this->modelTemplate->get_path();\n\t\tif ($this->files->write($model_path, $model))\n\t\t\t$this->filenames[] = $model_path;\n\t}", "function __construct () {\n\n\t\techo 'I am in Model';\n\n\t}" ]
[ "0.6678947", "0.6297818", "0.61002237", "0.5937762", "0.59084713", "0.5810574", "0.57812756", "0.5710433", "0.5710433", "0.57023436", "0.57023436", "0.56336075", "0.56336075", "0.56336075", "0.56336075", "0.56336075", "0.56336075", "0.56336075", "0.5623705", "0.56184113", "0.54588574", "0.5451275", "0.54505277", "0.54505277", "0.5426543", "0.53897715", "0.5384791", "0.5378193", "0.5370648", "0.53692096", "0.5344457", "0.53434527", "0.5339271", "0.533819", "0.53353417", "0.5327522", "0.53036404", "0.528273", "0.5282687", "0.5281871", "0.5279047", "0.5260465", "0.5237308", "0.52304125", "0.52073634", "0.5189276", "0.516829", "0.5139469", "0.5110403", "0.5105695", "0.5104752", "0.51030755", "0.5090327", "0.50807387", "0.50647783", "0.50602067", "0.50489044", "0.50443965", "0.5038345", "0.50277555", "0.5026922", "0.5020963", "0.4996262", "0.4984914", "0.49828732", "0.49772054", "0.49764982", "0.49744216", "0.49716073", "0.4961496", "0.49595076", "0.49566144", "0.49462846", "0.4941268", "0.49392524", "0.49244776", "0.49139017", "0.49071002", "0.4901816", "0.4895352", "0.48912853", "0.4887624", "0.48861223", "0.48815566", "0.48804352", "0.48769382", "0.48740894", "0.48702243", "0.48612309", "0.48612309", "0.48612309", "0.48612309", "0.48570603", "0.48483852", "0.48479778", "0.4847611", "0.48469576", "0.48460248", "0.48337913", "0.48318887", "0.4828176" ]
0.0
-1
Build a service class script.
public static function buildServiceDefinition( bool $asCRUD = false, ?string $name = null, ?string $namespace = null, ?string $model = null ) { return self::createServiceBuilder($asCRUD, $name, $namespace, $model)->build(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function generate($className)\n\t{\n\t\t$this->builder->complete();\n\n\t\t$this->generatedClasses = [];\n\t\t$this->className = $className;\n\t\t$containerClass = $this->generatedClasses[] = new Nette\\PhpGenerator\\ClassType($this->className);\n\t\t$containerClass->setExtends(Container::class);\n\t\t$containerClass->addMethod('__construct')\n\t\t\t->addBody('$this->parameters = $params;')\n\t\t\t->addBody('$this->parameters += ?;', [$this->builder->parameters])\n\t\t\t->addParameter('params', [])\n\t\t\t\t->setTypeHint('array');\n\n\t\t$definitions = $this->builder->getDefinitions();\n\t\tksort($definitions);\n\n\t\t$meta = $containerClass->addProperty('meta')\n\t\t\t->setVisibility('protected')\n\t\t\t->setValue([Container::TYPES => $this->builder->getClassList()]);\n\n\t\tforeach ($definitions as $name => $def) {\n\t\t\t$meta->value[Container::SERVICES][$name] = $def->getImplement() ?: $def->getType() ?: null;\n\t\t\tforeach ($def->getTags() as $tag => $value) {\n\t\t\t\t$meta->value[Container::TAGS][$tag][$name] = $value;\n\t\t\t}\n\t\t}\n\n\t\tforeach ($definitions as $name => $def) {\n\t\t\ttry {\n\t\t\t\t$name = (string) $name;\n\t\t\t\t$methodName = Container::getMethodName($name);\n\t\t\t\tif (!PhpHelpers::isIdentifier($methodName)) {\n\t\t\t\t\tthrow new ServiceCreationException('Name contains invalid characters.');\n\t\t\t\t}\n\t\t\t\t$containerClass->addMethod($methodName)\n\t\t\t\t\t->addComment(PHP_VERSION_ID < 70000 ? '@return ' . ($def->getImplement() ?: $def->getType()) : '')\n\t\t\t\t\t->setReturnType(PHP_VERSION_ID >= 70000 ? ($def->getImplement() ?: $def->getType()) : null)\n\t\t\t\t\t->setBody($name === ContainerBuilder::THIS_CONTAINER ? 'return $this;' : $this->generateService($name))\n\t\t\t\t\t->setParameters($def->getImplement() ? [] : $this->convertParameters($def->parameters));\n\t\t\t} catch (\\Exception $e) {\n\t\t\t\tthrow new ServiceCreationException(\"Service '$name': \" . $e->getMessage(), 0, $e);\n\t\t\t}\n\t\t}\n\n\t\t$aliases = $this->builder->getAliases();\n\t\tksort($aliases);\n\t\t$meta->value[Container::ALIASES] = $aliases;\n\n\t\treturn $this->generatedClasses;\n\t}", "public function build()\n\t{\n\t\t$script = \"\";\n\t\t$this->addTable($script);\n\t\t$this->addIndices($script);\n\t\t$this->addForeignKeys($script);\n\t\treturn $script;\n\t}", "private function buildClassDefinition()\n {\n $reflection = new \\ReflectionClass($this->context->getFullClassName());\n $haxeClass = new HaxeClass();\n $haxeClass\n ->setName($this->context->getClassName())\n ->setPackage(implode('.', explode('\\\\', $this->context->getCurrentNamespace())))\n ;\n\n $this->parseProperties($reflection, $haxeClass);\n $this->parseMethods($reflection, $haxeClass);\n\n return $haxeClass->transpile();\n }", "public function build()\n {\n }", "public function main()\n {\n $className = $this->fullyQualifiedClassName();\n $templatePath = $this->template();\n $destinationDir = $this->destinationDir();\n $destinationFile = $this->destinationFile();\n\n if (!file_exists($templatePath)) {\n $this->error(sprintf('Given template file path does not exists [%s]', $templatePath));\n return 1;\n }\n \n if ($this->opt('force') === false && file_exists($destinationFile)) {\n $this->error(sprintf(\n '\\'%s\\' already exists. Use --force to directly replaces it.', \n $className\n ));\n return 2;\n }\n\n $name = $this->name();\n $namespace = $this->fullNamespace();\n\n $placeholders = $this->preparedPlaceholders();\n $placeholders['{{name}}'] = $name;\n $placeholders['{{namespace}}'] = $namespace;\n \n $template = file_get_contents($templatePath);\n\n $constructor = $this->opt('constructor') === true ? $this->constructor() : '';\n $template = str_replace('{{constructor}}', $constructor, $template);\n\n $template = str_replace(\n array_keys($placeholders), array_values($placeholders), $template\n );\n\n if (!is_dir($destinationDir)) {\n mkdir($destinationDir, '0755', true);\n }\n file_put_contents($destinationFile, $template);\n\n $this->info(sprintf('%s created with success!', $className));\n $this->info(sprintf('File: %s', $destinationFile));\n\n return 0;\n }", "public function createService($serviceClass);", "public function handle()\n {\n $fileName=ucwords(strtolower($this->argument('name'))); \n $serviceFileName = \"${fileName}Service.php\";\n\n $content =\n'<?php\n\nnamespace App\\Services;\n\nclass '.$fileName.'Service extends MainService\n{\n public function __construct()\n {\n //\n }\n\n /**\n * fetch all records\n *\n * @return Array $rtn\n */\n public function all(): array\n {\n //\n }\n\n /**\n * get one record.\n *\n * @param Int|Null $id\n * @return Array $rtn\n */\n public function get(int $id = null): array\n {\n //\n }\n\n /**\n * store a record \n *\n * @return Bool|'.$fileName.' $rtn\n */\n public function store()\n {\n //\n }\n\n /**\n * update a record\n *\n * @param Int $id\n * @return Bool|'.$fileName.' $rtn\n */\n public function update(int $id)\n {\n //\n }\n\n /**\n * destroy a record \n *\n * @param Int $id\n * @return Bool\n */\n public function destroy($id)\n {\n //\n }\n\n}';\n\n if ($this->confirm('Do you wish to create '.$fileName.' Service file?')) {\n $path=app_path();\n // $repositoryFile = $path.\"/Services/$serviceFileName\";\n // $interfaceFile = $path.\"/Interfaces/$interfaceFileName\";\n // $RepositoryDir = $path.\"/Repositories\";\n // $InterfaceDir = $path.\"/Interfaces\";\n\n $serviceFile = $path.\"/Services/$serviceFileName\";\n $serviceDir = $path.\"/Services\";\n\n if ($this->files->isDirectory($serviceDir)) {\n if ($this->files->isFile($serviceFile)) {\n return $this->error($fileName.' File Already exists!');\n }\n \n if (!$this->files->put($serviceFile, $content)) {\n return $this->error('Something went wrong!');\n }\n $this->info(\"$fileName generated!\");\n } else {\n $this->files->makeDirectory($serviceDir, 0777, true, true);\n\n if (!$this->files->put($serviceFile, $content)) {\n return $this->error('Something went wrong!');\n }\n \n $this->info(\"$fileName generated!\");\n }\n\n }\n }", "protected function buildClass($name)\n {\n $namespace = $this->getNamespace($name);\n $default_replace = str_replace(\"use $namespace\\Controller;\\n\", '', parent::buildClass($name));\n //return str_replace(\"Now_Entity\", \"Creator_\" . $this->argument(\"name\"), $default_replace);\n return str_replace(\"Now_Entity\", $this->argument(\"name\"), $default_replace);\n }", "public function build() {}", "public function build() {}", "public function build() {}", "public function build( $class ) {\n\t\t$full_class_name = $this->namespace . $class;\n\t\treturn new $full_class_name();\n\t}", "public function build();", "public function build();", "public function build();", "public function build();", "public function build();", "public function build();", "public function build();", "public abstract function build();", "public abstract function build();", "protected function buildClass($name)\n {\n $this->line(\"<info>Creating</info> \" . $this->getNameInput());\n\n $controllerNamespace = $this->getNamespace($name);\n\n $replace = [];\n\n if ($this->option('service')) {\n $replace = $this->buildServiceReplacements($replace);\n }\n\n if ($this->option('base')) {\n $replace = $this->buildBaseReplacements($replace);\n }\n\n if ($this->option('otp')) {\n $replace = $this->buildOtpReplacements($replace);\n }\n\n $replace[\"use {$controllerNamespace}\\Controller;\\n\"] = '';\n\n return str_replace(\n array_keys($replace), array_values($replace), parent::buildClass($name)\n );\n }", "public function generate()\n {\n $placeHolders = [\n '<nameSpace>',\n '<useSpace>',\n '<annotation>',\n '<className>',\n '<body>',\n ];\n\n $replacements = [\n $this->generateNameSpace(),\n $this->generateUseStatements(),\n $this->generateAnnotation(),\n $this->generateClassName(),\n $this->generateBody(),\n ];\n\n $code = str_replace($placeHolders, $replacements, self::$classTemplate);\n\n return str_replace('<spaces>', $this->baseClass->getSpaces(), $code);\n }", "protected function buildClass()\n {\n return $this->files->get($this->getStub());\n }", "abstract public function build();", "abstract public function build();", "public function createCommand()\r\n\t{\r\n\t\t//start the string\r\n\t\t$command = '';\r\n\t\t\r\n\t\t//add the java command or the path to java\r\n\t\t$command .= $this->java_path;\r\n\t\t\r\n\t\t//add the class path\r\n\t\t$command .= ' -cp \"'. $this->stanford_path . $this->seperator . '*\" ';\r\n\t\t\r\n\t\t//add options\r\n\t\t$options = implode(' ', $this->java_options);\r\n\t\t$command .= '-'.$options;\r\n\t\t\r\n\t\t//add the call to the pipeline object\r\n\t\t$command .= ' edu.stanford.nlp.pipeline.StanfordCoreNLP ';\r\n\r\n\t\t//add the annotators\r\n\t\t$command .= '-annotators '. $this->listAnnotators();\r\n\t\t\r\n\t\t//add the input and output directors\r\n\t\t$command .= ' -file '. $this->tmp_file . ' -outputDirectory '. $this->tmp_path;\r\n\t\t\r\n\t\t//this is for testing purposes\r\n\t\t//$command .= ' -file '. $this->tmp_path .'\\\\nlp3F25.tmp' . ' -outputDirectory '. $this->tmp_path;\r\n\t\t\r\n\t\t//if using regexner add this to the command string\r\n\t\tif($this->annotators['regexner'] === true)\r\n\t\t{\r\n\t\t\t$command .=' -regexner.mapping '. $this->regexner_path . $this->seperator . $this->regexner_file;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn $command;\r\n\t}", "public function build ()\n {\n }", "private function generateService($name)\n\t{\n\t\t$def = $this->builder->getDefinition($name);\n\n\t\tif ($def->isDynamic()) {\n\t\t\treturn PhpHelpers::formatArgs('throw new Nette\\\\DI\\\\ServiceCreationException(?);',\n\t\t\t\t[\"Unable to create dynamic service '$name', it must be added using addService()\"]\n\t\t\t);\n\t\t}\n\n\t\t$entity = $def->getFactory()->getEntity();\n\t\t$serviceRef = $this->builder->getServiceName($entity);\n\t\t$factory = $serviceRef && !$def->getFactory()->arguments && !$def->getSetup() && $def->getImplementMode() !== $def::IMPLEMENT_MODE_CREATE\n\t\t\t? new Statement(['@' . ContainerBuilder::THIS_CONTAINER, 'getService'], [$serviceRef])\n\t\t\t: $def->getFactory();\n\n\t\t$this->currentService = null;\n\t\t$code = '$service = ' . $this->formatStatement($factory) . \";\\n\";\n\n\t\tif (\n\t\t\t(PHP_VERSION_ID < 70000 || $def->getSetup())\n\t\t\t&& ($type = $def->getType())\n\t\t\t&& !$serviceRef && $type !== $entity\n\t\t\t&& !(is_string($entity) && preg_match('#^[\\w\\\\\\\\]+\\z#', $entity) && is_subclass_of($entity, $type))\n\t\t) {\n\t\t\t$code .= PhpHelpers::formatArgs(\"if (!\\$service instanceof $type) {\\n\"\n\t\t\t\t. \"\\tthrow new Nette\\\\UnexpectedValueException(?);\\n}\\n\",\n\t\t\t\t[\"Unable to create service '$name', value returned by factory is not $type type.\"]\n\t\t\t);\n\t\t}\n\n\t\t$this->currentService = $name;\n\t\tforeach ($def->getSetup() as $setup) {\n\t\t\t$code .= $this->formatStatement($setup) . \";\\n\";\n\t\t}\n\n\t\t$code .= 'return $service;';\n\n\t\tif (!$def->getImplement()) {\n\t\t\treturn $code;\n\t\t}\n\n\t\t$factoryClass = (new Nette\\PhpGenerator\\ClassType)\n\t\t\t->addImplement($def->getImplement());\n\n\t\t$factoryClass->addProperty('container')\n\t\t\t->setVisibility('private');\n\n\t\t$factoryClass->addMethod('__construct')\n\t\t\t->addBody('$this->container = $container;')\n\t\t\t->addParameter('container')\n\t\t\t\t->setTypeHint($this->className);\n\n\t\t$rm = new \\ReflectionMethod($def->getImplement(), $def->getImplementMode());\n\n\t\t$factoryClass->addMethod($def->getImplementMode())\n\t\t\t->setParameters($this->convertParameters($def->parameters))\n\t\t\t->setBody(str_replace('$this', '$this->container', $code))\n\t\t\t->setReturnType(PHP_VERSION_ID >= 70000 ? (Reflection::getReturnType($rm) ?: $def->getType()) : null);\n\n\t\tif (PHP_VERSION_ID < 70000) {\n\t\t\t$this->generatedClasses[] = $factoryClass;\n\t\t\t$factoryClass->setName(str_replace(['\\\\', '.'], '_', \"{$this->className}_{$def->getImplement()}Impl_{$name}\"));\n\t\t\treturn \"return new {$factoryClass->getName()}(\\$this);\";\n\t\t}\n\n\t\treturn 'return new class ($this) ' . $factoryClass . ';';\n\t}", "public static function\n\t\tcreate_cli_script(\n\t\t\t$new_script_name,\n\t\t\tHaddockProjectOrganisation_ModuleDirectory $module_directory\n\t\t)\n\t{\n $module_directory->make_sure_classes_directory_exists();\n \n\t\t$classes_directory = $module_directory->get_classes_directory();\n\t\t\n\t\t$cli_scripts_directory_name\n\t\t\t= $classes_directory->get_name()\n\t\t\t\t. DIRECTORY_SEPARATOR . 'cli-scripts';\n\t\t\n\t\t#echo '$cli_scripts_directory_name: ' . $cli_scripts_directory_name . PHP_EOL;\n\t\t\n\t\tFileSystem_DirectoryHelper\n\t\t\t::mkdir_parents($cli_scripts_directory_name);\n\t\t\n\t\t$script_class_name\n\t\t\t= $module_directory->get_camel_case_root()\n\t\t\t\t. '_' . $new_script_name . 'CLIScript';\n\t\t\n\t\t#echo '$script_class_name: ' . $script_class_name . PHP_EOL;\n\t\t\n\t\t$cli_script_file_name\n\t\t\t= $cli_scripts_directory_name\n\t\t\t\t. DIRECTORY_SEPARATOR\n\t\t\t\t. $script_class_name . '.inc.php';\n\t\t\n\t\t#echo '$cli_script_file_name: ' . $cli_script_file_name . PHP_EOL;\n\t\t\n\t\tif (is_file($cli_script_file_name)) {\n\t\t\tthrow new ErrorHandling_SprintfException(\n\t\t\t\t'\\'%s\\' already exists!',\n\t\t\t\tarray(\n\t\t\t\t\t$cli_script_file_name\n\t\t\t\t)\n\t\t\t);\n\t\t} else {\n\t\t\t$date = date('Y-m-d');\n\t\t\t$copyright_holder = $module_directory->get_copyright_holder();\n\t\t\t\n\t\t\t$file_contents = <<<CNT\n<?php\n/**\n * $script_class_name\n *\n * @copyright $date, $copyright_holder\n */\n\nclass\n\t$script_class_name\nextends\n\tCLIScripts_CLIScript\n{\n\tpublic function\n\t\tdo_actions()\n\t{\n\t\t/*\n\t\t * Write code here.\n\t\t */\n\t}\n}\n?>\nCNT;\n\n\t\t\tif ($fh = fopen($cli_script_file_name, 'w')) {\n\t\t\t\tfwrite($fh, $file_contents);\n\t\t\t\t\n\t\t\t\tfclose($fh);\n\t\t\t\t\n\t\t\t\tCLIScripts_ScriptObjectRunnersHelper\n\t\t\t\t\t::generate_script_object_runners();\n\t\t\t}\n\t\t}\n\t}", "protected function buildClass($name)\n {\n $model = Str::studly($this->getNameInput());\n $serviceNamespace = $this->getNamespace($name);\n\n $replace = [];\n\n $repositoryClass = $this->parseRepository($model);\n\n if (!class_exists($repositoryClass)) {\n if ($this->confirm(\"A {$repositoryClass} repository does not exist. Do you want to generate it?\", true)) {\n $this->call('create:repository', ['name' => $model]);\n }\n }\n\n $replace = array_merge($replace, [\n '{{ namespacedRepository }}' => $repositoryClass,\n '{{ repository }}' => class_basename($repositoryClass),\n '{{ repositoryVariable }}' => Str::camel(Str::plural($model)),\n ]);\n\n $replace[\"use {$serviceNamespace}\\Service;\\n\"] = '';\n\n return str_replace(\n array_keys($replace),\n array_values($replace),\n parent::buildClass($name)\n );\n }", "abstract function build();", "function __construct($service) {\n // return new $class;\n }", "private function createService($name, $serviceFile, $module, $author, $email)\n {\n $template = file_get_contents(\n __DIR__.DIRECTORY_SEPARATOR.\"templates\".DIRECTORY_SEPARATOR.\"front_service.tpl\"\n );\n\n $name = $this->getModuleFileName($module).'.'.$name;\n\n $template = str_replace('$name', $name, $template);\n $template = str_replace('$module',$module, $template);\n $template = str_replace('$author', $author, $template);\n $template = str_replace('$email', $email, $template);\n\n file_put_contents($serviceFile.'.js', $template);\n }", "protected function build()\n\t{\n\t}", "protected function template() {\n\n\t\t$template = \"<?php \n\n/**\n *\n * PHP version 7.\n *\n * Generated with cli-builder gen.php\n *\n * Created: \" . date( 'm-d-Y' ) . \"\n *\n *\n * @author Your Name <email>\n * @copyright (c) \" . date( 'Y' ) . \"\n * @package $this->_namespace - {$this->_command_name}.php\n * @license\n * @version 0.0.1\n *\n */\n\n\";\n\t\tif ( ! empty( $this->_namespace ) ) {\n\t\t\t$template .= \"namespace cli_builder\\\\commands\\\\$this->_namespace;\";\n\t\t} else {\n\t\t\t$template .= \"namespace cli_builder\\\\commands;\";\n\t\t}\n\n\t\t$template .= \"\n\nuse cli_builder\\\\cli;\nuse cli_builder\\\\command\\\\builder;\nuse cli_builder\\command\\command;\nuse cli_builder\\\\command\\\\command_interface;\nuse cli_builder\\\\command\\\\receiver;\n\n/**\n * This concrete command calls \\\"print\\\" on the receiver, but an external.\n * invoker just knows that it can call \\\"execute\\\"\n */\nclass {$this->_command_name} extends command implements command_interface {\n\n\t\n\t/**\n\t * Each concrete command is built with different receivers.\n\t * There can be one, many or completely no receivers, but there can be other commands in the parameters.\n\t *\n\t * @param receiver \\$console\n\t * @param builder \\$builder\n\t * @param cli \\$cli\n\t */\n\tpublic function __construct( receiver \\$console, builder \\$builder, cli \\$cli ) {\n\t\tparent::__construct( \\$console, \\$builder, \\$cli );\n\t\t\n\t\t// Add the help lines.\n\t\t\\$this->_help_lines();\n\t\t\n\t\tif ( in_array( 'h', \\$this->_flags ) || isset( \\$this->_options['help'] ) ) {\n\t\t\t\\$this->help();\n\t\t\t\\$this->_help_request = true;\n\t\t} else {\n\t\t\t// Any setup you need.\n\t\t\t\n\t\t}\n\t}\n\n\n\t/**\n\t * Execute and output \\\"$this->_command_name\\\".\n\t *\n\t * @return mixed|void\n\t */\n\tpublic function execute() {\n\t\n\t\tif ( \\$this->_help_request ) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Get the args that were used in the command line input.\n\t\t\\$args = \\$this->_cli->get_args();\n\t\t\\$args = \\$this->_args;\n\t\t\n\t\t// Create the build directory tree. It will be 'build/' if \\$receiver->set_build_path() is not set in your root cli.php.\n\t\tif ( ! is_dir( \\$this->_command->build_path ) ) {\n\t\t\t\\$this->_builder->create_directory( \\$this->_command->build_path );\n\t\t}\n\n\t\t\\$this->_cli->pretty_dump( \\$args );\n\n\t\t\n\t\t// Will output all content sent to the write method at the end even if it was set in the beginning.\n\t\t\\$this->_command->write( __CLASS__ . ' completed run.' );\n\n\t\t// Adding completion of the command run to the log.\n\t\t\\$this->_command->log(__CLASS__ . ' completed run.');\n\t}\n\t\n\tprivate function _help_lines() {\n\t\t// Example\n\t\t//\\$this->add_help_line('-h, --help', 'Output this commands help info.');\n\n\t}\n\t\n\t/**\n\t * Help output for \\\"$this->_command_name\\\".\n\t *\n\t * @return string\n\t */\n\tpublic function help() {\n\t\n\t\t// You can comment this call out once you add help.\n\t\t// Outputs a reminder to add help.\n\t\tparent::help();\n\t\t\n\t\t//\\$help = \\$this->get_help();\n\n\t\t// Work with the array\n\t\t//print_r( \\$help );\n\t\t// Or output a table\n\t\t//\\$this->help_table();\n\t}\n}\n\";\n\n\t\treturn $template;\n\t}", "protected function buildClass($name)\n {\n $controllerNamespace = $this->getNamespace($name);\n $replace = [\n 'DummyServiceVar' => $this->replaceServiceVar($name),\n 'DummyViewPath' => $this->replaceViewPath($name),\n 'DummySingularServiceVar' => $this->replaceSingularServiceVar($name)\n ];\n return str_replace(\n array_keys($replace),\n array_values($replace),\n $this->generateClass($name)\n );\n }", "protected function buildClass($name)\n {\n $controllerNamespace = $this->getNamespace($name);\n\n $replace = [];\n\n $replace[\"use {$controllerNamespace}\\Services;\\n\"] = '';\n\n return str_replace(\n array_keys($replace), array_values($replace), parent::buildClass($name)\n );\n }", "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 handle()\n {\n $service = Str::studly($this->getNameInput()) . 'Service';\n $name = $this->qualifyClass($service);\n\n $path = $this->getPath($name);\n\n // First we will check to see if the class already exists. If it does, we don't want\n // to create the class and overwrite the user's code. So, we will bail out so the\n // code is untouched. Otherwise, we will continue generating this class' files.\n if ((!$this->hasOption('force') || !$this->option('force')) && $this->alreadyExists($service)) {\n $this->error($this->type . ' already exists!');\n\n return false;\n }\n\n // Next, we will generate the path to the location where this class' file should get\n // written. Then, we will build the class and make the proper replacements on the\n // stub files so that it gets the correctly formatted namespace and class name.\n $this->makeDirectory($path);\n\n $this->files->put($path, $this->sortImports($this->buildClass($name)));\n\n $this->info($this->type . ' created successfully.');\n }", "public function main() {\n $nameArr = explode(\".\", $this->name);\n $name = $nameArr[0];\n $xml = SimpleXml_load_file(\"../domain/base/\".$name.\".xml\");\n\n $path = $xml->path[\"name\"];\n\n $template = file_get_contents(\"generateDomain/DomainObjectTemplate\");\n $vars = array();\n $vars[\"class_name\"] = \"Base\".ucfirst($name);\n $template = $this->replaceTokens($vars, $template);\n\n// print_r($xml);\n if($xml->parentClass) {\n $template = $this->replaceToken(\"parent_class\", $xml->parentClass[\"name\"], $template);\n $template = $this->replaceToken(\"super_call\", file_get_contents(\"generateDomain/SuperCallTemplate\"), $template);\n $template = $this->replaceToken(\"register_new\", \"\", $template);\n } else {\n $template = $this->replaceToken(\"parent_class\", \"\\\\domain\\\\DomainObject\", $template);\n $template = $this->replaceToken(\"super_call\", \"\", $template);\n $template = $this->replaceToken(\"register_new\", file_get_contents(\"generateDomain/RegisterNewTemplate\"), $template);\n }\n\n $constantsPiece = \"\";\n $addAttributePiece = \"\";\n $gettersAndSettersPiece = \"\";\n foreach($xml->attributes->attribute as $attr) {\n // constants\n $constantsPiece.= 'const '. strtoupper($attr[\"name\"]). ' = \"'.$attr[\"name\"].'\";\n ' ;\n\n // AddAttributes method\n $vars = array();\n $vars[\"class_name\"] = \"Base\".ucfirst($name);\n $vars[\"constant\"] = strtoupper($attr[\"name\"]);\n\n $attrTemplate = file_get_contents(\"generateDomain/AddAttributesTemplate\");\n $addAttributePiece .= $this->replaceTokens($vars, $attrTemplate);\n\n // getters and setters\n $vars = array();\n $vars[\"class_name\"] = \"Base\".ucfirst($name);\n $vars[\"constant\"] = strtoupper($attr[\"name\"]);\n $vars[\"constant_name\"] = ucfirst($attr[\"name\"]);\n $vars[\"constant_normal_case\"] = $attr[\"name\"];\n\n $getterSetterTemplate = file_get_contents(\"generateDomain/GettersAndSettersTemplate\");\n $gettersAndSettersPiece .= $this->replaceTokens($vars, $getterSetterTemplate);\n }\n $template = $this->replaceToken(\"constants\", $constantsPiece, $template);\n $template = $this->replaceToken(\"attributes_to_add\", $addAttributePiece, $template);\n $template = $this->replaceToken(\"getters_and_setters\", $gettersAndSettersPiece, $template);\n\n\n if($xml->mapper) {\n $mapper = $xml->mapper[\"name\"];\n $klass = $xml->mapper[\"class\"];\n $table = $xml->mapper[\"table\"];\n $idField = $xml->mapper[\"idField\"];\n\n\n\n if($mapper !== null && $klass !== null && $table !== null && $idField !== null) {\n $t = file_get_contents(\"generateDomain/MapperTemplate\");\n $vars = array();\n $vars[\"class_name\"] = $klass;\n $vars[\"table_name\"] = $table;\n $vars[\"id_field\"] = $idField;\n echo \"MADE IT HERE!\";\n print_r($xml->mapper->joins);\n\n if($xml->mapper->joins) {\n echo \"Had Joins!\";\n $joinsTemplate = file_get_contents(\"generateDomain/MapperJoinTemplate\");\n $joinsPiece = \"\";\n foreach($xml->mapper->joins->join as $join) {\n\n $joinVars = array();\n $joinVars[\"join_name\"] = $join[\"name\"];\n $joinVars[\"join_table\"] = $join[\"table\"];\n $joinsPiece .= $this->replaceTokens($joinVars, $joinsTemplate);\n }\n $vars[\"joins\"] = $joinsPiece;\n } else {\n $vars[\"joins\"] = \"\";\n }\n\n\n $t = $this->replaceTokens($vars, $t);\n\n if(file_exists(\"../mapper/\".$mapper.\".php\")) {\n $mapperContent = file_get_contents(\"../mapper/\".$mapper.\".php\");\n if(preg_match('@(p)ublic function loadDataMap\\(\\) {[\\s\\S]*?(})@i', $mapperContent, $matches, PREG_OFFSET_CAPTURE)) {\n $mapperContent = substr_replace($mapperContent, $t, $matches[1][1], ($matches[2][1] - $matches[1][1]) + 1);\n\n $fh = fopen(\"../mapper/\".$mapper.\".php\", \"w\");\n fwrite($fh, $mapperContent);\n fclose($fh);\n } else {\n if(preg_match('@class\\s*'.$klass.'[\\s\\S]*(})[\\s\\S]*\\?>@i', $mapperContent, $matches, PREG_OFFSET_CAPTURE)) {\n $mapperContent = substr_replace($mapperContent, $t, $matches[1][1] - 1, 0);\n\n $fh = fopen(\"../mapper/\".$mapper.\".php\", \"w\");\n fwrite($fh, $mapperContent);\n fclose($fh);\n } else {\n throw new BuildException(\"Could not match regular expression in: \".$mapper);\n }\n }\n\n\n\n } else {\n throw new BuildException(\"Mapper file did not exist \". $mapper);\n }\n }\n }\n\n\n $fh = fopen(\"../domain/base/\".\"Base\".ucfirst($name).\".php\", \"w\");\n fwrite($fh, $template);\n fclose($fh);\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 build()\n {\n $this->global_variables = (new GlobalVariablesGenerator)->generate();\n }", "public function run()\n {\n $services = [\n 'Hospital',\n 'Police',\n 'Water services',\n 'Public bus station',\n 'Market',\n 'Shops',\n 'Electrical supply',\n 'Primary school',\n 'Secondary school'\n ];\n\n for($i = 0; $i < count($services); $i++){\n $service = [\n 'name' => $services[$i],\n ];\n Utility::create($service);\n }\n }", "public function run()\n {\n //\n SystemService::create([\n 'nombre' => 'La carta mozo'\n ]);\n SystemService::create([\n 'nombre' => 'Delivery'\n ]);\n SystemService::create([\n 'nombre' => 'Reservas'\n ]);\n SystemService::create([\n 'nombre' => 'Marketing'\n ]);\n }", "protected function makeCommand(): string\n {\n // make all required dirs and validate attributes\n parent::makeCommand();\n\n $path = app()->basePath() . DIRECTORY_SEPARATOR . 'scripts' . DIRECTORY_SEPARATOR;\n $fake = __DIR__ . DIRECTORY_SEPARATOR . 'log.txt';\n\n return \"{$path}fake.sh $fake 0.1\";\n }", "public function create(string $class);", "function SuperheroServiceAutoload($class){\n require_once $class . '.php';\n}", "public function create(string $className, array $args = []);", "protected function createInterface()\n {\n $classNameService = $this->argument('name');\n\n\n $this->call('make:service_interface', [\n 'name' => \"{$classNameService}Interface\",\n ]);\n }", "public function run()\n {\n foreach ($this->get_services() as $name) { \n $this->generate($name); \n }\n $this->generate('Example of Per page writing service', PriceType::PerPage);\n $this->generate('Example of Per word writing service', PriceType::PerWord);\n $this->generate('Example of Fixed Price writing service', PriceType::Fixed);\n\n }", "public function generateClass($class) {\n $gsTemplate = $this->loader->load('propertyTemplate');\n $namespaceTemplate = $this->loader->load('namespaceTemplate');\n \n $fp = fopen($this->outputdir . $class['className'] . '.php', 'w');\n $newClass = $this->factory->class($class['className'])->extend('\\HighCharts\\AbstractChartOptions');\n $newClassConstructor = $this->factory->method('__construct');\n $namespaceStmt = $namespaceTemplate->getStmts(array('name' => $this->namespace));\n $nsNode = $namespaceStmt[0];\n $properties = $this->getProperties($class['originalName']);\n $propnames = array();\n \n foreach ($properties as $property) {\n //Generate getters/setters for properties \n $placeHolders = array('name' => $property['name'], 'type' => $property['returnType'], 'description' => $this->processDescription($property['description']));\n $propertyStmts = $gsTemplate->getStmts($placeHolders);\n $thisReference = new PHPParser_Node_Expr_PropertyFetch(new PHPParser_Node_Expr_Variable('this'), $property['name']);\n if($property['isParent']) { //Recursively generate classes\n $this->generateClass($property); \n \n if(strpos($property['returnType'], '[]') !== false) { // Create an empty collection for array type parameters that have child classes\n $collectionstmt = new PHPParser_Node_Expr_Assign($thisReference, new PHPParser_Node_Expr_New(new PHPParser_Node_Name('\\HighCharts\\ChartOptionsCollection')));\n $newClassConstructor->addStmt($collectionstmt);\n } else { \n $newClassConstructor->addStmt(new PHPParser_Node_Expr_Assign($thisReference, new PHPParser_Node_Expr_New(new PHPParser_Node_Name($property['className']))));\n }\n } else {\n if(strpos($property['returnType'], '[]') !== false) { // Create an empty collection for unspecified array types\n $collectionstmt = new PHPParser_Node_Expr_Assign($thisReference, new PHPParser_Node_Expr_New(new PHPParser_Node_Name('\\HighCharts\\ChartOptions')));\n $newClassConstructor->addStmt($collectionstmt);\n }\n }\n\n $newClass->addStmts($propertyStmts[0]->stmts);\n $propnames[] = $property['name']; \n }\n //$getOptionsMethod = $this->generateGetOptionsMethodStatement($propnames);\n //$newClass->addStmt($getOptionsMethod);\n $newClass->addStmt($newClassConstructor);\n $node = $newClass->getNode();\n $node->setAttribute('comments', array(new PHPParser_Comment_Doc(\"/**\\n * \" . $class['className'] . \"\\n *\\n * \" . $this->processDescription($class['description']) . \"\\n */\")));\n \n $classDefinition = $this->prettyprinter->prettyPrint(array($nsNode, $node));\n fwrite($fp, \"<?php\\n$classDefinition\");\n fclose($fp);\n\n }", "protected function buildClass($name)\n {\n $stub = $this->files->get($this->getStub());\n\n $table = $this->option('table');\n $prefix = $this->option('prefix');\n if (!$name || !$table) {\n $this->comment('Command: crud-model {name} {--table=} {--prefix=}');\n exit;\n }\n\n return $this->replaceNamespace($stub, $name)\n ->compile($stub, $table, $prefix)\n ->generate($stub)\n ->replaceClass($stub, $name);\n }", "public function build()\n {\n $this->classMetadata->appendExtension($this->getExtensionName(), [\n 'groups' => [\n $this->fieldName,\n ],\n ]);\n }", "public function build(string $format)\n {\n $classPrefix = $this->config->getWriteFormatClassPrefix();\n $className = $classPrefix\n .self::COMMAND_NAME_PREFIX\n .ucfirst($format);\n $this->validator->validateClassExists($className);\n return new $className;\n }", "protected function generateServiceMethods(ReflectionClass $reflectionClass)\n {\n $methods = array();\n $methodNames = array();\n $reflectionMethods = $reflectionClass->getMethods();\n \n $excludedMethods = array(\n '__construct' => true,\n '__get' => true,\n '__set' => true,\n '__isset' => true,\n '__clone' => true,\n '__sleep' => true,\n '__wakeup' => true,\n '__invoke' => true,\n );\n \n foreach ($reflectionMethods as $method) {\n \n $name = $method->getName();\n \n if (\n $method->isConstructor()\n || isset($methodNames[$name])\n || isset($excludedMethods[strtolower($name)])\n || (substr($name, 0, 2) == '__')\n || $method->isFinal()\n || $method->isStatic()\n ) {\n continue;\n }\n \n $methodNames[$name] = true;\n $argumentString = '';\n $firstParam = true;\n $parameters = array();\n $eventConfig = $this->getOperationConfig($name, 'events');\n $preEventExists = false;\n $postEventExists = false;\n \n // Generate service methods only for public methods or\n // methods that have events configured \n if ((!$method->isPublic() && !$eventConfig) || $method->isPrivate()) {\n continue;\n }\n \n if ($eventConfig) {\n foreach ($eventConfig as $specs) {\n if ($specs['type'] == self::EVENT_PRE) {\n $preEventExists = true;\n } elseif ($specs['type'] == self::EVENT_POST) {\n $postEventExists = true;\n }\n }\n }\n \n foreach ($method->getParameters() as $key => $param) {\n \n if ($firstParam) {\n $firstParam = false;\n } else {\n $argumentString .= ', ';\n }\n \n if ($preEventExists) {\n $argumentString .= '$__event_params[\"' . $param->getName().'\"]';\n } else {\n $argumentString .= '$' . $param->getName();\n }\n \n $paramClass = $param->getClass();\n\n // We need to pick the type hint class too\n if (null !== $paramClass) {\n $parameterType = '\\\\' . $paramClass->getName();\n } elseif ($param->isArray()) {\n $parameterType = 'array';\n } else {\n $parameterType = null;\n }\n \n $parameter = new ParameterGenerator($param->getName(), $parameterType);\n \n if ($param->isDefaultValueAvailable()) {\n $parameter->setDefaultValue($param->getDefaultValue());\n }\n \n if ($param->isPassedByReference()) {\n $parameter->setPassedByReference(true);\n }\n \n $parameters[$param->getName()] = $parameter;\n }\n \n $cb = \"\\$this->__wrappedObject->\" . $name . '(' . $argumentString . ');';\n $source = '';\n \n if ($preEventExists) {\n $source .= $this->generateTriggerEventCode($name, array_keys($parameters), self::EVENT_PRE);\n }\n \n if ($postEventExists) {\n $source .= \"\\$response = \" . $cb . \"\\n\\n\";\n $source .= $this->generateTriggerEventCode($name, array_keys($parameters), self::EVENT_POST, $preEventExists);\n $source .= \"return \\$response;\\n\";\n } else {\n $source .= \"return \" . $cb . \"\\n\";\n }\n \n if ($method->isPublic()) {\n $visibility = MethodGenerator::FLAG_PUBLIC;\n } else {\n $visibility = MethodGenerator::FLAG_PROTECTED;\n }\n \n $methods[] = new MethodGenerator($name, $parameters, $visibility, $source);\n }\n \n return $methods;\n }", "public function handle()\n {\n\n $name = $this->qualifyClass($this->argument('name'));\n\n $path = $this->getPath($name);\n\n\n // First we will check to see if the class already exists. If it does, we don't want\n // to create the class and overwrite the user's code. So, we will bail out so the\n // code is untouched. Otherwise, we will continue generating this class' files.\n if ((! $this->hasOption('force') ||\n ! $this->option('force')) &&\n $this->alreadyExists($this->argument('name'))) {\n $this->error($this->type.' already exists!');\n\n return false;\n }\n\n // Next, we will generate the path to the location where this class' file should get\n // written. Then, we will build the class and make the proper replacements on the\n // stub files so that it gets the correctly formatted namespace and class name.\n $this->makeDirectory($path);\n\n $this->files->put($path, $this->sortImports($this->buildClass($name)));\n $repository = $this->confirm('Do You want to create repository?', true);\n if ($repository && !empty($this->argument('repository')))\n {\n $repositoryName = $this->qualifyRepositoryClass(Str::replaceFirst('Controller', 'Repository', $this->argument('repository')));\n $repositoryPath = $this->getPath($repositoryName);\n $this->makeDirectory($repositoryPath);\n $this->files->put($repositoryPath, $this->sortImports($this->buildRepositoryClass($repositoryName)));\n $this->info($repositoryName . ' created successfully.');\n }else{\n $repositoryName = $this->qualifyRepositoryClass(Str::replaceFirst('Controller', 'Repository', $this->argument('name')));\n $repositoryPath = $this->getPath($repositoryName);\n $this->makeDirectory($repositoryPath);\n $this->files->put($repositoryPath, $this->sortImports($this->buildRepositoryClass($repositoryName)));\n $this->info($repositoryName . ' created successfully.');\n }\n $services = $this->confirm('Do You want to create services?', true);\n if ($services && !empty($this->argument('service')))\n {\n $servicesName = $this->qualifyServicesClass(Str::replaceFirst('Controller', 'Services', $this->argument('service')));\n $servicesPath = $this->getPath($servicesName);\n $this->makeDirectory($servicesPath);\n $this->files->put($servicesPath, $this->sortImports($this->buildServicesClass($servicesName)));\n $this->info($servicesName . ' created successfully.');\n }else{\n $servicesName = $this->qualifyServicesClass(Str::replaceFirst('Controller', 'Services', $this->argument('name')));\n $servicesPath = $this->getPath($servicesName);\n $this->makeDirectory($servicesPath);\n $this->files->put($servicesPath, $this->sortImports($this->buildServicesClass($servicesName)));\n $this->info($servicesName . ' created successfully.');\n }\n $transformers = $this->confirm('Do You want to create transformers?', true);\n if ($transformers && !empty($this->argument('transformer')))\n {\n $transformersName = $this->qualifyTransformersClass(Str::replaceFirst('Controller', 'Transformer', $this->argument('transformer')));\n $transformersPath = $this->getPath($transformersName);\n $this->makeDirectory($transformersPath);\n $this->files->put($transformersPath, $this->sortImports($this->buildTransformersClass($transformersName)));\n $this->info($transformersName . ' created successfully.');\n }else{\n $transformersName = $this->qualifyTransformersClass(Str::replaceFirst('Controller', 'Transformer', $this->argument('name')));\n $transformersPath = $this->getPath($transformersName);\n $this->makeDirectory($transformersPath);\n $this->files->put($transformersPath, $this->sortImports($this->buildTransformersClass($transformersName)));\n $this->info($transformersName . ' created successfully.');\n }\n\n $this->info($this->type.' created successfully.');\n }", "public function generate()\n {\n $interfacesData = json_decode($this->json, true);\n foreach ($interfacesData as $interface) {\n $filename = $interface['name'] . '.java';\n $interfaceObject = new JAVAInterfaceObject();\n $interfaceObject->setName($interface['name']);\n foreach ($interface['methods'] as $method) {\n $methodObject = new JAVAMethod();\n $methodObject->setName($method['name']);\n $methodObject->setReturnValue($method['returnType']);\n $methodObject->setScope($method['scope']);\n $methodObject->setComment($method['comment']);\n foreach ($method['parameters'] as $parameter) {\n $parameterObject = new Parameter();\n $parameterObject->setName($parameter['name']);\n $parameterObject->setType($parameter['type']);\n $methodObject->addParameter($parameterObject);\n }\n foreach ($method['annotations'] as $annotation) {\n $annotationObject = new Annotation();\n $annotationObject->setName($annotation['name']);\n $annotationObject->setValue($annotation['value']);\n $annotationObject->setInterpreter('@');\n $methodObject->addAnnotation($annotationObject);\n }\n $interfaceObject->addMethod($methodObject);\n \n }\n file_put_contents($this->folder . DIRECTORY_SEPARATOR . $filename, $interfaceObject->toString());\n }\n }", "private function make($arg, $className = null) {\n $arrayClass = explode('/', $className);\n if(count($arrayClass) > 1) {\n if(!@end($arrayClass)) {\n die(\"\\n Please specify any name of `{$className}?`. \\n\");\n }\n }\n // switch make case\n switch($make = explode(':', $arg)[1]) {\n /**\n * @make:entry\n * \n */\n case 'entry':\n // check entry store exists.\n if(!file_exists(\".\\\\databases\\\\entry\")) {\n die(\"\\n fatal: The `.\\\\databases\\\\entry` folder not found, please initiate entry by `init` command. \\n\");\n }\n // check specify entry name\n if(!$className) {\n die(\"\\n Please specify entry name. \\n\");\n }\n // check class is duplicate\n foreach (scandir(\".\\\\databases\\\\entry\") as $fileName) {\n if(explode('.', $fileName)[0] === ucfirst($className)) {\n die(\"\\n The entry `{$className}` is duplicate. \\n\");\n }\n }\n // Read file content\n $fileContent = file_get_contents(__DIR__.'./tmpEntry.php');\n // do the replacements, modifications, etc. on $fileContent\n // This is just an example\n $fileContent = str_replace('{{className}}', ucfirst($className), $fileContent);\n // write the content to a new file\n if(file_put_contents(\".\\\\databases\\\\entry\\\\\". ucfirst($className) .\".php\", $fileContent)) {\n die(\"\\n make the entry `{$className}` is successfully. \\n\");\n } else {\n die(\"\\n make the entry failed. Please try again. \\n\");\n }\n break;\n /**\n * @make:controller\n * \n */\n case 'controller':\n // check controller store exists.\n if(!file_exists(\".\\\\modules\\\\controllers\")) {\n die(\"\\n fatal: The `.\\\\modules\\\\controllers` folder not found. \\n\");\n }\n // check specify controller name\n if(!$className) {\n die(\"\\n Please specify controller name. \\n\");\n }\n // explode when asign subfolder\n $masterName = explode('/', $className);\n $newClassName = ucfirst(end($masterName));\n // check don't asign conroller wording\n if(!strpos($newClassName, \"Controller\")) {\n $newClassName = $newClassName . \"Controller\";\n }\n // check include subfolder\n if(count($masterName) > 1) {\n array_pop($masterName);\n $subfolder = implode('\\\\', $masterName);\n if(!file_exists(\".\\\\modules\\\\controllers\\\\{$subfolder}\")) {\n if(!mkdir(\".\\\\modules\\\\controllers\\\\{$subfolder}\", 0777, true)) {\n die(\"\\n fatal: something error please try again. \\n\");\n }\n }\n // next new className\n $newClassName = $subfolder .\"\\\\\". $newClassName;\n }\n // check class is duplicate\n foreach (scandir(\".\\\\modules\\\\controllers\\\\\". @$subfolder) as $fileName) {\n $file = explode('.php', $fileName);\n $file = trim(@$subfolder .\"\\\\\". current($file), \"\\\\\");\n if($file === $newClassName) {\n die(\"\\n The class `{$newClassName}` is duplicate. \\n\");\n }\n }\n // Read file content\n $fileContent = file_get_contents(__DIR__.'./tmpController.php');\n // do the replacements, modifications, etc. on $fileContent\n // This is just an example\n $classNameReplace = explode(\"\\\\\", $newClassName);\n $fileContent = str_replace('{{className}}', end($classNameReplace), $fileContent);\n // write the content to a new file\n if(file_put_contents(\".\\\\modules\\\\controllers\\\\{$newClassName}.php\", $fileContent)) {\n die(\"\\n make the controller `{$newClassName}` is successfully. \\n\");\n } else {\n die(\"\\n make the controller failed. Please try again. \\n\");\n }\n break;\n /**\n * @make:model\n * \n */\n case 'model':\n // check model store exists.\n if(!file_exists(\".\\\\modules\\\\models\")) {\n die(\"\\n fatal: The `.\\\\modules\\\\models` folder not found. \\n\");\n }\n // check specify model name\n if(!$className) {\n die(\"\\n Please specify model name. \\n\");\n }\n // check include subfolder\n $masterName = explode('/', $className);\n $newClassName = ucfirst(end($masterName));\n if(count($masterName) > 1) {\n array_pop($masterName);\n $subfolder = implode('\\\\', $masterName);\n if(!file_exists(\".\\\\modules\\\\models\\\\{$subfolder}\")) {\n if(!mkdir(\".\\\\modules\\\\models\\\\{$subfolder}\", 0777, true)) {\n die(\"\\n fatal: something error please try again. \\n\");\n }\n }\n // next new className\n $newClassName = $subfolder .\"\\\\\". $newClassName;\n }\n // check class is duplicate\n foreach (scandir(\".\\\\modules\\\\models\\\\\". @$subfolder) as $fileName) {\n $file = explode('.php', $fileName);\n $file = trim(@$subfolder .\"\\\\\". current($file), \"\\\\\");\n if($file === $newClassName) {\n die(\"\\n The class `{$newClassName}` is duplicate. \\n\");\n }\n }\n // Read file content\n $fileContent = file_get_contents(__DIR__.'./tmpModel.php');\n // do the replacements, modifications, etc. on $fileContent\n // This is just an example\n $classNameReplace = explode(\"\\\\\", $newClassName);\n $fileContent = str_replace('{{className}}', end($classNameReplace), $fileContent);\n // write the content to a new file\n if(file_put_contents(\".\\\\modules\\\\models\\\\{$newClassName}.php\", $fileContent)) {\n die(\"\\n make the model `{$newClassName}` is successfully. \\n\");\n } else {\n die(\"\\n make the model failed. Please try again. \\n\");\n }\n break;\n /**\n * @make:view\n * \n */\n case 'view':\n // check view store exists.\n if(!file_exists(\".\\\\views\")) {\n die(\"\\n fatal: The `.\\\\views` folder not found. \\n\");\n }\n // check specify view name\n if(!$className) {\n die(\"\\n Please specify view name. \\n\");\n }\n // check include subfolder\n $masterName = explode('/', $className);\n if(count($masterName) > 1) {\n $endClassName = end($masterName);\n array_pop($masterName);\n $subfolder = implode('\\\\', $masterName);\n if(!file_exists(\".\\\\views\\\\{$subfolder}\")) {\n if(!mkdir(\".\\\\views\\\\{$subfolder}\", 0777, true)) {\n die(\"\\n fatal: something error please try again. \\n\");\n }\n }\n // next new className\n $className = $subfolder .\"\\\\\". $endClassName;\n }\n // include .view\n $className = $className.'.view';\n // check view is duplicate\n foreach (scandir(\".\\\\views\\\\\". @$subfolder) as $fileName) {\n $file = explode('.php', $fileName);\n $file = trim(@$subfolder .\"\\\\\". current($file), \"\\\\\");\n if($file === $className) {\n die(\"\\n The view `{$className}` is duplicate. \\n\");\n }\n }\n // argument passer\n if(self::$argument == '--blog') {\n // Read file content (bootstrap)\n $fileContent = file_get_contents(__DIR__.'./tmpViewBootstrap.php');\n } elseif(self::$argument == '--html') {\n // Read file content\n $fileContent = file_get_contents(__DIR__.'./tmpViewHtml.php');\n } else {\n // Read file content\n $fileContent = file_get_contents(__DIR__.'./tmpViewBlank.php');\n }\n // do the replacements, modifications, etc. on $fileContent\n // This is just an example\n $fileContent = str_replace('{{className}}', $className, $fileContent);\n // write the content to a new file\n if(file_put_contents(\".\\\\views\\\\{$className}.php\", $fileContent)) {\n die(\"\\n make the view `{$className}` is successfully. \\n\");\n } else {\n die(\"\\n make the view failed. Please try again. \\n\");\n }\n break;\n default:\n die(\"\\n command `make:{$make}` is incorrect. \\n\\n The most similar command is: \\n make:entry \\n make:controller \\n make:model \\n make:view \\n\");\n break;\n }\n }", "protected function getScriptClassName()\n\t{\n\t\treturn 'Plg' . str_replace('-', '', $this->group) . $this->element . 'InstallerScript';\n\t}", "public function generate() \r\n\t{\t\r\n\t\tparent::generate();\r\n\t\r\n\t\t$this->schemaXml = new SimpleXMLElement(file_get_contents( $this->_xmlFile ));\r\n\t\t\r\n\t\t//parse object types\r\n\t\tforeach ($this->schemaXml->children() as $reflectionType) \r\n\t\t{\r\n\t\t\tswitch($reflectionType->getName())\r\n\t\t\t{\r\n\t\t\t\tcase \"enums\":\r\n\t\t\t\t\t//create enum classes\r\n\t\t\t\t\tforeach($reflectionType->children() as $enums_node)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->writeEnum($enums_node);\r\n\t\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"classes\":\r\n\t\t\t\t\t//create object classes\r\n\t\t\t\t\tforeach($reflectionType->children() as $classes_node)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->writeObjectClass($classes_node);\r\n\t\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"services\":\r\n\t\t\t\t\t//implement services (api actions)\r\n\t\t\t\t\tforeach($reflectionType->children() as $services_node)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->writeService($services_node);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//write main class (if needed, this can also be included in the static sources folder if not dynamic)\r\n\t\t\t\t\t$this->writeMainClass($reflectionType->children());\r\n\t\t\t\tbreak;\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->addFile('KalturaTypes.js', $this->enumTypes);\r\n\t\t$this->addFile('KalturaVO.js', $this->voClasses);\r\n\t\t$this->addFile('KalturaServices.js', $this->serviceClasses);\r\n\t\t$this->addFile('KalturaClient.js', $this->mainClass);\r\n\t\t//write project file (if needed, this can also be included in the static sources folder if not dynamic)\r\n\t\t$this->writeProjectFile();\r\n\t}", "public function run()\n {\n\n $services = [\n 'Wi-fi',\n 'Posto macchina',\n 'Piscina',\n 'Animali',\n 'Vista mare',\n 'Sauna',\n 'Portineria',\n 'Cucina',\n 'Possibilità di fumare',\n 'Ascensore',\n 'Cassaforte',\n 'Tv',\n 'Aria condizionata',\n 'Kit di pronto-soccorso',\n 'Lavatrice'\n\n ];\n\n foreach ($services as $service) {\n \n $new_service = new Service();\n\n $new_service->name = $service;\n\n $new_service->save();\n\n }\n }", "public function create()\n\t{\n\t\t$scope = new \\ReflectionClass( $this -> className );\n\t\t$new_scope = $scope -> newInstanceArgs( $this -> arguments );\n\t\treturn $new_scope;\n\t}", "protected static function buildCode(\n string $type,\n string $preparedClassName,\n string $preparedNamespace,\n string $preparedExtends\n ) {\n $code = [];\n if ($preparedNamespace) {\n $code[] = \"namespace $preparedNamespace;\";\n }\n $code[] = \"$type $preparedClassName\";\n if ($preparedExtends) {\n $code[] = \"extends \\\\$preparedExtends\";\n }\n $code[] = '{}';\n\n // echo PHP_EOL . '------------------------------------------------------------------' . PHP_EOL;\n // echo(implode(' ', $code));\n // echo PHP_EOL . '------------------------------------------------------------------' . PHP_EOL;\n\n eval(implode(' ', $code));\n }", "public function create($scriptName = null);", "public function run()\n {\n Service::create([\n 'name'=>'consultation'\n ]);\n Service::create([\n 'name'=>'operation'\n ]);\n }", "abstract public function service();", "public static function class($name, $type, $args = array(), $singleton = false)\n {\n // Any psuedo instructions?\n foreach($args as $k => $arg) {\n\n // Psuedo instruction to create a __construct class\n ($arg != ':_CRUD')?:list($args[], $arg) = ['__construct', ':CRUD'];\n\n // Psuedo instruction\n if ($arg == ':CRUD') {\n\n // Add Instructions from psuedo instruction\n $args = array_merge($args, ['create', 'read', 'update', 'delete']);\n\n // Remove Pseudo Instruction\n unset($args[$k]);\n }\n }\n\n // Header\n $class = '<?php'\n .\"\\n\"\n .\"\\n\" .'namespace '.str_replace('/', '\\\\', $type).';'\n .((!$singleton)?'':\"\\n\".'use \\__singleton as __singleton;')\n .\"\\n\"\n .\"\\n\" .'class '.$name\n .\"\\n\" .'{';\n\n // Framework traits\n $class .= ((!$singleton)?'':\"\\n\".' use __singleton;');\n\n // Cron options settings\n $class .= (($type!='controllers/'.f::info()['config']['cron'])?''\n :\"\\n\" .' public static $options = ['\n .\"\\n\" .\" 'frequency' => 'everyFiveMinutes',\"\n .\"\\n\" .' ];');\n\n\n // Iterate components\n foreach($args as $arg ) {\n\n // Detect $ as variables\n if ( strpos($arg, '$') !== false ) {\n\n // Create a variable\n $class .= \"\\n\".' private static '.$arg.';'.\"\\n\";\n\n } else {\n\n // Create a method\n $class .= ''\n .\"\\n\".' public function '.$arg.'()'\n .\"\\n\".' {'\n .\"\\n\"\n .\"\\n\".' }';\n }\n }\n\n // End of class\n $class .= \"\\n\".'}';\n\n // Construct file path to write to\n $path = f::info()['directory'].'application/'.$type.'/'.$name.'.php';\n\n // Write new class to file\n return file_put_contents($path, $class);\n }", "public function run()\n {\n CarService::Create([\n 'name' => 'Oil change',\n ]);\n\n CarService::Create([\n 'name' => 'Tyres',\n ]);\n\n CarService::Create([\n 'name' => 'Suspension',\n ]);\n\n }", "protected function writeMainClass(SimpleXMLElement $servicesNodes)\r\n\t{\r\n\t\t$apiVersion = $this->schemaXml->attributes()->apiVersion;\r\n\t\r\n\t\t$this->echoLine($this->mainClass, \"/**\");\r\n\t\t$this->echoLine($this->mainClass, \" * The Kaltura Client - this is the facade through which all service actions should be called.\");\r\n\t\t$this->echoLine($this->mainClass, \" * @param config the Kaltura configuration object holding partner credentials (type: KalturaConfiguration).\");\r\n\t\t$this->echoLine($this->mainClass, \" */\");\r\n\t\t$this->echoLine($this->mainClass, \"function KalturaClient(config){\");\r\n\t\t$this->echoLine($this->mainClass, \"\\tthis.init(config);\");\r\n\t\t$this->echoLine($this->mainClass, \"}\");\r\n\t\t//$this->echoLine($this->mainClass, \"KalturaClient.prototype = new KalturaClientBase();\");\r\n\t\t//$this->echoLine($this->mainClass, \"KalturaClient.prototype.constructor = KalturaClient;\");\r\n\t\t$this->echoLine ($this->mainClass, \"KalturaClient.inheritsFrom (KalturaClientBase);\");\r\n\t\t$this->echoLine ($this->mainClass, \"KalturaClient.prototype.apiVersion = \\\"$apiVersion\\\";\");\r\n\t\t\r\n\t\tforeach($servicesNodes as $service_node)\r\n\t\t{\r\n\t\t\t$serviceName = $service_node->attributes()->name;\r\n\t\t\t$serviceClassName = \"Kaltura\".$this->upperCaseFirstLetter($serviceName).\"Service\";\r\n\t\t\t$this->echoLine($this->mainClass, \"/**\");\r\n\t\t\t$description = str_replace(\"\\n\", \"\\n *\\t\", $service_node->attributes()->description); // to format multi-line descriptions\r\n\t\t\t$this->echoLine($this->mainClass, \" * \" . $description);\r\n\t\t\t$this->echoLine($this->mainClass, \" * @param $serviceClassName\");\r\n\t\t\t$this->echoLine($this->mainClass, \" */\");\r\n\t\t\t$this->echoLine($this->mainClass, \"KalturaClient.prototype.$serviceName = null;\");\r\n\t\t}\r\n\t\t$this->echoLine($this->mainClass, \"/**\");\r\n\t\t$this->echoLine($this->mainClass, \" * The client constructor.\");\r\n\t\t$this->echoLine($this->mainClass, \" * @param config the Kaltura configuration object holding partner credentials (type: KalturaConfiguration).\");\r\n\t\t$this->echoLine($this->mainClass, \" */\");\r\n\t\t$this->echoLine($this->mainClass, \"KalturaClient.prototype.init = function(config){\");\r\n\t\t$this->echoLine($this->mainClass, \"\\t//call the super constructor:\");\r\n\t\t$this->echoLine($this->mainClass, \"\\tKalturaClientBase.prototype.init.apply(this, arguments);\");\r\n\t\t$this->echoLine($this->mainClass, \"\\t//initialize client services:\");\r\n\t\tforeach($servicesNodes as $service_node)\r\n\t\t{\r\n\t\t\t$serviceName = $service_node->attributes()->name;\r\n\t\t\t$serviceClassName = \"Kaltura\".$this->upperCaseFirstLetter($serviceName).\"Service\";\r\n\t\t\t$this->echoLine($this->mainClass, \"\\tthis.$serviceName = new $serviceClassName(this);\");\r\n\t\t}\r\n\t\t$this->echoLine($this->mainClass, \"}\");\r\n\t}", "function genClass()\r\n {\r\n $this->_file->file_name = GEN_DIR.\"/\".$this->db_name.\"/\".$this->table_name.\"/\".$this->table_name.\".php\";\r\n $this->_file->open(\"w\");\r\n\r\n $string = $this->_genClassHead();\r\n $string .= $this->_genConstructor();\r\n $string .= $this->_genInsert();\r\n $string .= $this->_genUpdate(); \r\n $string .= $this->_genDelete();\r\n $string .= $this->_genSelect();\r\n $string .= $this->_genSelectAll();\r\n $string .= $this->_genClassFoot();\r\n $this->_file->write($string);\r\n }", "function register_tool($class)\n {\n }", "public function makeComponent($class);", "public function generate()\n {\n $soapClientOptions = $this->getSoapClientOptions();\n $config = $this->getGeneratorConfig($soapClientOptions);\n $generator = $this->getGenerator();\n $generator->generate($config);\n }", "public function compileClass() {\n\t\t$parent = $this->_file->parent();\n\t\t$values = array(\n\t\t\t'{:name:}' => $this->_file->name(),\n\t\t\t'{:parent:}' => $parent ? $parent->name_space() . '/' . $parent->name() : 'foo',\n\t\t\t'{:contents:}' => $this->compileMethods(),\n\t\t\t'{:namespace:}' => $this->_file->name_space(),\n\t\t);\n\t\treturn str_replace(array_keys($values), $values, $this->_templates['class']);\n\t}", "public function create($className, array $args = []);", "public function run()\n {\n $services = [\n [\"type\" =>'wifi'],\n [\"type\" =>'posto auto'],\n [\"type\" =>'piscina'],\n [\"type\" =>'sauna'],\n [\"type\" =>'vista mare'],\n [\"type\" =>'reception']\n ];\n \n foreach($services as $service){\n $newService = new Service;\n $newService -> fill($service) -> save();\n }\n }", "public function buildClassAliasMapFile() {}", "public function run()\n {\n $service = new Service;\n $service = [\n [\n 'name' => 'Building Construction',\n 'img' => 'img/service-1.jpg',\n 'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus nec pretium mi. Curabitur facilisis \n ornare velit non vulputate. Aliquam metus tortor, auctor id gravida condimentum, viverra quis sem.',\n 'delay' => '0.1s'\n ],\n [\n 'name' => 'House Renovation',\n 'img' => 'img/service-2.jpg',\n 'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus nec pretium mi. Curabitur facilisis \n ornare velit non vulputate. Aliquam metus tortor, auctor id gravida condimentum, viverra quis sem.',\n 'delay' => '0.2s'\n ],\n [\n 'name' => 'Architecture Design',\n 'img' => 'img/service-3.jpg',\n 'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus nec pretium mi. Curabitur facilisis \n ornare velit non vulputate. Aliquam metus tortor, auctor id gravida condimentum, viverra quis sem.',\n 'delay' => '0.3s'\n ],\n [\n 'name' => 'Interior Design',\n 'img' => 'img/service-4.jpg',\n 'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus nec pretium mi. Curabitur facilisis \n ornare velit non vulputate. Aliquam metus tortor, auctor id gravida condimentum, viverra quis sem.',\n 'delay' => '0.4s'\n ],\n [\n 'name' => 'Fixing & Support',\n 'img' => 'img/service-5.jpg',\n 'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus nec pretium mi. Curabitur facilisis \n ornare velit non vulputate. Aliquam metus tortor, auctor id gravida condimentum, viverra quis sem.',\n 'delay' => '0.5s'\n ],\n [\n 'name' => 'Painting',\n 'img' => 'img/service-6.jpg',\n 'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus nec pretium mi. Curabitur facilisis \n ornare velit non vulputate. Aliquam metus tortor, auctor id gravida condimentum, viverra quis sem.',\n 'delay' => '0.6s'\n ],\n\n ];\n foreach ($service as $s) {\n Service::create($s);\n }\n }", "public function main()\n\t{\n\t\t$this->loadConfig();\n\t\t$this->validateProject();\n\t\t$this->cleanConfig();\n\t\t$this->installDependencies();\n\t\t$this->createAutoload();\n\t\t$this->finish();\n\t}", "public function createClass()\n {\n return $this->addExcludesNameEntry($this->classes);\n }", "public function testLibraryBuild(): void\r\n {\r\n $config = [\r\n 'SharedDateService' => [\r\n 'class' => DateTime::class,\r\n 'arguments' => [\r\n 'dateTimeString' => '1980-02-19 12:15:00'\r\n ],\r\n 'shared' => true\r\n ],\r\n 'NotSharedDateService' => [\r\n 'inherits' => 'SharedDateService',\r\n 'shared' => false\r\n ],\r\n DateTime::class => [\r\n 'inherits' => 'SharedDateService',\r\n ]\r\n ];\r\n\r\n $serviceLibrary = new ServiceLibrary(new ArrayParser());\r\n\r\n $serviceLibrary->build($config);\r\n $this->assertTrue($serviceLibrary->has('SharedDateService'));\r\n $this->assertTrue($serviceLibrary->has('NotSharedDateService'));\r\n $this->assertTrue($serviceLibrary->has(DateTime::class));\r\n }", "public static function buildFromReflection(\\ReflectionClass $class)\n {\n $classDefinition = new ClassDefinition($class->getNamespaceName(), $class->getName());\n\n $methods = $class->getMethods();\n if (count($methods) > 0) {\n foreach ($methods as $method) {\n $parameters = array();\n\n foreach ($method->getParameters() as $row) {\n $params = array(\n 'type' => 'parameter',\n 'name' => $row->getName(),\n 'const' => 0,\n 'data-type' => 'variable',\n 'mandatory' => !$row->isOptional()\n );\n if (!$params['mandatory']) {\n try {\n $params['default'] = $row->getDefaultValue();\n } catch (\\ReflectionException $e) {\n // TODO: dummy default value\n $params['default'] = true;\n }\n };\n $parameters[] = $params;\n }\n\n $classMethod = new ClassMethod($classDefinition, array(), $method->getName(), new ClassMethodParameters(\n $parameters\n ));\n $classMethod->setIsStatic($method->isStatic());\n $classMethod->setIsBundled(true);\n $classDefinition->addMethod($classMethod);\n }\n }\n\n $constants = $class->getConstants();\n if (count($constants) > 0) {\n foreach ($constants as $constantName => $constantValue) {\n $type = self::_convertPhpConstantType(gettype($constantValue));\n $classConstant = new ClassConstant($constantName, array('value' => $constantValue, 'type' => $type), null);\n $classDefinition->addConstant($classConstant);\n }\n }\n\n $properties = $class->getProperties();\n if (count($properties) > 0) {\n foreach ($properties as $property) {\n $visibility = array();\n\n if ($property->isPublic()) {\n $visibility[] = 'public';\n }\n\n if ($property->isPrivate()) {\n $visibility[] = 'private';\n }\n\n if ($property->isProtected()) {\n $visibility[] = 'protected';\n }\n\n if ($property->isStatic()) {\n $visibility[] = 'static';\n }\n\n $classProperty = new ClassProperty(\n $classDefinition,\n $visibility,\n $property->getName(),\n null,\n null,\n null\n );\n $classDefinition->addProperty($classProperty);\n }\n }\n\n $classDefinition->setIsBundled(true);\n\n return $classDefinition;\n }", "protected function buildClass($name)\n {\n\n $stub = $this->files->get($this->getStub());\n $tableName = $this->argument('name');\n $className = 'Create' . str_replace(' ', '', ucwords(str_replace('_', ' ', $tableName))) . 'Table';\n\n $fieldsToIndex = trim($this->option('indexes')) != '' ? explode(',', $this->option('indexes')) : [];\n $foreignKeys = trim($this->option('foreign-keys')) != '' ? explode(',', $this->option('foreign-keys')) : [];\n\n $schema = rtrim($this->option('schema'), ';');\n $fields = explode(';', $schema);\n\n $data = array();\n\n if ($schema) {\n $x = 0;\n foreach ($fields as $field) {\n\t\t\t\t\n $fieldArray = explode('#', $field);\n $data[$x]['name'] = trim($fieldArray[0]);\n\t\t\t\t$types = explode('|',$fieldArray[1]);\n\t\t\t\t$type = array_shift($types);\n $data[$x]['type'] = $type;\n if ((Str::startsWith($type, 'select')|| Str::startsWith($type, 'enum')) && isset($fieldArray[2])) {\n $options = trim($fieldArray[2]);\n $data[$x]['options'] = str_replace('options=', '', $options);\n }\n\t\t\t\t//string:30|default:'ofumbi'|nullable\n\t\t\t\t$data[$x]['modifiers'] = [];\n\t\t\t\tif(count($types)){\n\t\t\t\t\t$modifierLookup = [\n\t\t\t\t\t\t'comment',\n\t\t\t\t\t\t'default',\n\t\t\t\t\t\t'first',\n\t\t\t\t\t\t'nullable',\n\t\t\t\t\t\t'unsigned',\n\t\t\t\t\t\t'unique',\n\t\t\t\t\t\t'charset',\n\t\t\t\t\t];\n\t\t\t\t\tforeach($types as $modification){\n\t\t\t\t\t\t$variables = explode(':',$modification);\n\t\t\t\t\t\t$modifier = array_shift($variables);\n\t\t\t\t\t\tif(!in_array(trim($modifier), $modifierLookup)) continue;\n\t\t\t\t\t\t$variables = $variables[0]??\"\";\n\t\t\t\t\t\t$data[$x]['modifiers'][] = \"->\" . trim($modifier) . \"(\".$variables.\")\";\n\t\t\t\t\t}\n\t\t\t\t}\n $x++;\n }\n }\n\n $tabIndent = ' ';\n\n $schemaFields = '';\n foreach ($data as $item) {\n\t\t\t$data_type = explode(':',$item['type']);\n\t\t\t$item_type = array_shift($data_type);\n\t\t\t$variables = isset($data_type[0])?\",\".$data_type[0]:\"\";\n if (isset($this->typeLookup[$item_type ])) {\n $type = $this->typeLookup[$item_type];\n if (!empty($item['options'])) {\n $enumOptions = array_keys(json_decode($item['options'], true));\n $enumOptionsStr = implode(\",\", array_map(function ($string) {\n return '\"' . $string . '\"';\n }, $enumOptions));\n $schemaFields .= \"\\$table->enum('\" . $item['name'] . \"', [\" . $enumOptionsStr . \"])\";\n } elseif($item['name']==\"uuid\") {\n $schemaFields .= \"\\$table->uuid('\" . $item['name'] . \"')\";\n }else {\n $schemaFields .= \"\\$table->\" . $type . \"('\" . $item['name'] . \"'\".$variables.\")\";\n }\n } else {\n \t if (!empty($item['options'])) {\n $enumOptions = array_keys(json_decode($item['options'], true));\n $enumOptionsStr = implode(\",\", array_map(function ($string) {\n return '\"' . $string . '\"';\n }, $enumOptions));\n $schemaFields .= \"\\$table->enum('\" . $item['name'] . \"', [\" . $enumOptionsStr . \"])\";\n } elseif($item['name']==\"uuid\") {\n $schemaFields .= \"\\$table->uuid('\" . $item['name'] . \"')\";\n }else {\n $schemaFields .= \"\\$table->string('\" . $item['name'] . \"'\".$variables.\")\";\n }\n }\n\n // Append column modifier\n $schemaFields .= implode(\"\",$item['modifiers']);\n $schemaFields .= \";\\n\" . $tabIndent . $tabIndent . $tabIndent;\n }\n\n // add indexes and unique indexes as necessary\n foreach ($fieldsToIndex as $fldData) {\n $line = trim($fldData);\n\n // is a unique index specified after the #?\n // if no hash present, we append one to make life easier\n if (strpos($line, '#') === false) {\n $line .= '#';\n }\n\n // parts[0] = field name (or names if pipe separated)\n // parts[1] = unique specified\n $parts = explode('#', $line);\n if (strpos($parts[0], '|') !== 0) {\n $fieldNames = \"['\" . implode(\"', '\", explode('|', $parts[0])) . \"']\"; // wrap single quotes around each element\n } else {\n $fieldNames = trim($parts[0]);\n }\n\n if (count($parts) > 1 && $parts[1] == 'unique') {\n $schemaFields .= \"\\$table->unique(\" . trim($fieldNames) . \")\";\n } else {\n $schemaFields .= \"\\$table->index(\" . trim($fieldNames) . \")\";\n }\n\n $schemaFields .= \";\\n\" . $tabIndent . $tabIndent . $tabIndent;\n }\n\n // foreign keys\n foreach ($foreignKeys as $fk) {\n $line = trim($fk);\n\n $parts = explode('#', $line);\n\n // if we don't have three parts, then the foreign key isn't defined properly\n // --foreign-keys=\"foreign_entity_id#id#foreign_entity#onDelete#onUpdate\"\n if (count($parts) == 3) {\n $schemaFields .= \"\\$table->foreign('\" . trim($parts[0]) . \"')\"\n . \"->references('\" . trim($parts[1]) . \"')->on('\" . trim($parts[2]) . \"')\";\n } elseif (count($parts) == 4) {\n $schemaFields .= \"\\$table->foreign('\" . trim($parts[0]) . \"')\"\n . \"->references('\" . trim($parts[1]) . \"')->on('\" . trim($parts[2]) . \"')\"\n . \"->onDelete('\" . trim($parts[3]) . \"')\" . \"->onUpdate('\" . trim($parts[3]) . \"')\";\n } elseif (count($parts) == 5) {\n $schemaFields .= \"\\$table->foreign('\" . trim($parts[0]) . \"')\"\n . \"->references('\" . trim($parts[1]) . \"')->on('\" . trim($parts[2]) . \"')\"\n . \"->onDelete('\" . trim($parts[3]) . \"')\" . \"->onUpdate('\" . trim($parts[4]) . \"')\";\n } else {\n continue;\n }\n\n $schemaFields .= \";\\n\" . $tabIndent . $tabIndent . $tabIndent;\n }\n\n $primaryKey = $this->option('pk');\n $softDeletes = $this->option('soft-deletes');\n\n $softDeletesSnippets = '';\n if ($softDeletes == 'yes') {\n $softDeletesSnippets = \"\\$table->softDeletes();\\n\" . $tabIndent . $tabIndent . $tabIndent;\n }\n\n $schemaUp =\n \"Schema::create('\" . $tableName . \"', function (Blueprint \\$table) {\n \\$table->bigIncrements('\" . $primaryKey . \"');\n \\$table->timestamps();\\n\" . $tabIndent . $tabIndent . $tabIndent .\n $softDeletesSnippets .\n $schemaFields .\n \"});\";\n\n $schemaDown = \"Schema::drop('\" . $tableName . \"');\";\n\n return $this->replaceSchemaUp($stub, $schemaUp)\n ->replaceSchemaDown($stub, $schemaDown)\n ->replaceClass($stub, $className);\n }", "protected function generateMapFile()\n {\n $namespace = $this->getNamespace();\n $class = $this->options['class'];\n\n $php = <<<EOD\n<?php\n\nnamespace $namespace;\n\nuse $namespace\\\\Base\\\\${class}Map as Base${class}Map;\nuse $namespace\\\\${class};\nuse \\\\Pomm\\\\Exception\\\\Exception;\nuse \\\\Pomm\\\\Query\\\\Where;\n\nclass ${class}Map extends Base${class}Map\n{\n}\n\nEOD;\n\n return $php;\n }", "private function instantiate_service( $class ) {\n\t\tif ( ! class_exists( $class ) ) {\n\t\t\tthrow Exception\\InvalidService::from_service( $class );\n\t\t}\n\n\t\t$service = new $class();\n\n\t\tif ( ! $service instanceof Service ) {\n\t\t\tthrow Exception\\InvalidService::from_service( $service );\n\t\t}\n\n\t\tif ( $service instanceof AssetsAware ) {\n\t\t\t$service->with_assets_handler( $this->assets_handler );\n\t\t}\n\n\t\treturn $service;\n\t}", "public function __construct()\n {\n self::build();\n }", "protected function getConsole_Command_Thumbnail_GenerateService()\n {\n return $this->services['console.command.thumbnail.generate'] = new \\phpbb\\console\\command\\thumbnail\\generate(${($_ = isset($this->services['config']) ? $this->services['config'] : $this->getConfigService()) && false ?: '_'}, ${($_ = isset($this->services['user']) ? $this->services['user'] : $this->getUserService()) && false ?: '_'}, ${($_ = isset($this->services['dbal.conn']) ? $this->services['dbal.conn'] : ($this->services['dbal.conn'] = new \\phpbb\\db\\driver\\factory($this))) && false ?: '_'}, ${($_ = isset($this->services['cache']) ? $this->services['cache'] : $this->getCacheService()) && false ?: '_'}, './../', 'php');\n }", "public function addClassTask(string $className, $_ctorArgs = NULL): void {}", "public function creating(Service $Service)\n {\n //code...\n }", "public static function container()\n {\n $containerOutput = '[ServiceContainer]' . PHP_EOL;\n ServiceContainer::init();\n $services = ServiceContainer::getServiceCollection();\n $serviceDebug = [];\n foreach ($services as $name => $service) {\n $serviceDebug[] = [\n 'name' => $name,\n 'class' => get_class($service),\n ];\n }\n $containerOutput .= CLITableBuilder::init(\n $serviceDebug,\n ['Name', 'Class'],\n false,\n 10\n );\n CLIShellColor::commandOutput($containerOutput.PHP_EOL, 'white', 'green');\n }", "abstract protected function getWebBuildCommandBuilder() : WebBuildCommandBuilder;", "public function build() {\n $pref = new Pref(\"system\");\n $this->setMainTemplate($pref->template);\n\n\n if ($this->data['url']['application'] == \"admin\")\n $tpl = new Template(PATH_SITEADMIN_TEMPLATES);\n else\n $tpl = new Template(PATH_TEMPLATES);\n if (!USER_ID && !$this->isAllowed())\n header(\"location: \" . page(\"user\", \"login\"));\n\n if (!USER_ID && $this->isAllowed())\n $tpl->login = true;\n else\n $tpl->login = false;\n $tpl->loadFile(\"template.php\");\n $tpl->data = $this->data;\n $tpl->build();\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 }", "public function Create()\n {\n parent::Create();\n\n //Properties\n $this->RegisterPropertyString('VariableList', '[]');\n\n //Scripts\n $this->RegisterScript('TurnOff', $this->Translate('Turn Off'), \"<?php\\n\\nAL_SwitchOff(IPS_GetParent(\\$_IPS['SELF']));\");\n }", "function mdl_create_class_constructor(array $properties)\n{\n $required_parameters = array_map(function ($item) {\n return mdl_create_function_parameter([\n 'name' => $item['name'],\n 'type' => $item['type'] ?? null,\n 'optional' => false\n ]);\n }, array_filter($properties, function ($item) {\n return !isset($item['optional']) || (isset($item['optional']) && boolval($item['optional']) === false);\n }));\n $optional_parameters = array_map(function ($item) {\n return mdl_create_function_parameter([\n 'name' => $item['name'],\n 'type' => $item['type'] ?? null,\n 'optional' => true,\n 'default' => $item['default'] ?? null\n ]);\n }, array_filter($properties, function ($item) {\n return isset($item['optional']) && boolval($item['optional']) === true;\n }));\n $constructor_parameters = [...$required_parameters, ...$optional_parameters];\n $constructor = PHPClassMethod(\n '__construct',\n $constructor_parameters,\n null,\n 'public',\n 'Create new class instance'\n );\n foreach ($constructor_parameters as $parameter) {\n $constructor = $constructor->addLine(\"\\$this->\" . $parameter->name() . ' = ' . \"\\$\" . $parameter->name());\n }\n return $constructor;\n}", "private function createMetadataDefinition()\n {\n $id = $this->getServiceId('metadata');\n if (!$this->container->has($id)) {\n $definition = new Definition(self::CLASS_METADATA);\n $definition\n ->setFactory([new Reference($this->getManagerServiceId()), 'getClassMetadata'])\n ->setArguments([\n $this->container->getParameter($this->getServiceId('class'))\n ])//->setPublic(false)\n ;\n $this->container->setDefinition($id, $definition);\n }\n }", "public function run()\n {\n factory(Clase::Class,15)->create();\n }", "public function create_command($service_name) {\n\n // $doctrine represents the database configuration\n $doctrine = $this->sm->get($service_name);\n // schema represents manipulations over tables (alter, drop, create)\n $schema = $doctrine->get_schema();\n\n if(!$doctrine) {\n $this->shell->write_line('Service \"' . $service_name . '\" not found.');\n return;\n }\n \n $schema->create(); // we get the sql (array)\n\n $this->shell->offset = 2;\n\n $this->output->write_line(\n $this->formater->set_color(\n 'Tables created', 'green'\n )\n );\n }", "protected function staticClassGeneration(): void\n {\n $types = $this->definition->getTypes();\n\n $this->writeClassFile(\n FileUtils::buildGenericFilePath(\n $this->config,\n $this->config->getNamespace(true),\n PHPFHIR_CLASSNAME_CONSTANTS\n ),\n TemplateBuilder::generateConstants($this->config, $types)\n );\n\n $this->writeClassFile(\n FileUtils::buildGenericFilePath(\n $this->config,\n $this->config->getNamespace(true),\n PHPFHIR_CLASSNAME_TYPEMAP\n ),\n TemplateBuilder::generateTypeMapClass($this->config, $types)\n );\n\n $this->writeClassFile(\n FileUtils::buildGenericFilePath(\n $this->config,\n $this->config->getNamespace(true),\n PHPFHIR_CLASSNAME_AUTOLOADER\n ),\n TemplateBuilder::generateAutoloaderClass($this->config, $types)\n );\n\n $this->writeClassFile(\n FileUtils::buildGenericFilePath(\n $this->config,\n $this->config->getNamespace(true),\n PHPFHIR_INTERFACE_TYPE\n ),\n TemplateBuilder::generatePHPFHIRTypeInterface($this->config, $types)\n );\n\n $this->writeClassFile(\n FileUtils::buildGenericFilePath(\n $this->config,\n $this->config->getNamespace(true),\n PHPFHIR_INTERFACE_CONTAINED_TYPE\n ),\n TemplateBuilder::generatePHPFHIRContainedTypeInterface($this->config, $types)\n );\n\n $this->writeClassFile(\n FileUtils::buildGenericFilePath(\n $this->config,\n $this->config->getNamespace(true),\n PHPFHIR_INTERFACE_COMMENT_CONTAINER\n ),\n TemplateBuilder::generatePHPFHIRCommentContainerInterface($this->config, $types)\n );\n\n $this->writeClassFile(\n FileUtils::buildGenericFilePath(\n $this->config,\n $this->config->getNamespace(true),\n PHPFHIR_TRAIT_COMMENT_CONTAINER\n ),\n TemplateBuilder::generatePHPFHIRCommentContainerTrait($this->config, $types)\n );\n\n $this->writeClassFile(\n FileUtils::buildGenericFilePath(\n $this->config,\n $this->config->getNamespace(true),\n PHPFHIR_TRAIT_VALIDATION_ASSERTIONS\n ),\n TemplateBuilder::generatePHPFHIRValidationAssertionsTrait($this->config, $types)\n );\n\n $this->writeClassFile(\n FileUtils::buildGenericFilePath(\n $this->config,\n $this->config->getNamespace(true),\n PHPFHIR_TRAIT_CHANGE_TRACKING\n ),\n TemplateBuilder::generatePHPFHIRChangeTrackingTrait($this->config, $types)\n );\n\n $this->writeClassFile(\n FileUtils::buildGenericFilePath(\n $this->config,\n $this->config->getNamespace(true),\n PHPFHIR_CLASSNAME_RESPONSE_PARSER_CONFIG\n ),\n TemplateBuilder::generatePHPFHIRResponseParserConfigClass($this->config, $types)\n );\n\n $this->writeClassFile(\n FileUtils::buildGenericFilePath(\n $this->config,\n $this->config->getNamespace(true),\n PHPFHIR_CLASSNAME_RESPONSE_PARSER\n ),\n TemplateBuilder::generatePHPFHIRResponseParserClass($this->config, $types)\n );\n }", "function generateConstructor($type, $fullClassName) {\n\t\t$type = strtolower($type);\n\t\tif ($type == 'model') {\n\t\t\treturn \"ClassRegistry::init('$fullClassName');\\n\";\n\t\t}\n\t\tif ($type == 'controller') {\n\t\t\t$className = substr($fullClassName, 0, strlen($fullClassName) - 10);\n\t\t\treturn \"new Test$fullClassName();\\n\\t\\t\\$this->{$className}->constructClasses();\\n\";\n\t\t}\n\t\treturn \"new $fullClassName();\\n\";\n\t}" ]
[ "0.57985175", "0.5769299", "0.5728823", "0.54643005", "0.5453592", "0.5449895", "0.54490674", "0.54429924", "0.5417342", "0.5417342", "0.5417092", "0.5406658", "0.5393787", "0.5393787", "0.5393787", "0.5393787", "0.5393787", "0.5393787", "0.5393787", "0.5374585", "0.5374585", "0.5356396", "0.5316923", "0.5306236", "0.5300965", "0.5300965", "0.52949923", "0.5270182", "0.5257469", "0.52519083", "0.5238858", "0.5237694", "0.52258813", "0.52110046", "0.52000505", "0.5196713", "0.51648045", "0.5161994", "0.51229644", "0.50979286", "0.50463635", "0.5040406", "0.5036551", "0.50250185", "0.5015339", "0.5008146", "0.49963", "0.49892873", "0.4958247", "0.49486414", "0.49475467", "0.49434453", "0.49172828", "0.4908206", "0.49058214", "0.49057925", "0.48979798", "0.489164", "0.48834553", "0.48692855", "0.4857553", "0.48574516", "0.48490584", "0.4843123", "0.4837606", "0.48304853", "0.4829059", "0.4824477", "0.48186606", "0.48175055", "0.48095533", "0.4801267", "0.47983336", "0.47902918", "0.47890237", "0.4788922", "0.47879958", "0.47807088", "0.47800848", "0.47772732", "0.4768271", "0.47665542", "0.47638378", "0.47621173", "0.4755803", "0.475513", "0.47406697", "0.4731396", "0.4729927", "0.47284472", "0.4726853", "0.4718289", "0.4717498", "0.47154135", "0.47121143", "0.47058538", "0.47024852", "0.47011778", "0.46972954", "0.46956414", "0.46877804" ]
0.0
-1
Build view model class script.
public static function buildViewModelDefinition( bool $single = false, array $rules = [], array $updateRules = [], ?string $name = null, ?string $namespace = null, ?string $path = null, ?string $model = null, ?bool $hasHttpHandlers = false ) { return self::createViewModelBuilder( $single, $rules, $updateRules, $name, $namespace, $path, $model, $hasHttpHandlers )->build(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function build()\n\t{\n\t\t$script = \"\";\n\t\t$this->addTable($script);\n\t\t$this->addIndices($script);\n\t\t$this->addForeignKeys($script);\n\t\treturn $script;\n\t}", "protected function buildView()\n {\n $table = $this->columns;\n\n $columns = $table->map(function ($column) {\n return $column->column.':'.$column->method.','.$column->caption;\n })->implode('|');\n\n $dropdown = $table->filter(function ($column) {\n return true == $column->is_foreign;\n })->transform(function ($column) {\n return $column->column.':'.$column->table_foreign;\n })->implode('|');\n\n $this->view = [\n 'name' => $this->module->name,\n '--columns' => $columns,\n '--controller' => $this->class,\n '--request' => $this->class,\n '--module' => $this->module->id,\n '--dropdown' => $dropdown,\n '--icon' => $this->module->icon,\n ];\n }", "public function getContent(){\n\t\t$this->modelname = sprintf($this->format, $this->classname);\n\t\t$this->date = date('Y-m-d H:i:s');\n\t\t\n\t\t$templateFile = LUMINE_INCLUDE_PATH . '/lib/Templates/Model.tpl';\n\t\t$tpl = file_get_contents($templateFile);\n\t\t\n\t\t$start = \"### START AUTOCODE\";\n\t\t$end = \"### END AUTOCODE\";\n\t\t\n\t\t$originalFile = $this->getFullFileName();\n\t\t\n\t\t$class = '';\n\t\t$tpl = preg_replace('@\\{(\\w+)\\}@e','$this->$1',$tpl);\n\t\t\n\t\tif(file_exists($originalFile)){\n\t\t\t\n\t\t\t$content = file_get_contents($originalFile);\n\t\t\t$autoCodeOriginal = substr($content, strpos($content,$start)+strlen($start), strpos($content,$end)+strlen($end) - (strpos($content,$start)+strlen($start)));\n\t\t\t\n\t\t\t$autoCodeGenerated = substr($tpl, strpos($tpl,$start)+strlen($start), strpos($tpl,$end)+strlen($end) - (strpos($tpl,$start)+strlen($start)));\n\t\t\t\n\t\t\t$class = str_replace($autoCodeOriginal, $autoCodeGenerated, $content);\n\t\t\t\n\t\t} else {\n\t\t\t$class = $tpl;\n\t\t}\n\t\t\n\t\t\n\t\treturn $class;\n\t}", "function build($view) {\n\t\t//$_GET['gamme'] = 3;\n\t\t(is_as_get(\"gamme\")) ? $gamme = $_GET['gamme'] : $gamme = WEBSHOP_COLL_SEGMENT_ID;\n\t\tif ((strpos($_SERVER['SCRIPT_FILENAME'], \"/content/\") === false )&& ($_SERVER['REQUEST_URI']!='/')) {} else {\n\n\t\t\tif (is_file($_SERVER['DOCUMENT_ROOT'].'/modules/webshop/custom/class.'.$view.'.php')) {\n\n\t\t\t\tinclude_once('modules/webshop/custom/class.'.$view.'.php');\n\t\t\t\t$this->view = new $view($this);\n\t\t\t\t$params = Array('segment' => $this->models['shop']->segment($gamme));\n\t\t\t\t$this->view->render($params);\n\n\t\t\t} else\techo \"SegmentDetailController.build > Incorrect View given for display : /modules/webshop/custom/class.\".$view.\".php<br/>\";\n\t\t}\n\t}", "public function createMvcCode() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get input\n\t\t$componentName = KRequest::getKeyword('component_name');\n\t\t$nameSingular = KRequest::getKeyword('name_singular');\n\t\t$namePlural = KRequest::getKeyword('name_plural');\n\n\t\t// Validate input\n\t\tif (empty($componentName)) {\n\t\t\tKLog::log(\"Component name is not specified.\", 'custom_code_creator');\n\t\t\techo \"Component name is not specified.\";\n\t\t\treturn;\n\t\t}\n\n\t\tif (empty($nameSingular)) {\n\t\t\tKLog::log(\"Singular name is not specified.\", 'custom_code_creator');\n\t\t\techo \"name_singular is empty.\";\n\t\t\treturn;\n\t\t}\n\n\t\tif (empty($namePlural)) {\n\t\t\tKLog::log(\"Plural name is not specified.\", 'custom_code_creator');\n\t\t\techo \"Parameter name_plural is empty.\";\n\t\t\treturn;\n\t\t}\n\n\t\t// Prepare the table name and\n\t\t$tableName = strtolower('configbox_external_' . $namePlural);\n\t\t$model = KenedoModel::getModel('ConfigboxModelAdminmvcmaker');\n\n\t\t// Make all files\n\t\t$model->createControllerFile($componentName, $nameSingular, $namePlural);\n\t\t$model->createModelFile($componentName, $namePlural, $tableName);\n\t\t$model->createViewFiles($componentName, $nameSingular, $namePlural, 'form');\n\t\t$model->createViewFiles($componentName, $nameSingular, $namePlural, 'list');\n\n\t\techo 'All done';\n\n\t}", "public function buildModel() {}", "private function _model_generation()\n\t{\n\t\t$prefix = ($this->bundle == DEFAULT_BUNDLE) ? '' : Str::classify($this->bundle).'_';\n\n\t\t// set up the markers for replacement within source\n\t\t$markers = array(\n\t\t\t'#CLASS#'\t\t=> $prefix.$this->class_prefix.$this->class,\n\t\t\t'#LOWER#'\t\t=> $this->lower,\n\t\t\t'#TIMESTAMPS#'\t=> $this->_timestamps\n\t\t);\n\n\t\t// loud our model template\n\t\t$template = Utils::load_template('model/model.tpl');\n\n\t\t// holder for relationships source\n\t\t$relationships_source = '';\n\n\t\t// loop through our relationships\n\t\tforeach ($this->arguments as $relation)\n\t\t{\t\n\n\t\t\t// if we have a valid relation\n\t\t\tif(strstr($relation, ':')) :\n\n\t\t\t\t// split\n\t\t\t\t$relation_parts = explode(':', Str::lower($relation));\n\n\t\t\t\t// we need two parts\n\t\t\t\tif(! count($relation_parts) == 2) continue;\n\n\t\t\t\t$method = $this->method($relation_parts[1]);\n\n\t\t\t\t// markers for relationships\n\t\t\t\t$rel_markers = array(\n\t\t\t\t\t'#CLASS#'\t\t\t=> $prefix.$this->class_prefix.$this->class,\n\t\t\t\t\t'#SINGULAR#'\t\t=> Str::lower(Str::singular($relation_parts[1])),\n\t\t\t\t\t'#PLURAL#'\t\t\t=> Str::lower(Str::plural($relation_parts[1])),\n\t\t\t\t\t'#METHOD#'\t\t\t=> $method,\n\t\t\t\t\t'#WORD#'\t\t\t=> Str::classify(Str::singular($relation_parts[1])),\n\t\t\t\t\t'#WORDS#'\t\t\t=> Str::classify(Str::plural($relation_parts[1]))\n\t\t\t\t);\n\n\t\t\t\t// start with blank\n\t\t\t\t$relationship_template = '';\n\n\t\t\t\t// use switch to decide which template\n\t\t\t\tswitch ($relation_parts[0])\n\t\t\t\t{\n\t\t\t\t\tcase \"has_many\":\n\t\t\t\t\tcase \"hm\":\n\t\t\t\t\t\t$relationship_template = Utils::load_template('model/has_many.tpl');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"belongs_to\":\n\t\t\t\t\tcase \"bt\":\n\t\t\t\t\t\t$relationship_template = Utils::load_template('model/belongs_to.tpl');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"has_one\":\n\t\t\t\t\tcase \"ho\":\n\t\t\t\t\t\t$relationship_template = Utils::load_template('model/has_one.tpl');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"has_many_and_belongs_to\":\n\t\t\t\t\tcase \"hbm\":\n\t\t\t\t\t\t$relationship_template = Utils::load_template('model/has_many_and_belongs_to.tpl');\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\telse:\n\n\t\t\t\t$method = $this->method($relation);\n\n\t\t\t\t// markers for relationships\n\t\t\t\t$rel_markers = array(\n\t\t\t\t\t'#METHOD#'\t\t=> $method,\n\t\t\t\t);\n\n\t\t\t\t$relationship_template = Utils::load_template('model/method.tpl');\n\n\t\t\tendif;\t\n\n\t\t\t// add it to the source\n\t\t\t$relationships_source .= Utils::replace_markers($rel_markers, $relationship_template);\n\t\t}\n\n\t\t// add a marker to replace the relationships stub\n\t\t// in the model template\n\t\t$markers['#RELATIONS#'] = $relationships_source;\n\n\t\t// add the generated model to the writer\n\t\t$this->writer->create_file(\n\t\t\t'Model',\n\t\t\t$prefix.$this->class_prefix.$this->class,\n\t\t\t$this->bundle_path.'models/'.$this->class_path.$this->lower.EXT,\n\t\t\tUtils::replace_markers($markers, $template)\n\t\t);\n\t}", "function __construct()\r\n {\r\n $this->view = new View();\r\n }", "public function build()\n {\n $this->validate_attributes();\n\n $attributes = [];\n foreach (static::$object_attributes as $key => $value) {\n $attributes[$key] = $this->{$key};\n }\n\n // Construct a vcalendar object based on the templated\n return (new Build(\n static::VTEMPLATE\n ))->build(\n $attributes\n );\n }", "function __construct()\n {\n $this->view = new View();\n }", "function viewMain() {\n\t$view = new viewModel();\n\t$view->showMain();\t\n}", "function __construct()\n {\n $this->view = new View(); \n }", "public function launch()\r\n {\r\n // Extract data to be usable inside the view file\r\n extract($this->data);\r\n\r\n // Expected view file format is\r\n // viewfolder.viewfile\r\n $view_file = str_replace(\".\", \"/\", $this->view_file);\r\n\r\n // Require view\r\n require path('app').'/views/'.$view_file.'.php';\r\n }", "function initViewClass($class){\n\t\t$c = $this->prefixId.'_'.$class.'View';\n\t\t$class = new $c();\n\t\t$class->cObj \t\t\t\t\t= \t$this->cObj;\n\t\t$class->conf \t\t\t\t\t= \t$this->conf;\n\t\t$class->extKey \t\t\t\t\t= \t$this->extKey;\n\t\t$class->prefixId \t\t\t\t= \t$this->prefixId;\n\t\t$class->templateCode\t\t\t=\t$this->templateCode;\n\t\t$class->tooltipCode = \t\t\t\t$this->cObj->getSubpart($this->templateCode, '###TOOLTIP###');\n\t\t$class->scriptRelPath \t\t\t= \t$this->scriptRelPath;\n\t\t$class->pi_checkCHash \t\t\t= \t$this->pi_checkCHash;\n\t\t$class->caching \t\t\t\t=\t$this->caching;\n\t\t$class->configure();\n\t\t$class->pidList \t\t\t\t= \t$this->pidList;\n\n\t\t$class->piVars \t\t\t\t\t=\t$this->piVars;\n\n\t\t$class->enableFieldsCategories \t= \t$this->enableFieldsCategories;\n\t\t$class->enableFieldsEvents \t\t= \t$this->enableFieldsEvents;\n\t\t$class->enableFieldsLocation \t= \t$this->enableFieldsLocation;\n\t\t$class->enableFieldsOrganizer \t= \t$this->enableFieldsOrganizer;\n\n\t\t$class->enableFieldsExcEvents \t= \t$this->enableFieldsExcEvents;\n\t\t$class->enableFieldsExcCategories \t= \t$this->enableFieldsExcCategories;\n\n\t\treturn $class;\n\t}", "function __construct() {\n// \t\t$this -> view = new View();\n \t}", "protected function setView()\n {\n $view = 'Src\\Modules\\\\' . $this->module_name . '\\Views\\\\' . $this->class . 'View';\n $this->view = new $view;\n \n $this->view->setData( $this->model->getData() );\n \n $this->view->run();\n }", "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 }", "public function createView(){\n\t\t$vue = new View(\"Create\");\n\t\t$vue->generer();\n\t}", "private function buildClassDefinition()\n {\n $reflection = new \\ReflectionClass($this->context->getFullClassName());\n $haxeClass = new HaxeClass();\n $haxeClass\n ->setName($this->context->getClassName())\n ->setPackage(implode('.', explode('\\\\', $this->context->getCurrentNamespace())))\n ;\n\n $this->parseProperties($reflection, $haxeClass);\n $this->parseMethods($reflection, $haxeClass);\n\n return $haxeClass->transpile();\n }", "private function model()\n {\n $location = $this->args[\"location\"] . DIRECTORY_SEPARATOR . 'models' . DIRECTORY_SEPARATOR;\n $relative_location = $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'models' . DIRECTORY_SEPARATOR;\n $class_name = '';\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 $tmp = explode(DIRECTORY_SEPARATOR, $this->args['subdirectories']);\n $tmp = join('_', $tmp);\n $class_name .= ApplicationHelpers::camelize($tmp);\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 $class_name .= ucfirst(strtolower($this->args['name']));\n\n $args = array(\n \"class_name\" => ucfirst(strtolower($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_model'],\n \"extra\" => $this->extra,\n 'relative_location' => $relative_location,\n );\n\n $template = new TemplateScanner(\"model\", $args);\n $model = $template->parse();\n\n $message = \"\\t\";\n if (file_exists($filename))\n {\n $message .= 'Model 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, $model))\n {\n $message .= 'Created model: ';\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 model: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'red');\n }\n $message .= $relative_location;\n }\n\n fwrite(STDOUT, $message . PHP_EOL);\n\n // Create the migration for the new model\n $this->migration();\n\n return;\n }", "protected function makeViews()\n {\n new MakeView($this, $this->files);\n }", "public function __construct()\n {\n $this->view = new View($this);\n }", "function build() {\n\t\t$this->order_id = new view_field(\"Order ID\");\n\t\t$this->timestamp = new view_field(\"Date\");\n\t\t$this->total_amount = new view_field(\"Amount\");\n $this->view= new view_element(\"static\");\n \n $translations = new translations(\"fields\");\n $invoice_name = $translations->translate(\"fields\",\"Invoice\",true);\n $this->view->value=\"<a href=\\\"/orders/order_details.php?order_id={$this->_order_id}\\\" target=\\\"invoice\\\">\".$invoice_name.\"</a>\";\n\n\t\tif(isset($_SESSION['wizard']['complete']['process_time']))\n\t\t{\n\t\t\t$this->process_time = new view_field(\"Seconds to process\");\n\t\t\t$this->process_time->value=$_SESSION['wizard']['complete']['process_time'];\n\t\t\t$this->server = new view_field();\n\t\t\t$address_parts = explode('.',$_SERVER['SERVER_ADDR']);\n\t\t\t$this->server->value = $address_parts[count($address_parts) - 1];\n\t\t}\n\t\tparent::build();\n\t}", "public function __construct(){\n parent::__construct();\n \n // set the default template as the name of the view class\n $template = get_class($this);\n if(strtolower(substr($template, -4)) === 'view'){\n $template = substr($template, 0, strlen($template) - 4);\n }\n $this->template($template);\n }", "private function setModelViewTemplateModelJsPath()\n\t\t{\n\n\t\t\t$this->modelViewTemplateModelJsPath = stubs_path('ModelView');\n\n\t\t\treturn $this;\n\n\t\t}", "function _custom_teasers_views_build_view($teaser_view = array()) {\n $teaser_view += custom_teasers_views_default_data();\n \n // Now we'll set up the basic starting structure.\n $view = new view;\n $view->name = $teaser_view['module'] .'_'. $teaser_view['name'];\n $view->description = \"Generated automatically by the {$teaser_view['module']} module.\";\n $view->base_table = 'node';\n $view->is_cacheable = FALSE;\n $view->api_version = 2;\n $view->disabled = FALSE;\n\n // Bootstrap the default display for the view. Here's where the action happens.\n $handler = $view->new_display('default', 'Defaults', 'default');\n\n _custom_teasers_views_add_fields($handler, $teaser_view);\n _custom_teasers_views_add_sort($handler, $teaser_view);\n _custom_teasers_views_add_filter($handler, $teaser_view);\n\n _custom_teasers_views_add_extras($view, $teaser_view);\n\n drupal_alter('teaser_view', $view, $teaser_view);\n\n // We will NOT save the view. Instead we're going to return it so others can\n // expose it as a default, save it to the DB, or whatever they'd like to do.\n return $view;\n}", "private function _View() {\n\t \n // $this->_View;\n\t\t\t//$View = ClassRegistry::getObject('');\n\t\treturn $this->_View;\n\t}", "public function generate()\r\n {\r\n $loader = new ContentLoader($this->_viewVariables);\r\n $loader->initContent($this->_contentViewPath);\r\n $this->_layout = $loader->initLayout($this->_layoutPath);\r\n echo $this->_layout;\r\n }", "function __construct(){\n $this->advancedModel = new AdvancedModel($this);\n $this->basicModel = new BasicModel($this);\n\n\n $this->title = \"Progress\";\n $lcView = \"ProgressView.php\";\n $this->navigationModel = new NavigationModel();\n //$this->navigationModel = new NavigationModel();\n if(isset($_REQUEST[\"cmd\"]))\n \n switch($_REQUEST[\"cmd\"]){\n \n case \"next\":\n $this->progressModel->next();\n break;\n \tcase \"prev\":\n $this->progressModel->previous();\n \t\tbreak; \n case \"Basic\":\n \t\t$lcView = \"BasicView.php\"; \n \t default: \n $lcView = \"ProgressView.php\";\n \t\t}\n \t\t$this->navigationModel->saveCurrentView($lcView);\n \n \t\trequire_once(\"View//\".$lcView);\n \t}", "private function viewBuilder() {\n $html = '';\n $file = false;\n // Create fields\n foreach ($this->formDatas as $field) {\n $type = $field['type'];\n switch ($type) {\n case 'text' :\n case 'password' :\n case 'hidden' :\n $html .= '\n <label for=\"' . $field['name'] . '\">' . $field['label'] . '</label>\n <input type=\"' . $type . '\" name=\"' . $field['name'] . '\" id=\"' . $field['name'] . '\" value=\"<?php echo set_value(\"' . $field['name'] . '\", \"' . $field['value'] . '\"); ?>\"/>';\n break;\n // Addon - 2013-07-31\n case 'date' :\n case 'datetime' :\n $html .= '\n <label for=\"' . $field['name'] . '\">' . $field['label'] . '</label>\n <input type=\"text\" name=\"' . $field['name'] . '\" id=\"' . $field['name'] . '\" value=\"<?php echo set_value(\"' . $field['name'] . '\", \"' . $field['value'] . '\"); ?>\"/>';\n\n\n if ($type == 'datetime') {\n $plugin = $this->addPlugin('widget', false);\n $plugin = $this->addPlugin('date');\n }\n $plugin = $this->addPlugin($type);\n if (!isset($this->js['script'])) {\n $this->js['script'] = '';\n }\n if ($type == 'datetime') {\n $this->js['script'] .= '\n <script type=\"text/javascript\">$(document).ready(function() {$(\"#' . $field['name'] . '\").datetimepicker({ dateFormat: \"yy-mm-dd\", timeFormat : \"HH:mm\"});});</script>';\n } else {\n $this->js['script'] .= '\n <script type=\"text/javascript\">$(document).ready(function() {$(\"#' . $field['name'] . '\").datepicker({ dateFormat: \"yy-mm-dd\"});});</script>';\n }\n break;\n // End Addon\n case 'select' :\n $html .= '\n <label for=\"' . $field['name'] . '\">' . $field['label'] . '</label>\n <select name=\"' . $field['name'] . '\">';\n // Add options\n foreach ($field['options'] as $option) {\n $html .= '\n <option value=\"' . $option . '\" <?php echo set_select(\"' . $field['name'] . '\", \"' . $option . '\"); ?>>' . $option . '</option>';\n }\n $html .= '\n </select>';\n break;\n case 'checkbox' :\n $html .= '\n <label for=\"' . $field['name'] . '\">' . $field['label'] . '</label>\n ';\n // Add options\n foreach ($field['checkbox'] as $option) {\n $html .= '\n <input type=\"checkbox\" value=\"' . $option . '\" value=\"<?php echo set_value(\"' . $field['name'] . '\", \"' . $option . '\"); ?>\"><span>' . $option . '</span>';\n }\n break;\n case 'radio' :\n $html .= '\n <label for=\"' . $field['name'] . '\">' . $field['label'] . '</label>\n ';\n // Add options\n foreach ($field['radio'] as $option) {\n $html .= '\n <input type=\"radio\" value=\"' . $option . '\" value=\"<?php echo set_value(\"' . $field['name'] . '\", \"' . $option . '\"); ?>\"><span>' . $option . '</span>';\n }\n break;\n case 'reset' :\n case 'submit' :\n $html .= '\n <input type=\"' . $type . '\" name=\"' . $field['name'] . '\" id=\"' . $field['name'] . '\" value=\"<?php echo set_value(\"' . $field['name'] . '\", \"' . $field['value'] . '\"); ?>\"/>';\n break;\n case 'textarea' :\n $html .= '\n <label for=\"' . $field['name'] . '\">' . $field['label'] . '</label>\n <textarea name=\"' . $field['name'] . '\" id=\"' . $field['name'] . '\"><?php echo set_value(\"' . $field['name'] . '\", \"' . $field['value'] . '\"); ?></textarea>';\n break;\n case 'file' :\n $html .= '\n <label for=\"' . $field['name'] . '\">' . $field['label'] . '</label>\n <input type=\"file\" name=\"' . $field['name'] . '\" id=\"' . $field['name'] . '\" />';\n $file = true;\n break;\n }\n }\n\n $view = '\n <html>\n <head>\n <link type=\"text/css\" rel=\"stylesheet\" href=\"<?php echo base_url() ?>assets/css/generator/' . $this->cssName . '.css\">\n '; // Addon - 2013-07-31\n foreach ($this->css as $css) {\n $view .= $css . '\n ';\n }\n foreach ($this->js as $js) {\n $view .= $js . '\n ';\n }\n // End Addon\n $view .= '\n </head>\n <body>\n <?php\n // Show errors\n if(isset($error)) {\n switch($error) {\n case \"validation\" :\n echo validation_errors();\n break;\n case \"save\" :\n echo \"<p class=\\'error\\'>Save error !</p>\";\n break;\n }\n }\n if(isset($errorfile)) {\n foreach($errorfile as $name => $value) {\n echo \"<p class=\\'error\\'>File \\\"\".$name.\"\\\" upload error : \".$value.\"</p>\";\n }\n }\n ?>\n <form action=\"<?php echo base_url() ?>' . $this->formName . '\" method=\"post\" ' . ($file == true ? 'enctype=\"multipart/form-data\"' : '') . '>\n ' . $html . '\n </form>\n </body>\n </html>';\n return array(str_replace('<', '&lt;', $view), $view);\n }", "public abstract function build();", "public abstract function build();", "function generate($content_view, $template_view, $data = null)\n {\n include 'mvcphp/views/'.$template_view;\n }", "function __construct(){\n $this->view=new View(); \n }", "public function build();", "public function build();", "public function build();", "public function build();", "public function build();", "public function build();", "public function build();", "protected function generateJavascript() {}", "protected function generateJavascript() {}", "function build() {\n $this->to_usd = new view_field(\"To USD\");\n $this->to_local = new view_field(\"To local\");\n $this->timestamp = new view_field(\"Created\");\n $this->expire_date_time = new view_field(\"Expired\");\n parent::build();\n }", "protected function compile()\n {\n // Backend mode\n if (TL_MODE == 'BE') {\n return $this->compileBackend('### Showcase Overview ###');\n }\n\n // Add folder navigation\n \\Input::setGet('showcase', \\Input::get('showcase'));\n\n if (!empty(\\Input::get('showcase'))) {\n return '';\n }\n\n // Add isotope JS library\n $GLOBALS['TL_JAVASCRIPT'][] = Environment::get('path').'/bundles/comoloshowcase/js/isotope.pkgd.min.js|static';\n $GLOBALS['TL_JAVASCRIPT'][] = Environment::get('path').'/bundles/comoloshowcase/js/isotope-script.js|static';\n\n $this->Template->categories = ShowcaseCategoryModel::findBy('pid', $this->showcase, ['order' => 'sorting ASC']);\n $this->Template->strShowcases = $this->parseShowcases();\n }", "public function build ()\n {\n }", "protected function build()\n {\n $this->global_variables = (new GlobalVariablesGenerator)->generate();\n }", "protected function initializeStandaloneViewInstance() {}", "public function classView()\n\t{\n\t\treturn new ClassView(10);\n\t}", "protected function build()\n\t{\n\t}", "public function generate()\n {\n $placeHolders = [\n '<nameSpace>',\n '<useSpace>',\n '<annotation>',\n '<className>',\n '<body>',\n ];\n\n $replacements = [\n $this->generateNameSpace(),\n $this->generateUseStatements(),\n $this->generateAnnotation(),\n $this->generateClassName(),\n $this->generateBody(),\n ];\n\n $code = str_replace($placeHolders, $replacements, self::$classTemplate);\n\n return str_replace('<spaces>', $this->baseClass->getSpaces(), $code);\n }", "public function createView();", "public function build()\n {\n }", "abstract public function build();", "abstract public function build();", "public function __construct(){\n //l'intensification de la classe view\n $this->view=new View();\n }", "public function __construct(){\n\t\tparent::__construct();\t\t\n\t\t$this->data_view = parent::setupThemes();\n\t\t$this->destination_path = \"/public/document/library/own/\";\n\t\t$this->data_view['pipeline_index'] \t= $this->data_view['view_path'] . '.pipeline.index';\n\t\t$this->data_view['master_view'] \t= $this->data_view['view_path'] . '.dashboard.index';\n\t\t$this->pipeline_model = new \\CustomerOpportunities\\CustomerOpportunitiesEntity;\n\t}", "public function build() {}", "public function build() {}", "public function build() {}", "protected function _writeViews()\n {\n if (! $this->_model_name) {\n $list = array('index');\n } else {\n $list = array();\n }\n \n foreach ($list as $view) {\n \n $text = $this->_parseTemplate(\"view-$view\");\n \n $file = $this->_class_dir . \"/View/$view.php\";\n if (file_exists($file)) {\n $this->_outln(\"View '$view' exists.\");\n } else {\n $this->_outln(\"Writing '$view' view.\");\n file_put_contents($file, $text);\n }\n }\n }", "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}", "function generateJsClass(& $Code, & $Description) {\r\n ob_start();\r\n ?>\r\n\r\nfunction\r\n <?php echo $Description->Class; ?>\r\n() { var oParent = new JPSpan_RemoteObject(); if ( arguments[0] ) {\r\noParent.Async(arguments[0]); } oParent.__remoteClass = '\r\n <?php echo $Description->Class; ?>\r\n'; oParent.__request = new\r\n <?php echo $this->jsRequestClass;\r\n ?>\r\n(new\r\n <?php echo $this->jsEncodingClass; ?>\r\n());\r\n <?php\r\n foreach ( $Description->methods as $method => $url ) {\r\n ?>\r\n\r\n// @access public oParent.\r\n <?php echo $method; ?>\r\n= function() { return this.__call('\r\n <?php echo $url; ?>\r\n',arguments,'\r\n <?php echo $method; ?>\r\n'); };\r\n <?php\r\n }\r\n ?>\r\n\r\nreturn oParent; }\r\n\r\n <?php\r\n $Code->append(ob_get_contents());\r\n ob_end_clean();\r\n }", "public function getViewScript()\n {\n return $this->__get(\"view_script\");\n }", "function __construct($nm=NULL) {\r\n $this->view= new view();\r\n $this->loadmodel($nm);\r\n }", "public function makeView() {\n\t\treturn \n\t\t\t$this->getView()\n\t\t\t\t->with('option', $this);\n\t}", "private function setModelViewTemplateVuexJsPath()\n\t\t{\n\n\t\t\t$this->modelViewTemplateVuexJsPath = stubs_path('ModelView');\n\n\t\t\treturn $this;\n\n\t\t}", "protected function _view()\r\n\t\t{\r\n\t\t\t((!is_object($this->_view)) ? $this->_view = init_class(VIEW_NAME) : '');\r\n\t\t}", "public function __construct()\n {\n self::build();\n }", "public function __construct(){\r\n $this->view = new Views(\"./app/view\");\r\n $this->site = new Site();\r\n $this->user = new User();\r\n }", "function run() {\r\n $this->view->data=$this->model->run();\r\n }", "public function build() {\n $pref = new Pref(\"system\");\n $this->setMainTemplate($pref->template);\n\n\n if ($this->data['url']['application'] == \"admin\")\n $tpl = new Template(PATH_SITEADMIN_TEMPLATES);\n else\n $tpl = new Template(PATH_TEMPLATES);\n if (!USER_ID && !$this->isAllowed())\n header(\"location: \" . page(\"user\", \"login\"));\n\n if (!USER_ID && $this->isAllowed())\n $tpl->login = true;\n else\n $tpl->login = false;\n $tpl->loadFile(\"template.php\");\n $tpl->data = $this->data;\n $tpl->build();\n }", "public function GetViewClass ();", "abstract function build();", "protected function generateView() {\n \n $this->getViewData();\n $this->generatePageHeader(\"Kunde\");\n $this->generatePageBody();\n $this->generatePageFooter();\n }", "public function generate()\n\t{\n\t\tif ($this->init == false)\n\t\t\tthrow new Exception('Generator Error: Data must be initialized.');\n\t\t\n\t\t// table view\n\t\t$table = new Table($this->model->get_name(), $this->model->get_columns());\n\t\t$template = $this->files->read($this->tableTemplate->get_template());\n\t\t$table->set_body($template);\n\t\t$tbl = $table->generate();\n\t\t$table_view = $this->compiler->compile($tbl, $this->data);\n\t\t$table_view_path = $this->tableTemplate->get_path();\n\t\tif ($this->files->write($table_view_path, $table_view))\n\t\t\t$this->filenames[] = $table_view_path;\n\n\t\t// controller\n\t\t$template = $this->files->read($this->controllerTemplate->get_template());\n\t\t$controller = $this->compiler->compile($template, $this->data);\n\t\t$controller_path = $this->controllerTemplate->get_path();\n\t\tif ($this->files->write($controller_path, $controller))\n\t\t\t$this->filenames[] = $controller_path;\n\n\t\t// main view\n\t\t$template = $this->files->read($this->viewTemplate->get_template());\n\t\t$view = $this->compiler->compile($template, $this->data);\n\t\t$view_path = $this->viewTemplate->get_path();\n\t\tif ($this->files->write($view_path, $view))\n\t\t\t$this->filenames[] = $view_path;\n\n\t\t// model\n\t\t$template = $this->files->read($this->modelTemplate->get_template());\n\t\t$model = $this->compiler->compile($template, $this->data);\n\t\t$model_path = $this->modelTemplate->get_path();\n\t\tif ($this->files->write($model_path, $model))\n\t\t\t$this->filenames[] = $model_path;\n\t}", "private function modelBuilder() {\n // Create model\n $model = '<?php\n class ' . ucfirst($this->formName) . '_model extends CI_Model {\n\n private $table;\n\n // Constructor\n function __construct() {\n\n parent::__construct();\n $this->table = \"' . $this->formName . '\";\n }\n\n /**\n * Insert datas in ' . $this->formName . '\n *\n * @param array $data\n * @return bool\n */\n function save($data = array()) {\n // Insert\n $this->db->insert($this->table, $data);\n\n // If error return false, else return inserted id\n if (!$this->db->affected_rows()) {\n\t return false;\n } else {\n\t\treturn $this->db->insert_id();\n }\n }\n\n }\n ?>';\n\n return array(str_replace('<', '&lt;', $model), $model);\n }", "protected function generateJavascript()\n\t{\n\t}", "public function __construct()\n {\n parent::__construct();\n $this->view->js = array('pizza/js/default.js',\n 'pizza/js/jquery.jeditable.min.js',\n '../public/js/jquery.goup.min.js');\n\n $this->view->css = array('pizza/css/default.css');\n }", "private function renderView()\n\t{\n\t\tff_renderView(substr(__CLASS__, 7));\n\t}", "private function renderView()\n\t{\n\t\tff_renderView(substr(__CLASS__, 7));\n\t}", "public function run()\n {\n \\App\\Model\\TemplateLib::create([\n 'name' => 'FNK Test',\n 'stylesheet' => 'body {background:white};',\n 'javascript' => '',\n 'code_header' => $this->codeHeader,\n 'code_footer' => $this->codeFooter,\n 'code_index' => $this->codeIndex,\n 'code_search' => '<h1>saya di search</h1>',\n 'code_category' => '<h1>saya di category</h1>',\n 'code_page' => $this->codePage,\n 'code_post' => $this->codePost,\n 'code_about' => '<h1>saya di about</h1>',\n 'code_404' => '<h1>saya di 404</h1>',\n ]);\n }", "public function __toString() {\n ob_start();\n extract($this->_vars);\n\n include $this->_viewFile;\n\n return ob_get_clean();\n }", "public function view(){\n\t\t$html = new \\Emagid\\Mvc\\Views\\Html(func_get_args());\n\n\t\treturn $html;\n\t}", "public function build()\n {\n $this->classMetadata->appendExtension($this->getExtensionName(), [\n 'groups' => [\n $this->fieldName,\n ],\n ]);\n }", "function mscaffolding_create_main_view($name)\n\t{\n\t\t$view = lfile_read(\"tools/scaffolding/views/view.php\");\n\t\t$view = str_replace(\"***NAME***\", $name, $view);\n\t\treturn lfile_write(\"data/scaffolding/\" . $name . \"/views/\" . $name . \".php\", $view);\n\t}", "private function launcher() {\n \n $controller = $this->controller;\n $task = $this->task;\n \n if (!isset($controller)) {\n $controller = 'IndexController';\n }\n else {\n $controller = ucfirst($controller).'Controller';\n }\n \n if (!isset($task)) {\n $task = 'index';\n }\n \n $c = new $controller();\n \n call_user_func(array($c, $task));\n \n Quantum\\Output::setMainView($this->controller, $task);\n \n\n }", "public function __toString()\n {\n /*@var Zend_Controller_Action_Helper_ViewRenderer $viewRenderer*/\n $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');\n\n //Ajout des variables pour la vue\n $viewRenderer->view->o = $this;\n\n if ($arg = func_get_args()) {\n if ($arg = array_shift($arg)) {\n if (array_key_exists('showOptions', $arg)) {\n $viewRenderer->view->options = true;\n }\n if (array_key_exists('showDetails', $arg)) {\n $viewRenderer->view->details = true;\n }\n }\n }\n\n //Ajout du répertoire des script de vues (library)\n $viewRenderer->view->addScriptPath(__DIR__ . \"/views/\");\n\n //Récupération du script traité\n return $viewRenderer->view->render(\"author.phtml\");\n }", "public function __construct()\n {\n $this->view = new Views('about');\n }", "protected function buildView()\n {\n $view = new FusionView();\n\n $httpRequest = Request::createFromEnvironment();\n $request = $httpRequest->createActionRequest();\n\n $uriBuilder = new UriBuilder();\n $uriBuilder->setRequest($request);\n\n $this->controllerContext = new ControllerContext(\n $request,\n new Response(),\n new Arguments([]),\n $uriBuilder\n );\n\n $view->setControllerContext($this->controllerContext);\n $view->disableFallbackView();\n $view->setPackageKey('Flowpack.Listable');\n $view->setFusionPathPattern(__DIR__ . '/Fixtures/');\n\n return $view;\n }", "public function generate() {\n\t\t$args = $this->args;\n\t\t$this->args = array_map('strtolower', $this->args);\n\t\t$modelAlias = ucfirst($args[0]);\n\t\t$pluginName = ucfirst($this->args[1]);\n\t\t$modelId = isset($args[2]) ? $args[2] : null;\n\t\t$len = isset($args[3]) ? $args[3] : null;\n\t\t$extensions = $this->_CroogoPlugin->getPlugins();\n\t\t$active = CakePlugin::loaded($pluginName);\n\n\t\tif (!empty($pluginName) && !in_array($pluginName, $extensions) && !$active) {\n\t\t\t$this->err(__('plugin \"%s\" not found.', $pluginName));\n\t\t\treturn false;\n\t\t}\n\t\tif (empty($len)) {\n\t\t\t$len = 5;\n\t\t}\n\n\t\t$options = array();\n\t\tif (!empty($modelId)) {\n\t\t\t$options = Set::merge($options, array(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t$modelAlias.'.id' => $modelId\n\t\t\t\t)\n\t\t\t));\n\t\t}\n\n\t\t$Model = ClassRegistry::init($pluginName.'.'.$modelAlias);\n\t\t$Model->recursive = -1;\n\t\t$results = $Model->find('all', $options);\n\t\tforeach ($results as $result) {\n\t\t\t$Model->id = $result[$modelAlias]['id'];\n\t\t\tif (!empty($modelId)) {\n\t\t\t\t$foreignKey = $modelId;\n\t\t\t} else {\n\t\t\t\t$foreignKey = $Model->id;\n\t\t\t}\n\t\t\t$token = $this->Token->find('first', array(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t'Token.model' => $modelAlias,\n\t\t\t\t\t'Token.foreign_key' => $foreignKey,\n\t\t\t\t)\n\t\t\t));\n\t\t\tif (empty($token)) {\n\t\t\t\t$Model->Behaviors->attach('Givrate.Tokenable');\n\t\t\t\t$token = $Model->Behaviors->Tokenable->__GenerateUniqid($len);\n\t\t\t\tif ($Model->Behaviors->Tokenable->__isValidToken($token)) {\n\t\t\t\t\tif ($Model->Behaviors->Tokenable->__saveToken($Model, $token)) {\n\t\t\t\t\t\t$this->out(sprintf(__('Successful generate token for model <success>%s</success> id <bold>%d</bold>', $Model->alias, $Model->id)));\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->out(sprintf(__('Failed generate token for model <failed>%s</failed> id <bold>%d</bold>', $Model->alias, $Model->id)));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->out(sprintf(__('Model <failed>%s</failed> id <bold>%d</bold> already have token', $Model->alias, $Model->id)));\n\t\t\t}\n\t\t}\n\t}", "protected function _writeAppClass()\n {\n // emit feedback\n $this->_outln(\"App class '{$this->_class}' extends '{$this->_extends}'.\");\n $this->_outln(\"Preparing to write to '{$this->_target}'.\");\n \n // using app, or app-model?\n if ($this->_model_name) {\n $tpl_key = 'app-model';\n } else {\n $tpl_key = 'app';\n }\n \n // get the app class template\n $text = $this->_parseTemplate($tpl_key);\n \n // write the app class\n if (file_exists($this->_class_file)) {\n $this->_outln('App class already exists.');\n } else {\n $this->_outln('Writing app class.');\n file_put_contents($this->_class_file, $text);\n }\n }", "private static function view()\n {\n $files = ['View'];\n $folder = static::$root.'MVC/View'.'/';\n\n self::call($files, $folder);\n\n $files = ['Template', 'Views'];\n $folder = static::$root.'MVC/View/Libs'.'/';\n\n self::call($files, $folder);\n\n $files = ['ViewNotFoundException'];\n $folder = static::$root.'MVC/View/Exceptions'.'/';\n\n self::call($files, $folder);\n }", "function genClass()\r\n {\r\n $this->_file->file_name = GEN_DIR.\"/\".$this->db_name.\"/\".$this->table_name.\"/\".$this->table_name.\".php\";\r\n $this->_file->open(\"w\");\r\n\r\n $string = $this->_genClassHead();\r\n $string .= $this->_genConstructor();\r\n $string .= $this->_genInsert();\r\n $string .= $this->_genUpdate(); \r\n $string .= $this->_genDelete();\r\n $string .= $this->_genSelect();\r\n $string .= $this->_genSelectAll();\r\n $string .= $this->_genClassFoot();\r\n $this->_file->write($string);\r\n }", "function __construct () {\n\n\t\techo 'I am in Model';\n\n\t}", "public function __construct() {\n parent::__construct();\n\t\tView::set_shared_data('require_js_main', '/' . CONTEXT_PATH . '/public/main');\n }", "public function generateView()\n {\n foreach ($this->cds as $cd)\n {\n $view = new View('CdItem');\n $view->setValue('TITLE', $cd->getTitle());\n $view->setValue('ARTIST', $cd->getArtist());\n $view->setValue('GENRE', $cd->getGenre());\n $view->setValue('CREATION_YEAR', $cd->getCreationYear());\n $view->display();\n }\n }", "protected function get_controller_content()\n {\n $this->load_table_acronym();\n //genera el prefijo de traduccion tipo tr[acronimo]_\n $this->load_translate_prefix();\n //carga las primeras traducciones sobre todo de entidades.\n $this->load_extra_translate();\n \n $this->sTimeNow = date(\"d-m-Y H:i\").\" (SPAIN)\";\n $arLines = array();\n $arLines[] = \"<?php\";\n $arLines[] = \"/**\n * @author Module Builder 1.1.4\n * @link www.eduardoaf.com\n * @version 1.0.0\n * @name $this->sControllerClassName\n * @file $this->sControllerFileName \n * @date $this->sTimeNow\n * @observations: \n * @requires:\n */\"; \n //IMPORTACION DE CLASES:\n $arLines[] = \"//TFW\";\n $arLines[] = \"import_component(\\\"page,validate,filter\\\");\";\n $arLines[] = \"import_helper(\\\"form,form_fieldset,form_legend,input_text,label,anchor,table,table_typed\\\");\";\n $arLines[] = \"import_helper(\\\"input_password,button_basic,raw,div,javascript\\\");\";\n $arLines[] = \"//APP\";\n $sImport = $this->get_import_models();\n $arLines[] = \"import_model(\\\"user,$sImport\\\");\";\n $arLines[] = \"import_appmain(\\\"controller,view,behaviour\\\");\";\n $arLines[] = \"import_appbehaviour(\\\"picklist\\\");\";\n $arLines[] = \"import_apphelper(\\\"listactionbar,controlgroup,formactions,buttontabs,formhead,alertdiv,breadscrumbs,headertabs\\\");\";\n $arLines[] = \"\";\n \n //BEGIN CLASS\n $arLines[] = \"class $this->sControllerClassName extends TheApplicationController\";\n $arLines[] = \"{\";\n $arLines[] = \"\\tprotected \\$$this->sModelObjectName;\";\n $arLines[] = \"\";\n $arLines[] = \"\\tpublic function __construct()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_func_construct($arLines);\n $arLines[] = \"\\t}\";\n $arLines[] = \"\";\n \n//<editor-fold defaultstate=\"collapsed\" desc=\"BUILDING LIST\">\n $arLines[] = \"//<editor-fold defaultstate=\\\"collapsed\\\" desc=\\\"LIST\\\">\";\n //build_list_scrumbs\n $arLines[] = \"\\t//list_1\";\n $arLines[] = \"\\tprotected function build_list_scrumbs()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_lst_buildlistscrumbs($arLines);\n $arLines[] = \"\\t}\";\n $arLines[] = \"\";\n \n $arLines[] = \"\\t//list_2\";\n $arLines[] = \"\\tprotected function build_list_tabs()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_lst_buildlisttabs($arLines);\n $arLines[] = \"\\t}\";\n $arLines[] = \"\";\n \n //build_listoperation_buttons();\n $arLines[] = \"\\t//list_3\";\n $arLines[] = \"\\tprotected function build_listoperation_buttons()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_lst_buildlistoperationbuttons($arLines);\n $arLines[] = \"\\t}//build_listoperation_buttons()\";\n $arLines[] = \"\";\n \n //load_config_list_filters();\n $arLines[] = \"\\t//list_4\";\n $arLines[] = \"\\tprotected function load_config_list_filters()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_lst_loadconfiglistfilters($arLines);\n $arLines[] = \"\\t}//load_config_list_filters()\";\n $arLines[] = \"\"; \n \n $arLines[] = \"\\t//list_5\";\n $arLines[] = \"\\tprotected function set_listfilters_from_post()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_lst_setlistfiltersfrompost($arLines);\n $arLines[] = \"\\t}//set_listfilters_from_post()\";\n $arLines[] = \"\";\n \n //get_list_filters();\n $arLines[] = \"\\t//list_6\";\n $arLines[] = \"\\tprotected function get_list_filters()\";\n $arLines[] = \"\\t{\";\n $arLines[] = \"\\t\\t//CAMPOS\";\n $this->controlleradd_lst_getlistfilters($arLines); \n $arLines[] = \"\\t\\treturn \\$arFields;\";\n $arLines[] = \"\\t}//get_list_filters()\";\n $arLines[] = \"\"; \n //get_list_columns();\n $arLines[] = \"\\t//list_7\";\n $arLines[] = \"\\tprotected function get_list_columns()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_lst_getlistcolumns($arLines);\n $arLines[] = \"\\t\\treturn \\$arColumns;\";\n $arLines[] = \"\\t}//get_list_columns()\";\n $arLines[] = \"\"; \n $arLines[] = \"\\t//list_8\";\n $arLines[] = \"\\tpublic function get_list()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_lst_getlist($arLines);\n $arLines[] = \"\\t}//get_list()\";\n $arLines[] = \"//</editor-fold>\";\n $arLines[] = \"\";\n//</editor-fold>\n\n//<editor-fold defaultstate=\"collapsed\" desc=\"BUILDING INSERT\"> \n $arLines[] = \"//<editor-fold defaultstate=\\\"collapsed\\\" desc=\\\"INSERT\\\">\";\n //build_insert_srumbs\n $arLines[] = \"\\t//insert_1\";\n $arLines[] = \"\\tprotected function build_insert_scrumbs()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_ins_buildinsertscrumbs($arLines);\n $arLines[] = \"\\t}//build_insert_scrumbs()\";\n $arLines[] = \"\";\n $arLines[] = \"\\t//insert_2\";\n $arLines[] = \"\\tprotected function build_insert_tabs()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_ins_buildinserttabs($arLines);\n $arLines[] = \"\\t}//build_insert_tabs()\"; \n \n //build_insert_opbuttons\n $arLines[] = \"\\t//insert_3\";\n $arLines[] = \"\\tprotected function build_insert_opbuttons()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_ins_buildinsertopbuttons($arLines);\n $arLines[] = \"\\t}//build_insert_opbuttons()\";\n $arLines[] = \"\";\n\n //build_insert_fields\n $arLines[] = \"\\t//insert_4\";\n $arLines[] = \"\\tprotected function build_insert_fields(\\$usePost=0)\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_ins_buildinsertfields($arLines);\n $arLines[] = \"\\t}//build_insert_fields()\";\n $arLines[] = \"\";\n \n //get_insert_validate\n $arLines[] = \"\\t//insert_5\";\n $arLines[] = \"\\tprotected function get_insert_validate()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_ins_getinsertvalidate($arLines);\n $arLines[] = \"\\t}//get_insert_validate\";\n $arLines[] = \"\";\n\n //build_insert_form\n $arLines[] = \"\\t//insert_6\";\n $arLines[] = \"\\tprotected function build_insert_form(\\$usePost=0)\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_ins_buildinsertform($arLines);\n $arLines[] = \"\\t}//build_insert_form()\";\n $arLines[] = \"\";\n \n //insert()\n $arLines[] = \"\\t//insert_7\";\n $arLines[] = \"\\tpublic function insert()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_ins_insert($arLines);\n $arLines[] = \"\\t}//insert()\";\n $arLines[] = \"//</editor-fold>\";\n $arLines[] = \"\";\n//</editor-fold>\n\n//<editor-fold defaultstate=\"collapsed\" desc=\"BUILDING UPDATE\"> \n $arLines[] = \"//<editor-fold defaultstate=\\\"collapsed\\\" desc=\\\"UPDATE\\\">\";\n $arLines[] = \"\\t//update_1\";\n $arLines[] = \"\\tprotected function build_update_scrumbs()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_upd_buildupdatescrumbs($arLines);\n $arLines[] = \"\\t}//build_update_scrumbs()\";\n $arLines[] = \"\";\n $arLines[] = \"\\t//update_2\";\n $arLines[] = \"\\tprotected function build_update_tabs()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_upd_buildupdatetabs($arLines);\n $arLines[] = \"\\t}//build_update_tabs()\";\n $arLines[] = \"\";\n $arLines[] = \"\\t//update_3\";\n $arLines[] = \"\\tprotected function build_update_opbuttons()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_upd_buildupdateopbuttons($arLines);\n $arLines[] = \"\\t}//build_update_opbuttons()\";\n $arLines[] = \"\";\n //build_update_fields\n $arLines[] = \"\\t//update_4\";\n $arLines[] = \"\\tprotected function build_update_fields(\\$usePost=0)\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_upd_buildupdatefields($arLines);\n $arLines[] = \"\\t}//build_update_fields()\";\n $arLines[] = \"\";\n //get_update_validate\n $arLines[] = \"\\t//update_5\";\n $arLines[] = \"\\tprotected function get_update_validate()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_ins_getinsertvalidate($arLines,1);\n $arLines[] = \"\\t}//get_update_validate\";\n $arLines[] = \"\"; \n $arLines[] = \"\\t//update_6\";\n $arLines[] = \"\\tprotected function build_update_form(\\$usePost=0)\";\n $arLines[] = \"\\t{\"; \n //$arLines[] = \"\\t\\t\\$id = \\$this->get_get(\\\"id\\\");\";\n $this->controlleradd_upd_buildupdateform($arLines);\n $arLines[] = \"\\t}//build_update_form()\";\n $arLines[] = \"\";\n $arLines[] = \"\\t//update_7\";\n $arLines[] = \"\\tpublic function update()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_upd_update($arLines);\n $arLines[] = \"\\t}//update()\";\n $arLines[] = \"//</editor-fold>\";\n $arLines[] = \"\";\n//</editor-fold>\n\n//<editor-fold defaultstate=\"collapsed\" desc=\"BUILDING DELETE\">\n $arLines[] = \"//<editor-fold defaultstate=\\\"collapsed\\\" desc=\\\"DELETE\\\">\";\n $arLines[] = \"\\t//delete_1\";\n $arLines[] = \"\\tprotected function single_delete()\";\n $arLines[] = \"\\t{\";\n $arLines[] = \"\\t\\t\\$id = \\$this->get_get(\\\"id\\\");\";\n $arLines[] = \"\\t\\tif(\\$id)\";\n $arLines[] = \"\\t\\t{\";\n $arLines[] = \"\\t\\t\\t\\$this->$this->sModelObjectName\".\"->set_id(\\$id);\";\n $arLines[] = \"\\t\\t\\t\\$this->$this->sModelObjectName\".\"->autodelete();\";\n $arLines[] = \"\\t\\t\\tif(\\$this->$this->sModelObjectName\".\"->is_error())\";\n $arLines[] = \"\\t\\t\\t{\";\n $arLines[] = \"\\t\\t\\t\\t\\$this->isError = TRUE;\";\n $arLines[] = \"\\t\\t\\t\\t\\$this->set_session_message(tr_mdb_error_trying_to_delete);\";\n $arLines[] = \"\\t\\t\\t}\";\n $arLines[] = \"\\t\\t\\telse\";\n $arLines[] = \"\\t\\t\\t{\";\n $arLines[] = \"\\t\\t\\t\\t\\$this->set_session_message(tr_mdb_data_deleted);\";\n $arLines[] = \"\\t\\t\\t}\";\n $arLines[] = \"\\t\\t}//si existe el id\";\n $arLines[] = \"\\t\\telse\";\n $arLines[] = \"\\t\\t\\t\\$this->set_session_message(tr_mdb_error_key_not_supplied,\\\"e\\\");\";\n $arLines[] = \"\\t}//single_delete()\";\n $arLines[] = \"\";\n $arLines[] = \"\\t//delete_2\";\n $arLines[] = \"\\tprotected function multi_delete()\";\n $arLines[] = \"\\t{\";\n $arLines[] = \"\\t\\t//Intenta recuperar pkeys sino pasa a recuperar el id. En ultimo caso lo que se ha pasado por parametro\";\n $arLines[] = \"\\t\\t\\$arKeys = \\$this->get_listkeys();\";\n $arLines[] = \"\\t\\tforeach(\\$arKeys as \\$sKey)\";\n $arLines[] = \"\\t\\t{\";\n $arLines[] = \"\\t\\t\\t\\$id = \\$sKey;\";\n $arLines[] = \"\\t\\t\\t\\$this->$this->sModelObjectName\".\"->set_id(\\$id);\";\n $arLines[] = \"\\t\\t\\t\\$this->$this->sModelObjectName\".\"->autodelete();\";\n $arLines[] = \"\\t\\t\\tif(\\$this->$this->sModelObjectName\".\"->is_error())\";\n $arLines[] = \"\\t\\t\\t{\";\n $arLines[] = \"\\t\\t\\t\\t\\$this->isError = true;\";\n $arLines[] = \"\\t\\t\\t\\t\\$this->set_session_message(tr_mdb_error_trying_to_delete,\\\"e\\\");\";\n $arLines[] = \"\\t\\t\\t}\";\n $arLines[] = \"\\t\\t}//foreach arkeys\";\n $arLines[] = \"\\t\\tif(!\\$this->isError)\";\n $arLines[] = \"\\t\\t\\t\\$this->set_session_message(tr_mdb_data_deleted);\";\n $arLines[] = \"\\t}//multi_delete()\";\n $arLines[] = \"\";\n $arLines[] = \"\\t//delete_3\";\n $arLines[] = \"\\tpublic function delete()\";\n $arLines[] = \"\\t{\";\n $arLines[] = \"\\t\\t//\\$this->go_to_401(\\$this->oPermission->is_not_delete()||\\$this->oSessionUser->is_not_dataowner());\";\n $arLines[] = \"\\t\\t\\$this->go_to_401(\\$this->oPermission->is_not_delete());\";\n $arLines[] = \"\\t\\t\\$this->isError = FALSE;\";\n $arLines[] = \"\\t\\t//Si ocurre un error se guarda en isError\";\n $arLines[] = \"\\t\\tif(\\$this->is_multidelete())\";\n $arLines[] = \"\\t\\t\\t\\$this->multi_delete();\";\n $arLines[] = \"\\t\\telse\";\n $arLines[] = \"\\t\\t\\t\\$this->single_delete();\";\n $arLines[] = \"\\t\\t//Si no ocurrio errores en el intento de borrado\";\n $arLines[] = \"\\t\\tif(!\\$this->isError)\";\n $arLines[] = \"\\t\\t\\t\\$this->go_to_after_succes_cud();\";\n $arLines[] = \"\\t\\telse//delete ok\";\n $arLines[] = \"\\t\\t\\t\\$this->go_to_list();\";\n $arLines[] = \"\\t}\\t//delete()\";\n $arLines[] = \"//</editor-fold>\";\n $arLines[] = \"\";\n $arLines[] = \"//<editor-fold defaultstate=\\\"collapsed\\\" desc=\\\"QUARANTINE\\\">\";\n $arLines[] = \"\\t//quarantine_1\";\n $arLines[] = \"\\tprotected function single_quarantine()\";\n $arLines[] = \"\\t{\";\n $arLines[] = \"\\t\\t\\$id = \\$this->get_get(\\\"id\\\");\";\n $arLines[] = \"\\t\\tif(\\$id)\";\n $arLines[] = \"\\t\\t{\";\n $arLines[] = \"\\t\\t\\t\\$this->$this->sModelObjectName\".\"->set_id(\\$id);\";\n $arLines[] = \"\\t\\t\\t\\$this->$this->sModelObjectName\".\"->autoquarantine();\";\n $arLines[] = \"\\t\\t\\tif(\\$this->$this->sModelObjectName\".\"->is_error())\";\n $arLines[] = \"\\t\\t\\t\\t\\$this->set_session_message(tr_mdb_error_trying_to_delete);\";\n $arLines[] = \"\\t\\t\\telse\";\n $arLines[] = \"\\t\\t\\t\\t\\$this->set_session_message(tr_mdb_data_deleted);\";\n $arLines[] = \"\\t\\t}//else no id\";\n $arLines[] = \"\\t\\telse\";\n $arLines[] = \"\\t\\t\\t\\$this->set_session_message(tr_mdb_error_key_not_supplied,\\\"e\\\");\";\n $arLines[] = \"\\t}//single_quarantine()\";\n $arLines[] = \"\"; \n $arLines[] = \"\\t//quarantine_2\";\n $arLines[] = \"\\tprotected function multi_quarantine()\";\n $arLines[] = \"\\t{\";\n $arLines[] = \"\\t\\t\\$this->isError = FALSE;\";\n $arLines[] = \"\\t\\t//Intenta recuperar pkeys sino pasa a id, y en ultimo caso lo que se ha pasado por parametro\";\n $arLines[] = \"\\t\\t\\$arKeys = \\$this->get_listkeys();\";\n $arLines[] = \"\\t\\tforeach(\\$arKeys as \\$sKey)\";\n $arLines[] = \"\\t\\t{\";\n $arLines[] = \"\\t\\t\\t\\$id = \\$sKey;\";\n $arLines[] = \"\\t\\t\\t\\$this->$this->sModelObjectName\".\"->set_id(\\$id);\";\n $arLines[] = \"\\t\\t\\t\\$this->$this->sModelObjectName\".\"->autoquarantine();\";\n $arLines[] = \"\\t\\t\\tif(\\$this->$this->sModelObjectName\".\"->is_error())\";\n $arLines[] = \"\\t\\t\\t{\";\n $arLines[] = \"\\t\\t\\t\\t\\$isError = true;\";\n $arLines[] = \"\\t\\t\\t\\t\\$this->set_session_message(tr_mdb_error_trying_to_delete,\\\"e\\\");\";\n $arLines[] = \"\\t\\t\\t}\";\n $arLines[] = \"\\t\\t}\";\n $arLines[] = \"\\t\\tif(!\\$isError)\";\n $arLines[] = \"\\t\\t\\t\\$this->set_session_message(tr_mdb_data_deleted);\";\n $arLines[] = \"\\t}//multi_quarantine()\";\n $arLines[] = \"\";\n $arLines[] = \"\\t//quarantine_3\";\n $arLines[] = \"\\tpublic function quarantine()\";\n $arLines[] = \"\\t{\";\n $arLines[] = \"\\t\\t//\\$this->go_to_401(\\$this->oPermission->is_not_quarantine()||\\$this->oSessionUser->is_not_dataowner());\"; \n $arLines[] = \"\\t\\t\\$this->go_to_401(\\$this->oPermission->is_not_quarantine());\"; \n $arLines[] = \"\\t\\tif(\\$this->is_multiquarantine())\";\n $arLines[] = \"\\t\\t\\t\\$this->multi_quarantine();\";\n $arLines[] = \"\\t\\telse\";\n $arLines[] = \"\\t\\t\\t\\$this->single_quarantine();\";\n $arLines[] = \"\\t\\t\\$this->go_to_list();\";\n $arLines[] = \"\\t\\tif(!\\$this->isError)\";\n $arLines[] = \"\\t\\t\\t\\$this-go_to_after_succes_cud();\";\n $arLines[] = \"\\t\\telse //quarantine ok\"; \n $arLines[] = \"\\t\\t\\t\\$this->go_to_list();\";\n $arLines[] = \"\\t}//quarantine()\";\n $arLines[] = \"\";\n $arLines[] = \"//</editor-fold>\";\n $arLines[] = \"\";\n//</editor-fold>\n\n//<editor-fold defaultstate=\"collapsed\" desc=\"BUILDING MULTIASSIGN\">\n $this->arTranslation[] = $this->sTranslatePrefix.\"clear_filters\";\n $this->arTranslation[] = $this->sTranslatePrefix.\"refresh\";\n $this->arTranslation[] = $this->sTranslatePrefix.\"multiadd\";\n $this->arTranslation[] = $this->sTranslatePrefix.\"closeme\";\n $this->arTranslation[] = $this->sTranslatePrefix.\"entities\";\n \n $arLines[] = \"//<editor-fold defaultstate=\\\"collapsed\\\" desc=\\\"MULTIASSIGN\\\">\";\n $arLines[] = \"\\t//multiassign_1\";\n $arLines[] = \"\\tprotected function build_multiassign_buttons()\";\n $arLines[] = \"\\t{\";\n $arLines[] = \"\\t\\t\\$arOpButtons = array();\";\n $arLines[] = \"\\t\\t\\$arOpButtons[\\\"filters\\\"]=array(\\\"href\\\"=>\\\"javascript:reset_filters();\\\",\\\"icon\\\"=>\\\"awe-magic\\\",\\\"innerhtml\\\"=>$this->sTranslatePrefix\".\"clear_filters);\";\n $arLines[] = \"\\t\\t\\$arOpButtons[\\\"reload\\\"]=array(\\\"href\\\"=>\\\"javascript:TfwControl.form_submit();\\\",\\\"icon\\\"=>\\\"awe-refresh\\\",\\\"innerhtml\\\"=>$this->sTranslatePrefix\".\"refresh);\";\n $arLines[] = \"\\t\\t\\$arOpButtons[\\\"multiadd\\\"]=array(\\\"href\\\"=>\\\"javascript:multiadd();\\\",\\\"icon\\\"=>\\\"awe-external-link\\\",\\\"innerhtml\\\"=>$this->sTranslatePrefix\".\"multiadd);\";\n $arLines[] = \"\\t\\t\\$arOpButtons[\\\"closeme\\\"]=array(\\\"href\\\"=>\\\"javascript:closeme();\\\",\\\"icon\\\"=>\\\"awe-remove-sign\\\",\\\"innerhtml\\\"=>$this->sTranslatePrefix\".\"closeme);\";\n $arLines[] = \"\\t\\t\\$oOpButtons = new AppHelperButtontabs($this->sTranslatePrefix\".\"entities);\";\n $arLines[] = \"\\t\\t\\$oOpButtons->set_tabs(\\$arOpButtons);\";\n $arLines[] = \"\\t\\treturn \\$oOpButtons;\";\n $arLines[] = \"\\t}//build_multiassign_buttons()\";\n $arLines[] = \"\";\n //load_config_multiassign_filters();\n $arLines[] = \"\\t//multiassign_2\";\n $arLines[] = \"\\tprotected function load_config_multiassign_filters()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_lst_loadconfiglistfilters($arLines);\n $arLines[] = \"\\t}//load_config_multiassign_filters()\";\n $arLines[] = \"\";\n $arLines[] = \"\\t//multiassign_3\";\n $arLines[] = \"\\tprotected function get_multiassign_filters()\";\n $arLines[] = \"\\t{\";\n $arLines[] = \"\\t\\t//CAMPOS\";\n $this->controlleradd_lst_getlistfilters($arLines,0);\n $arLines[] = \"\\t\\treturn \\$arFields;\";\n $arLines[] = \"\\t}//get_multiassign_filters()\";\n $arLines[] = \"\"; \n $arLines[] = \"\\t//multiassign_4\";\n $arLines[] = \"\\tprotected function set_multiassignfilters_from_post()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_lst_setlistfiltersfrompost($arLines);\n $arLines[] = \"\\t}//set_multiassignfilters_from_post()\";\n $arLines[] = \"\"; \n //get_multiassign_columns();\n $arLines[] = \"\\t//multiassign_5\";\n $arLines[] = \"\\tprotected function get_multiassign_columns()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_lst_getlistcolumns($arLines,0);\n $arLines[] = \"\\t\\treturn \\$arColumns;\";\n $arLines[] = \"\\t}//get_multiassign_columns()\";\n $arLines[] = \"\"; \n $arLines[] = \"\\t//multiassign_6\";\n $arLines[] = \"\\tpublic function multiassign()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_multiassign($arLines);\n $arLines[] = \"\\t}//multiassign()\";\n $arLines[] = \"//</editor-fold>\";\n $arLines[] = \"\";\n//</editor-fold>\n\n//<editor-fold defaultstate=\"collapsed\" desc=\"BUILDING SINGLEASSIGN\"> \n $arLines[] = \"//<editor-fold defaultstate=\\\"collapsed\\\" desc=\\\"SINGLEASSIGN\\\">\";\n $arLines[] = \"\\t//singleassign_1\";\n $arLines[] = \"\\tprotected function build_singleassign_buttons()\";\n $arLines[] = \"\\t{\";\n $arLines[] = \"\\t\\t\\$arButTabs = array();\";\n $arLines[] = \"\\t\\t\\$arButTabs[\\\"filters\\\"]=array(\\\"href\\\"=>\\\"javascript:reset_filters();\\\",\\\"icon\\\"=>\\\"awe-magic\\\",\\\"innerhtml\\\"=>$this->sTranslatePrefix\".\"clear_filters);\";\n $arLines[] = \"\\t\\t\\$arButTabs[\\\"reload\\\"]=array(\\\"href\\\"=>\\\"javascript:TfwControl.form_submit();\\\",\\\"icon\\\"=>\\\"awe-refresh\\\",\\\"innerhtml\\\"=>$this->sTranslatePrefix\".\"refresh);\";\n $arLines[] = \"\\t\\t\\$arButTabs[\\\"closeme\\\"]=array(\\\"href\\\"=>\\\"javascript:closeme();\\\",\\\"icon\\\"=>\\\"awe-remove-sign\\\",\\\"innerhtml\\\"=>$this->sTranslatePrefix\".\"closeme);\";\n $arLines[] = \"\\t\\treturn \\$arButTabs;\";\n $arLines[] = \"\\t}//build_singleassign_buttons()\";\n $arLines[] = \"\";\n //load_config_multiassign_filters();\n $arLines[] = \"\\t//singleassign_2\";\n $arLines[] = \"\\tprotected function load_config_singleassign_filters()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_lst_loadconfiglistfilters($arLines);\n $arLines[] = \"\\t}//load_config_singleassign_filters()\";\n $arLines[] = \"\"; \n \n //get_singleassign_filters();\n $arLines[] = \"\\t//singleassign_3\";\n $arLines[] = \"\\tprotected function get_singleassign_filters()\";\n $arLines[] = \"\\t{\";\n $arLines[] = \"\\t\\t//CAMPOS\";\n $this->controlleradd_lst_getlistfilters($arLines,0);\n $arLines[] = \"\\t\\treturn \\$arFields;\";\n $arLines[] = \"\\t}//get_singleassign_filters()\";\n $arLines[] = \"\"; \n \n $arLines[] = \"\\t//singleassign_4\";\n $arLines[] = \"\\tprotected function set_singleassignfilters_from_post()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_lst_setlistfiltersfrompost($arLines);\n $arLines[] = \"\\t}//set_singleassignfilters_from_post()\";\n $arLines[] = \"\";\n \n //get_singleassign_columns();\n $arLines[] = \"\\t//singleassign_5\";\n $arLines[] = \"\\tprotected function get_singleassign_columns()\";\n $arLines[] = \"\\t{\";\n //SINGLEASSIGN - COLUMNS\n $this->controlleradd_lst_getlistcolumns($arLines,0);\n $arLines[] = \"\\t\\treturn \\$arColumns;\";\n $arLines[] = \"\\t}//get_singleassign_columns()\";\n $arLines[] = \"\"; \n $arLines[] = \"\\t//singleassign_6\";\n $arLines[] = \"\\tpublic function singleassign()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_singleassign($arLines); \n $arLines[] = \"\\t}//singleassign()\";\n $arLines[] = \"//</editor-fold>\";\n $arLines[] = \"\";\n//</editor-fold>\n\n//<editor-fold defaultstate=\"collapsed\" desc=\"BUILDING EXTRAS\"> \n $arLines[] = \"//<editor-fold defaultstate=\\\"collapsed\\\" desc=\\\"EXTRAS\\\">\";\n $arLines[] = \"\\tpublic function addsellers()\";\n $arLines[] = \"\\t{\";\n $arLines[] = \"\\t\\t\\$sUrl = \\$this->get_assign_backurl(array(\\\"k\\\",\\\"k2\\\"));\";\n $arLines[] = \"\\t\\tif(\\$this->get_get(\\\"close\\\"))\";\n $arLines[] = \"\\t\\t\\t\\$this->js_colseme_and_parent_refresh();\";\n $arLines[] = \"\\t\\telse\";\n $arLines[] = \"\\t\\t\\t\\$this->js_parent_refresh();\";\n $arLines[] = \"\\t\\t\\$this->js_go_to(\\$sUrl);\";\n $arLines[] = \"\\t}\";\n $arLines[] = \"//</editor-fold>\";\n//</editor-fold> \n $arLines[] = \"}//end controller\";//fin clase\n $sContent = implode(\"\\n\",$arLines);\n return $sContent; \n }", "public function main() {\n $nameArr = explode(\".\", $this->name);\n $name = $nameArr[0];\n $xml = SimpleXml_load_file(\"../domain/base/\".$name.\".xml\");\n\n $path = $xml->path[\"name\"];\n\n $template = file_get_contents(\"generateDomain/DomainObjectTemplate\");\n $vars = array();\n $vars[\"class_name\"] = \"Base\".ucfirst($name);\n $template = $this->replaceTokens($vars, $template);\n\n// print_r($xml);\n if($xml->parentClass) {\n $template = $this->replaceToken(\"parent_class\", $xml->parentClass[\"name\"], $template);\n $template = $this->replaceToken(\"super_call\", file_get_contents(\"generateDomain/SuperCallTemplate\"), $template);\n $template = $this->replaceToken(\"register_new\", \"\", $template);\n } else {\n $template = $this->replaceToken(\"parent_class\", \"\\\\domain\\\\DomainObject\", $template);\n $template = $this->replaceToken(\"super_call\", \"\", $template);\n $template = $this->replaceToken(\"register_new\", file_get_contents(\"generateDomain/RegisterNewTemplate\"), $template);\n }\n\n $constantsPiece = \"\";\n $addAttributePiece = \"\";\n $gettersAndSettersPiece = \"\";\n foreach($xml->attributes->attribute as $attr) {\n // constants\n $constantsPiece.= 'const '. strtoupper($attr[\"name\"]). ' = \"'.$attr[\"name\"].'\";\n ' ;\n\n // AddAttributes method\n $vars = array();\n $vars[\"class_name\"] = \"Base\".ucfirst($name);\n $vars[\"constant\"] = strtoupper($attr[\"name\"]);\n\n $attrTemplate = file_get_contents(\"generateDomain/AddAttributesTemplate\");\n $addAttributePiece .= $this->replaceTokens($vars, $attrTemplate);\n\n // getters and setters\n $vars = array();\n $vars[\"class_name\"] = \"Base\".ucfirst($name);\n $vars[\"constant\"] = strtoupper($attr[\"name\"]);\n $vars[\"constant_name\"] = ucfirst($attr[\"name\"]);\n $vars[\"constant_normal_case\"] = $attr[\"name\"];\n\n $getterSetterTemplate = file_get_contents(\"generateDomain/GettersAndSettersTemplate\");\n $gettersAndSettersPiece .= $this->replaceTokens($vars, $getterSetterTemplate);\n }\n $template = $this->replaceToken(\"constants\", $constantsPiece, $template);\n $template = $this->replaceToken(\"attributes_to_add\", $addAttributePiece, $template);\n $template = $this->replaceToken(\"getters_and_setters\", $gettersAndSettersPiece, $template);\n\n\n if($xml->mapper) {\n $mapper = $xml->mapper[\"name\"];\n $klass = $xml->mapper[\"class\"];\n $table = $xml->mapper[\"table\"];\n $idField = $xml->mapper[\"idField\"];\n\n\n\n if($mapper !== null && $klass !== null && $table !== null && $idField !== null) {\n $t = file_get_contents(\"generateDomain/MapperTemplate\");\n $vars = array();\n $vars[\"class_name\"] = $klass;\n $vars[\"table_name\"] = $table;\n $vars[\"id_field\"] = $idField;\n echo \"MADE IT HERE!\";\n print_r($xml->mapper->joins);\n\n if($xml->mapper->joins) {\n echo \"Had Joins!\";\n $joinsTemplate = file_get_contents(\"generateDomain/MapperJoinTemplate\");\n $joinsPiece = \"\";\n foreach($xml->mapper->joins->join as $join) {\n\n $joinVars = array();\n $joinVars[\"join_name\"] = $join[\"name\"];\n $joinVars[\"join_table\"] = $join[\"table\"];\n $joinsPiece .= $this->replaceTokens($joinVars, $joinsTemplate);\n }\n $vars[\"joins\"] = $joinsPiece;\n } else {\n $vars[\"joins\"] = \"\";\n }\n\n\n $t = $this->replaceTokens($vars, $t);\n\n if(file_exists(\"../mapper/\".$mapper.\".php\")) {\n $mapperContent = file_get_contents(\"../mapper/\".$mapper.\".php\");\n if(preg_match('@(p)ublic function loadDataMap\\(\\) {[\\s\\S]*?(})@i', $mapperContent, $matches, PREG_OFFSET_CAPTURE)) {\n $mapperContent = substr_replace($mapperContent, $t, $matches[1][1], ($matches[2][1] - $matches[1][1]) + 1);\n\n $fh = fopen(\"../mapper/\".$mapper.\".php\", \"w\");\n fwrite($fh, $mapperContent);\n fclose($fh);\n } else {\n if(preg_match('@class\\s*'.$klass.'[\\s\\S]*(})[\\s\\S]*\\?>@i', $mapperContent, $matches, PREG_OFFSET_CAPTURE)) {\n $mapperContent = substr_replace($mapperContent, $t, $matches[1][1] - 1, 0);\n\n $fh = fopen(\"../mapper/\".$mapper.\".php\", \"w\");\n fwrite($fh, $mapperContent);\n fclose($fh);\n } else {\n throw new BuildException(\"Could not match regular expression in: \".$mapper);\n }\n }\n\n\n\n } else {\n throw new BuildException(\"Mapper file did not exist \". $mapper);\n }\n }\n }\n\n\n $fh = fopen(\"../domain/base/\".\"Base\".ucfirst($name).\".php\", \"w\");\n fwrite($fh, $template);\n fclose($fh);\n }", "public function initializeView() {}", "public function initializeView() {}" ]
[ "0.59083414", "0.583813", "0.58027947", "0.56963766", "0.5652062", "0.5619409", "0.5567655", "0.5509695", "0.5502949", "0.5473742", "0.5450257", "0.54291344", "0.5426051", "0.5418699", "0.5375342", "0.5360206", "0.53419536", "0.5331329", "0.5322292", "0.5320827", "0.5318663", "0.5318598", "0.5314963", "0.5293122", "0.52592766", "0.5257104", "0.5250425", "0.52467597", "0.52458644", "0.5242577", "0.5238593", "0.5238593", "0.5237065", "0.52313566", "0.52094114", "0.52094114", "0.52094114", "0.52094114", "0.52094114", "0.52094114", "0.52094114", "0.5209036", "0.52079403", "0.520741", "0.5201386", "0.51998866", "0.51831347", "0.517271", "0.5168351", "0.51683146", "0.5163858", "0.51616716", "0.5148712", "0.51449364", "0.51449364", "0.5135469", "0.5119201", "0.51012385", "0.51012385", "0.5101165", "0.50895745", "0.50747746", "0.5068578", "0.50640714", "0.5060849", "0.50608397", "0.50577193", "0.5057161", "0.50281125", "0.50242376", "0.50178194", "0.5013515", "0.5009845", "0.50082827", "0.5006083", "0.50053114", "0.49999174", "0.4998697", "0.49979302", "0.4995453", "0.4995453", "0.4991668", "0.49695703", "0.49680632", "0.49630877", "0.49506852", "0.49499482", "0.49490175", "0.49443817", "0.49373728", "0.4935367", "0.49338993", "0.4930948", "0.49137214", "0.49114072", "0.49074554", "0.49056557", "0.48832816", "0.4877906", "0.4874977", "0.4874977" ]
0.0
-1
Build Data transfer class script.
public static function buildDtoObjectDefinition( array $attributes = [], array $hidden = [], ?string $name = null, ?string $namespace = null, ?string $model = null ) { return self::createDtoBuilder( $attributes, $hidden, $name, $namespace, $model )->build(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function build()\n\t{\n\t\t$script = \"\";\n\t\t$this->addTable($script);\n\t\t$this->addIndices($script);\n\t\t$this->addForeignKeys($script);\n\t\treturn $script;\n\t}", "abstract public function build();", "abstract public function build();", "public abstract function build();", "public abstract function build();", "public function build() {}", "public function build() {}", "public function build() {}", "public function generateEntityCode()\n {\n $tables = $this->getTables();\n \n $code = \" require_once 'grandprix.data.php';\";\n foreach ($tables as $table)\n {\n $columns = $this->getColumns($table['tableName']);\n $children = $this->getChildren($table['tableName']);\n \n $code .=\n\"\n /**\n * \" . ucfirst($table['tableName']) . \" Data Entity class.\n * \n * @package Grandprix\n * @subpackage Data\n */\n class \" . ucfirst($table['tableName']) . \" extends DataEntity\n { \n\";\n \n foreach ($columns as $column)\n {\n $code .=\n\"\n /**\n * @var \" . self::getPhpType($column['dataType']) . \"\n */\n public \\$\" . ucfirst($column['columnName']) . \";\n\";\n }\n\n $code .=\n\"\n /**\n * Creates an empty instance of this class.\n * \n * @return \" . ucfirst($table['tableName']) . \"\n */\n public static function createInstance()\n {\n \\$className = __CLASS__; return new \\$className();\n }\n \n /**\n * Creates an instance of this class based on the provided data array.\n *\n * @param array \\$data The keyed array containing the data\n * @return \" . ucfirst($table['tableName']) . \"\n */\n public static function fromData(&\\$data)\n {\n \\$entity = self::createInstance();\n \\$entity->setObjectData(\\$data);\n return \\$entity;\n }\n }\n\";\n \n }\n \n return $code;\n }", "protected function build()\n\t{\n\t}", "abstract function build();", "function genClass()\r\n {\r\n $this->_file->file_name = GEN_DIR.\"/\".$this->db_name.\"/\".$this->table_name.\"/\".$this->table_name.\".php\";\r\n $this->_file->open(\"w\");\r\n\r\n $string = $this->_genClassHead();\r\n $string .= $this->_genConstructor();\r\n $string .= $this->_genInsert();\r\n $string .= $this->_genUpdate(); \r\n $string .= $this->_genDelete();\r\n $string .= $this->_genSelect();\r\n $string .= $this->_genSelectAll();\r\n $string .= $this->_genClassFoot();\r\n $this->_file->write($string);\r\n }", "public function build();", "public function build();", "public function build();", "public function build();", "public function build();", "public function build();", "public function build();", "public function GenerateAdapter() {\n $this->writeLine(\n 'class '.$this->getClassName()\n );\n $this->writeLine(\n 'extends '.$this->getExtends()\n ); \n $this->writeLine('implements ');\n $this->writeLine(\n implode(', ', $this->getImplements())\n ); \n $this->writeLine('{');\n $this->writeLine(\n 'public static $adapter = \\''.$this->name.'\\';'\n );\n $this->writeLine('public function __construct() {'); \n $this->writeLine('parent::__construct(\\''.$this->name.'\\');');\n $this->writeLine('}');\n if (isset($this->select_one)) \n foreach($this->select_one as $rq) \n $rq->toPhp(true);\n if (isset($this->select)) \n foreach($this->select as $rq) \n $rq->toPhp(true);\n if (isset($this->insert)) \n foreach($this->insert as $rq) \n $rq->toPhp(true);\n if (isset($this->update)) \n foreach($this->update as $rq) \n $rq->toPhp(true);\n if (isset($this->delete)) \n foreach($this->delete as $rq) \n $rq->toPhp(true);\n $this->writeLine('}'); \n }", "public function __construct($arguments = null) {\n if (!is_null($arguments) && is_array($arguments) && !empty($arguments)) {\n\n // argument count\n $this->argument_count = count($arguments);\n\n // get script name\n $this->name = basename($arguments[0]);\n $this->path = dirname($arguments[0]);\n\n $args = ScriptArgs::arguments($arguments);\n $arg_count = 0;\n \n $this->flags = new DataStore();\n $this->arguments = new DataStore();\n\n // handle the options\n $this->options = new DataStore($args['options']);\n\n // loop over the flags\n foreach ($args['flags'] as $flag) {\n $this->flags->set($flag,true); \n }\n\n // determine which argument group to use\n if (count($args['commands']) > 0) {\n $args_list = $args['commands'];\n }\n else {\n $args_list = $args['arguments'];\n }\n\n // loop over the arguments\n foreach ($args_list as $argument) {\n // increment arg_count\n $arg_count++;\n $this->arguments->set(\"arg\" . $arg_count,new Parameter($argument)); \n }\n }\n\n }", "private function buildDrushTask()\n {\n return $this->taskDrushStack($this::DRUSH_BIN)\n ->drupalRootDirectory((__DIR__) . '/web');\n }", "public function build()\n {\n }", "protected function build()\n {\n $this->request = $this->client->createRequest(RequestInterface::POST, 'actions/u2i/conversion', null, $this->getAll());\n }", "public function build ()\n {\n }", "protected function build()\n {\n $this->global_variables = (new GlobalVariablesGenerator)->generate();\n }", "public function main() {\n $nameArr = explode(\".\", $this->name);\n $name = $nameArr[0];\n $xml = SimpleXml_load_file(\"../domain/base/\".$name.\".xml\");\n\n $path = $xml->path[\"name\"];\n\n $template = file_get_contents(\"generateDomain/DomainObjectTemplate\");\n $vars = array();\n $vars[\"class_name\"] = \"Base\".ucfirst($name);\n $template = $this->replaceTokens($vars, $template);\n\n// print_r($xml);\n if($xml->parentClass) {\n $template = $this->replaceToken(\"parent_class\", $xml->parentClass[\"name\"], $template);\n $template = $this->replaceToken(\"super_call\", file_get_contents(\"generateDomain/SuperCallTemplate\"), $template);\n $template = $this->replaceToken(\"register_new\", \"\", $template);\n } else {\n $template = $this->replaceToken(\"parent_class\", \"\\\\domain\\\\DomainObject\", $template);\n $template = $this->replaceToken(\"super_call\", \"\", $template);\n $template = $this->replaceToken(\"register_new\", file_get_contents(\"generateDomain/RegisterNewTemplate\"), $template);\n }\n\n $constantsPiece = \"\";\n $addAttributePiece = \"\";\n $gettersAndSettersPiece = \"\";\n foreach($xml->attributes->attribute as $attr) {\n // constants\n $constantsPiece.= 'const '. strtoupper($attr[\"name\"]). ' = \"'.$attr[\"name\"].'\";\n ' ;\n\n // AddAttributes method\n $vars = array();\n $vars[\"class_name\"] = \"Base\".ucfirst($name);\n $vars[\"constant\"] = strtoupper($attr[\"name\"]);\n\n $attrTemplate = file_get_contents(\"generateDomain/AddAttributesTemplate\");\n $addAttributePiece .= $this->replaceTokens($vars, $attrTemplate);\n\n // getters and setters\n $vars = array();\n $vars[\"class_name\"] = \"Base\".ucfirst($name);\n $vars[\"constant\"] = strtoupper($attr[\"name\"]);\n $vars[\"constant_name\"] = ucfirst($attr[\"name\"]);\n $vars[\"constant_normal_case\"] = $attr[\"name\"];\n\n $getterSetterTemplate = file_get_contents(\"generateDomain/GettersAndSettersTemplate\");\n $gettersAndSettersPiece .= $this->replaceTokens($vars, $getterSetterTemplate);\n }\n $template = $this->replaceToken(\"constants\", $constantsPiece, $template);\n $template = $this->replaceToken(\"attributes_to_add\", $addAttributePiece, $template);\n $template = $this->replaceToken(\"getters_and_setters\", $gettersAndSettersPiece, $template);\n\n\n if($xml->mapper) {\n $mapper = $xml->mapper[\"name\"];\n $klass = $xml->mapper[\"class\"];\n $table = $xml->mapper[\"table\"];\n $idField = $xml->mapper[\"idField\"];\n\n\n\n if($mapper !== null && $klass !== null && $table !== null && $idField !== null) {\n $t = file_get_contents(\"generateDomain/MapperTemplate\");\n $vars = array();\n $vars[\"class_name\"] = $klass;\n $vars[\"table_name\"] = $table;\n $vars[\"id_field\"] = $idField;\n echo \"MADE IT HERE!\";\n print_r($xml->mapper->joins);\n\n if($xml->mapper->joins) {\n echo \"Had Joins!\";\n $joinsTemplate = file_get_contents(\"generateDomain/MapperJoinTemplate\");\n $joinsPiece = \"\";\n foreach($xml->mapper->joins->join as $join) {\n\n $joinVars = array();\n $joinVars[\"join_name\"] = $join[\"name\"];\n $joinVars[\"join_table\"] = $join[\"table\"];\n $joinsPiece .= $this->replaceTokens($joinVars, $joinsTemplate);\n }\n $vars[\"joins\"] = $joinsPiece;\n } else {\n $vars[\"joins\"] = \"\";\n }\n\n\n $t = $this->replaceTokens($vars, $t);\n\n if(file_exists(\"../mapper/\".$mapper.\".php\")) {\n $mapperContent = file_get_contents(\"../mapper/\".$mapper.\".php\");\n if(preg_match('@(p)ublic function loadDataMap\\(\\) {[\\s\\S]*?(})@i', $mapperContent, $matches, PREG_OFFSET_CAPTURE)) {\n $mapperContent = substr_replace($mapperContent, $t, $matches[1][1], ($matches[2][1] - $matches[1][1]) + 1);\n\n $fh = fopen(\"../mapper/\".$mapper.\".php\", \"w\");\n fwrite($fh, $mapperContent);\n fclose($fh);\n } else {\n if(preg_match('@class\\s*'.$klass.'[\\s\\S]*(})[\\s\\S]*\\?>@i', $mapperContent, $matches, PREG_OFFSET_CAPTURE)) {\n $mapperContent = substr_replace($mapperContent, $t, $matches[1][1] - 1, 0);\n\n $fh = fopen(\"../mapper/\".$mapper.\".php\", \"w\");\n fwrite($fh, $mapperContent);\n fclose($fh);\n } else {\n throw new BuildException(\"Could not match regular expression in: \".$mapper);\n }\n }\n\n\n\n } else {\n throw new BuildException(\"Mapper file did not exist \". $mapper);\n }\n }\n }\n\n\n $fh = fopen(\"../domain/base/\".\"Base\".ucfirst($name).\".php\", \"w\");\n fwrite($fh, $template);\n fclose($fh);\n }", "private function buildClassDefinition()\n {\n $reflection = new \\ReflectionClass($this->context->getFullClassName());\n $haxeClass = new HaxeClass();\n $haxeClass\n ->setName($this->context->getClassName())\n ->setPackage(implode('.', explode('\\\\', $this->context->getCurrentNamespace())))\n ;\n\n $this->parseProperties($reflection, $haxeClass);\n $this->parseMethods($reflection, $haxeClass);\n\n return $haxeClass->transpile();\n }", "private function buildDrushTask()\n {\n return $this->taskDrushStack($this::DRUSH_BIN)\n ->drupalRootDirectory((__DIR__) . '/docroot');\n }", "protected function template() {\n\n\t\t$template = \"<?php \n\n/**\n *\n * PHP version 7.\n *\n * Generated with cli-builder gen.php\n *\n * Created: \" . date( 'm-d-Y' ) . \"\n *\n *\n * @author Your Name <email>\n * @copyright (c) \" . date( 'Y' ) . \"\n * @package $this->_namespace - {$this->_command_name}.php\n * @license\n * @version 0.0.1\n *\n */\n\n\";\n\t\tif ( ! empty( $this->_namespace ) ) {\n\t\t\t$template .= \"namespace cli_builder\\\\commands\\\\$this->_namespace;\";\n\t\t} else {\n\t\t\t$template .= \"namespace cli_builder\\\\commands;\";\n\t\t}\n\n\t\t$template .= \"\n\nuse cli_builder\\\\cli;\nuse cli_builder\\\\command\\\\builder;\nuse cli_builder\\command\\command;\nuse cli_builder\\\\command\\\\command_interface;\nuse cli_builder\\\\command\\\\receiver;\n\n/**\n * This concrete command calls \\\"print\\\" on the receiver, but an external.\n * invoker just knows that it can call \\\"execute\\\"\n */\nclass {$this->_command_name} extends command implements command_interface {\n\n\t\n\t/**\n\t * Each concrete command is built with different receivers.\n\t * There can be one, many or completely no receivers, but there can be other commands in the parameters.\n\t *\n\t * @param receiver \\$console\n\t * @param builder \\$builder\n\t * @param cli \\$cli\n\t */\n\tpublic function __construct( receiver \\$console, builder \\$builder, cli \\$cli ) {\n\t\tparent::__construct( \\$console, \\$builder, \\$cli );\n\t\t\n\t\t// Add the help lines.\n\t\t\\$this->_help_lines();\n\t\t\n\t\tif ( in_array( 'h', \\$this->_flags ) || isset( \\$this->_options['help'] ) ) {\n\t\t\t\\$this->help();\n\t\t\t\\$this->_help_request = true;\n\t\t} else {\n\t\t\t// Any setup you need.\n\t\t\t\n\t\t}\n\t}\n\n\n\t/**\n\t * Execute and output \\\"$this->_command_name\\\".\n\t *\n\t * @return mixed|void\n\t */\n\tpublic function execute() {\n\t\n\t\tif ( \\$this->_help_request ) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Get the args that were used in the command line input.\n\t\t\\$args = \\$this->_cli->get_args();\n\t\t\\$args = \\$this->_args;\n\t\t\n\t\t// Create the build directory tree. It will be 'build/' if \\$receiver->set_build_path() is not set in your root cli.php.\n\t\tif ( ! is_dir( \\$this->_command->build_path ) ) {\n\t\t\t\\$this->_builder->create_directory( \\$this->_command->build_path );\n\t\t}\n\n\t\t\\$this->_cli->pretty_dump( \\$args );\n\n\t\t\n\t\t// Will output all content sent to the write method at the end even if it was set in the beginning.\n\t\t\\$this->_command->write( __CLASS__ . ' completed run.' );\n\n\t\t// Adding completion of the command run to the log.\n\t\t\\$this->_command->log(__CLASS__ . ' completed run.');\n\t}\n\t\n\tprivate function _help_lines() {\n\t\t// Example\n\t\t//\\$this->add_help_line('-h, --help', 'Output this commands help info.');\n\n\t}\n\t\n\t/**\n\t * Help output for \\\"$this->_command_name\\\".\n\t *\n\t * @return string\n\t */\n\tpublic function help() {\n\t\n\t\t// You can comment this call out once you add help.\n\t\t// Outputs a reminder to add help.\n\t\tparent::help();\n\t\t\n\t\t//\\$help = \\$this->get_help();\n\n\t\t// Work with the array\n\t\t//print_r( \\$help );\n\t\t// Or output a table\n\t\t//\\$this->help_table();\n\t}\n}\n\";\n\n\t\treturn $template;\n\t}", "public function generate() \r\n\t{\t\r\n\t\tparent::generate();\r\n\t\r\n\t\t$this->schemaXml = new SimpleXMLElement(file_get_contents( $this->_xmlFile ));\r\n\t\t\r\n\t\t//parse object types\r\n\t\tforeach ($this->schemaXml->children() as $reflectionType) \r\n\t\t{\r\n\t\t\tswitch($reflectionType->getName())\r\n\t\t\t{\r\n\t\t\t\tcase \"enums\":\r\n\t\t\t\t\t//create enum classes\r\n\t\t\t\t\tforeach($reflectionType->children() as $enums_node)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->writeEnum($enums_node);\r\n\t\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"classes\":\r\n\t\t\t\t\t//create object classes\r\n\t\t\t\t\tforeach($reflectionType->children() as $classes_node)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->writeObjectClass($classes_node);\r\n\t\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"services\":\r\n\t\t\t\t\t//implement services (api actions)\r\n\t\t\t\t\tforeach($reflectionType->children() as $services_node)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->writeService($services_node);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//write main class (if needed, this can also be included in the static sources folder if not dynamic)\r\n\t\t\t\t\t$this->writeMainClass($reflectionType->children());\r\n\t\t\t\tbreak;\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->addFile('KalturaTypes.js', $this->enumTypes);\r\n\t\t$this->addFile('KalturaVO.js', $this->voClasses);\r\n\t\t$this->addFile('KalturaServices.js', $this->serviceClasses);\r\n\t\t$this->addFile('KalturaClient.js', $this->mainClass);\r\n\t\t//write project file (if needed, this can also be included in the static sources folder if not dynamic)\r\n\t\t$this->writeProjectFile();\r\n\t}", "public function setup()\n {\n $dataModel = eval(\"?>\" . file_get_contents( $this->getDataModelFilename() ));\n if($dataModel instanceof DataModelInterface) {\n $dataModel = new ProjectData($dataModel);\n }\n $this->getEngine()->bindData($dataModel);\n $this->getEngine()->activate();\n }", "public function build( $data );", "protected function _generate() {\n\t\t\n\t\t// recuperation de l'executable\n\t\t$cmd = $this->getExecutable();\n\t\t\n\t\t// gestion des paramètres\n\t\tforeach ($this->getParam() as $param => $value) {$cmd .= ' --' . (!is_numeric($param) ? $param . '=' : '') . $value;}\n\t\t\n\t\t// connexion\n\t\tforeach (array('u ' => 'username', 'p' => 'password', 'dbname') as $prefix => $key) {\n\t\t\tif ($value = array_find($key, $this->getConfig())) {$cmd .= ' ' . (!is_numeric($prefix) ? '-' . $prefix : '') . $value;}\n\t\t\telse { \n\t\t\t\trequire_once 'Zend/Exception.php';\n\t\t\t\tthrow new Zend_Exception('Erreur paramètre de connexion : ' . $key);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//construction de l'url du fichier\n\t\tif (!strlen($this->getFile())) { $this->setFile($this->getDirectory() . '/mysqldump_' . array_find('dbname', $this->getConfig()) . '_' . time() .'.sql' . ($this->getCompress() ? '.bz2' : '')); }\n\t\t\n\t\t// ajoute la fonction pour la compression\n\t\t$cmd .= $this->getCompress() ? ' | bzip2 --stdout --quiet --best ' : '';\n\t\t\n\t\t// inscirption de l'url\n\t\t$cmd .= ' > ' . $this->getFile();\n\n\t\treturn $cmd;\n\t}", "private function __construct()\n {\n require_once DATA_DIR . '/system/DataIO.php';\n }", "protected function build()\n {\n // Grab some files from the config settings\n $exchange = $this->exchange;\n $queue = $this->queue;\n $routingKey = $this->routingKey;\n\n\n // Determine the DLX queue info\n $dlxQueue = is_null($this->dlxQueue) ? $queue . '.dlx' : $this->dlxQueue;\n $dlxRoutingKey = is_null($this->dlxRoutingKey) ? 'dlx' : $this->dlxRoutingKey;\n\n // Build the Exchange\n $this->createExchange($exchange);\n\n // Build the Queues\n $this->createQueue($dlxQueue);\n $this->createQueue($queue, [\n 'x-dead-letter-exchange' => $exchange,\n 'x-dead-letter-routing-key' => $dlxRoutingKey,\n ]);\n\n // Bind the Queues to the Exchange\n $this->bind($dlxQueue, $exchange, $dlxRoutingKey);\n $this->bind($queue, $exchange, $routingKey);\n }", "public function buildTaskMap(){\n\t\t$loadWebPageTask = DataClassLoader::createInstance('Modules.Website.Tasks.LoadStaticPage');\n\t\t$this->tasks['LoadWebsitePage'] = $loadWebPageTask;\n\t\t\n\t\t$this->taskMap['Inputs'][] = array('Enabled'=>'LoadWebsitePage.Enabled');\n\t\t$this->taskMap['Inputs'][] = array('Domain'=>'LoadWebsitePage.Domain');\n\t\t$this->taskMap['Inputs'][] = array('PagePath'=>'LoadWebsitePage.PagePath');\n\t\t\n\t\t//$showPageTask = DataClassLoader::createInstance('Modules.Website.Tasks.ShowPage');\n\t\t//$this->tasks['ShowWebPage'] = $showPageTask;\n\t\t\n\t\t\n\t\t//build the output HTML Task\n\t\t$outputHTMLTask = DataClassLoader::createInstance('Modules.Website.Tasks.SendHTMLResponse');\n\t\t$this->tasks['OutputHTML'] = $outputHTMLTask;\n\t\t\n\t\t$this->taskMap['LoadWebsitePage'][] = array('PageLoaded'=>'OutputHTML.Enabled');\n\t\t$this->taskMap['LoadWebsitePage'][] = array('WebsitePage.PageHTML'=>'OutputHTML.HTMLString');\n\t\t\n\t}", "public function main()\n {\n $options = array(\n 'server' => $this->host,\n 'database' => $this->name,\n 'username' => $this->user,\n 'password' => $this->password\n );\n\n ORM_Connection_Manager::add(new ORM_Adapter_Mysql($options));\n\n $gen = new ORM_Generator_Models();\n $gen->generateFromDb(ORM_Connection_Manager::getConnection(), $this->out, $this->table);\n\n $this->log('SQL write into file \"' . $this->out . '\"');\n //print($this->message);\n }", "protected function buildClass()\n {\n return $this->files->get($this->getStub());\n }", "public function Create()\n {\n parent::Create();\n\t\t\n\t\t//These lines are parsed on Symcon Startup or Instance creation\n //You cannot use variables here. Just static values.\n $this->RegisterPropertyString(\"author\", \"\");\n $this->RegisterPropertyString(\"modulename\", \"\");\n $this->RegisterPropertyString(\"url\", \"\");\n $this->RegisterPropertyString(\"version\", \"0.1\");\n $this->RegisterPropertyInteger(\"build\", 0);\n $this->RegisterPropertyInteger(\"CategoryID\", 0);\n $this->RegisterPropertyInteger(\"generateguid\", 0);\n $this->RegisterPropertyString(\"library_guid\", \"\");\n $this->RegisterPropertyString(\"io_guid\", \"\");\n $this->RegisterPropertyString(\"rx_guid\", \"\");\n $this->RegisterPropertyString(\"tx_guid\", \"\");\n $this->RegisterPropertyString(\"splitter_guid\", \"\");\n $this->RegisterPropertyString(\"splitterinterface_guid\", \"\");\n $this->RegisterPropertyString(\"device_guid\", \"\");\n $this->RegisterPropertyString(\"deviceinterface_guid\", \"\");\n $this->RegisterPropertyString(\"vendor\", \"\");\n $this->RegisterPropertyString(\"prefix\", \"\");\n $this->RegisterPropertyString(\"aliases\", \"\");\n $this->RegisterPropertyInteger(\"ownio\", 0);\n $this->RegisterPropertyInteger(\"typeio\", 0);\n $this->RegisterPropertyInteger(\"dataflowtype\", 0);\n $this->RegisterPropertyString(\"virtual_io_rx_guid\", \"{018EF6B5-AB94-40C6-AA53-46943E824ACF}\"); // Kann für die Kommunikation von ClientSocket, MulticastSocket, SerialPort, UDPSocket und ServerSocket (nur Buffer) genutzt werden\n $this->RegisterPropertyString(\"virtual_io_tx_guid\", \"{79827379-F36E-4ADA-8A95-5F8D1DC92FA9}\"); // Kann für die Kommunikation von ClientSocket, MulticastSocket, SerialPort, UDPSocket und ServerSocket (nur Buffer) genutzt werden\n $this->RegisterPropertyString(\"hid_rx_guid\", \"{FD7FF32C-331E-4F6B-8BA8-F73982EF5AA7}\"); // Kann für HID (Human Interface Device) Instanzen genutzt werden\n $this->RegisterPropertyString(\"hid_tx_guid\", \"{4A550680-80C5-4465-971E-BBF83205A02B}\"); // Kann für HID (Human Interface Device) Instanzen genutzt werden\n $this->RegisterPropertyString(\"server_rx_guid\", \"{7A1272A4-CBDB-46EF-BFC6-DCF4A53D2FC7}\"); // Kann für ServerSocket genutzt werden. Liefert Buffer, ClientIP und ClientPort\n $this->RegisterPropertyString(\"server_tx_guid\", \"{C8792760-65CF-4C53-B5C7-A30FCC84FEFE}\"); // Kann für ServerSocket genutzt werden. Liefert Buffer, ClientIP und ClientPort\n $this->RegisterPropertyString(\"www_reader_rx_guid\", \"{4CB91589-CE01-4700-906F-26320EFCF6C4}\"); // Kann für WWW Reader Instanzen genutzt werden\n $this->RegisterPropertyString(\"www_reader_tx_guid\", \"{D4C1D08F-CD3B-494B-BE18-B36EF73B8F43}\"); // Kann für WWW Reader Instanzen genutzt werden\n $this->RegisterPropertyString(\"io_clientsocket_guid\", \"{3CFF0FD9-E306-41DB-9B5A-9D06D38576C3}\"); // Client Socket\n $this->RegisterPropertyString(\"io_multicast_guid\", \"{BAB408E0-0A0F-48C3-B14E-9FB2FA81F66A}\"); // MulticastSocket\n $this->RegisterPropertyString(\"io_serialport_guid\", \"{6DC3D946-0D31-450F-A8C6-C42DB8D7D4F1}\"); // SerialPort\n $this->RegisterPropertyString(\"io_serversocket_guid\", \"{8062CF2B-600E-41D6-AD4B-1BA66C32D6ED}\"); // Server Socket\n $this->RegisterPropertyString(\"io_udpsocket_guid\", \"{82347F20-F541-41E1-AC5B-A636FD3AE2D8}\"); // UDPSocket\n $this->RegisterPropertyString(\"io_hid_guid\", \"{E6D7692A-7F4C-441D-827B-64062CFE1C02}\"); // HID\n $this->RegisterPropertyString(\"io_wwwreader_guid\", \"{4CB91589-CE01-4700-906F-26320EFCF6C4}\"); // WWW Reader\n }", "public function __construct()\n {\n $this->_baseDir = __DIR__;\n\n // Command line parser\n $this->_cmdParser = $parser = Console_CommandLine::fromXmlString($this->_cmdOptionsStructure);\n try {\n $cmdOptions = $parser->parse();\n if ($cmdOptions->command_name) {\n $this->_cmdOptions = $cmdOptions;\n $this->_cmdOptions->command_name = \"_{$this->_cmdOptions->command_name}\";\n } else {\n $parser->displayUsage();\n exit();\n }\n } catch (Exception $e) {\n $parser->displayError($e->getMessage());\n }\n\n // Load Config\n if (!$this->_cfg = $cfg = @json_decode(file_get_contents('config.json'), true)) {\n die($this->_fgColor('bold_red', \"\\nError: Could not read 'config.json'. Aborting.\\n\"));\n }\n\n // Logger\n $this->_log = new Logger('Tasks');\n $handler = new RotatingFileHandler(\"{$this->_baseDir}/log/report.log\", 10, Logger::INFO);\n $handler->setFormatter(new LineFormatter(\"[%datetime%] %level_name%: %message%\\n\"));\n $this->_log->pushHandler($handler);\n\n // Database\n $capsule = new Capsule;\n foreach ($cfg['databases'] as $k => $v) {\n $capsule->addConnection(\n [\n 'driver' => 'mysql',\n 'host' => $v['host'],\n 'database' => $v['database'],\n 'username' => $v['user'],\n 'password' => $v['password'],\n 'charset' => 'utf8',\n 'collation' => 'utf8_general_ci',\n 'prefix' => ''\n ],\n $k\n );\n }\n $capsule->setAsGlobal();\n\n // BitBucket Credentials\n $this->_bbApi = new Bitbucket\\API\\Api();\n $this->_bbApi->getClient()->addListener(\n new \\Bitbucket\\API\\Http\\Listener\\BasicAuthListener(\n $cfg['api']['bitbucket']['users']['admin']['user'],\n $cfg['api']['bitbucket']['users']['admin']['password']\n )\n );\n\n // Phonegap Build\n $this->_pgbApi = new PhonegapBuildApi($cfg['api']['pgb']['token']);\n\n // Stats\n $this->_report = array(\n 'Date & Time' => date('Y-m-d H:i:s'),\n 'Script Time' => 0,\n 'Method' => ''\n );\n }", "public function build()\n {\n return new EntityDataObject(\n $this->name,\n $this->type,\n $this->data,\n $this->linkedEntities,\n null,\n $this->vars\n );\n }", "public function __construct()\n {\n // Get arguments passed\n if ($_SERVER['argv']) {\n \n // Get arguments passed to the script\n $_commands = $_SERVER['argv'];\n \n // Load the JSON config data\n $this->add_to_log('Load main JSON config file', self::CONF_FILE);\n $this->_config = $this->load_json_file(self::CONF_FILE);\n \n // Set default function using JSON config data\n $this->set_default_behaviour();\n \n // : Set default values to be used for fetching an MMS order from the DB\n $this->set_mms_customer_codes();\n $this->set_mms_status();\n // : End\n \n // Parse the arguments given and perform requested action\n $this->parseArguments($_commands);\n \n // Print log\n if ($this->_log && is_array($this->_log)) {\n foreach ($this->_log as $_key => $_value) {\n foreach ($_value as $_key_1 => $_value_1) {\n print(\"$_key_1: $_value_1\" . PHP_EOL);\n }\n print(PHP_EOL);\n }\n }\n } else {\n die(\"FATAL ERROR: This script must be run from a command line. \\$_SERVER['argv'] is empty.\" . PHP_EOL);\n }\n }", "public function build()\n {\n $this->taskMirrorDir([\n 'src/modules' => 'web/modules/custom',\n 'src/themes' => 'web/themes/custom',\n ])->run();\n $this->_copy('src/settings.php', 'web/sites/default/settings.php');\n if (getenv('PROD_DEST') == 'pantheon') {\n $this->_copy('src/settings.pantheon.php', 'web/sites/default/settings.pantheon.php');\n }\n $this->_touch(\".built\");\n return $this;\n }", "function drush_module_builder_build_component($commands, $component_type, $component_info_drush_extra = array(), $component_data = array()) {\n // Get the Generator task, specifying the component we want so we get a\n // sanity check based on that and our environment.\n try {\n $mb_task_handler_generate = \\DrupalCodeBuilder\\Factory::getTask('Generate', $component_type);\n }\n catch (\\DrupalCodeBuilder\\Exception\\SanityException $e) {\n module_builder_handle_sanity_exception($e);\n return;\n }\n\n // Set the base type.\n $component_data['base'] = $component_type;\n\n // Get the component data info, and add in extra info specific to Drush.\n $component_data_info = $mb_task_handler_generate->getRootComponentDataInfo();\n // Remove extra property info that's for properties we don't know about (such\n // as ones that only apply to certain versions of Drupal).\n foreach ($component_info_drush_extra as $property_name => $property_extra_info) {\n if (!isset($component_data_info[$property_name])) {\n unset($component_info_drush_extra[$property_name]);\n }\n }\n $component_data_info = array_merge_recursive($component_data_info, $component_info_drush_extra);\n\n // Developer option: skip specified properties. This allows quicker manual\n // testing of interactive mode.\n $skip = array_fill_keys(explode(',', drush_get_option('skip')), TRUE);\n $component_data_info = array_diff_key($component_data_info, $skip);\n\n // Split the commands array into:\n // - plain commands\n // - a nested array of prefixed commands\n // - an array of boolean flags.\n // E.g. given 'foo bar hooks: biz presets: bax qux!', we want:\n // - $commands as just 'foo bar'\n // - hooks as 'biz'\n // - presets as 'bax'\n // - boolean flags as 'qux'\n $plain_commands = array();\n $prefixed_commands = array();\n $boolean_commands = array();\n foreach ($commands as $command) {\n if (strlen($command) > 1 && substr($command, -1) == ':') {\n // This is a preset marker.\n $prefix_marker = substr($command, 0, -1);\n\n // Set the array up and move on.\n $prefixed_commands[$prefix_marker] = array();\n continue;\n }\n\n if (substr($command, -1) == '!') {\n // This is a boolean flag.\n $boolean_flag = substr($command, 0, -1);\n\n $boolean_commands[$boolean_flag] = TRUE;\n continue;\n }\n\n if (isset($prefix_marker)) {\n // Continue taking commands for this prefix until we find another prefix\n // marker or run out of commands.\n $prefixed_commands[$prefix_marker][] = $command;\n }\n else {\n $plain_commands[] = $command;\n }\n }\n\n // Determine whether we're in interactive mode.\n $interactive = !drush_get_option(array('non-interactive', 'noi'));\n\n // This is a shortcut for developing, if you have --noi forced in your drush\n // config and need to switch back to interactive for testing.\n if (drush_get_option(array('interactive'))) {\n $interactive = TRUE;\n }\n\n // Build the component data array from the given commands.\n // Work through the component data info, assembling the component data array\n // Each property info needs to be prepared, so iterate by reference.\n foreach ($component_data_info as $property_name => &$property_info) {\n // Prepare the single property: get options, default value, etc.\n $mb_task_handler_generate->prepareComponentDataProperty($property_name, $property_info, $component_data);\n\n // Initialize our value from the default that's been set by\n // prepareComponentDataProperty(). We try various things to set it.\n $value = $component_data[$property_name];\n // Keep track of whether the value has come from the user or is still the\n // default.\n $user_specified = FALSE;\n\n // If the property is required, and there are plain command parameters\n // remaining, take one of those.\n if (!$user_specified && $property_info['required'] && $plain_commands) {\n $value = array_shift($plain_commands);\n $user_specified = TRUE;\n }\n\n // If the property has a prefix, and the commands included that prefix,\n // then take the commands for that prefix.\n if (!$user_specified && isset($property_info['command_prefix']) && !empty($prefixed_commands[$property_info['command_prefix']])) {\n $value = $prefixed_commands[$property_info['command_prefix']];\n $user_specified = TRUE;\n }\n\n // If the property can be set with a command-line option, check that.\n if (!$user_specified && isset($property_info['drush_option'])) {\n $drush_option_value = drush_get_option($property_info['drush_option']);\n if (!empty($drush_option_value)) {\n $value = $drush_option_value;\n $user_specified = TRUE;\n }\n }\n\n // Boolean commands.\n if ($property_info['format'] == 'boolean') {\n if (isset($boolean_commands[$property_name])) {\n $value = TRUE;\n $user_specified = TRUE;\n }\n }\n\n // Process direct mode values for compound properties into the expected\n // format.\n if ($user_specified && ($property_info['format'] == 'compound')) {\n // A compound property in direct input mode uses a ':' to separate the\n // different child items. So for example:\n // plugins: block alpha : block beta\n $child_property_names = array_keys($property_info['properties']);\n\n $child_items = [];\n $delta = 0;\n foreach ($value as $child_value) {\n if ($child_value == ':') {\n // This starts a new delta.\n $delta++;\n\n // Restore the list of child property names.\n $child_property_names = array_keys($property_info['properties']);\n\n // Move on to the next single value.\n continue;\n }\n\n // Still here: take the value.\n $child_property_name = array_shift($child_property_names);\n\n // Split array properties on a comma.\n // TODO: either document this or rethink it.\n if ($property_info['properties'][$child_property_name]['format'] == 'array') {\n $child_value = explode(',', $child_value);\n }\n\n $child_items[$delta][$child_property_name] = $child_value;\n // Defaults for other child properties will be filled in by the\n // process stage.\n }\n\n $value = $child_items;\n }\n\n // If we're not in interactive mode, there's nothing more to do for this\n // command other than use the default value. That's already set in the\n // component data.\n\n if (!$user_specified && $interactive) {\n // Prompt the user for a property we've not already got user input for.\n\n // Turn empty defaults into a value that Drush won't output.\n $default = empty($component_data[$property_name]) ? NULL : $component_data[$property_name];\n\n if ($property_info['format'] == 'compound') {\n // For compound properties, allow the user to enter as many items as\n // they like, prompting for all the child properties for each item.\n // Entering an empty value for the first child property ends the\n // handling of the compound property.\n $delta = 0;\n $child_property_names = array_keys($property_info['properties']);\n while (TRUE) {\n // Initialize a new child item so a default value can be placed\n // into it.\n $value[$delta] = [];\n\n foreach ($property_info['properties'] as $child_property_name => &$child_property_info) {\n // Prepare the child property so we get defaults.\n // (The call to prepare the compound property will have already\n // filled in defaults, but it's safe to call this again.)\n $mb_task_handler_generate->prepareComponentDataProperty($child_property_name, $child_property_info, $value[$delta]);\n\n // Turn empty defaults into a value that Drush won't output.\n $default = empty($value[$delta][$child_property_name]) ? NULL : $value[$delta][$child_property_name];\n\n // The first child property gets special treatment: don't propose a\n // default for it, and force it to be non-required. This is because\n // otherwise it would be impossible to leave the loop of collecting\n // child items, as leaving this property empty is the way for the\n // user to cause that.\n $first_child = ($child_property_name == $child_property_names[0]);\n\n if ($first_child) {\n $default = '';\n }\n\n // Add the parent label so we can use it in prompts.\n $child_property_info['parent_label'] = $property_info['label'];\n\n $child_value = module_builder_drush_interactive_prompt($child_property_name, $child_property_info, $component_data[$child_property_name], $default, $delta, $first_child);\n\n // If the first property is empty, stop collecting child items.\n if ($first_child && empty($child_value)) {\n // Bail on both the while and the foreach loops: XKCD dinosaur!\n // Remove the child item we created for this delta, as nothing's\n // been put in it.\n unset($value[$delta]);\n\n goto endcompound;\n }\n\n $value[$delta][$child_property_name] = $child_value;\n }\n\n $delta++;\n }\n endcompound:\n }\n else {\n $value = module_builder_drush_interactive_prompt($property_name, $property_info, $component_data, $default);\n }\n } // End interactive.\n\n // Split up the value if it should be an array.\n if ($property_info['format'] == 'array' && !is_array($value)) {\n $value = preg_split('/\\s+/', $value, -1, PREG_SPLIT_NO_EMPTY);\n }\n\n // Process compound properties into the expected format.\n if ($property_info['format'] == 'compound' && !is_array($value)) {\n $value = preg_split('/\\s+/', $value, -1, PREG_SPLIT_NO_EMPTY);\n\n // For now, a compound property is input in direct mode as a flat array,\n // where we take each array element to be the first child property.\n $child_properties = $property_info['properties'];\n $first_child_property = array_shift(array_keys($child_properties));\n\n $items = [];\n foreach ($value as $single_value) {\n $items[][$first_child_property] = $single_value;\n // Defaults for other child properties will be filled in by the\n // process stage.\n }\n $value = $items;\n }\n\n // Perform any processing specific to drush.\n if (isset($property_info['drush_value_process'])) {\n $callback = $property_info['drush_value_process'];\n $value = $callback($value);\n }\n\n // Set the value in the component data array.\n $component_data[$property_name] = $value;\n }\n\n\n // Generate the component.\n $files = $mb_task_handler_generate->generateComponent($component_data);\n\n $component_dir = module_builder_get_component_folder($component_type, $component_data['root_name']);\n\n // Finally, output the files!\n module_builder_drush_output_code($component_dir, $files);\n}", "function __buildGDL()\n {\n $gdl = new SwimTeamJobsAdminGUIDataList('Swim Team Jobs',\n '100%', 'jobstatus, jobposition', false) ;\n\n $gdl->set_alternating_row_colors(true) ;\n $gdl->set_show_empty_datalist_actionbar(true) ;\n\n return $gdl ;\n }", "public function createCommand()\r\n\t{\r\n\t\t//start the string\r\n\t\t$command = '';\r\n\t\t\r\n\t\t//add the java command or the path to java\r\n\t\t$command .= $this->java_path;\r\n\t\t\r\n\t\t//add the class path\r\n\t\t$command .= ' -cp \"'. $this->stanford_path . $this->seperator . '*\" ';\r\n\t\t\r\n\t\t//add options\r\n\t\t$options = implode(' ', $this->java_options);\r\n\t\t$command .= '-'.$options;\r\n\t\t\r\n\t\t//add the call to the pipeline object\r\n\t\t$command .= ' edu.stanford.nlp.pipeline.StanfordCoreNLP ';\r\n\r\n\t\t//add the annotators\r\n\t\t$command .= '-annotators '. $this->listAnnotators();\r\n\t\t\r\n\t\t//add the input and output directors\r\n\t\t$command .= ' -file '. $this->tmp_file . ' -outputDirectory '. $this->tmp_path;\r\n\t\t\r\n\t\t//this is for testing purposes\r\n\t\t//$command .= ' -file '. $this->tmp_path .'\\\\nlp3F25.tmp' . ' -outputDirectory '. $this->tmp_path;\r\n\t\t\r\n\t\t//if using regexner add this to the command string\r\n\t\tif($this->annotators['regexner'] === true)\r\n\t\t{\r\n\t\t\t$command .=' -regexner.mapping '. $this->regexner_path . $this->seperator . $this->regexner_file;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn $command;\r\n\t}", "public function build(\\stdClass $settings) {\n\t\t$this->sourcePath = $settings->target === \\Utils\\Constants::TARGET_NETTE_DATABASE ? \"/../Templates/$settings->templateName/model/nette-database/base.latte\" : \"/../Templates/$settings->templateName/model/doctrine2/base.latte\";\n\t\t$this->destinationPath = $settings->moduleName ? __DIR__ . \"$this->projectPath/{$settings->moduleName}Module/models/BaseRepository.php\" : __DIR__ . \"$this->projectPath/models/BaseRepository.php\";\n\t\t$this->params['moduleName'] = $settings->moduleName ? \"\\\\{$settings->moduleName}Module\" : NULL;\n\t\t$this->saveTemplate();\n\t\t\n\t\t$this->sourcePath = $settings->target === \\Utils\\Constants::TARGET_NETTE_DATABASE ? \"/../Templates/$settings->templateName/Model/nette-database/custom.latte\" : \"/../Templates/$settings->templateName/model/doctrine2/custom.latte\";\n\t\t$this->destinationPath = $settings->moduleName ? __DIR__ . \"$this->projectPath/{$settings->moduleName}Module/models/CustomRepository.php\" : __DIR__ . \"$this->projectPath/models/CustomRepository.php\";\n\t\t$this->params['moduleName'] = $settings->moduleName ? \"\\\\{$settings->moduleName}Module\" : NULL;\n\t\t$this->saveTemplate();\n\t}", "public function compileStoreDat() {}", "function run()\n{\n global $argv;\n\n $accountFrom = $argv[1];\n $accountTo = $argv[2];\n $value = (int) $argv[3];\n\n $transferService = (new TransferServiceFactory())();\n $transferService->execute($accountFrom, $accountTo, $value);\n}", "function __construct() {\n \n self::setQuantumVars();\n \n self::setAutoLoader();\n \n self::initActiveRecord();\n \n self::initSmarty();\n \n self::launcher();\n \n self::output();\n \n }", "function generateJsClass(& $Code, & $Description) {\r\n ob_start();\r\n ?>\r\n\r\nfunction\r\n <?php echo $Description->Class; ?>\r\n() { var oParent = new JPSpan_RemoteObject(); if ( arguments[0] ) {\r\noParent.Async(arguments[0]); } oParent.__remoteClass = '\r\n <?php echo $Description->Class; ?>\r\n'; oParent.__request = new\r\n <?php echo $this->jsRequestClass;\r\n ?>\r\n(new\r\n <?php echo $this->jsEncodingClass; ?>\r\n());\r\n <?php\r\n foreach ( $Description->methods as $method => $url ) {\r\n ?>\r\n\r\n// @access public oParent.\r\n <?php echo $method; ?>\r\n= function() { return this.__call('\r\n <?php echo $url; ?>\r\n',arguments,'\r\n <?php echo $method; ?>\r\n'); };\r\n <?php\r\n }\r\n ?>\r\n\r\nreturn oParent; }\r\n\r\n <?php\r\n $Code->append(ob_get_contents());\r\n ob_end_clean();\r\n }", "public function main()\n {\n $className = $this->fullyQualifiedClassName();\n $templatePath = $this->template();\n $destinationDir = $this->destinationDir();\n $destinationFile = $this->destinationFile();\n\n if (!file_exists($templatePath)) {\n $this->error(sprintf('Given template file path does not exists [%s]', $templatePath));\n return 1;\n }\n \n if ($this->opt('force') === false && file_exists($destinationFile)) {\n $this->error(sprintf(\n '\\'%s\\' already exists. Use --force to directly replaces it.', \n $className\n ));\n return 2;\n }\n\n $name = $this->name();\n $namespace = $this->fullNamespace();\n\n $placeholders = $this->preparedPlaceholders();\n $placeholders['{{name}}'] = $name;\n $placeholders['{{namespace}}'] = $namespace;\n \n $template = file_get_contents($templatePath);\n\n $constructor = $this->opt('constructor') === true ? $this->constructor() : '';\n $template = str_replace('{{constructor}}', $constructor, $template);\n\n $template = str_replace(\n array_keys($placeholders), array_values($placeholders), $template\n );\n\n if (!is_dir($destinationDir)) {\n mkdir($destinationDir, '0755', true);\n }\n file_put_contents($destinationFile, $template);\n\n $this->info(sprintf('%s created with success!', $className));\n $this->info(sprintf('File: %s', $destinationFile));\n\n return 0;\n }", "public function main() {\n\n $fs = new Filesystem();\n\n $fs->touch($this->getTargetFile());\n\n $seedProperties = Yaml::parse(file_get_contents($this->getSeedFile()));\n $generatedProperties = [];\n\n $generatedProperties['label'] = $seedProperties['project_label'];\n $generatedProperties['machineName'] = $seedProperties['project_name'];\n $generatedProperties['group'] = $seedProperties['project_group'];\n $generatedProperties['basePath'] = '${current.basePath}';\n $generatedProperties['type'] = $seedProperties['project_type'];\n $generatedProperties['repository']['main'] = $seedProperties['project_git_repository'];\n $generatedProperties['php'] = $seedProperties['project_php_version'];\n\n // Add platform information.\n if (isset($generatedProperties['platform'])) {\n $generatedProperties['platform'] = $seedProperties['platform'];\n }\n\n $fs->dumpFile($this->getTargetFile(), Yaml::dump($generatedProperties, 5, 2));\n }", "public function build()\n {\n $this->classMetadata->appendExtension($this->getExtensionName(), [\n 'groups' => [\n $this->fieldName,\n ],\n ]);\n }", "public static function build()\n {\n return call_user_func_array([(new static), 'serialize'], func_get_args());\n }", "public function Bin_Build_Save()\n\t{\t\t\n\t\t$config = $this->readConfigFile();\t//invoking web.xml parsing\n\t\t$appsetup = $this->buildAppSetup($config); //creating app setup array\n\t\t$sysfiles = $this->buildSystemConfig($config); //creating system config array\n\t\t$libraries = $this->buildLibraryConfig($config); //creating library config array\n\t\t$controllers = $this->buildControllerConfig($config); //creating controller config array\t\t\t\n\n\t\t/**\n\t\t * All xml information will be converted in to an array\n\t\t * based on the root folder it will be stored as dll file\n\t\t * in the following we checking whether this configuration file\n\t\t * is related to this root folder.\n\t\t */\n\t\tif(!$controllers)\n\t\t\treturn false;\n\t\t\t\n\t\t$content = \"<?php \\n\\n\".' $system = '.var_export($sysfiles, true) . \";\\n\";\n\t\t$content .= \"\\n\\n\".' $appsetup = '.var_export($appsetup, true) . \";\\n \";\n\t\t$content .= \"\\n\\n\".' $libraries = '.var_export($libraries, true) . \";\\n \";\n\t\t$content .= \"\\n\\n\".' $domapping = '.var_export($controllers['domapping'], true) . \";\\n \";\n\t\t$content .= \"\\n\\n\".' $globalmapping = '.var_export($controllers['globalmapping'], true) . \";\\n ?>\";\n\n\t\t@mkdir(ROOT_FOLDER.'Built/'.CURRENT_FOLDER,0777);\n\t\t@chmod(ROOT_FOLDER.'Built/'.CURRENT_FOLDER,0777);\n\t\t\n\t\tif ($fp = @fopen(ROOT_FOLDER.'Built/'.CURRENT_FOLDER.\"/Dll.php\", 'wb'))\n\t\t{\n\t\t\t@flock($fp, LOCK_EX);\t\t\t\n\t\t\tfwrite($fp, $content);\n\t\t\t@flock($fp, LOCK_UN);\n\t\t\tfclose($fp);\n\t\t\t@chmod(ROOT_FOLDER.'Built/'.CURRENT_FOLDER.\"/Dll.php\", 0666);\n\t\t}\t\n\t}", "function buildzip() {\n\t\t// make list of files to include\n\t\t$files = array_keys(index());\n\t\tforeach($_POST as $p => $v) if (substr($p, 0, 6) == 'build_') $files[] = substr($p, 6).'.php';\n\n\t\t// get the base script to modify\n\t\t$hypha = file_get_contents('hypha.php');\n\n\t\t// insert superuser name and password\n\t\t$hypha = preg_replace('/\\$username = \\'.*?\\';/', '\\$username = \\''.$_POST['username'].'\\';', $hypha);\n\t\t$hypha = preg_replace('/\\$password = \\'.*?\\';/', '\\$password = \\''.$_POST['password'].'\\';', $hypha);\n\n\t\t// build data library of zipped files to include\n\t\t$data = \"\t\t\t//START_OF_DATA\\n\";\n\t\t$data .= '\t\t\tcase \\'index\\': $zip = \"'.base64_encode(gzencode(implode(',', array_keys(index())), 9)).'\"; break;'.\"\\n\";\n\t\tforeach ($files as $file) $data.= '\t\t\tcase \\''.$file.'\\': $zip = \"'.base64_encode(gzencode(file_get_contents($file), 9)).'\"; break;'.\"\\n\";\n\t\t$data .= \"\t\t\t//END_OF_DATA\\n\";\n\n\t\t// include data library\n\t\t$hypha = preg_replace('#^\\t*//START_OF_DATA\\n.*//END_OF_DATA\\n#ms', $data, $hypha);\n\n\t\t// push script to client\n\t\theader('Content-Type: application/octet-stream');\n\t\theader('Content-Disposition: attachment; filename=\"hypha.php\"');\n\t\techo $hypha;\n\t\texit;\n\t}", "public function generate()\n\t{\n\t\t$this->import('Database');\n\n\t\t$arrButtons = array('copy', 'up', 'down', 'delete');\n\t\t$strCommand = 'cmd_' . $this->strField;\n\n\t\t// Change the order\n\t\tif ($this->Input->get($strCommand) && is_numeric($this->Input->get('cid')) && $this->Input->get('id') == $this->currentRecord)\n\t\t{\n\t\t\tswitch ($this->Input->get($strCommand))\n\t\t\t{\n\t\t\t\tcase 'copy':\n\t\t\t\t\t$this->varValue = array_duplicate($this->varValue, $this->Input->get('cid'));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'up':\n\t\t\t\t\t$this->varValue = array_move_up($this->varValue, $this->Input->get('cid'));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'down':\n\t\t\t\t\t$this->varValue = array_move_down($this->varValue, $this->Input->get('cid'));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'delete':\n\t\t\t\t\t$this->varValue = array_delete($this->varValue, $this->Input->get('cid'));\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// Get all modules from DB\n\t\t$objModules = $this->Database->execute(\"SELECT id, name FROM tl_module ORDER BY name\");\n\t\t$modules = array();\n\n\t\tif ($objModules->numRows)\n\t\t{\n\t\t\t$modules = array_merge($modules, $objModules->fetchAllAssoc());\n\t\t}\n\n\t\t$objRow = $this->Database->prepare(\"SELECT * FROM \" . $this->strTable . \" WHERE id=?\")\n\t\t\t\t\t\t\t\t ->limit(1)\n\t\t\t\t\t\t\t\t ->execute($this->currentRecord);\n\n\t\t// Columns\n\t\tif ($objRow->numRows)\n\t\t{\n\t\t\t$cols = array();\n\t\t\t$count = count(explode('x',$objRow->sc_type));\n\n\t\t\tswitch ($count)\n\t\t\t{\n\t\t\t\tcase '2':\n\t\t\t\t\t$cols[] = 'first';\n\t\t\t\t\t$cols[] = 'second';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase '3':\n\t\t\t\t\t$cols[] = 'first';\n\t\t\t\t\t$cols[] = 'second';\n\t\t\t\t\t$cols[] = 'third';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase '4':\n\t\t\t\t\t$cols[] = 'first';\n\t\t\t\t\t$cols[] = 'second';\n\t\t\t\t\t$cols[] = 'third';\n\t\t\t\t\t$cols[] = 'fourth';\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase '5':\n\t\t\t\t\t$cols[] = 'first';\n\t\t\t\t\t$cols[] = 'second';\n\t\t\t\t\t$cols[] = 'third';\n\t\t\t\t\t$cols[] = 'fourth';\n\t\t\t\t\t$cols[] = 'fifth';\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t\n\t\t}\n\n\t\t// Get new value\n\t\tif ($this->Input->post('FORM_SUBMIT') == $this->strTable)\n\t\t{\n\t\t\t$this->varValue = $this->Input->post($this->strId);\n\t\t}\n\n\t\t// Make sure there is at least an empty array\n\t\tif (!is_array($this->varValue) || !$this->varValue[0])\n\t\t{\n\t\t\t$this->varValue = array('');\n\t\t}\n\n\t\telse\n\t\t{\n\t\t\t// Initialize sorting order\n\t\t\tforeach ($cols as $col)\n\t\t\t{\n\t\t\t\t$arrCols[$col] = array();\n\t\t\t}\n\n\t\t\tforeach ($this->varValue as $v)\n\t\t\t{\n\t\t\t\t// Add only modules of an active section\n\t\t\t\tif (in_array($v['col'], $cols))\n\t\t\t\t{\n\t\t\t\t\t$arrCols[$v['col']][] = $v;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->varValue = array();\n\n\t\t\tforeach ($arrCols as $arrCol)\n\t\t\t{\n\t\t\t\t$this->varValue = array_merge($this->varValue, $arrCol);\n\t\t\t}\n\t\t}\n\n\t\t// Save the value\n\t\tif ($this->Input->get($strCommand) || $this->Input->post('FORM_SUBMIT') == $this->strTable)\n\t\t{\n\t\t\t$this->Database->prepare(\"UPDATE \" . $this->strTable . \" SET \" . $this->strField . \"=? WHERE id=?\")\n\t\t\t\t\t\t ->execute(serialize($this->varValue), $this->currentRecord);\n\n\t\t\t// Reload the page\n\t\t\tif (is_numeric($this->Input->get('cid')) && $this->Input->get('id') == $this->currentRecord)\n\t\t\t{\n\t\t\t\t$this->redirect(preg_replace('/&(amp;)?cid=[^&]*/i', '', preg_replace('/&(amp;)?' . preg_quote($strCommand, '/') . '=[^&]*/i', '', $this->Environment->request)));\n\t\t\t}\n\t\t}\n\n\t\t// Add label and return wizard\n\t\t$return .= '<table cellspacing=\"0\" cellpadding=\"0\" id=\"ctrl_'.$this->strId.'\" class=\"tl_modulewizard\" summary=\"Module wizard\">\n <thead>\n <tr>\n <td>'.$GLOBALS['TL_LANG'][$this->strTable]['module'].'</td>\n <td>'.$GLOBALS['TL_LANG'][$this->strTable]['column'].'</td>\n <td>&nbsp;</td>\n </tr>\n </thead>\n <tbody>';\n\n\t\t// Load tl_article language file\n\t\t$this->loadLanguageFile('tl_article');\n\n\t\t// Add input fields\n\t\tfor ($i=0; $i<count($this->varValue); $i++)\n\t\t{\n\t\t\t$options = '';\n\n\t\t\t// Add modules\n\t\t\tforeach ($modules as $v)\n\t\t\t{\n\t\t\t\t$options .= '<option value=\"'.specialchars($v['id']).'\"'.$this->optionSelected($v['id'], $this->varValue[$i]['mod']).'>'.$v['name'].'</option>';\n\t\t\t}\n\n\t\t\t$return .= '\n <tr>\n <td><select name=\"'.$this->strId.'['.$i.'][mod]\" class=\"tl_select\" onfocus=\"Backend.getScrollOffset();\">'.$options.'</select></td>';\n\n\t\t\t$options = '';\n\n\t\t\t// Add column\n\t\t\tforeach ($cols as $v)\n\t\t\t{\n\t\t\t\t$options .= '<option value=\"'.specialchars($v).'\"'.$this->optionSelected($v, $this->varValue[$i]).'>'. ((isset($GLOBALS['TL_LANG']['CTE'][$v]) && !is_array($GLOBALS['TL_LANG']['CTE'][$v])) ? $GLOBALS['TL_LANG']['CTE'][$v] : $v) .'</option>';\n\t\t\t}\n\n\t\t\t$return .= '\n <td><select name=\"'.$this->strId.'['.$i.'][col]\" class=\"tl_select_column\" onfocus=\"Backend.getScrollOffset();\">'.$options.'</select></td>\n <td>';\n\n\t\t\tforeach ($arrButtons as $button)\n\t\t\t{\n\t\t\t\t$return .= '<a href=\"'.$this->addToUrl('&amp;'.$strCommand.'='.$button.'&amp;cid='.$i.'&amp;id='.$this->currentRecord).'\" title=\"'.specialchars($GLOBALS['TL_LANG'][$this->strTable]['wz_'.$button]).'\" onclick=\"Backend.moduleWizard(this, \\''.$button.'\\', \\'ctrl_'.$this->strId.'\\'); return false;\">'.$this->generateImage($button.'.gif', $GLOBALS['TL_LANG'][$this->strTable]['wz_'.$button], 'class=\"tl_listwizard_img\"').'</a> ';\n\t\t\t}\n\n\t\t\t$return .= '</td>\n </tr>';\n\t\t}\n\n\t\treturn $return.'\n </tbody>\n </table>';\n\t}", "public function Create()\n {\n parent::Create();\n\n $this->RegisterPropertyString('Host', '');\n $this->RegisterPropertyString('Username', '');\n $this->RegisterPropertyString('Password', '');\n $this->RegisterPropertyString('Database', 'IPS');\n $this->RegisterPropertyString('Variables', json_encode([]));\n $this->RegisterTimer('LogData', 0, 'ACmySQL_LogData($_IPS[\\'TARGET\\']);');\n $this->Vars = [];\n $this->Buffer = [];\n }", "protected function buildClass($name)\n {\n\n $stub = $this->files->get($this->getStub());\n $tableName = $this->argument('name');\n $className = 'Create' . str_replace(' ', '', ucwords(str_replace('_', ' ', $tableName))) . 'Table';\n\n $fieldsToIndex = trim($this->option('indexes')) != '' ? explode(',', $this->option('indexes')) : [];\n $foreignKeys = trim($this->option('foreign-keys')) != '' ? explode(',', $this->option('foreign-keys')) : [];\n\n $schema = rtrim($this->option('schema'), ';');\n $fields = explode(';', $schema);\n\n $data = array();\n\n if ($schema) {\n $x = 0;\n foreach ($fields as $field) {\n\t\t\t\t\n $fieldArray = explode('#', $field);\n $data[$x]['name'] = trim($fieldArray[0]);\n\t\t\t\t$types = explode('|',$fieldArray[1]);\n\t\t\t\t$type = array_shift($types);\n $data[$x]['type'] = $type;\n if ((Str::startsWith($type, 'select')|| Str::startsWith($type, 'enum')) && isset($fieldArray[2])) {\n $options = trim($fieldArray[2]);\n $data[$x]['options'] = str_replace('options=', '', $options);\n }\n\t\t\t\t//string:30|default:'ofumbi'|nullable\n\t\t\t\t$data[$x]['modifiers'] = [];\n\t\t\t\tif(count($types)){\n\t\t\t\t\t$modifierLookup = [\n\t\t\t\t\t\t'comment',\n\t\t\t\t\t\t'default',\n\t\t\t\t\t\t'first',\n\t\t\t\t\t\t'nullable',\n\t\t\t\t\t\t'unsigned',\n\t\t\t\t\t\t'unique',\n\t\t\t\t\t\t'charset',\n\t\t\t\t\t];\n\t\t\t\t\tforeach($types as $modification){\n\t\t\t\t\t\t$variables = explode(':',$modification);\n\t\t\t\t\t\t$modifier = array_shift($variables);\n\t\t\t\t\t\tif(!in_array(trim($modifier), $modifierLookup)) continue;\n\t\t\t\t\t\t$variables = $variables[0]??\"\";\n\t\t\t\t\t\t$data[$x]['modifiers'][] = \"->\" . trim($modifier) . \"(\".$variables.\")\";\n\t\t\t\t\t}\n\t\t\t\t}\n $x++;\n }\n }\n\n $tabIndent = ' ';\n\n $schemaFields = '';\n foreach ($data as $item) {\n\t\t\t$data_type = explode(':',$item['type']);\n\t\t\t$item_type = array_shift($data_type);\n\t\t\t$variables = isset($data_type[0])?\",\".$data_type[0]:\"\";\n if (isset($this->typeLookup[$item_type ])) {\n $type = $this->typeLookup[$item_type];\n if (!empty($item['options'])) {\n $enumOptions = array_keys(json_decode($item['options'], true));\n $enumOptionsStr = implode(\",\", array_map(function ($string) {\n return '\"' . $string . '\"';\n }, $enumOptions));\n $schemaFields .= \"\\$table->enum('\" . $item['name'] . \"', [\" . $enumOptionsStr . \"])\";\n } elseif($item['name']==\"uuid\") {\n $schemaFields .= \"\\$table->uuid('\" . $item['name'] . \"')\";\n }else {\n $schemaFields .= \"\\$table->\" . $type . \"('\" . $item['name'] . \"'\".$variables.\")\";\n }\n } else {\n \t if (!empty($item['options'])) {\n $enumOptions = array_keys(json_decode($item['options'], true));\n $enumOptionsStr = implode(\",\", array_map(function ($string) {\n return '\"' . $string . '\"';\n }, $enumOptions));\n $schemaFields .= \"\\$table->enum('\" . $item['name'] . \"', [\" . $enumOptionsStr . \"])\";\n } elseif($item['name']==\"uuid\") {\n $schemaFields .= \"\\$table->uuid('\" . $item['name'] . \"')\";\n }else {\n $schemaFields .= \"\\$table->string('\" . $item['name'] . \"'\".$variables.\")\";\n }\n }\n\n // Append column modifier\n $schemaFields .= implode(\"\",$item['modifiers']);\n $schemaFields .= \";\\n\" . $tabIndent . $tabIndent . $tabIndent;\n }\n\n // add indexes and unique indexes as necessary\n foreach ($fieldsToIndex as $fldData) {\n $line = trim($fldData);\n\n // is a unique index specified after the #?\n // if no hash present, we append one to make life easier\n if (strpos($line, '#') === false) {\n $line .= '#';\n }\n\n // parts[0] = field name (or names if pipe separated)\n // parts[1] = unique specified\n $parts = explode('#', $line);\n if (strpos($parts[0], '|') !== 0) {\n $fieldNames = \"['\" . implode(\"', '\", explode('|', $parts[0])) . \"']\"; // wrap single quotes around each element\n } else {\n $fieldNames = trim($parts[0]);\n }\n\n if (count($parts) > 1 && $parts[1] == 'unique') {\n $schemaFields .= \"\\$table->unique(\" . trim($fieldNames) . \")\";\n } else {\n $schemaFields .= \"\\$table->index(\" . trim($fieldNames) . \")\";\n }\n\n $schemaFields .= \";\\n\" . $tabIndent . $tabIndent . $tabIndent;\n }\n\n // foreign keys\n foreach ($foreignKeys as $fk) {\n $line = trim($fk);\n\n $parts = explode('#', $line);\n\n // if we don't have three parts, then the foreign key isn't defined properly\n // --foreign-keys=\"foreign_entity_id#id#foreign_entity#onDelete#onUpdate\"\n if (count($parts) == 3) {\n $schemaFields .= \"\\$table->foreign('\" . trim($parts[0]) . \"')\"\n . \"->references('\" . trim($parts[1]) . \"')->on('\" . trim($parts[2]) . \"')\";\n } elseif (count($parts) == 4) {\n $schemaFields .= \"\\$table->foreign('\" . trim($parts[0]) . \"')\"\n . \"->references('\" . trim($parts[1]) . \"')->on('\" . trim($parts[2]) . \"')\"\n . \"->onDelete('\" . trim($parts[3]) . \"')\" . \"->onUpdate('\" . trim($parts[3]) . \"')\";\n } elseif (count($parts) == 5) {\n $schemaFields .= \"\\$table->foreign('\" . trim($parts[0]) . \"')\"\n . \"->references('\" . trim($parts[1]) . \"')->on('\" . trim($parts[2]) . \"')\"\n . \"->onDelete('\" . trim($parts[3]) . \"')\" . \"->onUpdate('\" . trim($parts[4]) . \"')\";\n } else {\n continue;\n }\n\n $schemaFields .= \";\\n\" . $tabIndent . $tabIndent . $tabIndent;\n }\n\n $primaryKey = $this->option('pk');\n $softDeletes = $this->option('soft-deletes');\n\n $softDeletesSnippets = '';\n if ($softDeletes == 'yes') {\n $softDeletesSnippets = \"\\$table->softDeletes();\\n\" . $tabIndent . $tabIndent . $tabIndent;\n }\n\n $schemaUp =\n \"Schema::create('\" . $tableName . \"', function (Blueprint \\$table) {\n \\$table->bigIncrements('\" . $primaryKey . \"');\n \\$table->timestamps();\\n\" . $tabIndent . $tabIndent . $tabIndent .\n $softDeletesSnippets .\n $schemaFields .\n \"});\";\n\n $schemaDown = \"Schema::drop('\" . $tableName . \"');\";\n\n return $this->replaceSchemaUp($stub, $schemaUp)\n ->replaceSchemaDown($stub, $schemaDown)\n ->replaceClass($stub, $className);\n }", "public function createBaseClasses() {\n $config = array_merge($this->terrecord->getConfig('setting'),$this->terrecord->getConfig('db'));\n $config['ext'] = $this->config['file_ext'];\n $config['db_type'] = $this->config['db_type'];\n $config['see'] = array();\n $config['params'] = array();\n $outputpath = $this->config['output'];\n \n // Connection\n $config['name'] = 'connection';\n $config['desc'] = 'the database connection class';\n $config['generate_type'] = 'baseclass';\n $contents = $this->smarty->fetch('fuelphp/baseclass/connection.tpl',$config);\n\n $fh = fopen($outputpath.'connection.php','w');\n fwrite($fh,$contents);\n fclose($fh);\n\n // TerRecord\n $config['name'] = 'terrecord';\n $config['desc'] = '';\n $config['generate_type'] = 'baseclass';\n $contents = $this->smarty->fetch('fuelphp/baseclass/terrecord.tpl',$config);\n\n $fh = fopen($outputpath.'terrecord.php','w');\n fwrite($fh,$contents);\n fclose($fh);\n\n // TerLoader\n $config['name'] = 'terrecordloader';\n $config['desc'] = '';\n $config['generate_type'] = 'baseclass';\n $contents = $this->smarty->fetch('fuelphp/baseclass/terrecordloader.tpl',$config);\n\n $fh = fopen($outputpath.'terrecordloader.php','w');\n fwrite($fh,$contents);\n fclose($fh);\n\n // TerList\n $config['name'] = 'terlist';\n $config['desc'] = '';\n $config['generate_type'] = 'baseclass';\n $contents = $this->smarty->fetch('fuelphp/baseclass/terlist.tpl',$config);\n\n $fh = fopen($outputpath.'terlist.php','w');\n fwrite($fh,$contents);\n fclose($fh);\n\n // TerListLoader\n $config['name'] = 'terlistloader';\n $config['desc'] = '';\n $config['generate_type'] = 'baseclass';\n $contents = $this->smarty->fetch('fuelphp/baseclass/terlistloader.tpl',$config);\n\n $fh = fopen($outputpath.'terlistloader.php','w');\n fwrite($fh,$contents);\n fclose($fh);\n }", "public function __construct()\r\n {\r\n if(3 == func_num_args())\r\n {\r\n $this->destination = func_get_arg(0);\r\n $this->hsCode = func_get_arg(1);\r\n $this->source = func_get_arg(2);\r\n }\r\n }", "public function __construct(){\n\n parent::__construct();\n \n $this->cfg_jsincdir=$this->getFileName($this->cfg_jsincdir);\n $this->cfg_jquerylink=$this->getFileName($this->cfg_jquerylink);\n $this->cfg_jquerylinkmin=$this->getFileName($this->cfg_jquerylinkmin);\n $this->cfg_jqueryuilink=$this->getFileName($this->cfg_jqueryuilink);\n $this->cfg_jqueryuicsslink=$this->getFileName($this->cfg_jqueryuicsslink);\n $this->cfg_dojolink=$this->getFileName($this->cfg_dojolink); \n \n }", "public function run()\n {\n \\App\\AdminTaskType::create([ 'name' => 'Phone', 'system' => 1, 'active' => 1, ]);\n \\App\\AdminTaskType::create([ 'name' => 'Text', 'system' => 1, 'active' => 1, ]);\n \\App\\AdminTaskType::create([ 'name' => 'Email', 'system' => 1, 'active' => 1, ]);\n \\App\\AdminTaskType::create([ 'name' => 'Mail', 'system' => 1, 'active' => 1, ]);\n \\App\\AdminTaskType::create([ 'name' => 'Newsletter', 'system' => 1, 'active' => 1, ]);\n \\App\\AdminTaskType::create([ 'name' => 'Note', 'system' => 1, 'active' => 1, ]);\n }", "function run()\n\t{\n\t\t//-----------------------------------------\n\t\t// Any \"extra\" configs required for this driver?\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( is_array( $this->install->saved_data ) and count( $this->install->saved_data ) )\n\t\t{\n\t\t\tforeach( $this->install->saved_data as $k => $v )\n\t\t\t{\n\t\t\t\tif ( preg_match( \"#^__sql__#\", $k ) )\n\t\t\t\t{\n\t\t\t\t\t$k = str_replace( \"__sql__\", \"\", $k );\n\t\t\t\t\n\t\t\t\t\t$this->install->ipsclass->vars[ $k ] = $v;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* Switch */\n\t\tswitch( $this->install->ipsclass->input['sub'] )\n\t\t{\n\t\t\tcase 'sql':\n\t\t\t\t$this->install_sql();\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'settings':\n\t\t\t\t$this->install_settings();\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'acpperms':\n\t\t\t\t$this->install_acpperms();\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'templates':\n\t\t\t\t$this->install_templates();\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'other':\n\t\t\t\t$this->install_other();\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'caches':\n\t\t\t\t$this->install_caches();\n\t\t\tbreak;\n\t\t\t\n\t\t\tdefault:\n\t\t\t\t/* Output */\n\t\t\t\t$this->install->template->append( $this->install->template->install_page() );\t\t\n\t\t\t\t$this->install->template->next_action = '?p=install&sub=sql';\n\t\t\t\t$this->install->template->hide_next = 1;\n\t\t\tbreak;\t\n\t\t}\n\t}", "protected function _generate()\n {\n $filters = $this->_params['storage']\n ->retrieve(Ingo_Storage::ACTION_FILTERS);\n\n $this->_addItem(Ingo::RULE_ALL, new Ingo_Script_Procmail_Comment(_(\"procmail script generated by Ingo\") . ' (' . date('F j, Y, g:i a') . ')'));\n\n if (isset($this->_params['forward_file']) &&\n isset($this->_params['forward_string'])) {\n $this->_addItem(\n Ingo::RULE_ALL,\n new Ingo_Script_String($this->_params['forward_string']),\n $this->_params['forward_file']\n );\n }\n\n /* Add variable information, if present. */\n if (!empty($this->_params['variables']) &&\n is_array($this->_params['variables'])) {\n foreach ($this->_params['variables'] as $key => $val) {\n $this->_addItem(Ingo::RULE_ALL, new Ingo_Script_Procmail_Variable(array('name' => $key, 'value' => $val)));\n }\n }\n\n foreach ($filters->getFilterList($this->_params['skip']) as $filter) {\n switch ($filter['action']) {\n case Ingo_Storage::ACTION_BLACKLIST:\n $this->generateBlacklist(!empty($filter['disable']));\n break;\n\n case Ingo_Storage::ACTION_WHITELIST:\n $this->generateWhitelist(!empty($filter['disable']));\n break;\n\n case Ingo_Storage::ACTION_VACATION:\n $this->generateVacation(!empty($filter['disable']));\n break;\n\n case Ingo_Storage::ACTION_FORWARD:\n $this->generateForward(!empty($filter['disable']));\n break;\n\n default:\n if (in_array($filter['action'], $this->_actions)) {\n /* Create filter if using AND. */\n if ($filter['combine'] == Ingo_Storage::COMBINE_ALL) {\n $recipe = new Ingo_Script_Procmail_Recipe($filter, $this->_params);\n if (!$filter['stop']) {\n $recipe->addFlag('c');\n }\n foreach ($filter['conditions'] as $condition) {\n $recipe->addCondition($condition);\n }\n $this->_addItem(Ingo::RULE_FILTER, new Ingo_Script_Procmail_Comment($filter['name'], !empty($filter['disable']), true));\n $this->_addItem(Ingo::RULE_FILTER, $recipe);\n } else {\n /* Create filter if using OR */\n $this->_addItem(Ingo::RULE_FILTER, new Ingo_Script_Procmail_Comment($filter['name'], !empty($filter['disable']), true));\n $loop = 0;\n foreach ($filter['conditions'] as $condition) {\n $recipe = new Ingo_Script_Procmail_Recipe($filter, $this->_params);\n if ($loop++) {\n $recipe->addFlag('E');\n }\n if (!$filter['stop']) {\n $recipe->addFlag('c');\n }\n $recipe->addCondition($condition);\n $this->_addItem(Ingo::RULE_FILTER, $recipe);\n }\n }\n }\n }\n }\n\n // If an external delivery program is used, add final rule\n // to deliver to $DEFAULT\n if (isset($this->_params['delivery_agent'])) {\n $this->_addItem(Ingo::RULE_FILTER, new Ingo_Script_Procmail_Default($this->_params));\n }\n }", "public function backend_builder_data() {\n\t\t$script = FUSION_BUILDER_DEV_MODE ? 'fusion_builder_app_js' : 'fusion_builder';\n\t\twp_localize_script(\n\t\t\t$script,\n\t\t\t'fusionDynamicData',\n\t\t\t[\n\t\t\t\t'dynamicOptions' => $this->get_params(),\n\t\t\t\t'commonDynamicFields' => $this->get_common(),\n\t\t\t]\n\t\t);\n\t}", "protected function createUserDataScript() {\n\t\t$cdata_user = '\n\t\t\t//<![CDATA[\n\t\t\t var cursorImageUrl = \"'.$this->image_cursor_path.'\";\n\t\t\t var clickImageUrl = \"'.$this->image_click_path.'\";\n\t\t\t var recordingData = {\n\t\t\t \tvp_height: '.$this->viewPortHeight.',\n\t\t\t\tvp_width: '.$this->viewPortWidth.',\n\t\t\t\thovered: '.$this->hovered.',\n\t\t\t\tclicked: '.$this->clicked.',\n\t\t\t\tlost_focus: '.$this->lostFocus.',\n\t\t\t\tscrolls: '.$this->scrolls.',\n\t\t\t\tviewports: '.$this->viewports.'\n\t\t\t\t};\n\t\t\t window.parent.resizeFrame(recordingData.vp_height,recordingData.vp_width);\n\t\t\t//]]>\n\t\t\t';\n\t\t// create user data script\n\t\t$this->js_user_data = $this->doc->createInlineScript($cdata_user);\n\t}", "function _drush_build() {\n drush_invoke('updatedb');\n drush_invoke('features-revert-all', array('force' => TRUE));\n drush_invoke('cc', array('type' => 'all'));\n drush_log(dt('Built!'), 'success');\n}", "public function build() {\n $pref = new Pref(\"system\");\n $this->setMainTemplate($pref->template);\n\n\n if ($this->data['url']['application'] == \"admin\")\n $tpl = new Template(PATH_SITEADMIN_TEMPLATES);\n else\n $tpl = new Template(PATH_TEMPLATES);\n if (!USER_ID && !$this->isAllowed())\n header(\"location: \" . page(\"user\", \"login\"));\n\n if (!USER_ID && $this->isAllowed())\n $tpl->login = true;\n else\n $tpl->login = false;\n $tpl->loadFile(\"template.php\");\n $tpl->data = $this->data;\n $tpl->build();\n }", "public function __construct($POST) {\n\n\t\t$this->db_connect();\n\t\t\n\t\t//Set instance variables based on POST array\n\t\t$this->setpostdata($POST);\n\n\t\t//Set platform and project information\n\t\t$this->platform_info();\n\t\tif (!$this->dms_project)\n\t\t\t$this->project_info();\n\n\t\t//Set file metadata\n\t\t$this->mutter(\"\\nSetting object metadata...\");\n\t\t$data = $this->filedata();\n\t\t\n\t\t//Set output file names\n\t\t$root = \"{$this->ingest_file_directory}/{$this->entry}_{$this->lname}_{$this->folder}\";\n\t\t$this->ds_name = \"$root.data_set.ingest\";\n\t\t$this->dt_name = \"$root.device.ingest\";\n\t\t$this->do_name = \"$root.object.ingest\";\n\t\t$this->ei_name = \"$root.initiative.ingest\";\n\n\t\t//Set dataset and device metadata\n\t\t$this->mutter(\"\\nSetting data set and device metadata...\");\n\t\t$this->datasetdata();\n\t\t$this->devicedata();\n\t\tif ($this->initiative)\n\t\t\t$this->initiativedata();\n\n\t\t//Output files\n\t\t$this->mutter(\"\\nWriting data object ingest file \" . basename($this->do_name) . \"...\");\n\t\t$this->dataobjectfile($this->do_name);\n\n\t\t$this->mutter(\"\\nWriting data set ingest file \" . basename($this->ds_name) . \"...\");\n\t\t$this->datasetfile($this->ds_name);\n\n\t\t$this->mutter(\"\\nWriting device ingest file \" . basename($this->dt_name) . \"...\");\n\t\t$this->devicefile($this->dt_name);\n\n\t\tif ($this->ei_data) {\n\t\t\t$this->mutter(\"\\nWriting initiative ingest file \" . basename($this->ei_name) . \"...\");\n\t\t\t$this->entryinitiativefile($this->ei_name);\n\t\t}\n\t\t//Chmod for group write\n\t\tforeach (array($this->dt_name, $this->ds_name, $this->do_name, $this->ei_name) as $file) {\n\t\t\tif (file_exists($file))\n\t\t\t\tchmod($file, 0660);\n\t\t}\n\t\t$this->mutter(\"\\n\");\n\t}", "public function build(array $dataset);", "public function GenerateStructure() {\n // WRITE CONSTRUCTOR\n $this->writeLine(\n sprintf(\n '$return = new pdoMap_Dao_Metadata_Table(\n \\'%1$s\\',\\'%2$s\\',\\'%3$s\\',\n \\'%4$s\\',\\'%5$s\\',\\'%6$s\\');',\n $this->name, // adapter name\n $this->getTableName(), // table name\n $this->entity->getClassName(), // entity class name\n $this->getInterface(), // interface service name\n $this->getAdapterClassName(), // adapter class name (if set)\n $this->getUse() // database connection\n )\n );\n // WRITE PROPERTIES\n $this->entity->GenerateProperties(); \n $this->writeLine('return $return;');\n }", "public function run()\n {\n Type::create([\n 'name' => 'Prototype',\n 'speed' => 60,\n 'fuelUnits' => 10,\n 'milesPerUnit' => 10\n ]);\n Type::create([\n 'name' => 'Normal',\n 'speed' => 40,\n 'fuelUnits' => 20,\n 'milesPerUnit' => 5\n ]);\n Type::create([\n 'name' => 'TransContinental',\n 'speed' => 20,\n 'fuelUnits' => 50,\n 'milesPerUnit' => 30\n ]);\n }", "public function construct()\r\n\t{\r\n\t\t\r\n\t\t\r\n\t\t$class = ($this->classClr) ? 'w50 clr' : 'w50';\r\n\t\t$class = ($this->classLong) ? 'long clr' : $class;\r\n\t\t$class .= ($this->picker) ? ' wizard' : '';\r\n\t\t\r\n\t\t$wizard = ($this->picker == 'page') ? array(array('tl_content', 'pagePicker')) : false;\r\n\t\t\r\n\t\t// input unit\r\n\t\tif (($this->picker == 'unit'))\r\n\t\t{\r\n\t\t\t$options = array();\r\n\t\t\tforeach (deserialize($this->units) as $arrOption)\r\n\t\t\t{\r\n\t\t\t\t$options[$arrOption['value']] = $arrOption['label'];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// the text field\r\n\t\t$this->generateDCA(($this->picker != 'unit') ? ($this->multiple) ? 'multiField' : 'textField' : 'inputUnit', array\r\n\t\t(\r\n\t\t\t'inputType' =>\t($this->picker == 'unit') ? 'inputUnit' : 'text',\r\n\t\t\t'label'\t\t=>\tarray($this->label, $this->description),\r\n\t\t\t'default'\t=>\t$this->defaultValue,\r\n\t\t\t'wizard'\t=>\t$wizard,\r\n\t\t\t'options'\t=>\t$options,\r\n\t\t\t'eval'\t\t=>\tarray\r\n\t\t\t(\r\n\t\t\t\t'mandatory'\t\t=>\t($this->mandatory) ? true : false, \r\n\t\t\t\t'minlength'\t\t=>\t$this->minlength, \r\n\t\t\t\t'maxlength'\t\t=>\t$this->maxLength, \r\n\t\t\t\t'tl_class'\t\t=>\t$class,\r\n\t\t\t\t'rgxp'\t\t\t=>\t$this->rgxp,\r\n\t\t\t\t'multiple'\t\t=>\t($this->multiple) ? true : false,\r\n\t\t\t\t'size'\t\t\t=>\t$this->multiple,\r\n\t\t\t\t'datepicker' \t=> \t($this->picker == 'datetime') ? true : false,\r\n\t\t\t\t'colorpicker' \t=> \t($this->picker == 'color') ? true : false,\r\n\t\t\t\t'isHexColor' \t=> \t($this->picker == 'color') ? true : false,\r\n\t\t\t),\r\n\t\t));\r\n\t\t\r\n\t}", "protected function buildMigration()\n {\n $columns = [];\n $fk = [];\n $default = [];\n $nullable = [];\n $comment = [];\n\n foreach ($this->columns as $column) {\n $col = $column->column.':'.$column->method;\n\n if ($column->arguments) {\n $col .= ','.$column->arguments;\n }\n\n $columns[] = $col;\n\n if ($column->default) {\n $default[] = $column->column.':'.$column->default;\n }\n\n if ($column->comment) {\n $comment[] = $column->column.':'.$column->comment;\n }\n\n if ($column->is_foreign) {\n $fk[] = $column->column.':'.$column->table_foreign.','.$column->references_foreign;\n }\n\n if ($column->nullable) {\n $nullable[] = $column->column;\n }\n }\n\n $columns = ($columns) ? implode('|', $columns) : '';\n $fk = ($fk) ? implode('|', $fk) : '';\n $default = ($default) ? implode('|', $default) : '';\n $nullable = ($nullable) ? implode('|', $nullable) : '';\n $comment = ($comment) ? implode('|', $comment) : '';\n\n $migration = [\n 'name' => $this->table,\n '--pk' => $this->primaryKey,\n '--module' => $this->module->id,\n ];\n\n foreach (['columns', 'fk', 'default', 'nullable', 'comment'] as $argument) {\n if (! empty($$argument)) {\n $migration['--'.$argument] = $$argument;\n }\n }\n\n $this->migration = $migration;\n }", "private function constructArguments()\r\n\t{\r\n\t\t$arguments = \"-q on \";\r\n\r\n\t\tif ($this->title)\r\n\t\t{\r\n\t\t\t$arguments.= \"-ti \\\"\" . $this->title . \"\\\" \";\r\n\t\t}\r\n\r\n\t\tif ($this->destdir)\r\n\t\t{\r\n\t\t\t$arguments.= \"-t \\\"\" . $this->destdir . \"\\\" \";\r\n\t\t}\r\n\r\n\t\tif ($this->sourcepath !== NULL)\r\n\t\t{\r\n\t\t\t$arguments.= \"-d \\\"\" . $this->sourcepath->__toString() . \"\\\" \";\r\n\t\t}\r\n\r\n\t\tif ($this->output)\r\n\t\t{\r\n\t\t\t$arguments.= \"-o \" . $this->output . \" \";\r\n\t\t}\r\n\r\n\t\tif ($this->linksource)\r\n\t\t{\r\n\t\t\t$arguments.= \"-s on \";\r\n\t\t}\r\n\r\n\t\tif ($this->parseprivate)\r\n\t\t{\r\n\t\t\t$arguments.= \"-pp on \";\r\n\t\t}\r\n\r\n\t\treturn $arguments;\r\n\t}", "public function __construct()\n {\n\n // Load components required by this gateway\n Loader::loadComponents($this, array(\"Input\"));\n\n // Load the language required by this gateway\n Language::loadLang(\"tpay_payments\", null, dirname(__FILE__) . DS . \"language\" . DS);\n\n $this->loadConfig(dirname(__FILE__) . DS . \"config.json\");\n\n include_once 'lib/src/_class_tpay/validate.php';\n include_once 'lib/src/_class_tpay/util.php';\n include_once 'lib/src/_class_tpay/exception.php';\n include_once 'lib/src/_class_tpay/paymentBasic.php';\n include_once 'lib/src/_class_tpay/curl.php';\n include_once 'lib/src/_class_tpay/lang.php';\n }", "public function __construct()\n {\n self::build();\n }", "public function run()\n\t{\n\t\tProperty::create([\n\t\t\t'alias' => 'Altabrisa',\n 'description' => 'Departamento de Lujo',\n 'address' => 'Av. Centro',\n 'postal_code' => '24640',\n 'price' => '6000',\n 'maintenance_cost' => '2000',\n 'capacity' => '4',\n 'contract_id' => 1,\n 'type_id' => 1,\n 'lessor_id' => 1]);\n\t}", "public function setupOptions()\n {\n $action = new Action('generate', 'Generate fake data');\n //output adapter\n $option = new Option('o', 'output', 'Specify output adapter. Available outputs: db.[orm|odm], file.[csv|json|xml]');\n $option->setRequired(true);\n $action->addOption($option);\n\n $option = new Option('d', 'dest', 'Specify the destination point. It might be a file, or database collection or table');\n $option->setRequired(true);\n $action->addOption($option);\n\n //data specification\n $option = new Option('s', 'spec', 'Specify the file path containing data specification in JSON format');\n $option->setRequired(true);\n $action->addOption($option);\n\n //count of data\n $option = new Option('c', 'count', 'Specify the count of data to generate');\n $option->setRequired(true);\n $action->addOption($option);\n\n $this->addTaskAction($action);\n }", "function build() {\n\t\t$this->order_id = new view_field(\"Order ID\");\n\t\t$this->timestamp = new view_field(\"Date\");\n\t\t$this->total_amount = new view_field(\"Amount\");\n $this->view= new view_element(\"static\");\n \n $translations = new translations(\"fields\");\n $invoice_name = $translations->translate(\"fields\",\"Invoice\",true);\n $this->view->value=\"<a href=\\\"/orders/order_details.php?order_id={$this->_order_id}\\\" target=\\\"invoice\\\">\".$invoice_name.\"</a>\";\n\n\t\tif(isset($_SESSION['wizard']['complete']['process_time']))\n\t\t{\n\t\t\t$this->process_time = new view_field(\"Seconds to process\");\n\t\t\t$this->process_time->value=$_SESSION['wizard']['complete']['process_time'];\n\t\t\t$this->server = new view_field();\n\t\t\t$address_parts = explode('.',$_SERVER['SERVER_ADDR']);\n\t\t\t$this->server->value = $address_parts[count($address_parts) - 1];\n\t\t}\n\t\tparent::build();\n\t}", "public function run()\n {\n $this->command->info('Begin Init base data.');\n\n $this->initAttr();\n $this->initSum();\n $this->initEnum();\n $this->initTags();\n $this->initSysBadge();\n $this->initSysTaskTag();\n $this->initSysUserSkill();\n $this->initUser();\n// $this->initSysIpSurvey();\n $this->command->info('All base data is ok!');\n }", "protected function build()\n {\n $this->getResponse()->setVersion($this->getConf()->getVersion());\n $this->getResponse()->setCreate(json_decode($this->getConf()->getCreate()));\n }", "public function buildClass($data)\n {\n $classDescriptor = new ClassDescriptor();\n\n $classDescriptor->setFullyQualifiedStructuralElementName($data->getName());\n $classDescriptor->setName($data->getShortName());\n\n $this->buildDocBlock($data, $classDescriptor);\n\n $classDescriptor->setParentClass($data->getParentClass());\n\n $classDescriptor->setLocation('', $data->getLinenumber());\n $classDescriptor->setAbstract($data->isAbstract());\n $classDescriptor->setFinal($data->isFinal());\n\n foreach ($data->getInterfaces() as $interfaceClassName) {\n $classDescriptor->getInterfaces()->set($interfaceClassName, $interfaceClassName);\n }\n foreach ($data->getConstants() as $constant) {\n $this->buildConstant($constant, $classDescriptor);\n }\n foreach ($data->getProperties() as $property) {\n $this->buildProperty($property, $classDescriptor);\n }\n foreach ($data->getMethods() as $method) {\n $this->buildMethod($method, $classDescriptor);\n }\n\n $fqcn = $classDescriptor->getFullyQualifiedStructuralElementName();\n $namespace = substr($fqcn, 0, strrpos($fqcn, '\\\\'));\n\n $classDescriptor->setNamespace($namespace);\n\n return $classDescriptor;\n }", "public function run()\n {\n DocumentType::create(['name' => 'DNI', 'digits' => '8', 'code' => '1']);\n DocumentType::create(['name' => 'Carnet Ext.', 'digits' => '12', 'code' => '4']);\n DocumentType::create(['name' => 'RUC', 'digits' => '11', 'code' => '5']);\n DocumentType::create(['name' => 'Pasaporte', 'digits' => '12', 'code' => '7']);\n DocumentType::create(['name' => 'Cedula diplomatica de identidad.', 'digits' => '15', 'code' => 'A']);\n DocumentType::create(['name' => 'No domiciliado.', 'digits' => '15', 'code' => '0']);\n DocumentType::create(['name' => 'Otros', 'digits' => '15', 'code' => '-']);\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->commandData = new CommandData($this, CommandData::$COMMAND_TYPE_API);\n }", "public function run() {\n\t\tif (empty($this->entId)) {\n\t\t\t$this->entId = config('gmf.ent.id');\n\t\t}\n\t\tif (empty($this->entId)) {\n\t\t\treturn;\n\t\t}\n\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_CBO_ORG\")->name(\"组织\")\n\t\t\t\t->local('api/cbo/orgs/batch');\n\t\t});\n\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_CBO_CURRENCY\")->name(\"币种\")\n\t\t\t\t->local('api/cbo/currencies/batch');\n\t\t});\n\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_CBO_UOM\")->name(\"计量单位\")\n\t\t\t\t->local('api/cbo/units/batch');\n\t\t});\n\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_CBO_DEPT\")->name(\"部门\")\n\t\t\t\t->local('api/cbo/depts/batch');\n\t\t});\n\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_CBO_WORK\")->name(\"工作中心\")\n\t\t\t\t->local('api/cbo/works/batch');\n\t\t});\n\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_CBO_WH\")->name(\"存储地点\")\n\t\t\t\t->local('api/cbo/whs/batch');\n\t\t});\n\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_CBO_PERSON\")->name(\"人员\")\n\t\t\t\t->local('api/cbo/persons/batch');\n\t\t});\n\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_CBO_PROJECT_CATEGORY\")->name(\"项目分类\")\n\t\t\t\t->local('api/cbo/project-categories/batch');\n\t\t});\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_CBO_PROJECT\")->name(\"项目\")\n\t\t\t\t->local('api/cbo/projects/batch');\n\t\t});\n\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_CBO_ITEM_CATEGORY\")->name(\"物料分类\")\n\t\t\t\t->local('api/cbo/item-categories/batch');\n\t\t});\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_CBO_ITEM\")->name(\"物料\")\n\t\t\t\t->local('api/cbo/items/batch');\n\t\t});\n\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_CBO_TRADER_CATEGORY\")->name(\"客商分类\")\n\t\t\t\t->local('api/cbo/trader-categories/batch');\n\t\t});\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_CBO_TRADER\")->name(\"客商\")\n\t\t\t\t->local('api/cbo/traders/batch');\n\t\t});\n\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_CBO_DOC_TYPE\")->name(\"单据类型\")\n\t\t\t\t->local('api/cbo/doc-types/batch');\n\t\t});\n\n\t\t//业务数据\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_TRADE_MISCRCV\")->name(\"业务-杂收\")\n\t\t\t\t->local('api/amiba/doc-bizs/batch'); $b->body('{\"FromDate\":\"#{fm_date}#\",\"toDate\":\"#{to_date}#\"}');\n\t\t});\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_TRADE_MISCSHIP\")->name(\"业务-杂发\")\n\t\t\t\t->local('api/amiba/doc-bizs/batch'); $b->body('{\"FromDate\":\"#{fm_date}#\",\"toDate\":\"#{to_date}#\"}');\n\t\t});\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_TRADE_TRANSIN\")->name(\"业务-库存调入\")\n\t\t\t\t->local('api/amiba/doc-bizs/batch'); $b->body('{\"FromDate\":\"#{fm_date}#\",\"toDate\":\"#{to_date}#\"}');\n\t\t});\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_TRADE_TRANSOUT\")->name(\"业务-库存调出\")\n\t\t\t\t->local('api/amiba/doc-bizs/batch'); $b->body('{\"FromDate\":\"#{fm_date}#\",\"toDate\":\"#{to_date}#\"}');\n\t\t});\n\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_TRADE_MOCOMPLETE\")->name(\"业务-生产完工\")\n\t\t\t\t->local('api/amiba/doc-bizs/batch'); $b->body('{\"FromDate\":\"#{fm_date}#\",\"toDate\":\"#{to_date}#\"}');\n\t\t});\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_TRADE_MOISSUE\")->name(\"业务-生产领料\")\n\t\t\t\t->local('api/amiba/doc-bizs/batch'); $b->body('{\"FromDate\":\"#{fm_date}#\",\"toDate\":\"#{to_date}#\"}');\n\t\t});\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_TRADE_RCV\")->name(\"业务-采购收货\")\n\t\t\t\t->local('api/amiba/doc-bizs/batch'); $b->body('{\"FromDate\":\"#{fm_date}#\",\"toDate\":\"#{to_date}#\"}');\n\t\t});\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_TRADE_RCVRTN\")->name(\"业务-采购退货\")\n\t\t\t\t->local('api/amiba/doc-bizs/batch'); $b->body('{\"FromDate\":\"#{fm_date}#\",\"toDate\":\"#{to_date}#\"}');\n\t\t});\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_TRADE_SHIP\")->name(\"业务-销售出货\")\n\t\t\t\t->local('api/amiba/doc-bizs/batch'); $b->body('{\"FromDate\":\"#{fm_date}#\",\"toDate\":\"#{to_date}#\"}');\n\t\t});\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_TRADE_SHIPRTN\")->name(\"业务-销售退货\")\n\t\t\t\t->local('api/amiba/doc-bizs/batch'); $b->body('{\"FromDate\":\"#{fm_date}#\",\"toDate\":\"#{to_date}#\"}');\n\t\t});\n\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_TRADE_AP_APBILL\")->name(\"业务-应付\")\n\t\t\t\t->local('api/amiba/doc-bizs/batch'); $b->body('{\"FromDate\":\"#{fm_date}#\",\"toDate\":\"#{to_date}#\"}');\n\t\t});\n\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_TRADE_ER_EXPENSEPLAN\")->name(\"业务-费用预算\")\n\t\t\t\t->local('api/amiba/doc-bizs/batch'); $b->body('{\"FromDate\":\"#{fm_date}#\",\"toDate\":\"#{to_date}#\"}');\n\t\t});\n\n\t\t//财务数据\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_TRADE_GL_VOUCHER\")->name(\"财务-凭证\")\n\t\t\t\t->local('api/amiba/doc-fis/batch'); $b->body('{\"FromDate\":\"#{fm_date}#\",\"toDate\":\"#{to_date}#\"}');\n\t\t});\n\t}", "function __construct(){\n\t\t\n\n\t\tforeach( $_POST[] as $k=>$x ){\n\t\t\t\n\t\t\tif( empty($x) ){\n\t\t\t\t\n\t\t\t\texit(\"fail - missing data for \" . $k);\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t$this->$k = $x;\n\t\t\t}\n\t\t}\t\t\n\n\t\t$status = 'Application started...<br>';\n\n\t\t//set the filename to use.\n\t\t$this->setNames();\t\t\t\t\t\n\n\t\t$this->XMLtemplate = $this->xmlSkeleton();\t\t\n\t\t\n\t\techo $status;\t\t\n\t\t\n\t}", "public function main()\n\t{\n\t\t$this->loadConfig();\n\t\t$this->validateProject();\n\t\t$this->cleanConfig();\n\t\t$this->installDependencies();\n\t\t$this->createAutoload();\n\t\t$this->finish();\n\t}", "protected function build()\n {\n return 'INSERT'\n . $this->buildFlags()\n . $this->buildInto()\n . $this->buildValuesForInsert()\n . $this->buildReturning();\n }", "private function __construct() {\n\t\trequire_once \"Scripts/HTMLCleaner.php\";\n\t\trequire_once \"Scripts/ProcessProperties.php\";\n\t}", "public function run()\n {\n PropertyType::create([\n 'name' => 'Allgemein',\n ]);\n\n PropertyType::create([\n 'name' => 'Vitalwerte',\n ]);\n\n PropertyType::create([\n 'name' => 'Medikamente',\n ]);\n }", "protected function generate()\n {\n $oServer = Input::singleton('server');\n $this->hData['method'] = isset($oServer['http_x_http_method_override']) ? strtolower($oServer['http_x_http_method_override']) : strtolower($oServer['request_method']);\n\n $oGet = Input::singleton('get');\n $this->processGet($oGet->getRaw());\n\n $this->hData['baseurl'] = rtrim(dirname($oServer['php_self']), '/') . '/';\n $this->hData['rawpath'] = rtrim(preg_replace(\"#\\?.*#\", '', preg_replace(\"#^\" . $this->hData['baseurl'] . \"#\", '', $oServer['request_uri'])), '/');\n $this->processRawPath();\n }", "public function generate()\n\t{\n\t\t$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/coursebuilderwizard/html/coursebuilderwizard.js';\n\t\t$GLOBALS['TL_CSS'][] = 'system/modules/coursebuilderwizard/html/coursebuilderwizard.css';\n\t\n\t\n\t\t$this->import('Database');\n\n\t\t$arrButtons = array('copy', 'up', 'down', 'delete');\n\t\t$strCommand = 'cmd_' . $this->strField;\n\n\t\t// Change the order\n\t\tif ($this->Input->get($strCommand) && is_numeric($this->Input->get('cid')) && $this->Input->get('id') == $this->currentRecord)\n\t\t{\n\t\t\tswitch ($this->Input->get($strCommand))\n\t\t\t{\n\t\t\t\tcase 'copy':\n\t\t\t\t\t$this->varValue = array_duplicate($this->varValue, $this->Input->get('cid'));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'up':\n\t\t\t\t\t$this->varValue = array_move_up($this->varValue, $this->Input->get('cid'));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'down':\n\t\t\t\t\t$this->varValue = array_move_down($this->varValue, $this->Input->get('cid'));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'delete':\n\t\t\t\t\t$this->varValue = array_delete($this->varValue, $this->Input->get('cid'));\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$elements = array();\n\t\t\n\t\t// Get all available options to assemble the courses\n\t\tforeach($GLOBALS['CB_ELEMENT'] as $strClass=>$arrData)\n\t\t{\n\t\t\t$objElements = $this->Database->prepare(\"SELECT id, name FROM {$arrData['table']} ORDER BY name\")->execute();\n\t\t\t\n\t\t\tif ($objElements->numRows)\n\t\t\t{\n\t\t\t\twhile($objElements->next())\n\t\t\t\t{\n\t\t\t\t\t$arrEl = $objElements->row(); \n\t\t\t\t\t$arrEl['type'] = $strClass;\n\t\t\t\t\t$elements[] = $arrEl;\n\t\t\t\t}\n\t\t\t\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\t// Get new value\n\t\tif ($this->Input->post('FORM_SUBMIT') == $this->strTable)\n\t\t{\n\t\t\t$this->varValue = $this->Input->post($this->strId);\n\t\t}\n\n\t\t// Make sure there is at least an empty array\n\t\tif (!is_array($this->varValue) || !$this->varValue[0])\n\t\t{\n\t\t\t$this->varValue = array('');\n\t\t}\n\n\t\t// Save the value\n\t\tif ($this->Input->get($strCommand) || $this->Input->post('FORM_SUBMIT') == $this->strTable)\n\t\t{\n\t\t\t$this->Database->prepare(\"UPDATE \" . $this->strTable . \" SET \" . $this->strField . \"=? WHERE id=?\")\n\t\t\t\t\t\t ->execute(serialize($this->varValue), $this->currentRecord);\n\n\t\t\t// Reload the page\n\t\t\tif (is_numeric($this->Input->get('cid')) && $this->Input->get('id') == $this->currentRecord)\n\t\t\t{\n\t\t\t\t$this->redirect(preg_replace('/&(amp;)?cid=[^&]*/i', '', preg_replace('/&(amp;)?' . preg_quote($strCommand, '/') . '=[^&]*/i', '', $this->Environment->request)));\n\t\t\t}\n\t\t}\n\n\t\t// Add label and return wizard\n\t\t$return .= '<table cellspacing=\"0\" cellpadding=\"0\" id=\"ctrl_'.$this->strId.'\" class=\"tl_courseBuilderWizard\" summary=\"Course wizard\">\n <thead>\n <tr>\n <td>'.$GLOBALS['TL_LANG']['MSC']['cb_course'].'</td>\n <td>&nbsp;</td>\n </tr>\n </thead>\n <tbody>';\n\n\t\t// Load tl_article language file\n\t\t$this->loadLanguageFile('tl_article');\n\n\t\t// Add input fields\n\t\tfor ($i=0; $i<count($this->varValue); $i++)\n\t\t{\n\t\t\t$options = '';\n\n\t\t\t// Add modules\n\t\t\tforeach ($elements as $v)\n\t\t\t{\n\t\t\t\t$options .= '<option value=\"'.specialchars($v['type']).'|'.specialchars($v['id']).'\"'.$this->optionSelected($v['type'].'|'.$v['id'], $this->varValue[$i]).'>'.$v['name'].'</option>';\n\t\t\t}\n\n\t\t\t$return .= '\n <tr>\n <td><select name=\"'.$this->strId.'['.$i.']\" class=\"tl_select\" onfocus=\"Backend.getScrollOffset();\">'.$options.'</select></td>';\n\t\t\t\n\t\t\t$return .= '<td>';\n\n\t\t\tforeach ($arrButtons as $button)\n\t\t\t{\n\t\t\t\t$return .= '<a href=\"'.$this->addToUrl('&amp;'.$strCommand.'='.$button.'&amp;cid='.$i.'&amp;id='.$this->currentRecord).'\" title=\"'.specialchars($GLOBALS['TL_LANG']['MSC']['mw_'.$button]).'\" onclick=\"CourseBuilderWizard.coursebuilderWizard(this, \\''.$button.'\\', \\'ctrl_'.$this->strId.'\\'); return false;\">'.$this->generateImage($button.'.gif', $GLOBALS['TL_LANG']['MSC']['mw_'.$button], 'class=\"tl_listwizard_img\"').'</a> ';\n\t\t\t}\n\n\t\t\t$return .= '</td>\n </tr>';\n\t\t}\n\n\t\treturn $return.'\n </tbody>\n </table>';\n\t}", "public function Create()\n {\n parent::Create();\n\n //Properties\n $this->RegisterPropertyString('VariableList', '[]');\n\n //Scripts\n $this->RegisterScript('TurnOff', $this->Translate('Turn Off'), \"<?php\\n\\nAL_SwitchOff(IPS_GetParent(\\$_IPS['SELF']));\");\n }", "public function run()\n {\n $formDataType = DataType::firstOrNew(['model_name' => 'Pvtl\\VoyagerForms\\Form']);\n\n if (!$formDataType->exists) {\n $formDataType->fill([\n 'name' => 'forms',\n 'slug' => 'forms',\n 'display_name_singular' => 'Form',\n 'display_name_plural' => 'Forms',\n 'icon' => 'voyager-documentation',\n 'controller' => '\\Pvtl\\VoyagerForms\\Http\\Controllers\\FormController',\n 'generate_permissions' => '1',\n ])->save();\n }\n\n $inputDataType = DataType::firstOrNew(['model_name' => 'Pvtl\\VoyagerForms\\FormInput']);\n\n if (!$inputDataType->exists) {\n $inputDataType->fill([\n 'name' => 'inputs',\n 'slug' => 'inputs',\n 'display_name_singular' => 'Input',\n 'display_name_plural' => 'Inputs',\n 'icon' => 'voyager-documentation',\n 'controller' => '\\Pvtl\\VoyagerForms\\Http\\Controllers\\InputController',\n 'generate_permissions' => '1',\n ])->save();\n }\n\n $enquiryDataType = DataType::firstOrNew(['model_name' => 'Pvtl\\VoyagerForms\\Enquiry']);\n\n if (!$enquiryDataType->exists) {\n $enquiryDataType->fill([\n 'name' => 'enquiries',\n 'slug' => 'enquiries',\n 'display_name_singular' => 'Enquiry',\n 'display_name_plural' => 'Enquiries',\n 'icon' => 'voyager-mail',\n 'controller' => '\\Pvtl\\VoyagerForms\\Http\\Controllers\\EnquiryController',\n 'generate_permissions' => '1',\n 'server_side' => '1',\n ])->save();\n }\n }", "public function run()\n {\n $poset = new PackageType();\n $poset->name = 'Poşet';\n $poset->description = 'Bulgur, Fasulye, Yeşil Mercimek gibi bakliyatların satıldığı ambalaj bir ambalaj çeşidi';\n $poset->save();\n\n $dose = new PackageType();\n $dose->name = 'Dose';\n $dose->description = 'El değmeden paketlenen ve daha çok zeytin paketlemesinde kullanılan bir ambalaj çeşidi.';\n $dose->save();\n }", "private function initialiseVariables(): void\n {\n $this->entityInterfaceFqn = $this->namespaceHelper->getEntityInterfaceFromEntityFqn($this->entityFqn);\n list($className, , $subDirs) = $this->namespaceHelper->parseFullyQualifiedName(\n $this->entityFqn,\n $this->srcSubFolderName,\n $this->projectRootNamespace\n );\n\n $this->singularNamespacedName = $this->namespaceHelper->getSingularNamespacedName(\n $this->entityFqn,\n $subDirs\n );\n $this->pluralNamespacedName = $this->namespaceHelper->getPluralNamespacedName(\n $this->entityFqn,\n $subDirs\n );\n $this->setDestinationDirectory(\n $className,\n $subDirs\n );\n $plural = ucfirst(MappingHelper::getPluralForFqn($this->entityFqn));\n $singular = ucfirst(MappingHelper::getSingularForFqn($this->entityFqn));\n $nsNoEntities = implode('\\\\', array_slice($subDirs, 2));\n $this->singularNamespace = ltrim($nsNoEntities . '\\\\' . $singular, '\\\\');\n $this->pluralNamespace = ltrim($nsNoEntities . '\\\\' . $plural, '\\\\');\n $this->dirsToRename = [];\n $this->filesCreated = [];\n }", "public function main()\n {\n $string = Generate::randomString($this->getStringType(), $this->getLength());\n\n $this->project->log(\n sprintf('Generated Random String: %s, Placing Under User Property: %s', $string, $this->getName()),\n Project::MSG_INFO\n );\n\n $this->project->setUserProperty($this->getName(), $string);\n }" ]
[ "0.5767891", "0.55024", "0.55024", "0.5460086", "0.5460086", "0.5398414", "0.5397972", "0.5397972", "0.5380638", "0.5352502", "0.5350208", "0.53442776", "0.5337919", "0.5337919", "0.5337919", "0.5337919", "0.5337919", "0.5337919", "0.5337919", "0.5310858", "0.5307657", "0.5287088", "0.5285345", "0.5258141", "0.52379465", "0.5224882", "0.5224709", "0.5192419", "0.5161622", "0.51584625", "0.5121469", "0.5117312", "0.5112964", "0.507929", "0.50132346", "0.50131804", "0.5003088", "0.4977809", "0.4975647", "0.4962903", "0.49608374", "0.495552", "0.4949641", "0.4945259", "0.49435803", "0.4940097", "0.49369577", "0.4926526", "0.4915883", "0.4912139", "0.49110115", "0.49098688", "0.49094692", "0.49079302", "0.48954064", "0.48893774", "0.48790345", "0.48749983", "0.4855126", "0.48539025", "0.48532608", "0.48403636", "0.4840113", "0.48394433", "0.48333722", "0.48329058", "0.48251754", "0.48206145", "0.48065245", "0.48007107", "0.4796614", "0.4790648", "0.47885513", "0.47864807", "0.47732878", "0.47661135", "0.4763058", "0.47608978", "0.47560096", "0.47523296", "0.4751758", "0.47478518", "0.47468662", "0.4743079", "0.4730994", "0.47309586", "0.47299734", "0.4729657", "0.47286698", "0.47248816", "0.4710316", "0.47070655", "0.47032708", "0.46914467", "0.46836758", "0.46785554", "0.46725452", "0.46683845", "0.4664877", "0.4663281", "0.4660666" ]
0.0
-1
Build controller class script.
public static function buildController( $model = null, $service = null, $viewModel = null, $dto = null, ?string $name = null, ?string $namespace = null, bool $auth = true, bool $authorize = false ) { return self::createControllerBuilder( $model, $service, $viewModel, $dto, $name, $namespace, $auth, $authorize )->build(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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}", "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 }", "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 }", "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 }", "private function generateControllerClass()\n {\n $dir = $this->bundle->getPath();\n\n $parts = explode('\\\\', $this->entity);\n $entityClass = array_pop($parts);\n $entityNamespace = implode('\\\\', $parts);\n\n $target = sprintf(\n '%s/Controller/%s/%sController.php',\n $dir,\n str_replace('\\\\', '/', $entityNamespace),\n $entityClass\n );\n\n if (file_exists($target)) {\n throw new \\RuntimeException('Unable to generate the controller as it already exists.');\n }\n\n $this->renderFile($this->skeletonDir, 'controller.php', $target, array(\n 'actions' => $this->actions,\n 'route_prefix' => $this->routePrefix,\n 'route_name_prefix' => $this->routeNamePrefix,\n 'dir' => $this->skeletonDir,\n 'bundle' => $this->bundle->getName(),\n 'entity' => $this->entity,\n 'entity_class' => $entityClass,\n 'namespace' => $this->bundle->getNamespace(),\n 'entity_namespace' => $entityNamespace,\n 'format' => $this->format,\n ));\n }", "private function buildControllerPath() : void\n\t{\n\t\t$this->controllerPath = ROOT_PATH . 'src/Controllers/' . $this->request->getControllerName() . '/Controller.php';\n\t}", "protected function get_controller_content()\n {\n $this->load_table_acronym();\n //genera el prefijo de traduccion tipo tr[acronimo]_\n $this->load_translate_prefix();\n //carga las primeras traducciones sobre todo de entidades.\n $this->load_extra_translate();\n \n $this->sTimeNow = date(\"d-m-Y H:i\").\" (SPAIN)\";\n $arLines = array();\n $arLines[] = \"<?php\";\n $arLines[] = \"/**\n * @author Module Builder 1.1.4\n * @link www.eduardoaf.com\n * @version 1.0.0\n * @name $this->sControllerClassName\n * @file $this->sControllerFileName \n * @date $this->sTimeNow\n * @observations: \n * @requires:\n */\"; \n //IMPORTACION DE CLASES:\n $arLines[] = \"//TFW\";\n $arLines[] = \"import_component(\\\"page,validate,filter\\\");\";\n $arLines[] = \"import_helper(\\\"form,form_fieldset,form_legend,input_text,label,anchor,table,table_typed\\\");\";\n $arLines[] = \"import_helper(\\\"input_password,button_basic,raw,div,javascript\\\");\";\n $arLines[] = \"//APP\";\n $sImport = $this->get_import_models();\n $arLines[] = \"import_model(\\\"user,$sImport\\\");\";\n $arLines[] = \"import_appmain(\\\"controller,view,behaviour\\\");\";\n $arLines[] = \"import_appbehaviour(\\\"picklist\\\");\";\n $arLines[] = \"import_apphelper(\\\"listactionbar,controlgroup,formactions,buttontabs,formhead,alertdiv,breadscrumbs,headertabs\\\");\";\n $arLines[] = \"\";\n \n //BEGIN CLASS\n $arLines[] = \"class $this->sControllerClassName extends TheApplicationController\";\n $arLines[] = \"{\";\n $arLines[] = \"\\tprotected \\$$this->sModelObjectName;\";\n $arLines[] = \"\";\n $arLines[] = \"\\tpublic function __construct()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_func_construct($arLines);\n $arLines[] = \"\\t}\";\n $arLines[] = \"\";\n \n//<editor-fold defaultstate=\"collapsed\" desc=\"BUILDING LIST\">\n $arLines[] = \"//<editor-fold defaultstate=\\\"collapsed\\\" desc=\\\"LIST\\\">\";\n //build_list_scrumbs\n $arLines[] = \"\\t//list_1\";\n $arLines[] = \"\\tprotected function build_list_scrumbs()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_lst_buildlistscrumbs($arLines);\n $arLines[] = \"\\t}\";\n $arLines[] = \"\";\n \n $arLines[] = \"\\t//list_2\";\n $arLines[] = \"\\tprotected function build_list_tabs()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_lst_buildlisttabs($arLines);\n $arLines[] = \"\\t}\";\n $arLines[] = \"\";\n \n //build_listoperation_buttons();\n $arLines[] = \"\\t//list_3\";\n $arLines[] = \"\\tprotected function build_listoperation_buttons()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_lst_buildlistoperationbuttons($arLines);\n $arLines[] = \"\\t}//build_listoperation_buttons()\";\n $arLines[] = \"\";\n \n //load_config_list_filters();\n $arLines[] = \"\\t//list_4\";\n $arLines[] = \"\\tprotected function load_config_list_filters()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_lst_loadconfiglistfilters($arLines);\n $arLines[] = \"\\t}//load_config_list_filters()\";\n $arLines[] = \"\"; \n \n $arLines[] = \"\\t//list_5\";\n $arLines[] = \"\\tprotected function set_listfilters_from_post()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_lst_setlistfiltersfrompost($arLines);\n $arLines[] = \"\\t}//set_listfilters_from_post()\";\n $arLines[] = \"\";\n \n //get_list_filters();\n $arLines[] = \"\\t//list_6\";\n $arLines[] = \"\\tprotected function get_list_filters()\";\n $arLines[] = \"\\t{\";\n $arLines[] = \"\\t\\t//CAMPOS\";\n $this->controlleradd_lst_getlistfilters($arLines); \n $arLines[] = \"\\t\\treturn \\$arFields;\";\n $arLines[] = \"\\t}//get_list_filters()\";\n $arLines[] = \"\"; \n //get_list_columns();\n $arLines[] = \"\\t//list_7\";\n $arLines[] = \"\\tprotected function get_list_columns()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_lst_getlistcolumns($arLines);\n $arLines[] = \"\\t\\treturn \\$arColumns;\";\n $arLines[] = \"\\t}//get_list_columns()\";\n $arLines[] = \"\"; \n $arLines[] = \"\\t//list_8\";\n $arLines[] = \"\\tpublic function get_list()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_lst_getlist($arLines);\n $arLines[] = \"\\t}//get_list()\";\n $arLines[] = \"//</editor-fold>\";\n $arLines[] = \"\";\n//</editor-fold>\n\n//<editor-fold defaultstate=\"collapsed\" desc=\"BUILDING INSERT\"> \n $arLines[] = \"//<editor-fold defaultstate=\\\"collapsed\\\" desc=\\\"INSERT\\\">\";\n //build_insert_srumbs\n $arLines[] = \"\\t//insert_1\";\n $arLines[] = \"\\tprotected function build_insert_scrumbs()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_ins_buildinsertscrumbs($arLines);\n $arLines[] = \"\\t}//build_insert_scrumbs()\";\n $arLines[] = \"\";\n $arLines[] = \"\\t//insert_2\";\n $arLines[] = \"\\tprotected function build_insert_tabs()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_ins_buildinserttabs($arLines);\n $arLines[] = \"\\t}//build_insert_tabs()\"; \n \n //build_insert_opbuttons\n $arLines[] = \"\\t//insert_3\";\n $arLines[] = \"\\tprotected function build_insert_opbuttons()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_ins_buildinsertopbuttons($arLines);\n $arLines[] = \"\\t}//build_insert_opbuttons()\";\n $arLines[] = \"\";\n\n //build_insert_fields\n $arLines[] = \"\\t//insert_4\";\n $arLines[] = \"\\tprotected function build_insert_fields(\\$usePost=0)\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_ins_buildinsertfields($arLines);\n $arLines[] = \"\\t}//build_insert_fields()\";\n $arLines[] = \"\";\n \n //get_insert_validate\n $arLines[] = \"\\t//insert_5\";\n $arLines[] = \"\\tprotected function get_insert_validate()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_ins_getinsertvalidate($arLines);\n $arLines[] = \"\\t}//get_insert_validate\";\n $arLines[] = \"\";\n\n //build_insert_form\n $arLines[] = \"\\t//insert_6\";\n $arLines[] = \"\\tprotected function build_insert_form(\\$usePost=0)\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_ins_buildinsertform($arLines);\n $arLines[] = \"\\t}//build_insert_form()\";\n $arLines[] = \"\";\n \n //insert()\n $arLines[] = \"\\t//insert_7\";\n $arLines[] = \"\\tpublic function insert()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_ins_insert($arLines);\n $arLines[] = \"\\t}//insert()\";\n $arLines[] = \"//</editor-fold>\";\n $arLines[] = \"\";\n//</editor-fold>\n\n//<editor-fold defaultstate=\"collapsed\" desc=\"BUILDING UPDATE\"> \n $arLines[] = \"//<editor-fold defaultstate=\\\"collapsed\\\" desc=\\\"UPDATE\\\">\";\n $arLines[] = \"\\t//update_1\";\n $arLines[] = \"\\tprotected function build_update_scrumbs()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_upd_buildupdatescrumbs($arLines);\n $arLines[] = \"\\t}//build_update_scrumbs()\";\n $arLines[] = \"\";\n $arLines[] = \"\\t//update_2\";\n $arLines[] = \"\\tprotected function build_update_tabs()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_upd_buildupdatetabs($arLines);\n $arLines[] = \"\\t}//build_update_tabs()\";\n $arLines[] = \"\";\n $arLines[] = \"\\t//update_3\";\n $arLines[] = \"\\tprotected function build_update_opbuttons()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_upd_buildupdateopbuttons($arLines);\n $arLines[] = \"\\t}//build_update_opbuttons()\";\n $arLines[] = \"\";\n //build_update_fields\n $arLines[] = \"\\t//update_4\";\n $arLines[] = \"\\tprotected function build_update_fields(\\$usePost=0)\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_upd_buildupdatefields($arLines);\n $arLines[] = \"\\t}//build_update_fields()\";\n $arLines[] = \"\";\n //get_update_validate\n $arLines[] = \"\\t//update_5\";\n $arLines[] = \"\\tprotected function get_update_validate()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_ins_getinsertvalidate($arLines,1);\n $arLines[] = \"\\t}//get_update_validate\";\n $arLines[] = \"\"; \n $arLines[] = \"\\t//update_6\";\n $arLines[] = \"\\tprotected function build_update_form(\\$usePost=0)\";\n $arLines[] = \"\\t{\"; \n //$arLines[] = \"\\t\\t\\$id = \\$this->get_get(\\\"id\\\");\";\n $this->controlleradd_upd_buildupdateform($arLines);\n $arLines[] = \"\\t}//build_update_form()\";\n $arLines[] = \"\";\n $arLines[] = \"\\t//update_7\";\n $arLines[] = \"\\tpublic function update()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_upd_update($arLines);\n $arLines[] = \"\\t}//update()\";\n $arLines[] = \"//</editor-fold>\";\n $arLines[] = \"\";\n//</editor-fold>\n\n//<editor-fold defaultstate=\"collapsed\" desc=\"BUILDING DELETE\">\n $arLines[] = \"//<editor-fold defaultstate=\\\"collapsed\\\" desc=\\\"DELETE\\\">\";\n $arLines[] = \"\\t//delete_1\";\n $arLines[] = \"\\tprotected function single_delete()\";\n $arLines[] = \"\\t{\";\n $arLines[] = \"\\t\\t\\$id = \\$this->get_get(\\\"id\\\");\";\n $arLines[] = \"\\t\\tif(\\$id)\";\n $arLines[] = \"\\t\\t{\";\n $arLines[] = \"\\t\\t\\t\\$this->$this->sModelObjectName\".\"->set_id(\\$id);\";\n $arLines[] = \"\\t\\t\\t\\$this->$this->sModelObjectName\".\"->autodelete();\";\n $arLines[] = \"\\t\\t\\tif(\\$this->$this->sModelObjectName\".\"->is_error())\";\n $arLines[] = \"\\t\\t\\t{\";\n $arLines[] = \"\\t\\t\\t\\t\\$this->isError = TRUE;\";\n $arLines[] = \"\\t\\t\\t\\t\\$this->set_session_message(tr_mdb_error_trying_to_delete);\";\n $arLines[] = \"\\t\\t\\t}\";\n $arLines[] = \"\\t\\t\\telse\";\n $arLines[] = \"\\t\\t\\t{\";\n $arLines[] = \"\\t\\t\\t\\t\\$this->set_session_message(tr_mdb_data_deleted);\";\n $arLines[] = \"\\t\\t\\t}\";\n $arLines[] = \"\\t\\t}//si existe el id\";\n $arLines[] = \"\\t\\telse\";\n $arLines[] = \"\\t\\t\\t\\$this->set_session_message(tr_mdb_error_key_not_supplied,\\\"e\\\");\";\n $arLines[] = \"\\t}//single_delete()\";\n $arLines[] = \"\";\n $arLines[] = \"\\t//delete_2\";\n $arLines[] = \"\\tprotected function multi_delete()\";\n $arLines[] = \"\\t{\";\n $arLines[] = \"\\t\\t//Intenta recuperar pkeys sino pasa a recuperar el id. En ultimo caso lo que se ha pasado por parametro\";\n $arLines[] = \"\\t\\t\\$arKeys = \\$this->get_listkeys();\";\n $arLines[] = \"\\t\\tforeach(\\$arKeys as \\$sKey)\";\n $arLines[] = \"\\t\\t{\";\n $arLines[] = \"\\t\\t\\t\\$id = \\$sKey;\";\n $arLines[] = \"\\t\\t\\t\\$this->$this->sModelObjectName\".\"->set_id(\\$id);\";\n $arLines[] = \"\\t\\t\\t\\$this->$this->sModelObjectName\".\"->autodelete();\";\n $arLines[] = \"\\t\\t\\tif(\\$this->$this->sModelObjectName\".\"->is_error())\";\n $arLines[] = \"\\t\\t\\t{\";\n $arLines[] = \"\\t\\t\\t\\t\\$this->isError = true;\";\n $arLines[] = \"\\t\\t\\t\\t\\$this->set_session_message(tr_mdb_error_trying_to_delete,\\\"e\\\");\";\n $arLines[] = \"\\t\\t\\t}\";\n $arLines[] = \"\\t\\t}//foreach arkeys\";\n $arLines[] = \"\\t\\tif(!\\$this->isError)\";\n $arLines[] = \"\\t\\t\\t\\$this->set_session_message(tr_mdb_data_deleted);\";\n $arLines[] = \"\\t}//multi_delete()\";\n $arLines[] = \"\";\n $arLines[] = \"\\t//delete_3\";\n $arLines[] = \"\\tpublic function delete()\";\n $arLines[] = \"\\t{\";\n $arLines[] = \"\\t\\t//\\$this->go_to_401(\\$this->oPermission->is_not_delete()||\\$this->oSessionUser->is_not_dataowner());\";\n $arLines[] = \"\\t\\t\\$this->go_to_401(\\$this->oPermission->is_not_delete());\";\n $arLines[] = \"\\t\\t\\$this->isError = FALSE;\";\n $arLines[] = \"\\t\\t//Si ocurre un error se guarda en isError\";\n $arLines[] = \"\\t\\tif(\\$this->is_multidelete())\";\n $arLines[] = \"\\t\\t\\t\\$this->multi_delete();\";\n $arLines[] = \"\\t\\telse\";\n $arLines[] = \"\\t\\t\\t\\$this->single_delete();\";\n $arLines[] = \"\\t\\t//Si no ocurrio errores en el intento de borrado\";\n $arLines[] = \"\\t\\tif(!\\$this->isError)\";\n $arLines[] = \"\\t\\t\\t\\$this->go_to_after_succes_cud();\";\n $arLines[] = \"\\t\\telse//delete ok\";\n $arLines[] = \"\\t\\t\\t\\$this->go_to_list();\";\n $arLines[] = \"\\t}\\t//delete()\";\n $arLines[] = \"//</editor-fold>\";\n $arLines[] = \"\";\n $arLines[] = \"//<editor-fold defaultstate=\\\"collapsed\\\" desc=\\\"QUARANTINE\\\">\";\n $arLines[] = \"\\t//quarantine_1\";\n $arLines[] = \"\\tprotected function single_quarantine()\";\n $arLines[] = \"\\t{\";\n $arLines[] = \"\\t\\t\\$id = \\$this->get_get(\\\"id\\\");\";\n $arLines[] = \"\\t\\tif(\\$id)\";\n $arLines[] = \"\\t\\t{\";\n $arLines[] = \"\\t\\t\\t\\$this->$this->sModelObjectName\".\"->set_id(\\$id);\";\n $arLines[] = \"\\t\\t\\t\\$this->$this->sModelObjectName\".\"->autoquarantine();\";\n $arLines[] = \"\\t\\t\\tif(\\$this->$this->sModelObjectName\".\"->is_error())\";\n $arLines[] = \"\\t\\t\\t\\t\\$this->set_session_message(tr_mdb_error_trying_to_delete);\";\n $arLines[] = \"\\t\\t\\telse\";\n $arLines[] = \"\\t\\t\\t\\t\\$this->set_session_message(tr_mdb_data_deleted);\";\n $arLines[] = \"\\t\\t}//else no id\";\n $arLines[] = \"\\t\\telse\";\n $arLines[] = \"\\t\\t\\t\\$this->set_session_message(tr_mdb_error_key_not_supplied,\\\"e\\\");\";\n $arLines[] = \"\\t}//single_quarantine()\";\n $arLines[] = \"\"; \n $arLines[] = \"\\t//quarantine_2\";\n $arLines[] = \"\\tprotected function multi_quarantine()\";\n $arLines[] = \"\\t{\";\n $arLines[] = \"\\t\\t\\$this->isError = FALSE;\";\n $arLines[] = \"\\t\\t//Intenta recuperar pkeys sino pasa a id, y en ultimo caso lo que se ha pasado por parametro\";\n $arLines[] = \"\\t\\t\\$arKeys = \\$this->get_listkeys();\";\n $arLines[] = \"\\t\\tforeach(\\$arKeys as \\$sKey)\";\n $arLines[] = \"\\t\\t{\";\n $arLines[] = \"\\t\\t\\t\\$id = \\$sKey;\";\n $arLines[] = \"\\t\\t\\t\\$this->$this->sModelObjectName\".\"->set_id(\\$id);\";\n $arLines[] = \"\\t\\t\\t\\$this->$this->sModelObjectName\".\"->autoquarantine();\";\n $arLines[] = \"\\t\\t\\tif(\\$this->$this->sModelObjectName\".\"->is_error())\";\n $arLines[] = \"\\t\\t\\t{\";\n $arLines[] = \"\\t\\t\\t\\t\\$isError = true;\";\n $arLines[] = \"\\t\\t\\t\\t\\$this->set_session_message(tr_mdb_error_trying_to_delete,\\\"e\\\");\";\n $arLines[] = \"\\t\\t\\t}\";\n $arLines[] = \"\\t\\t}\";\n $arLines[] = \"\\t\\tif(!\\$isError)\";\n $arLines[] = \"\\t\\t\\t\\$this->set_session_message(tr_mdb_data_deleted);\";\n $arLines[] = \"\\t}//multi_quarantine()\";\n $arLines[] = \"\";\n $arLines[] = \"\\t//quarantine_3\";\n $arLines[] = \"\\tpublic function quarantine()\";\n $arLines[] = \"\\t{\";\n $arLines[] = \"\\t\\t//\\$this->go_to_401(\\$this->oPermission->is_not_quarantine()||\\$this->oSessionUser->is_not_dataowner());\"; \n $arLines[] = \"\\t\\t\\$this->go_to_401(\\$this->oPermission->is_not_quarantine());\"; \n $arLines[] = \"\\t\\tif(\\$this->is_multiquarantine())\";\n $arLines[] = \"\\t\\t\\t\\$this->multi_quarantine();\";\n $arLines[] = \"\\t\\telse\";\n $arLines[] = \"\\t\\t\\t\\$this->single_quarantine();\";\n $arLines[] = \"\\t\\t\\$this->go_to_list();\";\n $arLines[] = \"\\t\\tif(!\\$this->isError)\";\n $arLines[] = \"\\t\\t\\t\\$this-go_to_after_succes_cud();\";\n $arLines[] = \"\\t\\telse //quarantine ok\"; \n $arLines[] = \"\\t\\t\\t\\$this->go_to_list();\";\n $arLines[] = \"\\t}//quarantine()\";\n $arLines[] = \"\";\n $arLines[] = \"//</editor-fold>\";\n $arLines[] = \"\";\n//</editor-fold>\n\n//<editor-fold defaultstate=\"collapsed\" desc=\"BUILDING MULTIASSIGN\">\n $this->arTranslation[] = $this->sTranslatePrefix.\"clear_filters\";\n $this->arTranslation[] = $this->sTranslatePrefix.\"refresh\";\n $this->arTranslation[] = $this->sTranslatePrefix.\"multiadd\";\n $this->arTranslation[] = $this->sTranslatePrefix.\"closeme\";\n $this->arTranslation[] = $this->sTranslatePrefix.\"entities\";\n \n $arLines[] = \"//<editor-fold defaultstate=\\\"collapsed\\\" desc=\\\"MULTIASSIGN\\\">\";\n $arLines[] = \"\\t//multiassign_1\";\n $arLines[] = \"\\tprotected function build_multiassign_buttons()\";\n $arLines[] = \"\\t{\";\n $arLines[] = \"\\t\\t\\$arOpButtons = array();\";\n $arLines[] = \"\\t\\t\\$arOpButtons[\\\"filters\\\"]=array(\\\"href\\\"=>\\\"javascript:reset_filters();\\\",\\\"icon\\\"=>\\\"awe-magic\\\",\\\"innerhtml\\\"=>$this->sTranslatePrefix\".\"clear_filters);\";\n $arLines[] = \"\\t\\t\\$arOpButtons[\\\"reload\\\"]=array(\\\"href\\\"=>\\\"javascript:TfwControl.form_submit();\\\",\\\"icon\\\"=>\\\"awe-refresh\\\",\\\"innerhtml\\\"=>$this->sTranslatePrefix\".\"refresh);\";\n $arLines[] = \"\\t\\t\\$arOpButtons[\\\"multiadd\\\"]=array(\\\"href\\\"=>\\\"javascript:multiadd();\\\",\\\"icon\\\"=>\\\"awe-external-link\\\",\\\"innerhtml\\\"=>$this->sTranslatePrefix\".\"multiadd);\";\n $arLines[] = \"\\t\\t\\$arOpButtons[\\\"closeme\\\"]=array(\\\"href\\\"=>\\\"javascript:closeme();\\\",\\\"icon\\\"=>\\\"awe-remove-sign\\\",\\\"innerhtml\\\"=>$this->sTranslatePrefix\".\"closeme);\";\n $arLines[] = \"\\t\\t\\$oOpButtons = new AppHelperButtontabs($this->sTranslatePrefix\".\"entities);\";\n $arLines[] = \"\\t\\t\\$oOpButtons->set_tabs(\\$arOpButtons);\";\n $arLines[] = \"\\t\\treturn \\$oOpButtons;\";\n $arLines[] = \"\\t}//build_multiassign_buttons()\";\n $arLines[] = \"\";\n //load_config_multiassign_filters();\n $arLines[] = \"\\t//multiassign_2\";\n $arLines[] = \"\\tprotected function load_config_multiassign_filters()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_lst_loadconfiglistfilters($arLines);\n $arLines[] = \"\\t}//load_config_multiassign_filters()\";\n $arLines[] = \"\";\n $arLines[] = \"\\t//multiassign_3\";\n $arLines[] = \"\\tprotected function get_multiassign_filters()\";\n $arLines[] = \"\\t{\";\n $arLines[] = \"\\t\\t//CAMPOS\";\n $this->controlleradd_lst_getlistfilters($arLines,0);\n $arLines[] = \"\\t\\treturn \\$arFields;\";\n $arLines[] = \"\\t}//get_multiassign_filters()\";\n $arLines[] = \"\"; \n $arLines[] = \"\\t//multiassign_4\";\n $arLines[] = \"\\tprotected function set_multiassignfilters_from_post()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_lst_setlistfiltersfrompost($arLines);\n $arLines[] = \"\\t}//set_multiassignfilters_from_post()\";\n $arLines[] = \"\"; \n //get_multiassign_columns();\n $arLines[] = \"\\t//multiassign_5\";\n $arLines[] = \"\\tprotected function get_multiassign_columns()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_lst_getlistcolumns($arLines,0);\n $arLines[] = \"\\t\\treturn \\$arColumns;\";\n $arLines[] = \"\\t}//get_multiassign_columns()\";\n $arLines[] = \"\"; \n $arLines[] = \"\\t//multiassign_6\";\n $arLines[] = \"\\tpublic function multiassign()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_multiassign($arLines);\n $arLines[] = \"\\t}//multiassign()\";\n $arLines[] = \"//</editor-fold>\";\n $arLines[] = \"\";\n//</editor-fold>\n\n//<editor-fold defaultstate=\"collapsed\" desc=\"BUILDING SINGLEASSIGN\"> \n $arLines[] = \"//<editor-fold defaultstate=\\\"collapsed\\\" desc=\\\"SINGLEASSIGN\\\">\";\n $arLines[] = \"\\t//singleassign_1\";\n $arLines[] = \"\\tprotected function build_singleassign_buttons()\";\n $arLines[] = \"\\t{\";\n $arLines[] = \"\\t\\t\\$arButTabs = array();\";\n $arLines[] = \"\\t\\t\\$arButTabs[\\\"filters\\\"]=array(\\\"href\\\"=>\\\"javascript:reset_filters();\\\",\\\"icon\\\"=>\\\"awe-magic\\\",\\\"innerhtml\\\"=>$this->sTranslatePrefix\".\"clear_filters);\";\n $arLines[] = \"\\t\\t\\$arButTabs[\\\"reload\\\"]=array(\\\"href\\\"=>\\\"javascript:TfwControl.form_submit();\\\",\\\"icon\\\"=>\\\"awe-refresh\\\",\\\"innerhtml\\\"=>$this->sTranslatePrefix\".\"refresh);\";\n $arLines[] = \"\\t\\t\\$arButTabs[\\\"closeme\\\"]=array(\\\"href\\\"=>\\\"javascript:closeme();\\\",\\\"icon\\\"=>\\\"awe-remove-sign\\\",\\\"innerhtml\\\"=>$this->sTranslatePrefix\".\"closeme);\";\n $arLines[] = \"\\t\\treturn \\$arButTabs;\";\n $arLines[] = \"\\t}//build_singleassign_buttons()\";\n $arLines[] = \"\";\n //load_config_multiassign_filters();\n $arLines[] = \"\\t//singleassign_2\";\n $arLines[] = \"\\tprotected function load_config_singleassign_filters()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_lst_loadconfiglistfilters($arLines);\n $arLines[] = \"\\t}//load_config_singleassign_filters()\";\n $arLines[] = \"\"; \n \n //get_singleassign_filters();\n $arLines[] = \"\\t//singleassign_3\";\n $arLines[] = \"\\tprotected function get_singleassign_filters()\";\n $arLines[] = \"\\t{\";\n $arLines[] = \"\\t\\t//CAMPOS\";\n $this->controlleradd_lst_getlistfilters($arLines,0);\n $arLines[] = \"\\t\\treturn \\$arFields;\";\n $arLines[] = \"\\t}//get_singleassign_filters()\";\n $arLines[] = \"\"; \n \n $arLines[] = \"\\t//singleassign_4\";\n $arLines[] = \"\\tprotected function set_singleassignfilters_from_post()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_lst_setlistfiltersfrompost($arLines);\n $arLines[] = \"\\t}//set_singleassignfilters_from_post()\";\n $arLines[] = \"\";\n \n //get_singleassign_columns();\n $arLines[] = \"\\t//singleassign_5\";\n $arLines[] = \"\\tprotected function get_singleassign_columns()\";\n $arLines[] = \"\\t{\";\n //SINGLEASSIGN - COLUMNS\n $this->controlleradd_lst_getlistcolumns($arLines,0);\n $arLines[] = \"\\t\\treturn \\$arColumns;\";\n $arLines[] = \"\\t}//get_singleassign_columns()\";\n $arLines[] = \"\"; \n $arLines[] = \"\\t//singleassign_6\";\n $arLines[] = \"\\tpublic function singleassign()\";\n $arLines[] = \"\\t{\";\n $this->controlleradd_singleassign($arLines); \n $arLines[] = \"\\t}//singleassign()\";\n $arLines[] = \"//</editor-fold>\";\n $arLines[] = \"\";\n//</editor-fold>\n\n//<editor-fold defaultstate=\"collapsed\" desc=\"BUILDING EXTRAS\"> \n $arLines[] = \"//<editor-fold defaultstate=\\\"collapsed\\\" desc=\\\"EXTRAS\\\">\";\n $arLines[] = \"\\tpublic function addsellers()\";\n $arLines[] = \"\\t{\";\n $arLines[] = \"\\t\\t\\$sUrl = \\$this->get_assign_backurl(array(\\\"k\\\",\\\"k2\\\"));\";\n $arLines[] = \"\\t\\tif(\\$this->get_get(\\\"close\\\"))\";\n $arLines[] = \"\\t\\t\\t\\$this->js_colseme_and_parent_refresh();\";\n $arLines[] = \"\\t\\telse\";\n $arLines[] = \"\\t\\t\\t\\$this->js_parent_refresh();\";\n $arLines[] = \"\\t\\t\\$this->js_go_to(\\$sUrl);\";\n $arLines[] = \"\\t}\";\n $arLines[] = \"//</editor-fold>\";\n//</editor-fold> \n $arLines[] = \"}//end controller\";//fin clase\n $sContent = implode(\"\\n\",$arLines);\n return $sContent; \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 }", "public function execute()\n\t{\t\n\t\t$this->controller = new Controller($this->path);\n\t\t$this->static_server = new StaticServer($this->path);\n\t\t\n\t\tCurrent::$plugins->hook('prePathParse', $this->controller, $this->static_server);\n\t\t\n\t\tif ( $this->static_server->isFile() )\n\t\t{\n\t\t\tCurrent::$plugins->hook('preStaticServe', $this->static_server);\n\t\t\t\n\t\t\t// Output the file\n\t\t\t$this->static_server->render();\n\t\t\t\n\t\t\tCurrent::$plugins->hook('postStaticServe', $this->static_server);\n\t\t\t\n\t\t\texit;\n\t\t}\n\t\t\n\t\t// Parse arguments from path and call appropriate command\n\t\tCowl::timer('cowl parse');\n\t\t$request = $this->controller->parse();\n\t\tCowl::timerEnd('cowl parse');\n\t\n\t\tif ( COWL_CLI )\n\t\t{\n\t\t\t$this->fixRequestForCLI($request);\n\t\t}\n\t\t\n\t\t$command = new $request->argv[0];\n\t\t\n\t\t// Set template directory, which is the command directory mirrored\n\t\t$command->setTemplateDir(Current::$config->get('paths.view') . $request->app_directory);\n\t\t\n\t\tCurrent::$plugins->hook('postPathParse', $request);\n\t\t\n\t\tCowl::timer('cowl command run');\n\t\t$ret = $command->run($request);\n\t\tCowl::timerEnd('cowl command run');\n\t\t\n\t\tCurrent::$plugins->hook('postRun');\n\t\t\n\t\tif ( is_string($ret) )\n\t\t{\n\t\t\tCowl::redirect($ret);\n\t\t}\n\t}", "public function createMvcCode() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get input\n\t\t$componentName = KRequest::getKeyword('component_name');\n\t\t$nameSingular = KRequest::getKeyword('name_singular');\n\t\t$namePlural = KRequest::getKeyword('name_plural');\n\n\t\t// Validate input\n\t\tif (empty($componentName)) {\n\t\t\tKLog::log(\"Component name is not specified.\", 'custom_code_creator');\n\t\t\techo \"Component name is not specified.\";\n\t\t\treturn;\n\t\t}\n\n\t\tif (empty($nameSingular)) {\n\t\t\tKLog::log(\"Singular name is not specified.\", 'custom_code_creator');\n\t\t\techo \"name_singular is empty.\";\n\t\t\treturn;\n\t\t}\n\n\t\tif (empty($namePlural)) {\n\t\t\tKLog::log(\"Plural name is not specified.\", 'custom_code_creator');\n\t\t\techo \"Parameter name_plural is empty.\";\n\t\t\treturn;\n\t\t}\n\n\t\t// Prepare the table name and\n\t\t$tableName = strtolower('configbox_external_' . $namePlural);\n\t\t$model = KenedoModel::getModel('ConfigboxModelAdminmvcmaker');\n\n\t\t// Make all files\n\t\t$model->createControllerFile($componentName, $nameSingular, $namePlural);\n\t\t$model->createModelFile($componentName, $namePlural, $tableName);\n\t\t$model->createViewFiles($componentName, $nameSingular, $namePlural, 'form');\n\t\t$model->createViewFiles($componentName, $nameSingular, $namePlural, 'list');\n\n\t\techo 'All done';\n\n\t}", "public function build()\n\t{\n\t\t$script = \"\";\n\t\t$this->addTable($script);\n\t\t$this->addIndices($script);\n\t\t$this->addForeignKeys($script);\n\t\treturn $script;\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 $this->createClass('controller');\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 }", "protected function createController()\n {\n $name = str_replace(\"Service\",\"\",$this->argument('name'));\n\n $this->call('make:controller', [\n 'name' => \"{$name}Controller\"\n ]);\n }", "private function launcher() {\n \n $controller = $this->controller;\n $task = $this->task;\n \n if (!isset($controller)) {\n $controller = 'IndexController';\n }\n else {\n $controller = ucfirst($controller).'Controller';\n }\n \n if (!isset($task)) {\n $task = 'index';\n }\n \n $c = new $controller();\n \n call_user_func(array($c, $task));\n \n Quantum\\Output::setMainView($this->controller, $task);\n \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 }", "private static function controller()\n {\n $files = ['Controller'];\n $folder = static::$root.'MVC'.'/';\n\n self::call($files, $folder);\n }", "protected function execute(InputInterface $input, OutputInterface $output)\n {\n $this->writeSection($output, 'Controller generation');\n\n $extensionName = $input->getOption('extension');\n $controllerName = $input->getArgument('controller_name');\n\n if (!$extensionName) {\n throw new \\RuntimeException('Parameter extension is required');\n }\n\n $path = \\WFP2Environment::getExtPath() . $extensionName . DIRECTORY_SEPARATOR;\n\n if (!is_dir($path)) {\n throw new \\RuntimeException('Path ' . $path . ' does not exists');\n }\n\n\n $classesPath = $path . 'Classes' . DIRECTORY_SEPARATOR;\n if (!is_dir($classesPath)) {\n mkdir($classesPath);\n }\n\n $controllerPath = $classesPath . 'Controller' . DIRECTORY_SEPARATOR;\n if (!is_dir($controllerPath)) {\n mkdir($controllerPath);\n }\n\n if (strpos($controllerName, 'Controller') === false) {\n $controllerName .= 'Controller';\n }\n\n $output->writeln('Create new controller ' . $controllerName);\n\n\n /* @var $dialog \\Symfony\\Component\\Console\\Helper\\DialogHelper */\n $dialog = $this->getHelper('dialog');\n $actionContent = array();\n\n while ($dialog->askConfirmation($output, 'generate action? [y/n]')) {\n $actionNameRaw = $actionName = $dialog->ask($output, 'Please insert your action name: ');\n\n if (strpos($actionName, 'Action') === false) {\n $actionName .= 'Action';\n }\n\n $templatePath = $this->mkdir($path . 'Resources/Private/Templates/' . $input->getArgument('controller_name'));\n $templateName = ucfirst(strtolower($actionNameRaw)) . '.html';\n\n $this->renderFile('view.html', $templatePath . $templateName, array(\n 'controller' => $controllerName,\n 'action' => $actionName\n ));\n\n $actionContent[] = $this->render('action.php', array(\n 'actionname' => $actionName,\n 'view' => str_replace(\\WFP2Environment::getExtPath(), '', $templatePath . $templateName)\n ));\n };\n\n $this->renderFile('controller.php', $controllerPath . $controllerName . '.php', array(\n 'name' => $controllerName,\n 'namespace' => $this->generateNamespaceForExtensionName($extensionName) . '\\\\Controller',\n 'body' => implode(PHP_EOL, $actionContent)\n ));\n\n $errors = array();\n\n\n $this->writeGeneratorSummery($output, $errors);\n }", "protected function buildController()\n {\n $class = $this->getParameter('fos_user.model.user.class');\n /** @var EntityManager $em */\n $em = $this->get('doctrine.orm.entity_manager');\n $this->doctrine_namespace = $em->getClassMetadata($class)->getName();\n parent::buildController();\n }", "private function controllerBuilder() {\n // Create rules\n $validationRules = '';\n $filecheck = '';\n $insert = false;\n $insertTab = '';\n // Foreach on form fields added on generator\n foreach ($this->formDatas as $field) {\n $rules = array();\n // Create rules for codeigniter framework\n if (isset($field['rules'])) {\n $rules = json_decode($field['rules'], true);\n }\n if (!empty($field['min_length'])) {\n $rules[] = 'min_length[' . $field['min_length'] . ']';\n }\n if (!empty($field['max_length'])) {\n $rules[] = 'max_length[' . $field['max_length'] . ']';\n }\n if (!empty($field['exact_length'])) {\n $rules[] = 'exact_length[' . $field['exact_length'] . ']';\n }\n if (!empty($field['greater_than'])) {\n $rules[] = 'greater_than[' . $field['greater_than'] . ']';\n }\n if (!empty($field['less_than'])) {\n $rules[] = 'less_than[' . $field['less_than'] . ']';\n }\n\n // Create php line\n if (isset($rules)) {\n $validationRules .= '$this->form_validation->set_rules(\\'' . strtolower($field['name']) . '\\', \\'' . $field['label'] . '\\', \\'' . implode('|', $rules) . '\\');\n ';\n }\n\n\n // File\n if ($field['type'] == 'file') {\n // If file_format selected or maxfilesize indicated\n if (isset($field['file_format']) || isset($field['maxfilesize'])) {\n if (!isset($field['file_format'])) {\n $fileformat = 'false';\n } else {\n $fileformat = str_replace(']', ')', str_replace('[', 'array(', sprintf($field['file_format'])));\n }\n\n // Create check line for checking file options\n $filecheck .= '$errorfile[\"' . $field['name'] . '\"] = $this->fileup->checkErrorUpload($_FILES[\"' . $field['name'] . '\"], ' . $fileformat . ', ' . $field['maxfilesize'] . ');\n ';\n }\n }\n\n // Check if database option is checked for create fields to insert\n if (isset($field['database_fields'])) {\n // Option to active database insert\n $insert = true;\n // Tab to insert\n $insertTab .= '$insertTab[\"' . $field['name'] . '\"] = $_POST[\"' . $field[\"name\"] . '\"];\n ';\n }\n }\n\n // Create com for files check\n if ($filecheck != '') {\n $filecheck = '// Files validation\n ' . $filecheck;\n }\n\n // Create code to insert in database\n if ($insert == true) {\n $database_insert = '\n // If valid\n if($valid == true) {\n ' . $insertTab . '\n // Save to bdd\n if (!$this->' . $this->formName . '_model->save($insertTab) == true) {\n // Save error\n $data[\"error\"] = \"save\";\n }\n }';\n } else {\n $database_insert = '';\n }\n\n // Build the controller\n $controller = '<?php\n class ' . ucfirst($this->formName) . ' extends CI_Controller {\n // Constructor\n function __construct()\n {\n parent::__construct();\n $this->load->library(array(\\'form_validation\\', \\'fileup\\'));\n $this->load->helper(array(\\'form\\'));\n $this->load->model(\\'' . $this->formName . '_model\\');\n }\n\n // Form ' . ucfirst($this->formName) . '\n public function index()\n {\n // Init\n $data = array();\n // If form sended\n if(!empty($_POST)) {\n // Delimitors\n $this->form_validation->set_error_delimiters(\\'<p class=\"error\">\\', \\'</p>\\');\n\n // Validation rules\n ' . $validationRules . '\n\n ' . $filecheck . '\n\n // To block database insertion if we have file errors\n $valid = true;\n\n // Check for file errors\n if(isset($errorfile)) {\n // Create file errors for view\n foreach($errorfile as $name => $errorf) {\n if($errorf != false) {\n $data[\"errorfile\"][$name] = $errorf;\n $valid = false;\n }\n }\n }\n\n if ($this->form_validation->run() == true) {\n // Insert in bdd\n ' . $database_insert . '\n\n // Redirect to success page\n redirect(\\'' . $this->formName . '/success\\');\n }\n else {\n // Validation error\n $data[\"error\"] = \"validation\";\n\n }\n }\n // Load view\n $this->load->view(\\'' . $this->formName . '\\', $data);\n }\n\n // Success\n public function success() {\n // Load view\n $this->load->view(\\'' . $this->formName . '_success\\');\n }\n\n }\n ?>';\n\n return array(str_replace('<', '&lt;', $controller), $controller);\n }", "public static function WriteInController($controller)\n {\n return \"<?php \\n\n namespace App\\Controller; \\n \n use Speeder\\Controller\\Controller; \\n \n /**\n * generer par Consolino de Speeder-Framework\n * @author sele shabani <[email protected]>\n */\\n\n class $controller extends Controller\n {\\n\n public function index()\\n\n {\\n \n //this->Render('');\\n\n }\\n\n }\";\n }", "public function callController()\n {\n Artisan::call('lucy:controller', $this->builder->getAttribute('controller'));\n }", "public function build()\n {\n }", "protected function build()\n {\n $this->global_variables = (new GlobalVariablesGenerator)->generate();\n }", "static function start()\n {\n $controller_name = 'Main';\n $action_name = 'Index';\n\n $routes = explode('/', $_SERVER['REQUEST_URI']);\n\n // get the name of the controller\n if (!empty($routes[1])) {\n $controller_name = ucfirst($routes[1]);\n }\n\n // get the name of the action\n if (!empty($routes[2])) {\n $action_name = ucfirst($routes[2]);\n }\n\n // add prefixes\n $controller_name = 'Controller' . $controller_name;\n $action_name = 'action' . $action_name;\n\n // take file with controller class\n $controller_file = $controller_name . '.php';\n $controller_path = \"../app/controllers/\" . $controller_file;\n\n try {\n if (!file_exists($controller_path)) {\n throw new \\Exception('Could not find file');\n }\n include \"../app/controllers/\" . $controller_file;\n } catch (\\Exception $e) {\n echo $e->getMessage();\n }\n\n // create a controller\n $controller_name = \"App\\\\Controllers\\\\\" . $controller_name;\n $controller = new $controller_name();\n $action = $action_name;\n\n try {\n if (!method_exists($controller, $action)) {\n throw new \\Exception('Could not find method');\n }\n // call the controller action\n $controller->$action();\n } catch (\\Exception $e) {\n echo $e->getMessage();\n }\n }", "function buildControllerData($inControllerName) {\r\n\t\t$this->getEngine()->assign('controllerName', $inControllerName);\r\n\t\t$this->getEngine()->assign('controllerClass', $inControllerName.'Controller');\r\n\t\t$this->getEngine()->assign('modelClass', $inControllerName.'Model');\r\n\t\t$this->getEngine()->assign('viewClass', $inControllerName.'View');\r\n\t\t$this->getEngine()->assign('functionName', ucwords($inControllerName));\r\n\t}", "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 build ()\n {\n }", "private function buildControllerNameWithNamespace() : void\n\t{\n\t\t$this->controllerName = '\\\\' . $this->namespace . '\\\\Controllers\\\\' . $this->request->getControllerName() . '\\\\Controller';\n\t}", "public static function generate()\n\t{\n\t\t//get the Name of the SourceFolder\n\t\t\techo \"First you need to give the name of the SourceFolder you want to generate.\\n\";\n\t\t\techo \"The SourceFolder name: \";\n\t\t\t$line = trim(fgets(STDIN));\n\t\t\t$dir = 'src/'.$line;\n\t\t//controll when the Folder already exist\n\t\t\twhile(is_dir($dir)){\n\t\t\t\techo \"This SourceFolder already exist! Do you want to overwrite this File?\\npress y for yes and another for no:\";\n\t\t\t\t$answer = trim(fgets(STDIN));\n\t\t\t\tif($answer === 'y'){\n\t\t\t\t\tFolder::delete($dir);\n\t\t\t\t\tbreak;\n\t\t\t\t}else{\n\t\t\t\t\techo \"The SourceFolder name: \";\n\t\t\t\t\t$line = trim(fgets(STDIN));\n\t\t\t\t\t$dir = 'src/'.$line;\n\t\t\t\t}\n\t\t\t}\t\n\t\t//create dirs\n\t\t\tmkdir($dir);\n\t\t\tmkdir($dir.'/Controller');\n\t\t\tmkdir($dir.'/Entity');\n\t\t\tmkdir($dir.'/Resources');\n\t\t\tmkdir($dir.'/Resources/views');\n\t\t//set controllerValue\n\t\t\t$controllerValue = \"<?php \\n\\n\";\n\t\t\t$controllerValue .='namespace '.$line.\"\\\\Controller;\\n\\n\";\n\t\t\t$controllerValue .='use Kernel\\Controller;'.\"\\n\\n\";\t\t\t\t\t\t\n\t\t\t$controllerValue .='class '.$line.\"Controller extends Controller\\n{\\n\";\n\t\t\t$controllerValue .='\tpublic function '.$line.'()'.\"\\n\";\n\t\t\t$controllerValue .=\"\t{\\n\";\n\t\t\t$controllerValue .='\t\treturn $this->render(\"'.$line.':default.html\");'.\"\\n\";\n\t\t\t$controllerValue .=\"\t}\\n\";\n\t\t\t$controllerValue .=\"}\\n\";\n\t\t//generate Controller\n\t\t\t$controller = fopen($dir.'/Controller/'.$line.'Controller.php', \"w\") or die(\"Unable to open file!\\n\");\n\t\t\tfwrite($controller, '');\n\t\t\tfwrite($controller, trim($controllerValue));\n\t\t\tfclose($controller);\n\t\t//generate template\n\t\t\t$templateValue = \"<div>hello</div>\";\n\t\t\t$template = fopen($dir.'/Resources/views/default.html', \"w\") or die(\"Unable to open file!\\n\");\n\t\t\tfwrite($template, '');\n\t\t\tfwrite($template, trim($templateValue));\n\t\t\tfclose($template);\n\t\t//amend srcInit\n\t\t\tif(!array_key_exists($line, Config::srcInit())){\n\t\t\t\t$content = $line.': '.$line;\n\t\t\t\tfile_put_contents('Config/SrcInit.yml', \"\\n\".$content, FILE_APPEND);\n\t\t\t}\n\t}", "public function __construct(null|string $controller=null, null|string $actions=null){ \n $this->rollup = $this->config->application->rootDir.'/node_modules/rollup/dist/bin/rollup';\n $this->importMap = $this->config->application->rootDir.'/node_modules/@rollup/plugin-alias/dist/cjs/index.js';\n $this->uglify = $this->config->application->rootDir.'/node_modules/uglify-js/bin/uglifyjs';\n $this->basePath = $this->config->application->publicDir.'js/modules/';\n $this->ext = 'mjs';\n $this->format = 'es'; \n if(isset($controller)){\n if(isset($actions)){\n foreach(explode(',', $actions) as $action){\n $action .= empty($action) ? '' : '/';\n $this->run($this->basePath.$controller.'/'.$action.'main.'.$this->ext);\n }\n } else {\n foreach($this->globRecursive($this->basePath.$controller.'/main.'.$this->ext) as $mainPath){\n $this->run($mainPath);\n }\n }\n } else {\n foreach($this->globRecursive($this->config->application->publicDir.'main.'.$this->ext) as $mainPath){\n $this->run($mainPath);\n }\n } \n }", "public function build() {}", "public function build() {}", "public function build() {}", "public function buildControllers () {\n\t\t$this->ApiControllers = new TrueApiController(\n\t\t\t'api_controllers',\n\t\t\tarray('index' => array()),\n\t\t\tarray($this, 'rest')\n\t\t);\n\n\t\t$this->debug('Retrieving possible controllers');\n\t\t$response = $this->ApiControllers->index();\n\n\t\tif ($this->opt('checkVersion')) {\n\t\t\t$remoteVersion = $this->find(\n\t\t\t\t$this->_response,\n\t\t\t\t'version',\n\t\t\t\t'meta'\n\t\t\t);\n\n\t\t\t$compare = version_compare($this->_apiVer, $remoteVersion);\n\t\t\tif ($compare != 0) {\n\t\t\t\t$this->warning(\n\t\t\t\t\t'Your version %s is %s than the server\\'s %s',\n\t\t\t\t\t$this->_apiVer,\n\t\t\t\t\t$compare < 0 ? 'lower' : 'higher',\n\t\t\t\t\t$remoteVersion\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t$remoteTime = $this->find(\n\t\t\t$this->_response,\n\t\t\t'time_epoch',\n\t\t\t'meta'\n\t\t);\n\t\t$diff = gmdate('U') - $remoteTime;\n\t\t$this->debug('Time difference of %s second(s) with server', $diff);\n\n\t\tif (abs($diff) > $this->opt('checkTime')) {\n\t\t\t$this->crit('Time difference exceeds limit of %s seconds', $this->opt('checkTime'));\n\t\t}\n\n\t\t$this->controllers = $this->find(\n\t\t\t$this->_response,\n\t\t\t'controllers'\n\t\t);\n\n\t\tif (!$this->controllers) {\n\t\t\treturn $this->err('Unable to fetch controllers');\n\t\t}\n\n\t\tforeach ($this->controllers as $controller => $actions) {\n\t\t\tif (is_numeric($controller) || !is_array($actions)) {\n\t\t\t\treturn $this->crit(\n\t\t\t\t\t'Invalid controller formatting. Please upgrade your API client'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$underscore = $this->underscore($controller);\n\t\t\t$class = $this->camelize($underscore);\n\t\t\tif (isset($this->{$class}) && is_object($this->{$class})) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$this->{$class} = new TrueApiController(\n\t\t\t\t$underscore,\n\t\t\t\t$actions,\n\t\t\t\tarray($this, 'rest')\n\t\t\t);\n\t\t}\n\n\t\treturn true;\n\t}", "public function generatecontrollerAction()\n\t{\n\t\t$this->view->disable();\n\t\t$status = array('status' => 'false');\t\n\t\tif ($this->request->isPost()) \n\t\t{\n\t\t\t$post = $this->request->getPost();\n\t\t\t$noincludes = array('file');\n\t\t\t$images = array();\n\t\t\t$functions = array();\n\t\t\t$widgets = array();\n\t\t\t$tables = array();\n\t\t\n\t\t\t$table = $post['table'];\t\t\t\n\t\t\t$columns = $this->db->fetchAll(\"DESCRIBE \".$table, Phalcon\\Db::FETCH_ASSOC);\n\n\t\t\t$postkeys = array_keys($post);\n\t\t\tforeach($postkeys as $var)\n\t\t\t{\n\t\t\t\t$v = explode('_',$var);\n\t\t\t\tif(isset($v[1]))\n\t\t\t\t{\n\t\t\t\t\tswitch($v[0])\n\t\t\t\t\t{\n\t\t\t\t\t\tcase 'file':\n\t\t\t\t\t\tarray_push($images,$v[1]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'functions':\n\t\t\t\t\t\t\tif(is_array($post[$var]))\n\t\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tforeach($post[$var] as $function)\n\t\t\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t\t\t$entity = $v[1];\n\t\t\t\t\t\t\t\t\t$value = explode('_',$function);\n\t\t\t\t\t\t\t\t\t$widgetentity = $value[0];\n\t\t\t\t\t\t\t\t\t$widgetentityid = $value[1];\n\t\t\t\t\t\t\t\t\t$table = array($entity,array('widgetentity' => $widgetentity,'widgetentityid' => $widgetentityid));\n\t\t\t\t\t\t\t\t\tarray_push($functions,$table);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'widget':\n\t\t\t\t\t\t\tarray_push($widgets,$v[1]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif($post[$var] == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tarray_push($tables,$var);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//get all tables\n\t\t\t$tablesq = $this->db->fetchAll(\"SHOW TABLES\", Phalcon\\Db::FETCH_ASSOC);\n\n\t\t\t//generate view relations for detail view\n\t\t\t$linkentityrelations = array();\n\t\t\t$entityrelations = array();\n\t\t\tforeach($tablesq as $tablex)\n\t\t\t{\t\t\n\t\t\t\t$table3 = explode('_',$tablex['Tables_in_'.DATABASENAME]);\n\t\t\t\tif(!isset($table3[1]))\n\t\t\t\t{\n\t\t\t\t\t$columnx = $this->db->fetchAll(\"DESCRIBE `\".$tablex['Tables_in_'.DATABASENAME].\"`\", Phalcon\\Db::FETCH_ASSOC);\n\t\t\t\t\tforeach($columnx as $column)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($table.'id' == $column['Field'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($tablex['Tables_in_'.DATABASENAME] != 'acl')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tarray_push($entityrelations,$tablex['Tables_in_'.DATABASENAME]);\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}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif($table3[0] == $table || $table3[1] == $table)\n\t\t\t\t\t{\n\t\t\t\t\t\tarray_push($linkentityrelations,$tablex['Tables_in_'.DATABASENAME]);\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t}\n\n\t\t\t$controller = new Controller();\n\t\t\t$controller->entity = $post['table'];\n\t\t\t$controller->columns = $columns;\n\t\t\t$controller->relations = $entityrelations;\n\t\t\t$controller->linkrelations = $linkentityrelations;\n\t\t\t$controller->tables = $tables;\t\t\n\t\t\t$controller->images = in_array($table,$images);\t\t\n\t\t\techo $controller->totext();\n\t\t}\n\t\techo json_encode($status);\n\t}", "public function controller()\n\t{\n\t\n\t}", "protected function build()\n\t{\n\t}", "public static function controller($source='', $options=[]) {\n if (empty($source)) return false;\n\n $root = $options['root'] ?? false;\n $force = $options['force'] ?? false;\n $debug = $options['debug'] ?? false;\n $source = file_get_contents(\"{$source}\");\n $template = \"<?php namespace App\\Http\\Controllers\\[AUTHOR]\\[PACKAGE];\n\nclass [SOURCECLASS] extends \\[SOURCENAMESPACE]\\[SOURCECLASS]\n{\n\n}\n\";\n\n $destinationNamespace = $options['namespace'] ?? '';\n $sourceNamespace = self::extract($source, 'namespace ', ';');\n $packageName = self::extract($sourceNamespace, '\\\\', '\\\\');\n $sourceClass = self::extract($source, 'class ', ' ');\n $author = self::extract($sourceNamespace, '', '\\\\');\n\n if (!empty($root)) $template = str_replace('\\[AUTHOR]\\[PACKAGE]', '', $template);\n $template = str_replace('[AUTHOR]', $author, $template);\n $template = str_replace('[SOURCECLASS]', $sourceClass, $template);\n $template = str_replace('[SOURCENAMESPACE]', $sourceNamespace, $template);\n $template = str_replace('[PACKAGE]', $packageName, $template);\n\n $destinationPath = $root ? \"app/Http/Controllers/\" : \"app/Http/Controllers/{$author}/{$packageName}/\";\n $destination = \"{$destinationPath}{$sourceClass}.php\";\n\n if (!Storage::disk('base')->exists($destination) || $force) Storage::disk('base')->put($destination, $template);\n\n return true;\n\n }", "public function build();", "public function build();", "public function build();", "public function build();", "public function build();", "public function build();", "public function build();", "public function execute()\n {\n $controllerClassName = $this->requestUrl->getControllerClassName();\n $controllerFileName = $this->requestUrl->getControllerFileName();\n $actionMethodName = $this->requestUrl->getActionMethodName();\n $params = $this->requestUrl->getParams();\n \n if ( ! file_exists($controllerFileName))\n {\n exit('controlador no existe');\n }\n\n require $controllerFileName;\n\n $controller = new $controllerClassName();\n\n $response = call_user_func_array([$controller, $actionMethodName], $params);\n \n $this->executeResponse($response);\n }", "public function run()\n {\n foreach(app(ModuleController::class)->getModules() as $module){\n\n foreach(glob($module['path'] . '/Constants/*.php') as $path){\n\n $camelCaseName = pathinfo($path, PATHINFO_FILENAME);\n $readableName = trim(preg_replace('/([A-Z])/', ' $1', $camelCaseName));\n $snakeCaseName = strtoupper(str_replace(' ', '_', $readableName));\n\n $header = ConstantHeader::create([\n 'name' => $snakeCaseName,\n 'display_name' => $readableName\n ]);\n\n\n $basePath = base_path('module');\n $classPath = pathinfo($path, PATHINFO_DIRNAME);\n\n $className = str_replace('/', '\\\\', 'Module' . str_replace($basePath, '', $classPath). '\\\\' . $camelCaseName);\n\n $class = new $className;\n $reflection = new ReflectionClass($className);\n $constants = $reflection->getConstants();\n\n\n if($reflection->hasProperty('exclude') && $class->exclude === true){\n continue;\n }\n\n\n\n $order = 0;\n foreach($constants as $value => $id){\n $readableValue = ucwords(strtolower(str_replace('_', ' ', $value)));\n $type = property_exists($class, 'types') && isset($class->types[$id]) ?\n $class->types[$id] : 'default';\n\n $ns = trim(preg_replace('/(Module|Constants)/', '', $reflection->getNamespaceName()), '\\\\');\n $ns = trim(strtolower(preg_replace('/([A-Z])/', '_$1', $ns)), '_');\n\n $key = $ns . '::constant.' . strtolower($snakeCaseName . '.' . $value);\n\n $header->constants()->create([\n 'code' => $id,\n 'name' => $value,\n 'display_name' => $readableValue,\n 'type' => $type,\n 'key' => $key,\n 'order' => ++$order,\n ]);\n }\n }\n\n }\n\n\n\n\n }", "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}", "function executeController()\r\n{\r\n\t// Uri and figure out the path to the controller.\r\n\t$request = trim($_GET['request'], \"/ \");\r\n\t\r\n\tif ($request != '') {\r\n\t // Using the URL segments, construct the name of the class.\r\n\t // Note: The class name is mapped to the directory structure.\r\n\t $reqSegments = explode(\"/\", $request);\r\n\t}\r\n\t\r\n\t$controllerName = 'App_Pages_';\r\n\t$controllerName .= ($reqSegments[0])?$reqSegments[0]:'Index';\r\n\t$controllerName .= '_Controller';\r\n\t\r\n\t$actionName = ($reqSegments[1])?$reqSegments[1]:'index';\r\n\r\n\tif (class_exists($controllerName)) {\r\n\t\tif (method_exists($controllerName, $actionName)) {\r\n\t\t\t$controller = new $controllerName();\r\n\t\t\t$controller->$actionName();\r\n\t\t} else {\r\n\t\t\tdie('Page not found');\r\n\t\t}\r\n\t} else {\r\n\t\tdie('Page not found');\r\n\t}\r\n}", "function wcfm_csm_ajax_controller() {\r\n\tglobal $WCFM, $WCFMu;\r\n\r\n\t$plugin_path = trailingslashit( dirname( __FILE__ ) );\r\n\r\n\t$controller = '';\r\n\tif( isset( $_POST['controller'] ) ) {\r\n\t\t$controller = $_POST['controller'];\r\n\r\n\t\tswitch( $controller ) {\r\n\t\t\tcase 'wcfm-build':\r\n\t\t\t\trequire_once( $plugin_path . 'controllers/wcfm-controller-build.php' );\r\n\t\t\t\tnew WCFM_Build_Controller();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n}", "public function execute()\n\t{\n\t\t// Create the class prefix\n\t\t$prefix = 'controller_';\n\n\t\tif ( ! empty($this->directory))\n\t\t{\n\t\t\t// Add the directory name to the class prefix\n\t\t\t$prefix .= str_replace(array('\\\\', '/'), '_', trim($this->directory, '/')).'_';\n\t\t}\n\n\t\tif (Kohana::$profiling === TRUE)\n\t\t{\n\t\t\t// Start benchmarking\n\t\t\t$benchmark = Profiler::start('Requests', $this->uri);\n\t\t}\n\n\t\ttry\n\t\t{\n\t\t\t// Load the controller using reflection\n\t\t\t$class = new ReflectionClass($prefix.$this->controller);\n\n\t\t\tif ($class->isAbstract())\n\t\t\t{\n\t\t\t\tthrow new Kohana_Exception('Cannot create instances of abstract :controller',\n\t\t\t\t\tarray(':controller' => $prefix.$this->controller));\n\t\t\t}\n\n\t\t\t// Create a new instance of the controller\n\t\t\t$controller = $class->newInstance($this);\n\n\t\t\t// Execute the \"before action\" method\n\t\t\t$class->getMethod('before')->invoke($controller);\n\n\t\t\t// Determine the action to use\n\t\t\t$action = empty($this->action) ? Route::$default_action : $this->action;\n\t\t\t\n\t\t\t// Ensure the action exists, and use __call() if it doesn't\n\t\t\tif ($class->hasMethod('action_'.$action))\n\t\t\t{\n\t\t\t\t// Execute the main action with the parameters\n\t\t\t\t$class->getMethod('action_'.$action)->invokeArgs($controller, $this->_params);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$class->getMethod('__call')->invokeArgs($controller,array($action,$this->_params));\n\t\t\t}\n\n\t\t\t// Execute the \"after action\" method\n\t\t\t$class->getMethod('after')->invoke($controller);\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\tif (isset($benchmark))\n\t\t\t{\n\t\t\t\t// Delete the benchmark, it is invalid\n\t\t\t\tProfiler::delete($benchmark);\n\t\t\t}\n\n\t\t\tif ($e instanceof ReflectionException)\n\t\t\t{\n\t\t\t\t// Reflection will throw exceptions for missing classes or actions\n\t\t\t\t$this->status = 404;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// All other exceptions are PHP/server errors\n\t\t\t\t$this->status = 500;\n\t\t\t}\n\n\t\t\t// Re-throw the exception\n\t\t\tthrow $e;\n\t\t}\n\n\t\tif (isset($benchmark))\n\t\t{\n\t\t\t// Stop the benchmark\n\t\t\tProfiler::stop($benchmark);\n\t\t}\n\n\t\treturn $this;\n\t}", "public function buildController(Resource $resource);", "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 }", "private function buildClassDefinition()\n {\n $reflection = new \\ReflectionClass($this->context->getFullClassName());\n $haxeClass = new HaxeClass();\n $haxeClass\n ->setName($this->context->getClassName())\n ->setPackage(implode('.', explode('\\\\', $this->context->getCurrentNamespace())))\n ;\n\n $this->parseProperties($reflection, $haxeClass);\n $this->parseMethods($reflection, $haxeClass);\n\n return $haxeClass->transpile();\n }", "protected function buildClass($name)\n {\n $namespace = $this->getNamespace($name);\n $default_replace = str_replace(\"use $namespace\\Controller;\\n\", '', parent::buildClass($name));\n //return str_replace(\"Now_Entity\", \"Creator_\" . $this->argument(\"name\"), $default_replace);\n return str_replace(\"Now_Entity\", $this->argument(\"name\"), $default_replace);\n }", "public abstract function build();", "public abstract function build();", "public function build() {\n $pref = new Pref(\"system\");\n $this->setMainTemplate($pref->template);\n\n\n if ($this->data['url']['application'] == \"admin\")\n $tpl = new Template(PATH_SITEADMIN_TEMPLATES);\n else\n $tpl = new Template(PATH_TEMPLATES);\n if (!USER_ID && !$this->isAllowed())\n header(\"location: \" . page(\"user\", \"login\"));\n\n if (!USER_ID && $this->isAllowed())\n $tpl->login = true;\n else\n $tpl->login = false;\n $tpl->loadFile(\"template.php\");\n $tpl->data = $this->data;\n $tpl->build();\n }", "function Controller()\n\t{\t\t\n\t\t$this->method = \"showView\";\n\t\tif (array_key_exists(\"method\", $_REQUEST))\n\t\t\t$this->method = $_REQUEST[\"method\"];\n\t\t\t\t\n\t\t$this->icfTemplating = new IcfTemplating();\n\t\t$this->tpl =& $this->icfTemplating->getTpl();\n\t\t$this->text =& $this->icfTemplating->getText();\t\t\n\t\t$this->controllerMessageArray = array();\n\t\t$this->pageTitle = \"\";\n\t\t$this->dateFormat = DateFormatFactory::getDateFormat();\n\t\t$this->controllerData =& $this->newControllerData();\n\t}", "public function create()\n {\n $output = new \\Symfony\\Component\\Console\\Output\\ConsoleOutput();\n $output->writeln(\"<info>Controller Create</info>\");\n }", "protected static function getTypoScriptFrontendController() {}", "public function automaticScript()\n \t{\t\n \t\t$scripts = array();\n \t\tif (isset($this->pluginPath)) {\n\t \t\t# JS Plugin Path\n\t\t\t$js_path_plugin = $this->pluginPath . $this->constant['webroot'] . DS . $this->constant['jsBaseUrl'];\n\n\t\t\tif (is_file($js_path_plugin . $this->controller . '.js')) {\n\t\t \t$scripts[] = $this->plugin.'.'.$this->controller;\n\t\t \t}\n\n\t\t \tif (is_file($js_path_plugin . $this->controller . DS . $this->action . '.js')) {\n\t\t \t$scripts[] = $this->plugin . '.' . $this->controller . '/' . $this->action;\n\t\t \t}\n \t\t}\n \t\t\n \t\t$js_path = $this->constant['www_root'] . $this->constant['jsBaseUrl'];\n \t\tif (is_file($js_path . $this->controller . '.js')) {\n\t \t$scripts[] = $this->controller;\n\t\t}\n\n\t \tif (is_file($js_path . $this->controller . DS . $this->action . '.js')) {\n\t \t$scripts[] = $this->controller . '/' . $this->action;\n\t\t}\n\t\treturn $this->script($scripts);\n \t}", "private function generateTestClass()\n {\n $parts = explode('\\\\', $this->entity);\n $entityClass = array_pop($parts);\n $entityNamespace = implode('\\\\', $parts);\n\n $dir = $this->bundle->getPath() .'/Tests/Controller';\n $target = $dir .'/'. str_replace('\\\\', '/', $entityNamespace).'/'. $entityClass .'ControllerTest.php';\n\n $this->renderFile($this->skeletonDir, 'tests/test.php', $target, array(\n 'route_prefix' => $this->routePrefix,\n 'route_name_prefix' => $this->routeNamePrefix,\n 'entity' => $this->entity,\n 'entity_class' => $entityClass,\n 'namespace' => $this->bundle->getNamespace(),\n 'entity_namespace' => $entityNamespace,\n 'actions' => $this->actions,\n 'dir' => $this->skeletonDir,\n ));\n }", "public function execute()\n\t{\n\t\t// Create the class prefix\n\t\t$prefix = 'controller_';\n\n\t\tif ($this->directory)\n\t\t{\n\t\t\t// Add the directory name to the class prefix\n\t\t\t$prefix .= str_replace(array('\\\\', '/'), '_', trim($this->directory, '/')).'_';\n\t\t}\n\n\t\tif (Kohana::$profiling)\n\t\t{\n\t\t\t// Set the benchmark name\n\t\t\t$benchmark = '\"'.$this->uri.'\"';\n\n\t\t\tif ($this !== Request::$instance AND Request::$current)\n\t\t\t{\n\t\t\t\t// Add the parent request uri\n\t\t\t\t$benchmark .= ' « \"'.Request::$current->uri.'\"';\n\t\t\t}\n\n\t\t\t// Start benchmarking\n\t\t\t$benchmark = Profiler::start('Requests', $benchmark);\n\t\t}\n\n\t\t// Store the currently active request\n\t\t$previous = Request::$current;\n\n\t\t// Change the current request to this request\n\t\tRequest::$current = $this;\n\n\t\ttry\n\t\t{\n\t\t\t// Load the controller using reflection\n\t\t\t$class = new ReflectionClass($prefix.$this->controller);\n\n\t\t\tif ($class->isAbstract())\n\t\t\t{\n\t\t\t\tthrow new Kohana_Exception('Cannot create instances of abstract :controller',\n\t\t\t\t\tarray(':controller' => $prefix.$this->controller));\n\t\t\t}\n\n\t\t\t// Create a new instance of the controller\n\t\t\t$controller = $class->newInstance($this);\n\n\t\t\t// Execute the \"before action\" method\n\t\t\t$class->getMethod('before')->invoke($controller);\n\n\t\t\t// Determine the action to use\n\t\t\t$action = empty($this->action) ? Route::$default_action : $this->action;\n\n\t\t\t// Execute the main action with the parameters\n\t\t\t$class->getMethod('action_'.$action)->invokeArgs($controller, $this->_params);\n\n\t\t\t// Execute the \"after action\" method\n\t\t\t$class->getMethod('after')->invoke($controller);\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\t// Restore the previous request\n\t\t\tRequest::$current = $previous;\n\n\t\t\tif (isset($benchmark))\n\t\t\t{\n\t\t\t\t// Delete the benchmark, it is invalid\n\t\t\t\tProfiler::delete($benchmark);\n\t\t\t}\n\n\t\t\tif ($e instanceof ReflectionException)\n\t\t\t{\n\t\t\t\t// Reflection will throw exceptions for missing classes or actions\n\t\t\t\t$this->status = 404;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// All other exceptions are PHP/server errors\n\t\t\t\t$this->status = 500;\n\t\t\t}\n\n\t\t\t// Re-throw the exception\n\t\t\tthrow $e;\n\t\t}\n\n\t\t// Restore the previous request\n\t\tRequest::$current = $previous;\n\n\t\tif (isset($benchmark))\n\t\t{\n\t\t\t// Stop the benchmark\n\t\t\tProfiler::stop($benchmark);\n\t\t}\n\n\t\treturn $this;\n\t}", "function __construct()\n {\n //domain/controller/action/param\n $breakArr = $this->XuLyURL();\n //Array ( [0] => controller [1] => action [2] => param1 [3] => param2)\n\n \n //Xu ly controller, kiem tra form co ton tai hay khong moi require\n if(file_exists(\"./mvc/controllers/\".$breakArr[0].\".php\")){\n $this->controller = $breakArr[0];\n unset($breakArr[0]);//sau khi da lay dc controller thi huy mang di -> tao param\n }\n require_once \"./mvc/controllers/\".$this->controller.\".php\";\n //sau khi đã tạo connect controller và extends, khởi tạo đối tượng controller là controller hiện tại\n $this->controller = new $this->controller;\n \n //Xu ly action, kiem tra array[1]-action cua class controller\n if(isset($breakArr[1])){\n //kiem tra ham ton tai, tham so la object or class(controller) va function(action)\n //kiem tra tra ve boolean\n if(method_exists($this->controller, $breakArr[1])){\n $this->action = $breakArr[1];\n\n }\n //bo ra ngoai dieu kien kiem tra ton tai, neu truong hop action khong ton tai action khong duoc thay the nen khong unset dc\n unset($breakArr[1]);//sau khi da lay dc controller thi huy mang di -> tao param\n }\n\n\n //Xu ly param\n //goi param, (? = neu) mang ton tai thi param = array values(mang)\n // (: = nguoc lai thi) param rong~\n $this->param = $breakArr?array_values($breakArr):[];\n call_user_func_array([$this->controller,$this->action], $this->param);\n }", "public function __construct(){\n $arr = $this->UrlProcess();\n\n // Xu ly controller\n if(!empty($arr)){\n if(file_exists(\"./source/controllers/\".$arr[0].\".php\")){\n $this->controller = $arr[0];\n unset($arr[0]); // loai bo controller khoi mang -> de lay params ben duoi\n }\n }\n \n\n require_once \"./source/controllers/\".$this->controller.\".php\";\n $this->controller = new $this->controller;\n\n // Xu ly action\n if(isset($arr[1])){\n if(method_exists($this->controller, $arr[1])){\n $this->action = $arr[1];\n }\n unset($arr[1]); // loai bo action khoi mang\n }\n\n //Xu li params\n $this->params = $arr?array_values($arr):[];\n \n call_user_func_array([$this->controller, $this->action], $this->params);\n\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}", "protected function build()\n {\n $this->getResponse()->setVersion($this->getConf()->getVersion());\n $this->getResponse()->setCreate(json_decode($this->getConf()->getCreate()));\n }", "public function main()\n {\n $className = $this->fullyQualifiedClassName();\n $templatePath = $this->template();\n $destinationDir = $this->destinationDir();\n $destinationFile = $this->destinationFile();\n\n if (!file_exists($templatePath)) {\n $this->error(sprintf('Given template file path does not exists [%s]', $templatePath));\n return 1;\n }\n \n if ($this->opt('force') === false && file_exists($destinationFile)) {\n $this->error(sprintf(\n '\\'%s\\' already exists. Use --force to directly replaces it.', \n $className\n ));\n return 2;\n }\n\n $name = $this->name();\n $namespace = $this->fullNamespace();\n\n $placeholders = $this->preparedPlaceholders();\n $placeholders['{{name}}'] = $name;\n $placeholders['{{namespace}}'] = $namespace;\n \n $template = file_get_contents($templatePath);\n\n $constructor = $this->opt('constructor') === true ? $this->constructor() : '';\n $template = str_replace('{{constructor}}', $constructor, $template);\n\n $template = str_replace(\n array_keys($placeholders), array_values($placeholders), $template\n );\n\n if (!is_dir($destinationDir)) {\n mkdir($destinationDir, '0755', true);\n }\n file_put_contents($destinationFile, $template);\n\n $this->info(sprintf('%s created with success!', $className));\n $this->info(sprintf('File: %s', $destinationFile));\n\n return 0;\n }", "protected function getTypoScriptFrontendController() {}", "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 }", "private function make($arg, $className = null) {\n $arrayClass = explode('/', $className);\n if(count($arrayClass) > 1) {\n if(!@end($arrayClass)) {\n die(\"\\n Please specify any name of `{$className}?`. \\n\");\n }\n }\n // switch make case\n switch($make = explode(':', $arg)[1]) {\n /**\n * @make:entry\n * \n */\n case 'entry':\n // check entry store exists.\n if(!file_exists(\".\\\\databases\\\\entry\")) {\n die(\"\\n fatal: The `.\\\\databases\\\\entry` folder not found, please initiate entry by `init` command. \\n\");\n }\n // check specify entry name\n if(!$className) {\n die(\"\\n Please specify entry name. \\n\");\n }\n // check class is duplicate\n foreach (scandir(\".\\\\databases\\\\entry\") as $fileName) {\n if(explode('.', $fileName)[0] === ucfirst($className)) {\n die(\"\\n The entry `{$className}` is duplicate. \\n\");\n }\n }\n // Read file content\n $fileContent = file_get_contents(__DIR__.'./tmpEntry.php');\n // do the replacements, modifications, etc. on $fileContent\n // This is just an example\n $fileContent = str_replace('{{className}}', ucfirst($className), $fileContent);\n // write the content to a new file\n if(file_put_contents(\".\\\\databases\\\\entry\\\\\". ucfirst($className) .\".php\", $fileContent)) {\n die(\"\\n make the entry `{$className}` is successfully. \\n\");\n } else {\n die(\"\\n make the entry failed. Please try again. \\n\");\n }\n break;\n /**\n * @make:controller\n * \n */\n case 'controller':\n // check controller store exists.\n if(!file_exists(\".\\\\modules\\\\controllers\")) {\n die(\"\\n fatal: The `.\\\\modules\\\\controllers` folder not found. \\n\");\n }\n // check specify controller name\n if(!$className) {\n die(\"\\n Please specify controller name. \\n\");\n }\n // explode when asign subfolder\n $masterName = explode('/', $className);\n $newClassName = ucfirst(end($masterName));\n // check don't asign conroller wording\n if(!strpos($newClassName, \"Controller\")) {\n $newClassName = $newClassName . \"Controller\";\n }\n // check include subfolder\n if(count($masterName) > 1) {\n array_pop($masterName);\n $subfolder = implode('\\\\', $masterName);\n if(!file_exists(\".\\\\modules\\\\controllers\\\\{$subfolder}\")) {\n if(!mkdir(\".\\\\modules\\\\controllers\\\\{$subfolder}\", 0777, true)) {\n die(\"\\n fatal: something error please try again. \\n\");\n }\n }\n // next new className\n $newClassName = $subfolder .\"\\\\\". $newClassName;\n }\n // check class is duplicate\n foreach (scandir(\".\\\\modules\\\\controllers\\\\\". @$subfolder) as $fileName) {\n $file = explode('.php', $fileName);\n $file = trim(@$subfolder .\"\\\\\". current($file), \"\\\\\");\n if($file === $newClassName) {\n die(\"\\n The class `{$newClassName}` is duplicate. \\n\");\n }\n }\n // Read file content\n $fileContent = file_get_contents(__DIR__.'./tmpController.php');\n // do the replacements, modifications, etc. on $fileContent\n // This is just an example\n $classNameReplace = explode(\"\\\\\", $newClassName);\n $fileContent = str_replace('{{className}}', end($classNameReplace), $fileContent);\n // write the content to a new file\n if(file_put_contents(\".\\\\modules\\\\controllers\\\\{$newClassName}.php\", $fileContent)) {\n die(\"\\n make the controller `{$newClassName}` is successfully. \\n\");\n } else {\n die(\"\\n make the controller failed. Please try again. \\n\");\n }\n break;\n /**\n * @make:model\n * \n */\n case 'model':\n // check model store exists.\n if(!file_exists(\".\\\\modules\\\\models\")) {\n die(\"\\n fatal: The `.\\\\modules\\\\models` folder not found. \\n\");\n }\n // check specify model name\n if(!$className) {\n die(\"\\n Please specify model name. \\n\");\n }\n // check include subfolder\n $masterName = explode('/', $className);\n $newClassName = ucfirst(end($masterName));\n if(count($masterName) > 1) {\n array_pop($masterName);\n $subfolder = implode('\\\\', $masterName);\n if(!file_exists(\".\\\\modules\\\\models\\\\{$subfolder}\")) {\n if(!mkdir(\".\\\\modules\\\\models\\\\{$subfolder}\", 0777, true)) {\n die(\"\\n fatal: something error please try again. \\n\");\n }\n }\n // next new className\n $newClassName = $subfolder .\"\\\\\". $newClassName;\n }\n // check class is duplicate\n foreach (scandir(\".\\\\modules\\\\models\\\\\". @$subfolder) as $fileName) {\n $file = explode('.php', $fileName);\n $file = trim(@$subfolder .\"\\\\\". current($file), \"\\\\\");\n if($file === $newClassName) {\n die(\"\\n The class `{$newClassName}` is duplicate. \\n\");\n }\n }\n // Read file content\n $fileContent = file_get_contents(__DIR__.'./tmpModel.php');\n // do the replacements, modifications, etc. on $fileContent\n // This is just an example\n $classNameReplace = explode(\"\\\\\", $newClassName);\n $fileContent = str_replace('{{className}}', end($classNameReplace), $fileContent);\n // write the content to a new file\n if(file_put_contents(\".\\\\modules\\\\models\\\\{$newClassName}.php\", $fileContent)) {\n die(\"\\n make the model `{$newClassName}` is successfully. \\n\");\n } else {\n die(\"\\n make the model failed. Please try again. \\n\");\n }\n break;\n /**\n * @make:view\n * \n */\n case 'view':\n // check view store exists.\n if(!file_exists(\".\\\\views\")) {\n die(\"\\n fatal: The `.\\\\views` folder not found. \\n\");\n }\n // check specify view name\n if(!$className) {\n die(\"\\n Please specify view name. \\n\");\n }\n // check include subfolder\n $masterName = explode('/', $className);\n if(count($masterName) > 1) {\n $endClassName = end($masterName);\n array_pop($masterName);\n $subfolder = implode('\\\\', $masterName);\n if(!file_exists(\".\\\\views\\\\{$subfolder}\")) {\n if(!mkdir(\".\\\\views\\\\{$subfolder}\", 0777, true)) {\n die(\"\\n fatal: something error please try again. \\n\");\n }\n }\n // next new className\n $className = $subfolder .\"\\\\\". $endClassName;\n }\n // include .view\n $className = $className.'.view';\n // check view is duplicate\n foreach (scandir(\".\\\\views\\\\\". @$subfolder) as $fileName) {\n $file = explode('.php', $fileName);\n $file = trim(@$subfolder .\"\\\\\". current($file), \"\\\\\");\n if($file === $className) {\n die(\"\\n The view `{$className}` is duplicate. \\n\");\n }\n }\n // argument passer\n if(self::$argument == '--blog') {\n // Read file content (bootstrap)\n $fileContent = file_get_contents(__DIR__.'./tmpViewBootstrap.php');\n } elseif(self::$argument == '--html') {\n // Read file content\n $fileContent = file_get_contents(__DIR__.'./tmpViewHtml.php');\n } else {\n // Read file content\n $fileContent = file_get_contents(__DIR__.'./tmpViewBlank.php');\n }\n // do the replacements, modifications, etc. on $fileContent\n // This is just an example\n $fileContent = str_replace('{{className}}', $className, $fileContent);\n // write the content to a new file\n if(file_put_contents(\".\\\\views\\\\{$className}.php\", $fileContent)) {\n die(\"\\n make the view `{$className}` is successfully. \\n\");\n } else {\n die(\"\\n make the view failed. Please try again. \\n\");\n }\n break;\n default:\n die(\"\\n command `make:{$make}` is incorrect. \\n\\n The most similar command is: \\n make:entry \\n make:controller \\n make:model \\n make:view \\n\");\n break;\n }\n }", "public function wcfmgs_ajax_controller() {\r\n \tglobal $WCFM, $WCFMgs;\r\n \t\r\n \t$controller = '';\r\n \tif( isset( $_POST['controller'] ) ) {\r\n \t\t$controller = $_POST['controller'];\r\n \t\t\r\n \t\tswitch( $controller ) {\r\n\t \t\r\n\t\t\t\tcase 'wcfm-capability':\r\n\t\t\t\t\tinclude_once( $this->controllers_path . 'wcfmgs-controller-capability.php' );\r\n\t\t\t\t\tnew WCFMgs_Capability_Controller();\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t\tcase 'wcfm-groups':\r\n\t\t\t\t\tinclude_once( $this->controllers_path . 'wcfmgs-controller-groups.php' );\r\n\t\t\t\t\tnew WCFMgs_Groups_Controller();\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t\tcase 'wcfm-groups-manage':\r\n\t\t\t\t\tinclude_once( $this->controllers_path . 'wcfmgs-controller-groups-manage.php' );\r\n\t\t\t\t\tnew WCFMgs_Groups_Manage_Controller();\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t\tcase 'wcfm-managers':\r\n\t\t\t\t\tinclude_once( $this->controllers_path . 'wcfmgs-controller-managers.php' );\r\n\t\t\t\t\tnew WCFMgs_Managers_Controller();\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t\tcase 'wcfm-managers-manage':\r\n\t\t\t\t\tinclude_once( $this->controllers_path . 'wcfmgs-controller-managers-manage.php' );\r\n\t\t\t\t\tnew WCFMgs_Managers_Manage_Controller();\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t\tcase 'wcfm-staffs':\r\n\t\t\t\t\tinclude_once( $this->controllers_path . 'wcfmgs-controller-staffs.php' );\r\n\t\t\t\t\tnew WCFMgs_Staffs_Controller();\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t\tcase 'wcfm-staffs-manage':\r\n\t\t\t\t\tinclude_once( $this->controllers_path . 'wcfmgs-controller-staffs-manage.php' );\r\n\t\t\t\t\tnew WCFMgs_Staffs_Manage_Controller();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected function buildClass($name)\n {\n $this->line(\"<info>Creating</info> \" . $this->getNameInput());\n\n $controllerNamespace = $this->getNamespace($name);\n\n $replace = [];\n\n if ($this->option('service')) {\n $replace = $this->buildServiceReplacements($replace);\n }\n\n if ($this->option('base')) {\n $replace = $this->buildBaseReplacements($replace);\n }\n\n if ($this->option('otp')) {\n $replace = $this->buildOtpReplacements($replace);\n }\n\n $replace[\"use {$controllerNamespace}\\Controller;\\n\"] = '';\n\n return str_replace(\n array_keys($replace), array_values($replace), parent::buildClass($name)\n );\n }", "public static function buildClassName($p_main)\n {\n return self::CONTROLLER_NS.'\\\\'.ucfirst($p_main).\"Controller\";\n }", "private function exec($version){\n $controllerPath = __DIR__ . '/../app/controllers/' .$this->getUrl()->getType().'/'.$this->getUrl()->getController().'Controller.php';\n\n if(file_exists($controllerPath)){\n require_once $controllerPath;\n\n if($this->getUrl()->getType() == Controller::TYPE_AJAX){\n //Todo process AJAX request\n }elseif($this->getUrl()->getType() == Controller::TYPE_URL){\n $className = $this->getUrl()->getController().'Controller';\n if (class_exists($className)) {\n $Class = new $className;\n $methodName = $this->getUrl()->getAction().'Action';\n if(method_exists($Class,$methodName)){\n $data = $this->getData();\n $data['feedback'] = $this->getFeedback();\n $result = $Class->$methodName($data);\n if(!empty($result)){\n $data = array_merge($result, $data);\n }\n if($data['errors'] = $Class->getErrors()){\n $data['feedback'] = $this->getFeedback();\n $result = $Class->formAction($data);\n if(!empty($result)){\n $data = array_merge($result, $data);\n }\n $templatePath = __DIR__ . '/../app/views/' .strtolower($this->getUrl()->getController()).'/FormView.php';\n }else{\n $templatePath = __DIR__ . '/../app/views/' .strtolower($this->getUrl()->getController()).'/'.ucfirst($this->getUrl()->getAction()).'View.php';\n }\n $headerTemplatePath = __DIR__ . '/../app/views/html/HeaderView.php';\n $footerTemplatePath = __DIR__ . '/../app/views/html/FooterView.php';\n if(file_exists($templatePath)){\n require_once $headerTemplatePath;\n require_once $templatePath;\n require_once $footerTemplatePath;\n }else{\n throw new Exception(\"The view '{$this->getUrl()->getController()}View.php' does not exist. Please create view\");\n }\n }else{\n throw new Exception(\"The method '{$methodName}' does not exist on '{$className}'. Please create method\");\n }\n }else{\n throw new Exception(\"The class '{$className}' does not exist. Please create class\");\n }\n }\n }else{\n throw new Exception(\"The controller '{$this->getUrl()->getType()}\".\"/\".\"{$this->getUrl()->getController()}'Controller.php does not exist. Please create file\");\n }\n }", "public function run()\n {\n \\App\\Model\\TemplateLib::create([\n 'name' => 'FNK Test',\n 'stylesheet' => 'body {background:white};',\n 'javascript' => '',\n 'code_header' => $this->codeHeader,\n 'code_footer' => $this->codeFooter,\n 'code_index' => $this->codeIndex,\n 'code_search' => '<h1>saya di search</h1>',\n 'code_category' => '<h1>saya di category</h1>',\n 'code_page' => $this->codePage,\n 'code_post' => $this->codePost,\n 'code_about' => '<h1>saya di about</h1>',\n 'code_404' => '<h1>saya di 404</h1>',\n ]);\n }", "function buildAcl() {\n \t\t$this->autoRender=false;\n $log = array();\n \n $aco =& $this->Acl->Aco;\n $root = $aco->node('controllers');\n if (!$root) {\n \n $aco->create(array('parent_id'\n => null, 'model' \n=> null, 'alias' \n=> 'controllers'));\n \n $root = $aco->save();\n \n $root['Aco']['id'] = $aco->id; \n \n $log[] = 'Created Aco node for \ncontrollers';\n } else {\n \n $root = $root[0];\n } \n \n App::import('Core',\n 'File');\n $Controllers = Configure::listObjects('controller');\n $appIndex = array_search('App', $Controllers);\n if ($appIndex\n !== false ) {\n \n unset($Controllers[$appIndex]);\n }\n $baseMethods = get_class_methods('Controller');\n $baseMethods[] = 'buildAcl';\n \n // look at each controller in app/controllers\n foreach ($Controllers\n as $ctrlName) {\n \n App::import('Controller', $ctrlName);\n \n $ctrlclass = $ctrlName\n . 'Controller';\n \n $methods = get_class_methods($ctrlclass);\n \n \n // find / make controller node\n \n $controllerNode = $aco->node('controllers/'.$ctrlName);\n \n if (!$controllerNode) {\n \n $aco->create(array('parent_id'\n => $root['Aco']['id'], 'model'\n => null, 'alias' \n=> $ctrlName));\n \n $controllerNode = $aco->save();\n \n $controllerNode['Aco']['id']\n = $aco->id;\n \n $log[] = 'Created Aco node for '.$ctrlName;\n \n } else {\n \n $controllerNode = $controllerNode[0];\n \n }\n \n \n //clean the methods. to remove those in Controller and private actions.\n \n foreach ($methods as $k => $method) {\n \n if (strpos($method, '_',\n 0) === 0) {\n \n unset($methods[$k]);\n \n continue;\n \n }\n \n if (in_array($method, $baseMethods)) {\n \n unset($methods[$k]);\n \n continue;\n \n }\n \n $methodNode = $aco->node('controllers/'.$ctrlName.'/'.$method);\n \n if (!$methodNode) {\n \n $aco->create(array('parent_id' => $controllerNode['Aco']['id'], 'model'\n => null, 'alias' \n=> $method));\n \n $methodNode =\n $aco->save();\n \n $log[] = 'Created\n Aco node for '. $method;\n \n }\n \n }\n }\n debug($log);\n }", "abstract public function build();", "abstract public function build();", "public function __construct()\n {\n $_RM = $_SERVER['REQUEST_METHOD'];\n $content = null;\n\n /**\n * If the request was a PATCH or DELETE request.\n * The request should be in JSON in this version of the API.\n */\n if($_RM == 'PATCH' || $_RM == 'DELETE' || $_RM == 'POST'){\n $request_content = file_get_contents(\"php://input\");\n if($request_content!=false){\n $content = json_decode($request_content,true);\n }\n }\n\n $params = isset($_GET['url'])?explode('/',$_GET['url']):[''];\n\n /**\n * Just listing all available controllers/classes for this api.\n * An error will be returned within the response if it does not exist.\n */\n $rootPath = realpath(__DIR__ . DIRECTORY_SEPARATOR . '..');\n $controlDir = DIRECTORY_SEPARATOR.'Controllers'.DIRECTORY_SEPARATOR;\n $controlPath = $rootPath.$controlDir;\n $fileName = ucwords($params[0]);\n\n $file = $controlPath.$fileName.'.php';\n\n if (file_exists($file)) {\n\n $className = 'Vimeochallenge\\\\Source\\\\'.ucwords($params[0]);\n $controller = new $className;\n\n //Set the proper method to be used based on the REQUEST_METHOD.\n switch($_RM){\n case 'GET' :\n $arg = $params;\n $method = 'getData';\n break;\n case 'POST' :\n $arg = $content;\n $method = 'postData';\n break;\n case 'DELETE' :\n $arg = $content;\n $method = 'deleteData';\n break;\n case 'PATCH' :\n $arg = $content;\n $method = 'patchData';\n break;\n default:\n $method = 'unknown';\n }\n\n /**\n * Use the method if it exists within the class.\n * Send argument within the contorller's method.\n */\n if (method_exists($controller, $method)) {\n $controller->setUri($params);\n $controller->$method($arg);\n } else {\n $controller->setError('Invalid Method ('.$method.')');\n }\n\n /**\n * Get the response from our controller and return it in JSON.\n * This can be changed to return in a different format if required.\n */\n $response = $controller->getResponse();\n\n } else {\n $response = ['status'=>false,'reason'=>'Invalid Request'];\n }\n\n /**\n * Output JSON to client as final view.\n * This can be changed to handle different Output Formats.\n */\n echo json_encode($response);\n }", "public function generate()\n {\n $placeHolders = [\n '<nameSpace>',\n '<useSpace>',\n '<annotation>',\n '<className>',\n '<body>',\n ];\n\n $replacements = [\n $this->generateNameSpace(),\n $this->generateUseStatements(),\n $this->generateAnnotation(),\n $this->generateClassName(),\n $this->generateBody(),\n ];\n\n $code = str_replace($placeHolders, $replacements, self::$classTemplate);\n\n return str_replace('<spaces>', $this->baseClass->getSpaces(), $code);\n }", "public function getController( );", "public function __construct()\n {\n //print_r($this->getUrl()) ;\n $url =$this->getUrl();\n //LOOK IN Controller for first value\n\n\n\n if(file_exists('..'.DS.'app'.DS.'controllers'.DS.ucwords($url[0]).'.php'))\n {\n //if exists set as controller\n $this->currentController=ucwords($url[0]);\n //unset zero index\n unset($url[0]);\n }\n $classControllers='MVCPHP\\controllers\\\\'.$this->currentController;\n //Require controller\n //require_once '../app/controllers/'.$this->currentController.'.php';\n $classController =new $classControllers();\n //CHECK for second part of url\n //var_dump($url);\n if(isset($url[1]))\n {\n if(method_exists($classController,$url[1]))\n {\n $this->currentMethod=$url[1];\n unset($url[1]);\n }\n }\n // GET PARAMS\n\n $this->params =$url?array_values($url) : [];\n //var_dump($classController);\n call_user_func_array([$classController,$this->currentMethod],$this->params);\n\n }", "public function run()\r\n\t{\r\n\t\t// function http_build_query ($query_data, $numeric_prefix = null, $arg_separator = null, $enc_type = PHP_QUERY_RFC1738);\r\n\t\t/**\r\n\t\t * @link http://php.net/manual/en/function.http-build-query.php\r\n\t\t */\r\n\t\t$url = '/' . ((isset($_GET['param'])) ? $_GET['param'] : '');\r\n\t\t$params = array();\r\n\r\n\t\tif (!empty($url) && $url != '/') {\r\n\r\n\t\t\t$url = explode('/', $url);\r\n\t\t\tarray_shift($url);\r\n\r\n\t\t\t$currentController = $url[0] . 'Controller';\r\n\t\t\tarray_shift($url);\r\n\r\n\t\t\tif (isset($url[0])) {\r\n\t\t\t\t$currentAction = $url[0];\r\n\t\t\t\tarray_shift($url);\r\n\t\t\t} else {\r\n\t\t\t\t$currentAction = 'index';\r\n\t\t\t}\r\n\r\n\t\t\tif (count($url) > 0) {\r\n\t\t\t\t$params = $url;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\tif (empty($url) || $url == '/') {\r\n\t\t\t$currentController = 'homeController';\r\n\t\t\t$currentAction = 'index';\r\n\t\t}\r\n\r\n\t\trequire_once __DIR__ . 'core/Controller.php';\r\n\r\n\t\t$instanceController = new $currentController();\r\n\r\n\t\t$arrayControllerAndAction = array($instanceController, $currentAction);\r\n\r\n\t\tcall_user_func_array($arrayControllerAndAction, $params);\r\n\t}", "public function __defaultController() {\n\n\t\t// Include only the Class needed\n\t\t$app = $this->app;\n\t\t$bind = $this->bind;\n\t\t$action = $this->action;\n\t\t$view_display = $this->view_display;\n\n\t\t$classFile = MVC_BASE_PATH.'/apps/greystone/models/'.$bind.'.php';\n\t\t$classView = MVC_BASE_PATH.'/apps/greystone/views/'.$view_display.'.php';\n\t\t$classAction = MVC_BASE_PATH.'/'.$bind.'.php?action='.$action;\n\t\t\n\t\t// Load and verify Class\n\t\trequire_once($classFile);\n\n\t\tif (class_exists($bind)) {\n\t\t\ttry {\n\t\t\t\t$instance = new $bind();\n\t\t\t\tif(!MVC_App::isValid($instance)) {\n\t\t\t\t\tdie('Not the object I am looking for.');\n\t\t\t\t}\t\t\t\t\n\t\t\t} catch (Exeception $e) {\n\t\t\t\techo 'Message: ' .$e->getMessage();\n\t\t\t\tdie(\"The requested class does not exists!\");\n\t\t\t}\n\t\t} else {\n\t\t\techo 'Message: Danger, Danger, Will Robinson!' ;\n\t\t\tdie(\"The requested class does not exists!\");\n\t\t}\n\n\t\t$instance->appName = $app;\n\t\t$result = array();\n\n\t\t// Execute and verify Class Action\n\t\ttry {\n\t\t\t$result = $instance->$action();\n\t\t} catch (Exeception $e) {\n\t\t\techo 'Message: ' .$e->getMessage();\n\t\t\tdie(\"No action found.\");\n\t\t}\n\n\t\t//Send the model results to view\n\t\t$view = MVC_View::factory($instance->view,$instance);\n\n\t\t$view->app = $app;\n\t\t$view->bind = $bind;\n\t\t$view->action = $action;\n\t\t$view->view_display = $view_display;\n\n\t\t$view->display();\n\n\t}", "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 }", "public function __construct(){\r\n $app = Application::getInstance();\r\n $this->_controller = $app->getController();\r\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}", "public function buildFrontend()\n {\n global $TSFE;\n EidUtility::initLanguage();\n\n /** @var TypoScriptFrontendController $TSFE */\n $TSFE = GeneralUtility::makeInstance('TYPO3\\\\CMS\\\\Frontend\\\\Controller\\\\TypoScriptFrontendController',\n $GLOBALS['TYPO3_CONF_VARS'], 0, 0);\n EidUtility::initLanguage();\n\n // Get FE User Information\n $TSFE->initFEuser();\n // Important: no Cache for Ajax stuff\n $TSFE->set_no_cache();\n $TSFE->initTemplate();\n // $TSFE->getConfigArray();\n Bootstrap::getInstance()\n ->loadCachedTca();\n $TSFE->cObj = GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer');\n $TSFE->settingLanguage();\n $TSFE->settingLocale();\n }", "public function __construct()\n {\n $this->controller = new DHTController();\n }", "public function __construct()\n {\n $url = $this->getUrl();\n // Look in controllers folder for first value and ucwords(); will capitalise first letter \n if (isset($url[0]) && file_exists('../app/controllers/' . ucwords($url[0]) . '.php')) {\n $this->currentController = ucwords($url[0]); // Setting the current controllers name to the name capitilised first letter\n unset($url[0]); \n }\n\n // Require the controller\n require_once '../app/controllers/' . $this->currentController . '.php';\n // Taking the current controller and instantiating the controller class \n $this->currentController = new $this->currentController;\n // This is checking for the second part of the URL\n if (isset($url[1])) {\n if (method_exists($this->currentController, $url[1])) { // Checking the seond part of the url which is the corresponding method from the controller class\n $this->currentMethod = $url[1];\n unset($url[1]);\n }\n }\n\n // Get params, if no params, keep it empty\n $this->params = $url ? array_values($url) : []; \n\n // Call a callback with array of params\n call_user_func_array([$this->currentController, $this->currentMethod], $this->params);\n }", "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}", "public function launch()\r\n\t{\r\n\t\t// Corrige le nom du controller.\r\n\t\t// ajoute le namespace et met la 1er lettre en majuscule\r\n\t\t$controller = \"\\\\application\\\\controllers\\\\\";\r\n\t\t$controller .= ucfirst($this->controller);\r\n\r\n\t\t// si la classe existe\r\n\t\tif(class_exists($controller))\r\n\t\t\t$controller = new $controller;\r\n\r\n\t\t// Si la class $controller n'existe pas\r\n\t\telse\r\n\t\t{\r\n\t\t\t// transformation en page d'erreur\r\n\t\t\theader(\"HTTP/1.0 404 Not Found\");\r\n\r\n\t\t\t// alors le controller d'erreur est instancé\r\n\t\t\t$controller = new \\application\\controllers\\Error;\r\n\r\n\t\t\t// appel la method index du controller d'erreur\r\n\t\t\treturn $controller->index();\r\n\t\t}\r\n\r\n\t\t// Si la variable restfull est fause\r\n\t\tif(!$controller->restful)\r\n\t\t\t$method = \"action_\".$this->method;\r\n\r\n\t\telse\r\n\t\t{\r\n\t\t\t// alors peu être appelé par le type de request\r\n\t\t\t// ex: get_index(), post_index(), put_index() or delete_index()\r\n\t\t\t$method = strtolower($_SERVER['REQUEST_METHOD']).\"_\" .$this->method;\r\n\t\t}\r\n\r\n\t\t// Vérifie que la method existe dans le controller\r\n\t\tif(method_exists($controller, $method))\r\n\t\t\t// Appel la method du controller en lui passant des parametres\r\n\t\t\treturn call_user_func_array(array($controller, $method), array($this->args));\r\n\r\n\t\telse\r\n\t\t{\r\n\t\t\t// transformation en page d'erreur\r\n\t\t\theader(\"HTTP/1.0 404 Not Found\");\r\n\r\n\t\t\t// alors le controller d'erreur est instancé\r\n\t\t\t$controller = new \\application\\controllers\\Error;\r\n\r\n\t\t\t// appel la method index du controller d'erreur\r\n\t\t\treturn $controller->index();\r\n\t\t}\r\n\t}", "private function createControllerData() : void\n {\n //Get the current url.\n $url = current_url();\n\n //Only get the part that interests us (CalculIP/Path/OtherPath..)\n $menu_path = substr($url, strpos($url, 'CalculIP'));\n\n //If the path ends with a / like for the index, remove it.\n if ($menu_path[strlen($menu_path) - 1] === '/') {\n $menu_path = substr($menu_path, 0, -1);\n }\n\n //Split the path into an array to create our link.\n $path_array = explode('/', $menu_path);\n\n //This array is only used for the menu.\n $menu_data = [\n \"path_array\" => $path_array,\n \"title\" => $this->controller_data[self::DATA_TITLE]\n ];\n\n //If the user is connected then append the right information to the menu view.\n if (isset($_SESSION[\"connect\"])) {\n $menu_data[\"user_name\"] = $this->session->get(\"phpCAS\")['attributes']['displayName'];\n $menu_data[\"user_id\"] = $this->session->get(\"connect\");\n }\n\n //Build the data for all controllers.\n $this->controller_data = [\n self::DATA_TITLE => \"Please set the title in the right controller\",\n \"menu_view\" => view('Templates/menu', $menu_data),\n ];\n }", "public function start()\n\t{\n\t\t// Get contoller and action names\n\t\t$this->getControllerName();\n\t\t$this->getActionName();\n\n\t\t// Set Names of executing class and action names\n\t\t$this->class_Name = ucfirst($this->controllerName);\n\t\t$this->action_Name = ucfirst($this->actionName);\n\n\t\t// Set globals variable\n\t\t$this->setGlobalsData();\n\n\t\t// Run action\n\t\t$this->getControllerAction();\n\t}", "public function run()\n \t{\n \t\t$controller = $this->factoryController();\n\n \t\t$action = $this->_currentAction;\n\n \t\t$controller->$action();\n \t}", "public function run()\r\n\t{\r\n\t\t$this->loadModule();\r\n\t\r\n\t\t$this->loadController();\r\n\t\r\n\t\t// this can be overwritten by user in controller\r\n\t\t$this->loadDefaultView();\r\n\t}" ]
[ "0.76378495", "0.69593275", "0.6612044", "0.63657856", "0.6364625", "0.6307347", "0.6159062", "0.6103015", "0.6001615", "0.59907675", "0.59742385", "0.5960749", "0.5897713", "0.5847798", "0.58380556", "0.58206534", "0.5815021", "0.58129555", "0.5805207", "0.57749593", "0.575738", "0.5721887", "0.5681796", "0.56592", "0.5649484", "0.5647733", "0.56195796", "0.5594257", "0.55770415", "0.556659", "0.55626065", "0.5555698", "0.55470914", "0.55245066", "0.552402", "0.552402", "0.5522238", "0.5511553", "0.551111", "0.5510661", "0.54887193", "0.5479883", "0.5479883", "0.5479883", "0.5479883", "0.5479883", "0.5479883", "0.5479883", "0.5468048", "0.5466688", "0.5443881", "0.5438491", "0.5427897", "0.54081064", "0.5402751", "0.5394246", "0.5380614", "0.5372236", "0.53670496", "0.53670496", "0.5366678", "0.53643376", "0.5360691", "0.5343498", "0.5336073", "0.5325172", "0.53178436", "0.5312294", "0.5305917", "0.5304914", "0.5298975", "0.5297692", "0.52929884", "0.5280033", "0.52747405", "0.52743375", "0.52642584", "0.52635", "0.5258937", "0.5256884", "0.52559674", "0.5255828", "0.5255828", "0.524134", "0.52360606", "0.52355754", "0.52338094", "0.5233433", "0.52287304", "0.5228684", "0.5215451", "0.52092344", "0.5205979", "0.5205813", "0.52055746", "0.5205365", "0.5201379", "0.51952744", "0.5191453", "0.5189554", "0.5187318" ]
0.0
-1
Rewrite a script component path.
public static function rebuildComponentPath(string $namespace, string $path) { $namespace = $namespace ?? ''; $namespace_dir = Str::contains($namespace ?? '', '\\') ? Str::afterLast('\\', $namespace) : $namespace; if (Str::lower($namespace_dir) !== Str::lower(Path::new($path)->basename())) { // If the last part of both namespace and path are not the same $parts = array_reverse(explode('\\', $namespace)); foreach ($parts as $value) { if (Str::contains($path, $value)) { $path = sprintf('%s%s%s', rtrim( $path, \DIRECTORY_SEPARATOR ), \DIRECTORY_SEPARATOR, ltrim( Str::replace( '\\', \DIRECTORY_SEPARATOR, Str::afterLast($value, $namespace) ), \DIRECTORY_SEPARATOR )); break; } } } return $path; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static function setScriptRelativePath() {\n\t\tself::$_ScriptRelativePath = str_replace(\n\t\t\tself::getConfig()->getBasePath().self::getDirSeparator(), '', self::getScriptPath()\n\t\t);\n\t}", "public function setScriptPath()\n\t{\n\t\t$this->scriptPath = Yii::getPathOfAlias('webroot').$this->ds.$this->suffix.$this->ds;\n\t}", "function url_for($script_path) {\n //add the leading '/' if not present\n if ($script_path[0] != '/') {\n $script_path = \"/\" . $script_path;\n }\n return WWW_ROOT . $script_path;\n }", "function url_for($script_path) {\n\t// adds the leading '/' if it isn't already passed through the argument\n\tif($script_path[0] != '/') {\n\t\t$script_path = \"/\" . $script_path;\n\t}\n\treturn WWW_ROOT . $script_path;\n}", "function urlForPath($script_path)\n{\n // Add the leading '/' if not present\n if ($script_path[0] != '/') {\n $script_path = '/' . $script_path;\n }\n return WWW_ROOT . $script_path;\n}", "function url_for($script_path) {\n\t\t// add the leading '/' if not present\n\t\tif($script_path[0] != '/') {\n\t\t\t$script_path = '/'. $script_path;\n\t\t}\n\t\treturn WWW_ROOT . $script_path;\n\t}", "function url_for($script_path){\n\n if ($script_path[0] != '/') {\n $script_path = '/' . $script_path;\n }\n \n return WWW_ROOT . $script_path;\n \n}", "function url_for($script_path)\n{\n // Add a leading \"/\" if not present\n if ($script_path[0] != '/') {\n $script_path = '/' . $script_path;\n }\n return WWW_ROOT . $script_path;\n}", "function url_for($script_path) {\r\n // add the leading '/' if not present\r\n if($script_path[0] != '/') {\r\n $script_path = \"/\" . $script_path;\r\n }\r\n return WWW_ROOT . $script_path;\r\n}", "function url_for($script_path) {\n if($script_path[0] != '/') {\n $script_path = \"/\" . $script_path;\n }\n return WWW_ROOT . $script_path;\n}", "function url_for($script_path){\n\nif($script_path[0] != '/'){\n \n $script_path = \"/\" . $script_path;\n}\n\n//echo WWW_ROOT .$script_path;\n\n\nreturn WWW_ROOT . $script_path;\n\n}", "public static function urlFor($script_path) {\r\n # add the leading '/' if not present\r\n if ($script_path[0] != '/') {\r\n $script_path = \"/\" . $script_path;\r\n }\r\n return WWW_ROOT . $script_path;\r\n }", "function url_for($script_path){\r\n // return the absolute path\r\n if($script_path[0] != '/'){\r\n $script_path = \"/\" . $script_path;\r\n }\r\n return WWW_ROOT . $script_path;\r\n}", "public function setScriptPath($path);", "protected function getComponentsPath(): string\n {\n return resource_path('js/Components');\n }", "public function rewrite();", "public function prefixLocalAnchorsWithScript() {}", "private static function setScriptPath() {\n\t\tif ( self::getIsCli() ) {\n\t\t\tif ( substr($_SERVER['SCRIPT_NAME'],0,1) == self::getDirSeparator() ) {\n\t\t\t\tself::$_ScriptPath = dirname($_SERVER['SCRIPT_NAME']);\n\t\t\t} else {\n\t\t\t\tif ( isset($_SERVER['PWD']) && strpos($_SERVER['PWD'], '/cygdrive') === 0 ) {\n\t\t\t\t\t// if running under cygwin, the path is from the cygwin terminal\n\t\t\t\t\t$pwd = preg_replace('/\\/cygdrive\\/([A-Z]{1})\\//i', '\\1:/', $_SERVER['PWD']);\n\t\t\t\t\t$pwd = ucfirst(str_replace(array('\\\\', '/'), self::getDirSeparator(), $pwd));\n\t\t\t\t\t$apath = explode(self::getDirSeparator(), $pwd);\n\t\t\t\t} else {\n\t\t\t\t\tif ( isset($_SERVER['PWD']) ) {\n\t\t\t\t\t\t$apath = explode(self::getDirSeparator(), substr($_SERVER['PWD'],1));\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$apath = explode(self::getDirSeparator(), substr(dirname(dirname(dirname(__FILE__))),1));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$pos = count($apath)-1;\n\t\t\t\t$ascript = explode(self::getDirSeparator(), $_SERVER['SCRIPT_NAME']);\n\t\t\t\tforeach ($ascript as $val) {\n\t\t\t\t\tif ($val == '.') continue;\n\t\t\t\t\tif ($val == '..') {\n\t\t\t\t\t\t$pos--;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif ($pos < -1) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t$apath[++$pos] = $val;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ( isset($_SERVER['PWD']) && strpos($_SERVER['PWD'], '/cygdrive') === 0 ) {\n\t\t\t\t\tself::$_ScriptPath = trim(dirname(implode(self::getDirSeparator(), $apath)));\n\t\t\t\t} else {\n\t\t\t\t\tself::$_ScriptPath = trim(dirname(self::getDirSeparator().implode(self::getDirSeparator(), $apath)));\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tself::$_ScriptPath = str_replace(\n\t\t\t\tarray('\\\\', '/'), self::getDirSeparator(), dirname($_SERVER['SCRIPT_FILENAME'])\n\t\t\t);\n\t\t}\n\t}", "abstract public function server_path($manipulation_name = '');", "function smarty_modifier_toAssetPath($string) {\n\n if (strpos($string, \"::\") !== false) {\n $parts = explode(\"::\", $string);\n $src = ModulesContext::instance()->getConfig()->get(\"businessRoot\", \"src\");\n $base = trim(str_replace(\"::\", \"/\", $src), \"/\");\n $result = \"$base/$parts[0]/assets/$parts[1]\";\n } else {\n $result = \"assets/$result\";\n }\n\n $resultingPath = Loader::toSinglePath($result, \".tpl\");\n\n return $resultingPath;\n}", "function setScript($value){\n $this->_options['script']=CHtml::normalizeUrl($value);\n }", "public static function rewriteScriptSourcePaths($query_path, array $url_base_alters, $file_path, $base_for_relative, $destination_base_url) {\n $attributes = [\n 'src' => 'script[src], embed[src]',\n 'value' => 'param[value]',\n ];\n $script_path_count = 0;\n $report = [];\n self::rewriteFlashSourcePaths($query_path, $url_base_alters, $file_path, $base_for_relative, $destination_base_url);\n foreach ($attributes as $attribute => $selector) {\n // Find all the selector on the page.\n $links_to_pages = $query_path->top($selector);\n // Initialize summary report information.\n $script_path_count += $links_to_pages->size();\n // Loop through them all looking for src or value path to alter.\n foreach ($links_to_pages as $link) {\n $href = trim($link->attr($attribute));\n $new_href = self::rewritePageHref($href, $url_base_alters, $file_path, $base_for_relative, $destination_base_url);\n // Set the new href.\n $link->attr($attribute, $new_href);\n\n if ($href !== $new_href) {\n // Something was changed so add it to report.\n $report[] = \"$attribute: $href changed to $new_href\";\n }\n }\n }\n // Message the report (no log).\n Message::makeSummary($report, $script_path_count, 'Rewrote script src');\n }", "function rewriteUrl($path)\n {\n global $rewriteUrlList;\n $path = ltrim($path, './');\n $urlArray = explode('/', $path);\n if (isset($rewriteUrlList[$urlArray[0]])) {\n $urlArray[0] = $rewriteUrlList[$urlArray[0]];\n }\n return implode('/', $urlArray) != '' ? implode('/', $urlArray) : './';\n }", "function DFPath($path, $script = '', $useDefaultSuffix = true) {\n\n $script = ($script != '') ? $script . ($useDefaultSuffix ? '.php' : '') : '';\n return (DSettings::$paths['baseDirectory'] . ($path == '.' ? '' : str_replace('.', SLASH, $path) . SLASH)) . $script;\n //DFrameworkPath\n}", "function translatePath($file) {\n // // // // //\n // // /// ///\n ////// // // ///\n // // /////// // //\n // // // // // //\n return substr($file, strlen(dirname($_SERVER['SCRIPT_FILENAME']))+1);\n }", "function rewritePath($path)\n {\n global $rewritePathList;\n $path = ltrim($path, './');\n $urlArray = explode('/', $path);\n if (isset($rewritePathList[$urlArray[0]])) {\n $urlArray[0] = $rewritePathList[$urlArray[0]];\n }\n return implode('/', $urlArray) != '' ? implode('/', $urlArray) : './';\n }", "public function updateJsRouter()\n {\n if(! array_key_exists( 'js_router', $this->options['paths'] )) {\n return;\n }\n $target = base_path($this->options['paths']['js_router']);\n\n // set import\n $hook = '/* bread_js_router_import */';\n $file = base_path($this->options['paths']['stubs']) . '/resources/assets/js/components/router_import.js';\n $this->updateFileContent($target, $hook, $file);\n\n // set route\n $hook = '/* bread_js_router_route */';\n $file = base_path($this->options['paths']['stubs']) . '/resources/assets/js/components/router_route.js';\n $this->updateFileContent($target, $hook, $file);\n }", "private static function _initViewScriptsFullPathBase () {\n\t\t$app = & \\MvcCore\\Application::GetInstance();\n\t\tself::$_viewScriptsFullPathBase = implode('/', [\n\t\t\t$app->GetRequest()->GetAppRoot(),\n\t\t\t$app->GetAppDir(),\n\t\t\t$app->GetViewsDir()\n\t\t]);\n\t}", "protected function setComponentPath()\n {\n return $this->aframe_component_path = $this->getPublicRoot() . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . $this->aframe_component_vendor . DIRECTORY_SEPARATOR . $this->aframe_component_name;\n }", "protected static function getPathThisScript() {}", "protected function determineScriptUrl()\n {\n if ($routePath = GeneralUtility::_GP('route')) {\n $router = GeneralUtility::makeInstance(Router::class);\n $route = $router->match($routePath);\n $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);\n $this->thisScript = (string)$uriBuilder->buildUriFromRoute($route->getOption('_identifier'));\n } elseif ($moduleName = GeneralUtility::_GP('M')) {\n $this->thisScript = BackendUtility::getModuleUrl($moduleName);\n } else {\n $this->thisScript = GeneralUtility::getIndpEnv('SCRIPT_NAME');\n }\n }", "public static function rewriteFlashSourcePaths($query_path, array $url_base_alters, $file_path, $base_for_relative, $destination_base_url) {\n $scripts = $query_path->top('script[type=\"text/javascript\"]');\n foreach ($scripts as $script) {\n $needles = [\n \"'src','\",\n \"'movie','\",\n ];\n $script_content = $script->text();\n foreach ($needles as $needle) {\n $start_loc = stripos($script_content, $needle);\n if ($start_loc !== FALSE) {\n $length_needle = strlen($needle);\n // Shift to the end of the needle.\n $start_loc = $start_loc + $length_needle;\n $end_loc = stripos($script_content, \"'\", $start_loc);\n $target_length = $end_loc - $start_loc;\n $old_path = substr($script_content, $start_loc, $target_length);\n if (!empty($old_path)) {\n // Process the path.\n $new_path = self::rewritePageHref($old_path, $url_base_alters, $file_path, $base_for_relative, $destination_base_url);\n // Replace.\n $script_content = str_replace(\"'$old_path'\", \"'$new_path'\", $script_content);\n if ($old_path !== $new_path) {\n // The path changed, so put it back.\n $script->text($script_content);\n }\n }\n }\n }\n }\n }", "protected function determineScriptUrl() {}", "protected function determineScriptUrl() {}", "protected function determineScriptUrl() {}", "protected function determineScriptUrl()\n {\n if ($routePath = GeneralUtility::_GP('route')) {\n $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);\n $this->thisScript = (string)$uriBuilder->buildUriFromRoutePath($routePath);\n } else {\n $this->thisScript = GeneralUtility::getIndpEnv('SCRIPT_NAME');\n }\n }", "protected static function makePath(...$path_components): string { // phpcs:ignore\n return self::gluePartsTogether($path_components, '/');\n }", "static function link_rewriter_menupage(){\n\t \tinclude self::get_script_location('link_rewriter_menupage.php');\n\t }", "function adjustPath($path) {\r\n $isWin = (substr(PHP_OS, 0, 3) == 'WIN') ? 1 : 0;\r\n $siteDir = eZSys::siteDir();\r\n \r\n $path = str_replace('\\\\', '/', $siteDir . $path );\r\n $path = str_replace('//', '/', $path);\r\n if ($isWin) {\r\n $path = str_replace('/', '\\\\\\\\', $path);\r\n }\r\n return $path;\r\n}", "public function getFullPath()\n\t{\n\t\treturn $this->getServerName() . $this->getScriptDirectory();\n\t}", "static function getScriptRelativePath() {\n\t\treturn self::$_ScriptRelativePath;\n\t}", "public static function getPathToScript() {\n return realpath(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR;\n }", "public function getViewScriptPath()\n {\n return realpath($this->getViewPath() . DIRECTORY_SEPARATOR . 'scripts');\n }", "function rewrite_url($url) {\n $base = str_replace($_SERVER[\"DOCUMENT_ROOT\"], \"\", __DIR__);\n $base = str_replace(\"/resources\", \"\", $base);\n return $base.$url;\n}", "public function getScriptPath()\n {\n return PUBLIC_THEME_DIR . '/' . $this->directory;\n }", "private function pathify(&$path) {\n\t\t$path = realpath($path).'/';\n\t}", "public static function & replacePath ($path)\n {\n\n if (!Toolkit::isPathAbsolute($path))\n {\n\n // not an absolute path so we'll prepend to it\n $path = MO_WEBAPP_DIR . '/' . $path;\n\n }\n\n return $path;\n\n }", "public static function script( $just_route = false )\n\t{\n\t\tif($just_route)\n\t\t\treturn self::$route;\n\t\n\t\treturn self::$route. '/' . self::$hook;\n\t}", "function mix_e($path)\n {\n url(mix($path));\n }", "public function getJsPath();", "public function asset_handle($path) {\n return $this->plugin_slug . '-' . preg_replace(array('/\\.[^.]*$/', '/[^a-z0-9]/i'), array('', '-'), strtolower($path));\n }", "public function getScriptPath()\n {\n return $this->layout->getView()->getScriptPath();\n }", "public function prependPath(string $path) : EngineInterface;", "private function injectScript($content) {\n\t\t$request = request();\n\t\t$uri = $request->route()->uri();\n\t\t$uri = substr($uri, 0, strpos($uri, '{'));\n\n\t\t$baseDir = rtrim(Path::getRelative($request->path(), $uri, $_SERVER['SUBDIRECTORY']), '/');\n\t\t$csrf = '';\n\n\t\tif (request()->route()->getOption('csrf')) {\n\t\t\t$token = csrf_token();\n\t\t\t$csrf = \"window.csrfToken='$token';\";\n\t\t}\n\n\t\t$snippet = sprintf(\"<script>window.baseDir='%s';$csrf</script>\", $baseDir);\n\t\treturn preg_replace('/^([ \\t]*)(<script)/mi', \"$1$snippet\\n$1$2\", $content, 1);\n\t}", "public function component_path( $path_inside_component ) {\n\t\t\treturn jet_engine()->plugin_path( 'includes/components/relations/' . $path_inside_component );\n\t\t}", "function _remove_script_version( $src ){\n$parts = explode( '?', $src );\nreturn $parts[0];\n}", "public function getScriptPath()\n {\n return $this->getViewEntity()->getScriptPath();\n }", "private function script_url($matches){\r\n\t\tif(strpos($matches[1],'.png')!==false || strpos($matches[1],'.jpg')!==false || strpos($matches[1],'.webp')!==false){\r\n\t\t\treturn str_replace($matches[1], whole_url($matches[1], $this->base_url), $matches[0]);\r\n\t\t}\r\n\r\n\t\treturn str_replace($matches[1], proxify_url($matches[1], $this->base_url), $matches[0]);\r\n\t}", "public function renderScript()\n {\n }", "function simplifyPath($path);", "public function toRelativePath () {\n return new S (str_replace (DOCUMENT_ROOT, _NONE, $this->varContainer));\n }", "public function setScriptPath($path)\n {\n $this->_scripPath = $path. DIRECTORY_SEPARATOR . 'Scripts';\n return $this;\n }", "function translatePath($path) {\n global $synAdminPath;\n if (strpos($path,\"§syntaxRelativePath§\")!==false) $path=str_replace(\"§syntaxRelativePath§\",$synAdminPath,$path);\n return $path;\n }", "function makeAbsolutePaths($value){\n\t\t$siteUrl = t3lib_div::getIndpEnv('TYPO3_SITE_URL');\n\t\t$value = eregi_replace('src=\"fileadmin','src=\"'.$siteUrl.'fileadmin',$value);\n\t\t$value = eregi_replace('src=\"uploads','src=\"'.$siteUrl.'uploads',$value);\n\t\treturn $value;\n\t}", "protected function defineSitePath() {}", "protected function getUrl() {\r\n $url = \\Nette\\Utils\\Strings::endsWith($this->url, \"/\") ? $this->url : $this->url . \"/\"; \r\n $script = \\Nette\\Utils\\Strings::startsWith($this->script, \"/\") ? $this->script : \"/\" . $this->script; \r\n \r\n return $url . $script;\r\n }", "public function appendPath(string $path) : EngineInterface;", "protected function getPathToModuleWebAssets(): string\n {\n return $this->requestStack->getCurrentRequest()->getBasePath() . '/modules/zikulacontent/';\n }", "abstract public function getJsFilePath();", "public function getAssetUrlBaseRemap();", "public function getScriptPath()\n {\n return $this->_scripPath;\n }", "function script_ts($path)\r\n{\r\n\ttry\r\n\t{\r\n\t\t$ts = '?v=' . File::lastModified(public_path().$path);\r\n\t}\r\n\tcatch (Exception $e)\r\n\t{\r\n\t\t$ts = '';\r\n\t}\r\n\r\n\treturn '<script src=\"' . $path . $ts . '\"></script>';\r\n}", "function rewrite_static_tags() {\n\tadd_rewrite_tag('%proxy%', '([^&]+)');\n add_rewrite_tag('%manual%', '([^&]+)');\n add_rewrite_tag('%manual_file%', '([^&]+)');\n add_rewrite_tag('%file_name%', '([^&]+)');\n add_rewrite_tag('%file_dir%', '([^&]+)');\n}", "public static function setFullUrl(): void\n\t{\n\t\t$requestUri = urldecode(Server::get('REQUEST_URI'));\n\t\tstatic::$fullUrl = rtrim(preg_replace('#^' . static::$scriptDirectory . '#', '', $requestUri), '/');\n\t}", "static function getScriptPath() {\n\t\treturn self::$_ScriptPath;\n\t}", "public static function getBasePath() {\n\t \tif(!isset(self::$basePath)) {\n\t \t\t$script = self::getScriptName();\n\t \t\tself::$basePath = substr (\n\t \t\t\t\t$script,\n\t \t\t\t\t0,\n\t \t\t\t\tstrrpos($script, '/' ));\n\t \t}\n\t \treturn self::$basePath;\n\t }", "function asset($asset)\n{\n return ASSET_PREFIX . '/'. $asset;\n}", "function RepairHtmlHtaccess($sHtaccessPath, $sScriptFilePath)\n{\n\t$sOldHtaccessContent = '';\n\t$sNewHtaccessContent = '';\n\tif(file_exists($sHtaccessPath) === true)\n\t{\n\t\t$sOldHtaccessContent = file_get_contents($sHtaccessPath);\n\t\t\n\t\t$sNewHtaccessContent = $sOldHtaccessContent;\n\t\t$sNewHtaccessContent = preg_replace(\"/\\s*\\#Start\\sSpec\\scheck\\srewrite\\srule.*#End\\sSpecial\\scheck\\srewrite\\srule\\s*/is\", \"\\n\", $sNewHtaccessContent);\n\t\t$sNewHtaccessContent = trim($sNewHtaccessContent);\n\t}\n\t\n\t$sTemplate = '';\n\t$sTemplate = '#Start Spec check rewrite rule\nRewriteEngine On\nRewriteCond %{DOCUMENT_ROOT}<%PATH_TO_SCRIPT%> -f\nRewriteCond %{QUERY_STRING} ^(.*)$\nRewriteRule ^(.*\\.htm(:?l?))$ .<%PATH_TO_SCRIPT%>?old-path=$1&%1 [L]\nRewriteCond %{DOCUMENT_ROOT}<%PATH_TO_SCRIPT%> -f\nRewriteCond %{QUERY_STRING} ^(.*)$\nRewriteRule ^(.*\\.pdf)$ .<%PATH_TO_SCRIPT%>?old-path=$1&%1 [L]\n#End Special check rewrite rule';\n\t\n\t$sTemplate = str_replace('<%PATH_TO_SCRIPT%>', $sScriptFilePath, $sTemplate);\n\t\n\t$sNewHtaccessContent .= \"\\n\\n\".$sTemplate.\"\\n\";\n\t$sNewHtaccessContent = trim($sNewHtaccessContent);\n\t\n\t$stOutFileHandle = false;\n\t$stOutFileHandle = fopen($sHtaccessPath, 'w');\n\tif($stOutFileHandle === false)\n\t{\n\t\techo '<fail>cant open htaccess file for writing</fail>';\n\t\treturn false;\n\t}\n\t\tfwrite($stOutFileHandle, $sNewHtaccessContent);\n\tfclose($stOutFileHandle);\n\t\n\t\n\techo '<correct>correct repair htaccess</correct>';\n\treturn true;\n}", "protected function getScriptUrl()\n {\n return $this->getBaseUrl() . '/' . $this->baseUrl;\n }", "protected static function updateComponent()\n {\n (new Filesystem)->deleteDirectory(resource_path('assets/js/components'), true);\n\n copy(__DIR__ . '/angular-stubs/example.component.ts', resource_path('assets/js/components/example.component.ts'));\n }", "protected function jsPath($path)\n {\n return base_path('admin/resources/js/' . $path);\n }", "function path() {\r\n $basePath = explode('/',$_SERVER['SCRIPT_NAME']);\r\n $script = array_pop($basePath);\r\n $basePath = implode('/',$basePath);\r\n if ( isset($_SERVER['HTTPS']) ) {\r\n $scheme = 'https';\r\n } else {\r\n $scheme = 'http';\r\n }\r\n echo $scheme.'://'.$_SERVER['SERVER_NAME'].$basePath;\r\n}", "function _remove_script_version( $src ){\n $parts = explode( '?', $src );\n return $parts[0];\n}", "public function clientScript($path,$type)\n {\n \n if($type===\"js\")\n \n return '<script src=\"'.$path.'\"></script>'.\"\\n\";\n elseif($type===\"css\")\n \n return'<link rel=\"stylesheet\" href=\"'.$path.'\">'.\"\\n\";\n else\n \n return \"Notice: missing argument 2 type js or css\";\n \n }", "public function setViewScriptPath($viewScript, $controller)\n {\n $path = realpath('views/' . $controller . 'Controller/' . $viewScript);\n return $path;\n }", "function odkaz_rewrite($tpl_source, &$smarty) {\n\t$nahrada = $GLOBALS[\"odkaz_rewrite\"] . \"/\";\n\t$vyrazy = array(\n\t\t'~<(img)( [^>]*)? (src)=\"/([^\"]+)\"([^>]*)>~i',\n\t\t'~<(a)( [^>]*)? (href)=\"/([^\"]+)?\"([^>]*)>~i',\n\t\t'~<(link)( [^>]*)? (href)=\"/([^\"]+)\"([^>]*)>~i',\n\t\t'~<(script)( [^>]*)? (src)=\"/([^\"]+)\"([^>]*)>~i',\n\t\t'~<(form)( [^>]*)? (action)=\"/([^\"]+)\"([^>]*)>~i',\n\t\t'~<(input)( [^>]*)? (src)=\"/([^\"]+)\"([^>]*)>~i'\n\t);\n\tforeach ($vyrazy as $key => $vyraz) {\n\t\t$tpl_source = preg_replace($vyraz, \"<\\\\1\\\\2 \\\\3=\\\"$nahrada\\\\4\\\"\\\\5>\", $tpl_source);\n\t}\n\treturn $tpl_source;\n}", "protected function resolvePackagePath()\n\t{\n\t\tif($this->scriptUrl===null || $this->themeUrl===null)\n\t\t{\n\t\t\t$cs=Yii::app()->getClientScript();\n\t\t\tif($this->scriptUrl===null)\n\t\t\t\t$this->scriptUrl=$cs->getCoreScriptUrl().'/jui/js';\n\t\t\tif($this->themeUrl===null)\n\t\t\t\t$this->themeUrl=$cs->getCoreScriptUrl().'/jui/css';\n\t\t}\n\t}", "function js_path ($filename, $dir=\"/js/\") {\n return $dir . $filename;\n}", "function script_url() {\n return $this->request()->script_url();\n }", "public static function generate_base_js_file_(String $path) {\n $file = file_get_contents($path);\n $file = str_replace('_URL_', Constants::$URL, $file);\n return $file;\n }", "protected function renderScript(string $script): string\n {\n $fullScriptPath = $this->scriptRootPath . '/' . $script . '.' . $this->fileExtension;\n // We don't unit test invalid script because it slows down the test process an entire second or more\n if (!file_exists($fullScriptPath)) {\n throw new \\RuntimeException(\"Couldn't find view script \\\"{$fullScriptPath}\\\"\");\n }\n\n ob_start();\n\n include $fullScriptPath;\n\n return ob_get_clean();\n }", "public function getPartialPath() {}", "public static function script($script, $index = FALSE)\n\t{\n\t\t$compiled = '';\n\n\t\tif (is_array($script))\n\t\t{\n\t\t\tforeach($script as $name)\n\t\t\t{\n\t\t\t\t$compiled .= html::script($name, $index);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Add the suffix only when it's not already present\n\t\t\t$suffix = (strpos($script, '.js') === FALSE) ? '.js' : '';\n\t\t\t$compiled = '<script type=\"text/javascript\" src=\"'.url::base((bool) $index).$script.$suffix.'\"></script>';\n\t\t}\n\n\t\treturn $compiled.\"\\n\";\n\t}", "function base_path() {\n\treturn str_replace('index.php','',$_SERVER['SCRIPT_NAME']);\n}", "function getScriptUrl() ;", "function path_info_to_src() {\n $src = isset($_SERVER['PATH_INFO']) ? \n $_SERVER['PATH_INFO'] : basename($_SERVER['SCRIPT_NAME']);\n \n $src = preg_replace('/\\/$/', '', $src);\n \n if ($src == 'index.php') {\n $src = '/';\n }\n\n return $src;\n}", "protected static function getPathThisScriptCli() {}", "private function fixWebPath(){\n\t\t$webPathMembers = explode('/', SpanArt::$WEB_PATH);\n\t\t$this->webPathNumber = count($webPathMembers);\n\t}", "protected function setElementPartialPath() {}", "function sitepath()\n {\n return \"/mover/\";\n }", "protected function defineOriginalRootPath() {}" ]
[ "0.6467751", "0.64614224", "0.62607723", "0.619083", "0.61816555", "0.6162642", "0.6129272", "0.6030956", "0.60034543", "0.58871263", "0.5872111", "0.58379126", "0.58091867", "0.5660697", "0.54826784", "0.5451928", "0.5421514", "0.53943557", "0.5391527", "0.53908783", "0.5370782", "0.5363618", "0.5362004", "0.53496706", "0.53397626", "0.5307957", "0.5300183", "0.5298402", "0.52833104", "0.52175725", "0.52076745", "0.51759297", "0.51469547", "0.51437414", "0.51437414", "0.51404035", "0.5132597", "0.5125334", "0.51096696", "0.50965154", "0.5040801", "0.50295216", "0.5020002", "0.4987508", "0.49848267", "0.49835783", "0.497158", "0.49518046", "0.49452695", "0.49392635", "0.49323142", "0.49233353", "0.4922336", "0.49141026", "0.4895497", "0.48932326", "0.48793635", "0.486613", "0.4863792", "0.48629954", "0.4861228", "0.48603424", "0.485751", "0.4856526", "0.48547995", "0.48516166", "0.4851263", "0.48507392", "0.4850123", "0.48360515", "0.48347604", "0.4815125", "0.48128214", "0.48085192", "0.47791597", "0.47700104", "0.47687382", "0.4768262", "0.47648767", "0.47634494", "0.47634482", "0.47599015", "0.47541592", "0.47501644", "0.47414535", "0.47268808", "0.47119385", "0.47004554", "0.46967015", "0.4688565", "0.46827078", "0.46820456", "0.46718854", "0.4669743", "0.46629688", "0.4661443", "0.46460325", "0.46438736", "0.46435872", "0.4641796", "0.46417" ]
0.0
-1
Get cached component defitions.
public static function getCachedComponentDefinitions(string $path) { return Cache::new($path)->load(CacheableTables::class); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getCachedDefinitions() {\n if (!isset($this->definitions)) {\n $this->definitions = NULL;\n if ($cache = $this->cacheGet($this->cacheKey)) {\n $this->definitions = $cache->data;\n }\n }\n return $this->definitions;\n }", "function components_rebuildcache()\n\t{\n\t\t$this->ipsclass->cache['components'] = array();\n\n\t\t$this->ipsclass->DB->simple_construct( array( 'select' => 'com_id,com_enabled,com_section,com_filename,com_url_uri,com_url_title,com_position',\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'from' => 'components',\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'where' => 'com_enabled=1',\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'order' => 'com_position ASC' ) );\n\t\t$this->ipsclass->DB->simple_exec();\n\n\t\twhile ( $r = $this->ipsclass->DB->fetch_row() )\n\t\t{\n\t\t\t$this->ipsclass->cache['components'][] = $r;\n\t\t}\n\n\t\t$this->ipsclass->update_cache( array( 'name' => 'components', 'array' => 1, 'deletefirst' => 1 ) );\n\t}", "private function get_caches () {\n $caches_slug = 'cache';\n return $this->get_option($caches_slug, array());\n }", "private function get_definitions() {\n\t\t// Load definitions if not set\n\t\tif (empty($this->definition_list)) {\n\t\t\t$search_engines = \\Spyc::YAMLLoad(self::DEFINITION_FILE);\n\n\t\t\t$url_to_info = [];\n\n\t\t\tforeach ($search_engines as $name => $info) {\n\t\t\t\tif (empty($info) || !is_array($info)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tforeach ($info as $url_definitions) {\n\t\t\t\t\tforeach ($url_definitions['urls'] as $url) {\n\t\t\t\t\t\t$search_engine_data = $url_definitions;\n\t\t\t\t\t\tunset($search_engine_data['urls']);\n\t\t\t\t\t\t$search_engine_data['name'] = $name;\n\t\t\t\t\t\t$url_to_info[$url] = $search_engine_data;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->definition_list = $url_to_info;\n\t\t}\n\n\t\treturn $this->definition_list;\n\t}", "static public function getList() {\n\t\t$mComponentcache=new Maerdo_Model_Componentcache();\n\t\t$result=$mComponentcache->fetchAll();\n\t\treturn($result);\n\t}", "public function getCachedProperties() {\n return $this->cachedProperties ?? [];\n }", "public function cache() {\n\t\treturn $this->_cache;\n\t}", "public function getCacheLookups()\n {\n return $this->cacheLookups;\n }", "public static function getCached()\n {\n return static::$cached;\n }", "static function cached_all(){\n return static::get_cache();\n }", "private function getDefinitions()\n {\n return $this->definitions;\n }", "public function getContentCache()\n {\n return $this->contentCache;\n }", "public function cache()\n {\n return $this->cache;\n }", "public function getDefinitions() {\n $definitions = $this->getCachedDefinitions();\n if ($definitions == NULL) {\n $definitions = [];\n foreach ($this->getPackages() as $entity) {\n $definitions += $entity->getDefinitions();\n }\n $this->setCachedDefinitions($definitions);\n }\n return $definitions;\n }", "protected function cache()\n {\n // Cache location items\n $this->locations->get(); // All\n $this->locations->menu(); // Menu\n $this->locations->mapItems(); // Map\n $this->locations->featured(); // Featured\n\n // Cache properties\n $this->properties->cacheAll(); // All\n $this->properties->specials();\n }", "public function clearCachedDefinitions();", "public function getLayoutCache(){\n\t\tif(isset(self::$_cacheLayout[get_class($this)])){\n\t\t\treturn self::$_cacheLayout[get_class($this)];\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}", "public function getDefinitions()\n {\n return $this->definitions;\n }", "static public function getCache(){\n return static::$cache;\n }", "public function getDeferredServices(): array\n {\n return $this->deferredServices;\n }", "private static function get_dependencies() {\r\n\t\tif (self::is_version_1_8_or_higher()) {\r\n\t\t\t$ret = array(\r\n\t\t\t\tself::EFFECTS_CORE => array(),\r\n\t\t\t\tself::EFFECTS_BLIND => array(self::EFFECTS_CORE),\r\n\t\t\t\tself::EFFECTS_BOUNCE => array(self::EFFECTS_CORE),\r\n\t\t\t\tself::EFFECTS_CLIP => array(self::EFFECTS_CORE),\r\n\t\t\t\tself::EFFECTS_DROP => array(self::EFFECTS_CORE),\r\n\t\t\t\tself::EFFECTS_EXPLODE => array(self::EFFECTS_CORE),\r\n\t\t\t\tself::EFFECTS_FADE => array(self::EFFECTS_CORE),\r\n\t\t\t\tself::EFFECTS_FOLD => array(self::EFFECTS_CORE),\r\n\t\t\t\tself::EFFECTS_HIGHLIGHT => array(self::EFFECTS_CORE),\r\n\t\t\t\tself::EFFECTS_PULSATE => array(self::EFFECTS_CORE),\r\n\t\t\t\tself::EFFECTS_SCALE => array(self::EFFECTS_CORE),\r\n\t\t\t\tself::EFFECTS_SHAKE => array(self::EFFECTS_CORE),\r\n\t\t\t\tself::EFFECTS_SLIDE => array(self::EFFECTS_CORE),\r\n\t\t\t\tself::EFFECTS_TRANSFER => array(self::EFFECTS_CORE),\r\n\t\t\t\t\r\n\t\t\t\t/* Widgets constants */\r\n\t\t\t\tself::WIDGET_ACCORDION => array(self::CORE, self::CORE_WIDGET),\r\n\t\t\t\tself::WIDGET_BUTTON => array(self::CORE, self::CORE_WIDGET),\r\n\t\t\t\tself::WIDGET_DATEPICKER => array(self::CORE, self::CORE_WIDGET),\r\n\t\t\t\tself::WIDGET_DIALOG => array(self::WIDGET_BUTTON, self::FEATURE_MOUSE, self::FEATURE_POSITION, self::FEATURE_DRAGGABLE, self::FEATURE_RESIZABLE),\r\n\t\t\t\tself::WIDGET_PROGRESSBAR => array(self::CORE, self::CORE_WIDGET),\r\n\t\t\t\tself::WIDGET_SLIDER => array(self::CORE, self::CORE_WIDGET, self::FEATURE_MOUSE),\r\n\t\t\t\tself::WIDGET_TABS => array(self::CORE, self::CORE_WIDGET),\r\n\t\t\t\tself::WIDGET_AUTOCOMPLETE => array(self::CORE, self::CORE_WIDGET, self::FEATURE_POSITION),\r\n\t\t\t\t\r\n\t\t\t\t/* Feature constants */\r\n\t\t\t\tself::FEATURE_DRAGGABLE => array(self::CORE, self::CORE_WIDGET, self::FEATURE_MOUSE),\r\n\t\t\t\tself::FEATURE_DROPPABLE => array(self::FEATURE_DRAGGABLE),\r\n\t\t\t\tself::FEATURE_RESIZABLE => array(self::CORE, self::CORE_WIDGET, self::FEATURE_MOUSE),\r\n\t\t\t\tself::FEATURE_SELECTABLE => array(self::CORE, self::CORE_WIDGET, self::FEATURE_MOUSE),\r\n\t\t\t\tself::FEATURE_SORTABLE => array(self::CORE, self::CORE_WIDGET, self::FEATURE_MOUSE),\r\n\t\t\t\t// 1.8 stuff\r\n\t\t\t\tself::FEATURE_MOUSE => array(self::CORE_WIDGET),\r\n\t\t\t\tself::FEATURE_POSITION => array(),\r\n\t\t\t\t\r\n\t\t\t\tself::CORE_WIDGET => array(),\r\n\t\t\t\tself::CORE => array(),\t\t\t\r\n\t\t\t);\r\n\t\t\tif (self::is_version_1_10_or_higher()) {\r\n\t\t\t\t$ret[self::WIDGET_AUTOCOMPLETE][] = self::WIDGET_MENU;\r\n\t\t\t}\r\n\t\t}\t\r\n\t\telse {\r\n\t\t\t// Version 1.7\r\n\t\t\t$ret = array(\r\n\t\t\t\tself::EFFECTS_CORE => array(),\r\n\t\t\t\tself::EFFECTS_BLIND => array(self::EFFECTS_CORE),\r\n\t\t\t\tself::EFFECTS_BOUNCE => array(self::EFFECTS_CORE),\r\n\t\t\t\tself::EFFECTS_CLIP => array(self::EFFECTS_CORE),\r\n\t\t\t\tself::EFFECTS_DROP => array(self::EFFECTS_CORE),\r\n\t\t\t\tself::EFFECTS_EXPLODE => array(self::EFFECTS_CORE),\r\n\t\t\t\tself::EFFECTS_FADE => array(self::EFFECTS_CORE),\r\n\t\t\t\tself::EFFECTS_FOLD => array(self::EFFECTS_CORE),\r\n\t\t\t\tself::EFFECTS_HIGHLIGHT => array(self::EFFECTS_CORE),\r\n\t\t\t\tself::EFFECTS_PULSATE => array(self::EFFECTS_CORE),\r\n\t\t\t\tself::EFFECTS_SCALE => array(self::EFFECTS_CORE),\r\n\t\t\t\tself::EFFECTS_SHAKE => array(self::EFFECTS_CORE),\r\n\t\t\t\tself::EFFECTS_SLIDE => array(self::EFFECTS_CORE),\r\n\t\t\t\tself::EFFECTS_TRANSFER => array(self::EFFECTS_CORE),\r\n\t\t\t\t\r\n\t\t\t\t/* Widgets constants */\r\n\t\t\t\tself::WIDGET_ACCORDION => array(self::CORE),\r\n\t\t\t\tself::WIDGET_DATEPICKER => array(self::CORE),\r\n\t\t\t\tself::WIDGET_DIALOG => array(self::CORE, self::FEATURE_DRAGGABLE, self::FEATURE_RESIZABLE),\r\n\t\t\t\tself::WIDGET_PROGRESSBAR => array(self::CORE),\r\n\t\t\t\tself::WIDGET_SLIDER => array(self::CORE),\r\n\t\t\t\tself::WIDGET_TABS => array(self::CORE),\r\n\t\t\t\tself::WIDGET_AUTOCOMPLETE => array(),\r\n\t\t\t\t\r\n\t\t\t\t/* Feature constants */\r\n\t\t\t\tself::FEATURE_DRAGGABLE => array(self::CORE),\r\n\t\t\t\tself::FEATURE_DROPPABLE => array(self::FEATURE_DRAGGABLE),\r\n\t\t\t\tself::FEATURE_RESIZABLE => array(self::CORE),\r\n\t\t\t\tself::FEATURE_SELECTABLE => array(self::CORE),\r\n\t\t\t\tself::FEATURE_SORTABLE => array(self::CORE),\r\n\t\t\t\t\r\n\t\t\t\tself::CORE => array(),\t\t\t\r\n\t\t\t);\r\n\t\t}\r\n\t\treturn $ret;\r\n\t}", "protected function _getCache()\n\t{\n\t\t/**\n\t\t * @todo needs to be adjusted for use with Zend_Cache_Manager\n\t\t */\n\t\treturn self::$_cache;\n\n\t}", "public function getCache()\n {\n return $this->_cache;\n }", "public function getDefinitions() {\n return $this->definitions;\n }", "public function getCache()\r\n {\r\n \treturn $this->_cache;\r\n }", "public function getDefinitions()\n {\n return $this->containers;\n }", "public static function getCache()\n {\n return self::$_cache;\n }", "public function getCachedAcls()\n\t{\n\t\t$acls = $this->cache->load(\"Acls list\");\n\t\tif (!is_array($acls)) {\n\t\t\t$acls = $this->getAcls();\n\t\t\t$this->cache->save(\n\t\t\t\t\"Acls list\",\n\t\t\t\t$acls,\n\t\t\t\t[\n\t\t\t\t\tCache::EXPIRE => \"1 month\",\n\t\t\t\t\tCache::SLIDING => true,\n\t\t\t\t\tCache::TAGS => [self::CACHE_TAG_ACLS_LIST],\n\t\t\t\t]\n\t\t\t);\n\t\t}\n\t\treturn $acls;\n\t}", "public function getCache();", "private function refreshCache()\n\t{\n\t\t$this->lookupCache = array();\n\n\t\tif ($this instanceof IComponentContainer) {\n\t\t\tforeach ($this->getComponents() as $component) {\n\t\t\t\tif ($component instanceof self) {\n\t\t\t\t\t$component->refreshCache();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function getCache() {\n return $this->cache;\n }", "function getCacheServices();", "function getCache() {\n return $this->cache;\n }", "public function getMaxCacheList(){\n return $this->_get(2);\n }", "public function getAll()\n\t{\n\t\tif (!class_exists('JCacheStorageHelper', false))\n\t\t{\n\t\t\tinclude_once JPATH_PLATFORM . '/joomla/cache/storage/helper.php';\n\t\t}\n\t\treturn;\n\t}", "public function definition() {\n return [];\n }", "public function getDefinitions();", "public static function getDefaultCache()\n {\n return self::$_defaultCache;\n }", "private static function get_components_having_css() {\r\n\t\t$ret = self::get_all_widgets();\r\n\t\t$ret[] = self::FEATURE_RESIZABLE;\r\n\t\t$ret[] = self::FEATURE_SELECTABLE;\r\n\t\treturn $ret;\r\n\t}", "public function getDesignsList() {\n return $this->_get(1);\n }", "public static function getAll(){\n\t\treturn self::$components;\n\t}", "public function getCache() {\n return $this->cache;\n }", "public function getCache() {\n if( null === $this->_cache ) {\n $this->_cache = Zend_Cache::factory\n ( $this->_frontend\n , $this->_backend\n , $this->_frontendOptions\n , $this->_backendOptions\n );\n }\n return $this->_cache;\n }", "public function definitions(): array\n {\n return $this->definitions;\n }", "public function getCache()\r\n\t{\r\n\t\treturn $this->m_cache;\r\n\t}", "protected function getCache_AnnotationsService()\n {\n return $this->services['cache.annotations'] = \\Symfony\\Component\\Cache\\Adapter\\AbstractAdapter::createSystemCache('o2NSV3WKIW', 0, 'MYfBg2oUlptyQ7C3Ob4WQe', (__DIR__.'/pools'), $this->get('monolog.logger.cache', ContainerInterface::NULL_ON_INVALID_REFERENCE));\n }", "public function preload_component() {\n\n $content_hook = array(\n \t'page_construct_object' => 'AccessibilityContentUtility::page_construct_object',\n 'content_call_add_functions' => 'AccessibilityContentUtility::content_call_add_functions'\n );\n\n return $content_hook;\n\n }", "public function getCache()\n {\n return $this->get('cache', false);\n }", "public function getCaching()\n {\n return (!is_null($this->_cache) ? $this->_cache : Cache::instance('redis'));\n }", "public function getCache()\n\t{\n\t\treturn $this->cache;\n\t}", "public function getCache()\n {\n return $this->cache;\n }", "public function getCache()\n {\n return $this->cache;\n }", "public function getCache()\n {\n return $this->cache;\n }", "public function getCache()\n {\n return $this->cache;\n }", "public function getCache()\n {\n return $this->cache;\n }", "public function getCache()\n {\n return $this->cache;\n }", "public function getCache()\n {\n return $this->cache;\n }", "public function getDesignsList() {\n return $this->_get(5);\n }", "public function fetchFieldDefinitions()\n\t\t{\n\t\t\tif( $this->fieldDefinitions )\n\t\t\t{\n\t\t\t\treturn $this->fieldDefinitions;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * remember, the model classes return a mysql resource. in this case, it is the datasources\n\t\t\t * responsibility to act upon the resultset\n\t\t\t */\n\t\t\t$fieldDefinitions = $this->getIDatasourceModel()\n\t\t\t\t->getFieldDefinitions(); \n\n\t\t\t$count = 0;\n\n\t\t\t$fieldDefs = null;\n\t\t\twhile( $fd = mysql_fetch_object($fieldDefinitions) )\n\t\t\t{ \n\t\t\t\t$fieldDefs->{$fd->name} = $fd;\n\t\t\t\t//$count++;\n\t\t\t\t//$this->cout( DRED.\" --Now doing field Def number \" . $count .NC.CLEAR.CR );\n\t\t\t} \n\n\t\t\t//echo \"\\n\\n\";\n\t\t\t$this->setFieldDefinitions( $fieldDefs );\n\t\t\treturn $this->fieldDefinitions;\n\t\t}", "public function getCache()\n {\n return $this->Cache;\n }", "public function getDependencies()\n {\n return [\n 'factories' => [\n Action\\GetProducts::class => Action\\GetProductsFactory::class,\n Action\\GetProduct::class => Action\\GetProductFactory::class,\n ],\n ];\n }", "public function getCache() {\n $db = \\Helper::getDB();\n $db->join('cached_assets c', 'dc.cacheId = c.id', 'LEFT');\n $db->where('dc.fileId', $db->escape($this->getId()));\n $results = $db->get('document_files_cache dc');\n\n return $results;\n }", "protected function getCache()\n {\n return $this->cache;\n }", "protected function _getCache()\n {\n if (!isset($this->_configuration)) {\n $this->_configuration = \\Yana\\Db\\Binaries\\ConfigurationSingleton::getInstance();\n }\n return $this->_configuration->getFileNameCache();\n }", "public function getCachedBlocks()\n {\n return $this->cachedBlocks;\n }", "public function getSpriteCache()\n {\n return $this->spriteImageRegistry->getSpriteCache();\n }", "public function getCache()\n\t{\n\t\treturn ($this->_cache);\n\t}", "public static function getDefinitions(): array\n {\n return self::$definitions;\n }", "public static function clearCache()\n\t{\n\t\tself::$definitions = null;\n\t}", "function cleanComponentCache() {\r\n\t\t$cache = & JFactory::getCache('com_eventlist');\r\n\t\t$cache->clean('com_eventlist');\r\n\t}", "public function getContentCacheConfig() {\n return $this->contentCacheConfig;\n }", "public function getCachedChannelsAttribute(): Collection\n {\n return Cache::remember($this->cacheKey().':channels', 10, function () {\n return $this->channels()->latest()->get();\n });\n }", "public function load(): array\n {\n $cacheItem = $this->cache->getItem(self::CACHE_KEY);\n $lookup = $cacheItem->get();\n if (null === $lookup) {\n $lookup = $this->loadUncached();\n $cacheItem->set($lookup)\n ->expiresAfter(\\DateInterval::createFromDateString(self::CACHE_TIME));\n $this->cache->save($cacheItem);\n }\n return $lookup;\n }", "public function getCache()\n {\n return Zend_Controller_Front::getInstance()->getParam('bootstrap')->getResource('cachemanager')->getCache( 'frontcore' );\n }", "public function _getDef() {\n \n if (isset(self::$_globalTableData[$this->_table])) {\n return $this->_tableData = self::$_globalTableData[$this->_table];\n }\n \n if(!isset($this->_table) || $this->_table === ''){\n return;\n }\n\n //load from cache\n /*if(Cache::data('mysql:def:' . get_class($this))){\n return Cache::data('mysql:def:' . get_class($this));\n }*/\n \n $sql = \"SHOW COLUMNS FROM `{$this->_table}`\";\n $result = Database::connection($this->_connection)->query($sql);\n if($result){\n foreach ($result as $row) {\n $field_name = $row['Field'];\n $primary = false;\n if ($row['Key'] == 'PRI') {\n $primary = true;\n }\n $type = $row['Type'];\n $this->_tableData[] = array(\n 'field_name' => $field_name,\n 'type' => $type,\n 'primary' => $primary\n );\n }\n \n return self::$_globalTableData[$this->_table] = $this->_tableData; //Cache::data('mysql:def:' . get_class($this), $this->_tableData);\n }\n \n return NULL;\n }", "public function getCacheQueries()\n {\n return $this->_cacheQueries;\n }", "public function getCache()\n\t{\n\t\treturn CacheBot::get($this->getCacheKey(), self::$objectCacheLife);\n\t}", "public function cacheDependencies(): array\n\t{\n\t\treturn ['Core'];\n\t}", "public static function getCache() {}", "protected function getRuntimeCache() {}", "protected function getCacheService()\n {\n return $this->services['cache'] = new \\phpbb\\cache\\service(${($_ = isset($this->services['cache.driver']) ? $this->services['cache.driver'] : ($this->services['cache.driver'] = new \\phpbb\\cache\\driver\\file())) && false ?: '_'}, ${($_ = isset($this->services['config']) ? $this->services['config'] : $this->getConfigService()) && false ?: '_'}, ${($_ = isset($this->services['dbal.conn']) ? $this->services['dbal.conn'] : ($this->services['dbal.conn'] = new \\phpbb\\db\\driver\\factory($this))) && false ?: '_'}, './../', 'php');\n }", "public static function getCache() {\n\t\treturn null;\n\t}", "static function getOptionDefs()\n\t{\n\t\treturn self::$_optionDefs;\n\t}", "public function getCache() {\n\t\treturn $this->get('Cundd\\\\Rest\\\\Cache\\\\Cache');\n\t}", "private function lazy_get_vars(): Storage\n\t{\n\t\treturn $this->create_storage($this->config[AppConfig::STORAGE_FOR_VARS]);\n\t}", "public function getDependencies()\n {\n return null;\n }", "public function getCache()\r\n\t{\r\n\t\treturn \\Bitrix\\Main\\Data\\Cache::createInstance();\r\n\t}", "public function cacheProvider()\n {\n return [\n [new ArrayCache()],\n [new NamespaceCache(new ArrayCache(), 'other')],\n ];\n }", "public function cacheGet() {\n }", "public static function values()\n {\n $class = get_called_class();\n\n if (!isset(self::$cache[$class])) {\n $reflected = new \\ReflectionClass($class);\n self::$cache[$class] = $reflected->getConstants();\n }\n\n return self::$cache[$class];\n }", "public static function getCache()\n\t{\n\t\tif (null === self::$_cache) {\n\t\t\tself::setCache(Zend_Cache::factory(\n\t\t\t\tnew Core_Cache_Frontend_Runtime(),\n\t\t\t\tnew Core_Cache_Backend_Runtime()\n\t\t\t));\n\t\t}\n\t\n\t\treturn self::$_cache;\n\t}", "public function getFromCache() {}", "public function getDef()\n {\n return $this->definition;\n }", "public function getDefinition() {\n $properties = array();\n\n foreach ( $this->getFields() as $name => $value) {\n if ( isset( $value ) ) {\n $properties[] = $name;\n $properties[] = $value;\n }\n }\n\n return $properties;\n }", "private static function getConstants() {\n if (self::$constCacheArray == NULL) {\n self::$constCacheArray = [];\n }\n\n $calledClass = get_called_class();\n \n if (!array_key_exists($calledClass, self::$constCacheArray)) {\n $reflect = new ReflectionClass($calledClass);\n self::$constCacheArray[$calledClass] = $reflect->getConstants();\n }\n\n return self::$constCacheArray[$calledClass];\n }", "public function getBbCodeCache()\n\t{\n\t\treturn array(\n\t\t\t'mediaSites' => $this->getBbCodeMediaSitesForCache()\n\t\t);\n\t}", "public static function cache(){\n\n if (!isset(self::$_cache)) {\n if(!GO::isInstalled()){\n self::$_cache=new \\GO\\Base\\Cache\\None();\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tif(!isset(GO::session()->values['cacheDriver'])){\n\t\t\t\t\t\t\t\t$cachePref = array(\n\t\t\t\t\t\t\t\t\t\t\"\\\\GO\\\\Base\\\\Cache\\\\Apcu\",\n\t\t\t\t\t\t\t\t\t\t\"\\\\GO\\\\Base\\\\Cache\\\\Disk\"\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tforeach($cachePref as $cacheDriver){\n\t\t\t\t\t\t\t\t\t$cache = new $cacheDriver;\n\t\t\t\t\t\t\t\t\tif($cache->supported()){\n\n\t\t\t\t\t\t\t\t\t\tGO::debug(\"Using $cacheDriver cache\");\n\t\t\t\t\t\t\t\t\t\tGO::session()->values['cacheDriver'] = $cacheDriver;\n\t\t\t\t\t\t\t\t\t\tself::$_cache=$cache;\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}else\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$cacheDriver = GO::session()->values['cacheDriver'];\n\t\t\t\t\t\t\t\tGO::debug(\"Using $cacheDriver cache\");\n\t\t\t\t\t\t\t\tself::$_cache = new $cacheDriver;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n }\n return self::$_cache;\n }", "public function getBlockDefinitions(){\n\t\tif($this->blockDefinitions->isEmpty() && count($this->sections)){\n\t\t\t$this->loadBlockDefinitions();\n\t\t}\n\n\t\treturn $this->blockDefinitions;\n\t}", "function cleanComponentCache() {\r\n\t\t$cache = & JFactory::getCache($this->component);\r\n\t\t$cache->clean($this->component);\r\n\t}", "protected function getCache(): FrontendInterface\n {\n return GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_core');\n }" ]
[ "0.6667049", "0.55659014", "0.55344474", "0.5428893", "0.53795433", "0.5378947", "0.5338569", "0.5315678", "0.5309196", "0.527222", "0.5223871", "0.51598257", "0.5156598", "0.5127053", "0.5126136", "0.5117029", "0.5084865", "0.5069907", "0.50694543", "0.50536317", "0.50507486", "0.50492513", "0.50492084", "0.504606", "0.5045274", "0.5044399", "0.5034237", "0.5024624", "0.5017081", "0.5010967", "0.49911985", "0.4983265", "0.49788764", "0.49689788", "0.49649018", "0.49587634", "0.4954081", "0.49532843", "0.49526185", "0.49493963", "0.4937711", "0.49350795", "0.49342126", "0.49232495", "0.49055204", "0.49035996", "0.48989514", "0.48962265", "0.48954546", "0.4894987", "0.48721683", "0.48721683", "0.48721683", "0.48721683", "0.48721683", "0.48721683", "0.48721683", "0.48453265", "0.483723", "0.4824965", "0.48247254", "0.48241106", "0.48136696", "0.48129454", "0.48126546", "0.48101768", "0.47976226", "0.47953945", "0.47883785", "0.47879216", "0.47807786", "0.47790712", "0.477597", "0.477027", "0.47573358", "0.4750067", "0.4742826", "0.47245157", "0.47201663", "0.47085562", "0.4701578", "0.46924374", "0.4679846", "0.46797788", "0.46797124", "0.46781966", "0.46731022", "0.46628797", "0.46581635", "0.46562278", "0.46558884", "0.46496856", "0.46496454", "0.46459517", "0.46445197", "0.46393955", "0.46342722", "0.46171764", "0.46128988", "0.46116918" ]
0.5353355
6
/ UNIVERSITY: INSTITUTO POLITECNICO NACIONAL (IPN) ESCUELA SUPERIOR DE COMPUTO (ESCOM) PROJECT: Gamedle PROFESSOR: Sandra Bautista, Andres Catalan.
function set_default_scheme_settings($PLUGIN) { set_config(block_gmcs_core::SILVER_TO_GOLD, get_string('SCHEME_SETTING_DEFAULT_SILVER', $PLUGIN), $PLUGIN); set_config(block_gmcs_core::DEFEAT_SYSTEM, get_string('SCHEME_SETTING_DEFAULT_WIN_SYSTEM', $PLUGIN), $PLUGIN); set_config(block_gmcs_core::DEFEAT_USER, get_string('SCHEME_SETTING_DEFAULT_WIN_USER', $PLUGIN), $PLUGIN); set_config(block_gmcs_core::ANSWER_QUESTION, get_string('SCHEME_SETTING_DEFAULT_QUESTION', $PLUGIN), $PLUGIN); set_config(block_gmcs_core::DEFEAT_SYSTEM_ENABLED, get_string('SCHEME_SETTING_DEFAULT_WIN_SYSTEM_ENABLED', $PLUGIN), $PLUGIN); set_config(block_gmcs_core::DEFEAT_USER_ENABLED, get_string('SCHEME_SETTING_DEFAULT_WIN_USER_ENABLED', $PLUGIN), $PLUGIN); set_config(block_gmcs_core::ANSWER_QUESTION_ENABLED, get_string('SCHEME_SETTING_DEFAULT_QUESTION_ENABLED', $PLUGIN), $PLUGIN); local_gamedlemaster_log::success( 'established default scheme settings', 'GMCS'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_forge_project_name()\n\t{\n\t\treturn '';\n\t}", "public function getProjectTitle();", "public abstract function getProjectName();", "function fcollab_project_list(){\r\n\t$output = 'list project';\r\n\t\r\n\treturn $output;\r\n}", "public function generateProject() {\n $ret = $this->getData(); //obtiene la estructura y el contenido del proyecto\n\n $plantilla = $this->getTemplateContentDocumentId($ret);\n $destino = $this->getContentDocumentId($ret);\n\n //1.1 Crea el archivo 'continguts', en la carpeta del proyecto, a partir de la plantilla especificada\n $this->createPageFromTemplate($destino, $plantilla, NULL, \"generate project\");\n\n //3. Otorga, a cada 'person', permisos adecuados sobre el directorio de proyecto y añade shortcut si no se ha otorgado antes\n $params = $this->buildParamsToPersons($ret[ProjectKeys::KEY_PROJECT_METADATA], NULL);\n $this->modifyACLPageAndShortcutToPerson($params);\n\n //4. Establece la marca de 'proyecto generado'\n $ret[ProjectKeys::KEY_GENERATED] = $this->projectMetaDataQuery->setProjectGenerated();\n\n return $ret;\n }", "public function getProject();", "public function run()\n {\n //\n $projecta=new Project();\n $projecta->id=4;\n $projecta->title=\"CASI - Centralized Admission System of IOE >> काजी\";\n $projecta->summary=\"Automation of admission process for all of our campuses/colleges\";\n $projecta->projectData=\"<h1 style='text-align:center'>CASI - Centralized Admission System of IOE &gt;&gt; काजी</h1><p>Continuous improvement in the academic environment and achieving excellence in producing quality engineers is the main motto of IOE. After automating the BE &amp; M.Sc. entrance system, IOE is proceeding towards the automation of admission process for all of its campuses/colleges where the research study carried out in 2016 thoroughly investigated the existing system and recommend reform in admission process of IOE. We, the member of that research team reviewed the study documents and propose the suitable administrative and technical framework for the automation of IOE admission system.&nbsp;CASI&nbsp;is a research based projects implemented for the uniformity in admission process at all constituent campuses and the affialiated colleges of Institute of Engineering towards excellency by enrolling meritorious best students every year at its engineering education.&nbsp;<br />\n The enrollment software systems developed is running from&nbsp;<a href='http://admission.ioe.edu.np/' target='_blank'>http://admission.ioe.edu.np</a>&nbsp;and is contineous progress in optimum implementation</p>\";\n $projecta->save();\n $projecta=new Project();\n $projecta->id=5;\n $projecta->title=\"Real Time Intranet based Entrance ExamiNAtion System (RETIENAS) रेटिनाज\";\n $projecta->summary=\"The fully managed and hassle free application processing system of IOE entrance examination allows applicants to simply apply and receive admit card with specified time slot.\";\n $projecta->projectData=\"<h1 style='text-align:center'>Real Time Intranet based Entrance ExamiNAtion System (RETIENAS) रेटिनाज</h1>\n\n <p>RETIENAS is a research and development project initiated by Prof. Dr. Bharat Raj Pahari, formar Dean of Institute of Engineering (IOE), Tribhuvan University (TU) on 2012 with the objective to select highly qualified candidates by having sohpisticated computer based entrance examination system for bachelor/master level engineering study at the institute. IOE is the government owned oldest institution in Nepal providing quality education in the engineering domain since 1972. However in the recent decade, other several universities are established in the country, IOE hasn&#39;t lost its popularity with its major features to have dedication on quality education to fulfill the world class standards in education. As a public institution, it provides equal opportunities for all qualified citizens to enter into the university education. There are generally more than 11,000 competitive applicants in the entrance exam of bachelors program. Hence less than 32% students were selected for the admission.&nbsp;<br />\n As being the technical institute, historically IOE is always ahead in the use of technology. The increasing burden in the manual processing of the entrance exam enforces IOE to step into the automatic exam oepration and result processing system. In 2004, IOE developed automatic answer sheet scanning and processing system and started online based application since 2009. From the year 2014, IOE has started fully computer based entrance examination at its resourceful centers (ICTC) at Pulchowk. The fully managed and hassle free application processing system of IOE entrance examination (<a href='http://entrance.ioe.edu.np/' target='_blank'>&nbsp;http://entrance.ioe.edu.np</a>) allows applicants to simply apply and receive admit card with specified time slot from online registration system.&nbsp;<br />\n Project RETIENAS had been executed since 2012 and is currently led by dean of Institute of Engineering Prof. Dr. Triratna Bajracharya including highly qualified research oriented faculties of IOE. RETIENAS has the following features:&nbsp;</p>\n \n <ul>\n <li>It is an automated system for Application Registration, Processing, Verification and Admit Card Generation for BE/BArch as well as M.Sc. Entrance Examination</li>\n <li>The system also reserved the exam date and time slot for every applicants.</li>\n <li>Highly secured intrancet system is available at Information and Communication Technology Center at IOE Pulchowk. Students appear in the center and give exam from specified LAB and the computer.</li>\n <li>The redundant entrance examination servers (WEB,DB) are maintained and more than 240 client computers are dedicately placed at ICTC. Hence 240 examinees can appear at a time for the examination</li>\n <li>The Entrance Examination Board of IOE massively conducts yearly entrance exam by planning four slots in a day and one slot consists of 240 examinees. Hence, it takes almost 10 to 12 days to conduct exam for about 11,000 applicants.</li>\n </ul>\n \n <p>The deveoped package to conduct entrance examination is fully interactive client server based system in which the time between server and client is well synchronized. We implemented lamports timestamp with the cristian&#39;s clock synchronization algorithm to distribute updated timestamp from server. Since the system is on the single LAN (Intranet), hence the propagation delay between client and server for timestamp distribution is very little (in micro-second) that does not considerably affect examinees during examination.&nbsp;<br />\n LICT team is continuing the research and development (upgrade) of the system to make it fully distributed and run on multiple LAN with the introdcution of CACHE servers to balance the load and increase the concurrent access during examination so that we can increase the number of examinees in a slot.</p>\n \n <h3><strong>Glimpse of ICTC Computer Labs:</strong></h3>\n \n <p><strong><img alt='' src='../../project/project5-1.jpg' style='height:50%; width:100%' /></strong></p>\n \n <p><strong><img alt='' src='../../project/project5-2.jpg' style='height:50%; width:100%' /></strong></p>\";\n $projecta->save();\n $projecta=new Project();\n $projecta->id=6;\n $projecta->title=\"Semester Exam AuTomation System of IOE (SETISI) सेटिसी\";\n $projecta->summary=\"Inhouse ICT Research and Development Project initiated to automate the Semester Exam activities of IOE.\";\n $projecta->projectData=\"<h1 style='text-align:center'>&nbsp; &nbsp;&nbsp;Semester Exam AuTomation System of IOE (SETISI) सेटिसी</h1>\n\n <p>SETISI is an inhouse ICT Research and Development Project initiated to automate the Semester Exam activities of IOE. Examination Control Division (ECD) of Institute of Engineering, Tribhuvan University is the one prominent and most busy organization where it conducts several examinations throughout the year. ECD conducts bi-annual semester exams for regular and back exam of bachelor of engineering students having 10 streams in its four constituent campuses and ten affiliated colleges. Similarly, ECD also conducts bi-annual exams for masters of engineering programs having seven streams and 21 sub-streams. Hence tentatively, there are more than 16000 examinees in an exam including regular and back. Additionally, successful conduction of BE/BArch entrance examination as well as M.Sc. entrance examination is the part of examination to be conducted by ECD.<br />\n Examination registrations of all programs, exam center management, examinees detail verifications, exam roll number and admit card generations, collections of internal, projects, survey marks and its processing/verifications, coding/decoding of the answer sheets, packaging, expert assignments, air and ground transportations and delivery of packets/question, tracking of packets, secure result processing and result publications, question setting arrangement, re-totaling managements, error correction and verification and many more are the quite challenging events continuously to be handled by ECD of IOE requiring more human resources and time critical management of all activities to adapt with the pre-defined IOE calendar.&nbsp;<br />\n The increase of streams and examinees demand more on all other relevant resources making the system more complex for operation and management within the existing non-automated manual system environment. Hence, to consider the efficient, reliable, secure and transparent operation and management of the system, a research towards the automation process of ECD has been initiated with the development of the software and its implementation in a planned way. The whole system development at a time shall be complicated and costly too. We are developing the automated system and implementing by developing it in modules with the principle of rapid application development so that while implementing one module encourages for analysis and design of other relevant modules.&nbsp;<br />\n ECD already has secure result processing system for BE/BArch programs. While online based exam registrarion, procfessing and admit card generation as well as M.Sc. result processing and publications modules are under development</p>\";\n $projecta->save();\n $projecta=new Project();\n $projecta->id=7;\n $projecta->title=\"Transformation to Future Networking with Broadband and IoT Implementations: Status of Nepal and the Steps Ahead (TraFNet)\";\n $projecta->summary=\"Transformation to Future Networking with Broadband and IoT Implementations\";\n $projecta->projectData=\"<h1 style='text-align:center'>T<strong>ra</strong><strong>nsformation to</strong><strong>&nbsp;F</strong><strong>uture&nbsp;</strong><strong>Net</strong><strong>working with Broadband and IoT Implementations: Status of Nepal and the Steps Ahead (TraFNet)</strong></h1>\n\n <p>&nbsp;</p>\n \n <h2>Research Motivation</h2>\n \n <p>We, the research team members include professionals of networking and telecommunications as well as university professors. Our main motto is to have localized ICT research for our country that contributes towards speedy implementation of new technologies in the field of information and communication technology for social transformation. At the different time frame, we members were involved in real time network configuration of telecom networks, ICT policy formulation including IPv6 migration, broadband communication, latest network deployment et cetera. It was also the major concern of Nepal Telecommunications Authority (NTA) to formulate suitable policies and regulatory guidelines to transform the current network into new networking paradigms. The important part for our country is the identification of proper cost of broadband deployment as well as network migration for ISP and Telecom equipment upgrades towards IPv6 and Software Defined Network (SDN), Implementation for Internet of Things (IoT), network operation &amp; maintenance and upgrade as well. Another major concern is the amount of energy consumed by networks. The increasing network size and continuous operation increase the energy consumption by the network devices. Because of this, the companies pay a significant percentage of their revenue to power their network infrastructures. With the rapid growth of smart users, IoT implementation and the Wireless Sensor Network (WSN) deployment becomes major concern for the service providers as their sustainable business solutions. Considering the global pace of technology transformations, we need to take steps for our country&rsquo;s network to identify its current status and apply suitable measures towards future smart life.&nbsp;<br />\n This seismic shift in the technological paradigm has encouraged the team to carry out practical research on the field of smart cities and the related infrastructure including IoT, carrier network and data analytics infrastructure along with evolutionary enablers such as IPv6, Software Defined Networks (SDN), cloud computing infrastructure and virtualization technologies. These technological enablers are critical in realizing a functional high-tech society that can lead to efficient service delivery, better communication and improved quality of life in the smart communities.&nbsp;</p>\n \n <h2>Background</h2>\n \n <p>Internet and related technologies have transformed the way humans communicate. Rapid technological advancement, service proliferation and integration of innumerable services have made the Internet an indispensable part of our lives. Traditionally, Internet has been a means of communication between people. The technology and network enabled people to quickly communicate with each other irrespective of geographical distance. This network then led to the evolution of network based services in trade, finance, education, social networking, and public services delivery. Even conventional communication media such as voice telephony and short messaging services are becoming Internet-borne.&nbsp;<br />\n Lately, Internet and IP technology have taken another very transformative turn. Machines have started to get more autonomous as connected entities that can create and consume data. This traditionally human activity (of creating and consuming data) has started being done by machines in what is known as M2M (Machine to Machine) network. This phenomena combined with the Internet technology is also called the Internet of Things (IoT). This has created an unprecedented avenue of technological evolution and business opportunity. Concepts such as remote surveillance, smart cities, smart homes, societal automation are becoming a reality. This, combined with advanced data analytics technologies, artificial intelligence, cloud platforms, rapid expansion of next generation broadband networks (wired and wireless) for seamless communication and future-proof technologies such as IPv6 has made the dream of smart communities, industrial automation and automated public service delivery a reality.<br />\n According to the gadget survey within the last 20 years, the number of Internet users reached more than 3 billion. The number of connected devices is more than 7.2 billion mobile gadgets which is even bigger than world&#39;s population in 2015. The rapid growth of Internet users and ICT business in the world led to the exhaustion of IPv4 address space and forced the industry to standardize new addressing scheme having 128 bits, called Internet Protocol version 6 (IPv6). In the next generation networking infrastructure, every connected device shall have one or more unique IPv6 addresses. The vast size of the IPv6 address space has enough addresses to allocate to every such device coming up in the foreseeable future. IPv6 on the one hand improves the efficiency of internet protocol as a whole including routing, while on the other hand Software Defined Networks (SDN) improves the controllability of networking equipment with an approach to using open protocols, such as Open-Flow, to apply globally aware software control at the edges of the network to access network devices that typically would use closed and vendor specific firmware. The invention of these new concepts and development creates bigger challenges in networking for service providers to migrate their existing legacy networks into the software defined and IPv6 enabled network and the implementation of those technologies in broadband communications.&nbsp;<br />\n With the rapid growth of internet users, increased Internet of Things (IoT), smart devices and the trend of world moving to converged network environment into the mode of computer networks (IP based network), the researchers, developers and the networking enterprises worldwide are obliged to enhance the intelligence in networking technologies. For the realization of the dream of smart cities and smart communities it is imperative to move towards next generation networking paradigm like IPv6 addressing mechanism, Software Defined Network as well as implementing the IoT &amp; Wireless Sensor Network and addressing the increased user&rsquo;s demand by having high speed broadband communications.&nbsp;<br />\n Being the developing country, Nepal is a net consumer of Internet services and technologies. ISPs of Nepal are the distributors of technologies and services. However, the rapid changes in technology worldwide has raised the challenges and issues for the developing country like Nepal towards the early implementation of evolving and new services. The major hurdles are limited skilled human resources, limited purchasing capacity and lack of proper planning. There is also a need for proper and timely government initiatives to formulate the policies, laws and regulation as well as their proper enforcement to usher in desired change in relevant sectors of society.</p>\n \n <p>Nepal has six licensed telecom operators and more than 60 ISPs. Recently promulgated broadband policy of Nepal is still in the initial stage of implementation while the sufficient study on technology migration, migration policy and strategy have not been set by the government. The change in technologies encourages and prompts the service providers to introduce new technologies and provide efficient services to the customers via technology migration. The migration is a gradual process for which proper strategy has to be developed by the service providers considering the technology needs, customer demand, Capital Expenditure (CapEX), Operational Expenditure (OpEX) and traffic engineering perspectives towards smooth transitioning. The transition period spans longer during when the service providers should have to move forward with proper migration planning with optimum cost. On the other hand the geographical distribution of Nepal is unique in the world having highest peak, mostly covered by Himalayan, hilly diverse terrain and a small part of plain area. Difficult geographical terrain and scattered inhabitation makes it difficult to build communication infrastructure and distribute the technologies and services. Core network migration to IPv6 and SDN, broadband infrastructure deployment with proper policy to suit of those migrated new technologies and the IoT implementations are the major concerns for the service providers of developing countries like Nepal. Looking into the Nepalese context, the technology migration is in the early stage. Similarly the broadband deployment, cloud computing, IoT implementations together with the necessary policy and implementation guideline formulation are in the early stages. This encouraged us to undertake this localized ICT research for our country so that we find the current status of technology implementation and recommend for the future that helps the country towards smart life and reduce the digital divide. We also expect the research to provide important insight to help innovate and introduce new services with right technologies in an effective and economical manner.</p>\n \n <h2>Justification of the Study</h2>\n \n <p>This research performs the technical and economic analysis of the legacy network migration to Software Defined IPv6 Network with broadband deployment challenges for Nepal including IoT implementation and the security measure that the service providers should consider. It will focus to identify networking equipment status for their upgradability towards future networking, optimum estimate to migrate the service provider network with cost of migration and broadband network deployment and identify the IoT implementation plan with better security.&nbsp;<br />\n <strong>Technological Impact:</strong>&nbsp;This research is highly assistive to the service providers of Nepal to efficiently migrate their current network into next generation networking paradigm like SDN &amp; IPv6 as well as it comes up with proper plan and strategies for broadband deployment and IoT implementations.<br />\n <strong>Socio economic impact:</strong>&nbsp;organizations and the citizens are directly benefited with the use of low cost and affordable new ICT services.&nbsp;<br />\n This research would also be helpful to the government agencies/regulators for proper regulation, development of regulatory guidelines/rules and future planning.</p>\n \n <h2>Objective(s)</h2>\n \n <p>The major objective(s) of this faculty research shall be as follows</p>\n \n <ol start='1' style='list-style-type:decimal'>\n <li>Study the current trend of networking technologies migrations including broadband deployment and the IoT implementation for future smart life</li>\n <li>Find the position of Nepal regarding Broadband deployment, SDN/IPv6 migration &amp; IoT implementation.</li>\n <li>Analyze the future network transformation challenges and recommend the solution for Nepal.</li>\n </ol>\n \n <p><strong>Reserach Duration: 2 Years</strong></p>\n \n <p><strong>This research is</strong></p>\n \n <ul>\n <li>Academically supported by Center for Applied Research and Development, Institute of Engineering in collaboration with NTNU (Norwegian University of Science and Technology) under Sustainable Engineering Education Project (SEEP) and financed by the Energy and Petroleum Program (EnPe) in NORAD (Norwegian Agency for Development Cooperation) and Nepal Academy of Science and Technology</li>\n <li>Requested to University Grant Commission Nepal (UGC-Nepal) for funding support of up to 4 Lakhs under faculty research grant.</li>\n </ul>\";\n $projecta->save();\n }", "function aboutHNG()\n{\n return 'The HNG is a 3-month remote internship program designed to locate the most talented software developers in Nigeria and the whole of Africa. Everyone is welcome to participate (there is no entrance exam). We create fun challenges every week on our slack channel. THose who solve them stay on. Everyone gets to learn important concepts quickly, and make connections with people they can work with in the future. The intern coders are introduced to complex programming frameworks, and get to work on real applications that scale. the finalist are connected to the best companies in the tech ecosystem and get full time jobs and contracts immediately.';\n}", "public static function label()\n {\n return 'Projects';\n }", "public function PrintProject(){\r\n\t\tprint \"id: $this->id<br>\\n\";\r\n\t\tprint \"number: $this->number<br>\\n\";\r\n\t\tprint \"name: $this->name<br>\\n\";\r\n\t\tprint \"status: $this->status<br>\\n\";\r\n\t\tprint \"manager: $this->manager<br>\\n\";\t\r\n\t\tprint \"location: $this->location<br>\\n\";\r\n\t\tprint \"information: $this->information<br>\\n\";\r\n\t\tprint \"showme: $this->show<br>\\n\";\r\n\t\tprint \"cadmin: $this->cadmin<br>\\n\";\r\n\t\tprint \"changeday: $this->changeday<br>\\n\";\t\r\n\t\tprint \"location_name: $this->location_name<br>\\n\";\r\n\t\tprint \"manager_name: $this->manager_name<br>\\n\";\r\n\t\tprint \"cadmin_name: $this->cadmin_name<br>\\n\";\r\n\t}", "function rawpheno_function_getproject($project_id) {\n $result = chado_query(\"SELECT name FROM {project} WHERE project_id = :project_id LIMIT 1\", array(\n ':project_id' => $project_id,\n ));\n\n return ($result) ? $result->fetchField() : 0;\n}", "function gpl3(){\n\t$glp3= <<<INICIO\n<!--\n\t/**************************************************************************************************\n\t# Copyright (c) 2008, 2009, 2010, 2011, 2012 Fernando A. Rodriguez para SerInformaticos.es #\n\t# #\n\t# Este programa es software libre: usted puede redistribuirlo y / o modificarlo #\n\t# bajo los t&eacute;rminos de la GNU General Public License publicada por la #\n\t# la Free Software Foundation, bien de la versi&oacute;n 3 de la Licencia, o de #\n\t# la GPL2, o cualquier versi&oacute;n posterior. #\n\t# #\n\t# Este programa se distribuye con la esperanza de que sea &uacute;til, #\n\t# pero SIN NINGUNA GARANTÍA, incluso sin la garant&iacute;a impl&iacute;cita de #\n\t# COMERCIABILIDAD o IDONEIDAD PARA UN PROPÓSITO PARTICULAR. V&eacute;ase el #\n\t# GNU General Public License para m&aacute;s detalles. #\n\t# #\n\t# Usted deber&iacute;a haber recibido una copia de la Licencia P&uacute;blica General de GNU #\n\t# junto con este programa. Si no, visite <http://www.gnu.org/licenses/>. #\n\t# #\n\t# Puede descargar la version completa de la GPL3 en este enlace: #\n\t# \t< http://www.serinformaticos.es/index.php?file=kop804.php > #\n\t# #\n\t# Para mas información puede contactarnos : #\n\t# #\n\t# Teléfono (+34) 961 19 60 62 #\n\t# #\n\t# Email: [email protected] #\n\t# #\n\t# MSn: [email protected] #\n\t# #\n\t# Twitter: @SerInformaticos #\n\t# #\n\t# Web: www.SerInformaticos.es #\n\t# #\n\t**************************************************************************************************/\n-->\n\nINICIO;\n\treturn $gpl3;\n}", "public function creer_projet_phase()\n\t{\n\t\n\t\t\treturn view('creer_projet_phase');\n\t}", "public function getSolution(): string\n {\n }", "function rawpheno_function_project() {\n $sql = \"SELECT FROM pheno_project_cvterm\";\n $project_count = db_query($sql)\n ->rowCount();\n\n return ($project_count <= 0) ? 0 : 1;\n}", "function list_of_available_project_titles()\n{\n\t$output = \"\";\n\t//$static_url = \"https://static.fossee.in/cfd/project-titles/\";\n\t$preference_rows = array();\n\t\t$i = 1;\n\t$query = db_query(\"SELECT * from list_of_project_titles WHERE {project_title_name} NOT IN( SELECT project_title from case_study_proposal WHERE approval_status = 0 OR approval_status = 1 OR approval_status = 3)\");\n\twhile($result = $query->fetchObject()) {\n\t\t$preference_rows[] = array(\n\t\t\t\t$i,\n\t\t\t\t//print_r(array_keys($case_studies_list))\n\t\t\t\tl($result->project_title_name, 'case-study-project/download/project-title-file/' .$result->id)\n\t\t\t\t);\n\t\t\t$i++;\n\t}\n\t\t$preference_header = array(\n\t\t\t'No',\n\t\t\t'List of available projects'\n\t\t);\n\t\t$output .= theme('table', array(\n\t\t\t'header' => $preference_header,\n\t\t\t'rows' => $preference_rows\n\t\t));\n\t\n\treturn $output;\n}", "private function term_project() {\n $matched = false;\n $project = array();\n\n $line = $this->_lines->cur();\n\n // special default project zero, for orphaned tasks and the like\n if ($this->_index == 0) {\n $text = \\tpp\\lang('orphaned');\n $note = $this->empty_note();\n $matched = true;\n $line = '';\n\n } elseif (preg_match($this->term['project'], $line , $match) > 0) {\n $this->_lines->move();\n\n $text = $match[1];\n $note = $this->term_note();\n $matched = true;\n }\n\n if ($matched) {\n $project = (object) array('type' => 'project', 'text' => $text, 'index' => $this->_index, 'note' => $note, 'raw' => $line);\n $this->_index++;\n\n $project->children = $this->match_any(array('term_task', 'term_info', 'term_empty'), array());\n return $project;\n } else {\n return false;\n }\n }", "public function project(){\n try {\n // Sparql11query.g:652:3: ( SELECT ( DISTINCT | REDUCED )? ( ASTERISK | ( variable | builtInCall | functionCall | ( OPEN_BRACE expression ( AS variable )? CLOSE_BRACE )+ ) ) ) \n // Sparql11query.g:653:3: SELECT ( DISTINCT | REDUCED )? ( ASTERISK | ( variable | builtInCall | functionCall | ( OPEN_BRACE expression ( AS variable )? CLOSE_BRACE )+ ) ) \n {\n $this->match($this->input,$this->getToken('SELECT'),self::$FOLLOW_SELECT_in_project2381); \n // Sparql11query.g:654:3: ( DISTINCT | REDUCED )? \n $alt69=2;\n $LA69_0 = $this->input->LA(1);\n\n if ( (($LA69_0>=$this->getToken('DISTINCT') && $LA69_0<=$this->getToken('REDUCED'))) ) {\n $alt69=1;\n }\n switch ($alt69) {\n case 1 :\n // Sparql11query.g: \n {\n if ( ($this->input->LA(1)>=$this->getToken('DISTINCT') && $this->input->LA(1)<=$this->getToken('REDUCED')) ) {\n $this->input->consume();\n $this->state->errorRecovery=false;\n }\n else {\n $mse = new MismatchedSetException(null,$this->input);\n throw $mse;\n }\n\n\n }\n break;\n\n }\n\n // Sparql11query.g:658:3: ( ASTERISK | ( variable | builtInCall | functionCall | ( OPEN_BRACE expression ( AS variable )? CLOSE_BRACE )+ ) ) \n $alt73=2;\n $LA73_0 = $this->input->LA(1);\n\n if ( ($LA73_0==$this->getToken('ASTERISK')) ) {\n $alt73=1;\n }\n else if ( ($LA73_0==$this->getToken('COALESCE')||$LA73_0==$this->getToken('IF')||($LA73_0>=$this->getToken('STR') && $LA73_0<=$this->getToken('REGEX'))||$LA73_0==$this->getToken('IRI_REF')||$LA73_0==$this->getToken('PNAME_NS')||$LA73_0==$this->getToken('PNAME_LN')||($LA73_0>=$this->getToken('VAR1') && $LA73_0<=$this->getToken('VAR2'))||$LA73_0==$this->getToken('OPEN_BRACE')) ) {\n $alt73=2;\n }\n else {\n $nvae = new NoViableAltException(\"\", 73, 0, $this->input);\n\n throw $nvae;\n }\n switch ($alt73) {\n case 1 :\n // Sparql11query.g:659:5: ASTERISK \n {\n $this->match($this->input,$this->getToken('ASTERISK'),self::$FOLLOW_ASTERISK_in_project2414); \n\n }\n break;\n case 2 :\n // Sparql11query.g:661:5: ( variable | builtInCall | functionCall | ( OPEN_BRACE expression ( AS variable )? CLOSE_BRACE )+ ) \n {\n // Sparql11query.g:661:5: ( variable | builtInCall | functionCall | ( OPEN_BRACE expression ( AS variable )? CLOSE_BRACE )+ ) \n $alt72=4;\n $LA72 = $this->input->LA(1);\n if($this->getToken('VAR1')== $LA72||$this->getToken('VAR2')== $LA72)\n {\n $alt72=1;\n }\n else if($this->getToken('COALESCE')== $LA72||$this->getToken('IF')== $LA72||$this->getToken('STR')== $LA72||$this->getToken('LANG')== $LA72||$this->getToken('LANGMATCHES')== $LA72||$this->getToken('DATATYPE')== $LA72||$this->getToken('BOUND')== $LA72||$this->getToken('SAMETERM')== $LA72||$this->getToken('ISIRI')== $LA72||$this->getToken('ISURI')== $LA72||$this->getToken('ISBLANK')== $LA72||$this->getToken('ISLITERAL')== $LA72||$this->getToken('REGEX')== $LA72)\n {\n $alt72=2;\n }\n else if($this->getToken('IRI_REF')== $LA72||$this->getToken('PNAME_NS')== $LA72||$this->getToken('PNAME_LN')== $LA72)\n {\n $alt72=3;\n }\n else if($this->getToken('OPEN_BRACE')== $LA72)\n {\n $alt72=4;\n }\n else{\n $nvae =\n new NoViableAltException(\"\", 72, 0, $this->input);\n\n throw $nvae;\n }\n\n switch ($alt72) {\n case 1 :\n // Sparql11query.g:662:7: variable \n {\n $this->pushFollow(self::$FOLLOW_variable_in_project2434);\n $this->variable();\n\n $this->state->_fsp--;\n\n\n }\n break;\n case 2 :\n // Sparql11query.g:663:9: builtInCall \n {\n $this->pushFollow(self::$FOLLOW_builtInCall_in_project2444);\n $this->builtInCall();\n\n $this->state->_fsp--;\n\n\n }\n break;\n case 3 :\n // Sparql11query.g:664:9: functionCall \n {\n $this->pushFollow(self::$FOLLOW_functionCall_in_project2454);\n $this->functionCall();\n\n $this->state->_fsp--;\n\n\n }\n break;\n case 4 :\n // Sparql11query.g:665:9: ( OPEN_BRACE expression ( AS variable )? CLOSE_BRACE )+ \n {\n // Sparql11query.g:665:9: ( OPEN_BRACE expression ( AS variable )? CLOSE_BRACE )+ \n $cnt71=0;\n //loop71:\n do {\n $alt71=2;\n $LA71_0 = $this->input->LA(1);\n\n if ( ($LA71_0==$this->getToken('OPEN_BRACE')) ) {\n $alt71=1;\n }\n\n\n switch ($alt71) {\n \tcase 1 :\n \t // Sparql11query.g:665:10: OPEN_BRACE expression ( AS variable )? CLOSE_BRACE \n \t {\n \t $this->match($this->input,$this->getToken('OPEN_BRACE'),self::$FOLLOW_OPEN_BRACE_in_project2465); \n \t $this->pushFollow(self::$FOLLOW_expression_in_project2467);\n \t $this->expression();\n\n \t $this->state->_fsp--;\n\n \t // Sparql11query.g:665:32: ( AS variable )? \n \t $alt70=2;\n \t $LA70_0 = $this->input->LA(1);\n\n \t if ( ($LA70_0==$this->getToken('AS')) ) {\n \t $alt70=1;\n \t }\n \t switch ($alt70) {\n \t case 1 :\n \t // Sparql11query.g:665:33: AS variable \n \t {\n \t $this->match($this->input,$this->getToken('AS'),self::$FOLLOW_AS_in_project2470); \n \t $this->pushFollow(self::$FOLLOW_variable_in_project2472);\n \t $this->variable();\n\n \t $this->state->_fsp--;\n\n\n \t }\n \t break;\n\n \t }\n\n \t $this->match($this->input,$this->getToken('CLOSE_BRACE'),self::$FOLLOW_CLOSE_BRACE_in_project2476); \n\n \t }\n \t break;\n\n \tdefault :\n \t if ( $cnt71 >= 1 ) break 2;//loop71;\n $eee =\n new EarlyExitException(71, $this->input);\n throw $eee;\n }\n $cnt71++;\n } while (true);\n\n\n }\n break;\n\n }\n\n\n }\n break;\n\n }\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "public function getGathercontentProject();", "public function fetchProjectID(): string;", "public function run()\n {\n $nomes_jogos =['Diablo 3', 'Dishonored', 'Far Cry 3', 'Mortal Kombat', 'Resident Evil 6', 'Skyrim', 'Tomb Raider'];\n\n $desenvolvedor=['Blizzard', 'Arkane Studios', 'Ubisoft Montreal', 'Netherrealm Studios e ANDYN', 'Capcom', 'Bethesda Game Studios', 'Core Design e Crystal Dynamics'];\n\n $plataformas=['PC', 'PC, Xbox 360 e Playstation 3', 'PC, Xbox 360 e Playstation 3', 'Xbox 360, PlayStation 3, PlayStation Vita ,Microsoft Windows', 'PlayStation 3, Xbox 360, Microsoft Windows', 'PC, Xbox 360 e Playstation 3', 'PlayStation 3, Xbox 360, Microsoft Windows'];\n\n $lancamento=['15 de maio de 2012', '12 de outubro de 2012', '30 de novembro de 2012', '28 de Abril de 2011', '2 de outubro de 2012', '11 de novembro de 2011', ' Lançamento do primeiro Tomb Raider foi em 1996'];\n\n $genero=['RPG', 'Stealth, ação-aventura, tiro em primeira pessoa', 'Tiro em primeira pessoa, \"mundo aberto\"', 'Luta', 'Horror dramático, survival horror, tiro na terceira pessoa', 'RPG', 'Terror Ação, Aventura, tiro na terceira pessoa'];\n\n $modo_de_jogo=['Single player/Multiplayer', 'Single player', 'Single player/Multiplayer', 'Single player/Multiplayer', 'Single player/Multiplayer', 'Single player', 'Single player'];\n\n $classificacao=['+16', '+18', '+18', '+18', '+18', '+18', '+18'];\n\n $descricao=[\n \t'Diablo III segue a história de seu predecessor, Diablo II: Lord of Destruction, que superou expectativas. A história do novo jogo passa-se depois de vinte anos dos acontecimentos que marcaram o fim de Diablo II. Os demônios Diablo, Mephisto e Baal foram derrotados, mas quando um cometa cai na Terra exatamente no lugar onde Diablo foi confinado, os guerreiros são novamente convocados para defender a humanidade contra as chamas do Inferno. O estilo do jogo continua o mesmo, mas desta vez utilizando os recursos das novas tecnologias reproduzindo um mundo totalmente em 3D e interativo, podendo até destruir cenários. Os jogadores poderão escolher entre cinco classes disponíveis e se aventurar num mundo mágico e ameaçador que Diablo III proporciona, porém desta vez, com novas habilidades e equipamentos e com um nível de personalização de personagem mais apurado.',\n \t 'És o antigo guarda-costas de confiança da Imperatriz. Injustamente culpado pelo seu assassinato, e movido pela vingança, terás de te tornar um infame assassino, conhecido apenas pela perturbadora máscara que se tornou o teu cartão-de-visita. À medida que vagueias por um mundo destroçado pela peste e oprimido por um governo armado com estranhas tecnologias, a verdade por detrás da tua traição é tão obscura como as águas que rodeiam a cidade. As tuas escolhas determinarão o destino do mundo, mas, o que quer que aconteça, a tua antiga vida desapareceu para sempre.',\n \t '\"Para além dos limites da civilização encontra-se uma ilha, um lugar sem lei governado por pirataria e miséria humana, onde os escapes são apenas as drogas ou o cano de uma arma. Este é o lugar onde você se encontra, preso num lugar que esqueceu o certo do errado, um lugar que vive pelos princípios da violência. Descubra os segredos sangrentos da ilha e leva a luta ao inimigo; improvise e use o ambiente para sobreviver. Cuidado com a beleza e o mistério deste paraíso inexplorado e vive para superar os seus personagens cruéis e desesperados. Irá precisar de mais do que sorte para sobreviver\". ',\n \t 'O jogo retorna as suas raízes, com lutas com movimentação completamente 2D, mas gráficos em 3D, onde não há mais possibilidade de se esquivar dos golpes andando para os lados e é o jogo mais rápido da série. Ao invés do clássico controle com Soco e Chute, Alto e Baixo, terá um botão pra cada membro sendo Braço e Perna, Esquerda e Direita.\n\n\t\t\t\tO jogo conta com vários modos de jogo. O principal é o Kombate, onde permite lutas um contra um ou em duplas, permitindo até 4 jogadores lutarem na mesma partida. Outro modo de jogo é a Torre dos Desafios, que consiste em uma grande torre dividida em 300 partes, onde cada parte contém um desafio a ser completado com um personagem especifico. Alguns dos desafios que compões a torre são os Minigames Teste sua Força, em que o jogador deve apertar freneticamente os botões do controle com o objetivo de acumular força para quebrar certos objetos; o Teste seu Golpe, onde o jogador deve acumular uma quantidade muito precisa de força para quebrar somente o objeto que está em uma pilha; o Teste sua Sorte, onde uma roleta sorteia várias condições especiais para a luta; e o Teste sua Percepção, onde um objeto é escondido em um dos vários copos/crânios e são embaralhados e cabe ao jogador descobrir onde estão.\n\n\t\t\t\tDurante as lutas foram adicionados vários novos sistemas e alguns reformulados, como os combos, onde pode-se ligar quase todos os golpes tendo poucos golpes que não tem ligação ou combos já programados e alguns personagens podem usar armas durante eles. Além disso os combos podem ser ligados com o parceiro no modo Tag-Team, assim criando sequencias únicas com dois personagens. Ao jogo também foi adicionada uma barra, que é usada para fazer movimentos especiais. Ela dividida em 3 níveis que podem respectivamente tornar os golpes especiais mais fortes, revidar um golpe e o Movimento de Raio-X, um combo mostrando os danos causados pelos golpes diretamente nos ossos e órgãos dos adversários, podendo retirar até 50% da vida do oponente dependendo do personagem. E por fim também há os Golpes Finais, um movimento em que se faz uma sequência de botões para finalizar o oponente de uma forma violenta, além dos movimentos finais de cada personagem, há o Fatality de Arena ou Stage Fatality, agora inovado, ao invés de simplesmente desferir um uppercut no oponente, o jogador executa um movimento que o leva a uma morte consequente (Ex: Na floresta viva, ao invés de dar um gancho no oponente, o personagem o agarra pelo ombro e o braço e o arremessa na boca de uma árvore que mastiga até que as pernas quebrem e se desprendam do corpo). Há também a inclusão do famoso Babality, em que o oponente volta a ser um bebê chorão. (Ex: Reptile, quando é pego por um, torna-se um ovo de réptil e eclode, tornando-se um \"bebê-réptil\", começando a chorar e cuspir ácido).',\n \t\t\t\t'Resident Evil 6 (バイオハザード 6, título japonês: Biohazard 6), é um jogo de vídeo do género horror dramático/de sobrevivência jogado na terceira pessoa desenvolvido e publicado pela Capcom. Foi apresentado durante uma campanha de divulgação viral na página NoHopeLeft.com. Apesar do nome é o nono jogo da série principal Resident Evil e foi lançado em 2 de outubro de 2012 para PlayStation 3 e Xbox 360. A versão para Microsoft Windows foi lançada no dia 22 de março de 2013.\n\n\t\t\t\tA história é contada a partir das perspectivas de Chris Redfield, membro e fundador da BSAA traumatizado por ter falhado uma missão; Leon S. Kennedy, um sobrevivente de Raccoon City e agente especial do governo; Jake Muller, filho ilegítimo de Albert Wesker e associado de Sherry Birkin; e Ada Wong, uma agente solitária com ligações aos ataques bio-terroristas pela Neo-Umbrella.\n\n\t\t\t\tO conceito do jogo começou em 2009, mas começou a ser produzido no ano seguinte sobre a supervisão de Hiroyuki Kobayashi, que já tinha produzido Resident Evil 4. A equipa de produção acabou por crescer e tornou-se na maior de sempre a trabalhar num jogo da série Resident Evil.\n\n\t\t\t\tResident Evil 6 recebeu reacções negativas aquando do lançamento da demo devido aos problemas nos controlos e criticas muito diversas devido à mudança drástica da jogabilidade encontrada na versão final do jogo, sendo um ponto de elogio e também de critica nas diferentes análises.\n\n\t\t\t\tApesar de não ter sido bem recebido tanto pela imprensa especializada como pelos jogadores, a Capcom editou mais de 4,5 milhões de cópias e Resident Evil 6 tornou-se o jogo da série que mais vendeu inicialmente.',\n\n\t\t\t\t'Os acontecimentos deste jogo passam-se duzentos anos depois da, já quase esquecida, crise de Oblivion, no ano 201 da quarta era (4E 201) na província de Skyrim, no norte de Tamriel, e 30 anos após a mais recente Grande Guerra, onde Thalmors e Humanos lutaram arduamente, mas que quase extinguiu os humanos de Tamriel, e para evitar tal derrota, acordaram com os Thalmors, rendendo duas forças e sujeitando-se as suas exigências.\n\t\t\t\tSkyrim é a terra natal de um povo bravo chamados de Nords (nórdicos), onde além da Grande Guerra, irrompeu uma guerra civil após o assassinato do Alto Rei de Skyrim, Torygg. E diante de todas estas guerras e problemas, a província se encontra dividida: de um lado se quer a separação do Império que agora está em ruínas, e do outro lado se quer permanecer leal.', \n\t\t\t\t'Tomb Raider é uma série de jogos, histórias em quadrinhos e filmes tendo como protagonista a personagem Lara Croft. Desde o lançamento do primeiro Tomb Raider, em 1996, as séries tiveram um grande lucro e Lara transformou-se num dos principal ícone da indústria de video-jogos/vídeo games. O Guiness Book reconheceu Lara Croft como \"a heroína de video-jogo/vídeo game mais bem sucedida\" em 2006.\n\n\t\t\t\tSeis jogos da série foram desenvolvidos pela Core Design, e os três últimos pela Crystal Dynamics. Todos os jogos foram publicados pela Eidos Interactive, que mantém os direitos dos personagens e a marca registrada de Tomb Raider. Para o cinema, Lara Croft: Tomb Raider e Lara Croft Tomb Raider: The Cradle of Life foram produzidos, estrelando a atriz americana Angelina Jolie como Lara Croft. Todos os jogos Tomb Raider venderam mais de 30 milhões de unidades, fazendo uma das séries de video jogos mais vendidas de todos os tempos.'];\n\n\t\t\t\tfor ($i=0; $i < count($nomes_jogos); $i++) { \n\n\t\t\t\t\t$dados = [\n\t\t\t\t\t\t'nome_jogo' => $nomes_jogos[$i],\n\t\t\t\t\t\t'desenvolvedor' => $desenvolvedor[$i],\n\t\t\t\t\t\t'plataformas' => $plataformas[$i],\n\t\t\t\t\t\t'lancamento' => $lancamento[$i],\n\t\t\t\t\t\t'genero' => $genero[$i],\n\t\t\t\t\t\t'modo_de_jogo' => $modo_de_jogo[$i],\n\t\t\t\t\t\t'classificacao' => $classificacao[$i],\n\t\t\t\t\t\t'descricao' => $descricao[$i]\n\t\t\t\t\t];\n\n\t\t\t\t\tDB::table('ficha_tecnica')->insert($dados);\n\n\t\t\t\t}\n\n }", "public function run()\n\t{\n\t\t$projects = [\n\t\t\t[\n\t\t\t\t\"status_id\" => 1,\n\t\t\t\t\"name\" => 'Caerus',\n\t\t\t\t\"description\" => 'Caerus is a free service to job seekers, where you can upload a resume, search for jobs, save them and apply to them directly. Employers may also keep track of their candidates and maintain a history of the interview progress.',\n\t\t\t\t\"photo\" => 'projects/caerus.png',\n\t\t\t],\n\t\t\t[\n\t\t\t\t\"status_id\" => 1,\n\t\t\t\t\"name\" => 'Hermes',\n\t\t\t\t\"description\" => 'Hermes is a free instant messaging app available on the web. It allows you to send text messages to other users one-on-one.',\n\t\t\t\t\"photo\" => 'projects/hermes.png',\n\t\t\t],\n\t\t\t[\n\t\t\t\t\"status_id\" => 1,\n\t\t\t\t\"name\" => 'SiSr',\n\t\t\t\t\"description\" => 'SiSr is a web app that allows you to order your food at your favorite restaurant without the need of interacting with the waiters, simply choose your grub, confirm and await!',\n\t\t\t\t\"photo\" => 'projects/sisr.png',\n\t\t\t],\n\t\t\t[\n\t\t\t\t\"status_id\" => 1,\n\t\t\t\t\"name\" => 'Agora',\n\t\t\t\t\"description\" => 'An online marketplace where you can buy and sell anything, anywhere at anytime!',\n\t\t\t\t\"photo\" => 'projects/agora.png',\n\t\t\t],\n\t\t\t[\n\t\t\t\t\"status_id\" => 1,\n\t\t\t\t\"name\" => 'Artemis',\n\t\t\t\t\"description\" => 'A bug tracking software meant for software development companies',\n\t\t\t\t\"photo\" => 'projects/artemis.png',\n\t\t\t],\n\t\t\t[\n\t\t\t\t\"status_id\" => 1,\n\t\t\t\t\"name\" => 'Aletheia',\n\t\t\t\t\"description\" => 'No information provided',\n\t\t\t\t\"photo\" => 'projects/aletheia.png',\n\t\t\t],\n\t\t\t[\n\t\t\t\t\"status_id\" => 1,\n\t\t\t\t\"name\" => 'UI Basa Capital',\n\t\t\t\t\"description\" => 'The static version of the website of Basa Capital (https://portalweb.basacapital.com.py)',\n\t\t\t\t\"photo\" => 'projects/ui-basa-capital.png',\n\t\t\t],\n\t\t\t[\n\t\t\t\t\"status_id\" => 1,\n\t\t\t\t\"name\" => 'UI Raices',\n\t\t\t\t\"description\" => 'The static version of the website of Raices (https://usuarios.raices.com.py/login)',\n\t\t\t\t\"photo\" => 'projects/ui-raices.png',\n\t\t\t],\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t[\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"status_id\" => 1,\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\" => 'Merkto',\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"description\" => 'A business-to-business (B2B) ecommerce, purchase goods from anywhere in Paraguay!',\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"photo\" => 'projects/merkto.png',\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t],\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t[\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"status_id\" => 1,\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\" => 'Gymmer',\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"description\" => 'Manage your customers data such as routines, schedules, muscle priorities, monthly payments/installments and more!',\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"photo\" => 'projects/gymmer.png',\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t],\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t[\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"status_id\" => 1,\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\" => 'Matse',\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"description\" => 'Software meant to manage all the real estate properties of Matse S.A.',\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"photo\" => 'projects/matse.png',\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t],\n\t\t];\n\n\t\tforeach ($projects as $project) {\n\t\t\t$new_project = new Project();\n\t\t\t$new_project->status_id = $project['status_id'];\n\t\t\t$new_project->name = $project['name'];\n\t\t\t$new_project->description = $project['description'];\n\t\t\t$new_project->photo = $project['photo'];\n\t\t\t$new_project->name = $project['name'];\n\t\t\t$new_project->started_at = now()->subDays(rand(30, 120));\n\t\t\t$new_project->save();\n\t\t}\n\n\t}", "function SimplonShortcode() {\n\treturn '<p>La publication de cet article est possible grace à mon super partenaire \n<a href=\"http//simplon.co\">simplon.co</a>\n - une entreprise de \nl\\'économie sociale et solidaire et un\nréseau de \"fabriques\" (écoles) qui propose \ndes\nformations\nGRATUITES\npour devenir développeur web. </p>';\n}", "public function verificaSitEntProj() {\n $sSql = \"select sitgeralproj,sitproj,sitcliente,sitvendas,filcgc,nr,desc_novo_prod,dtimp,\n empcod,officedes,repnome,resp_venda_nome,dtaprovendas,\n resp_proj_cod,resp_venda_cod,repcod,emailCli,\n DATEDIFF(day,dtaprovendas,GETDATE())as dias \n from tbqualNovoProjeto where sitvendas='Aprovado' \n and sitgeralproj='Em execução' and sitcliente = 'Aguardando'\";\n $result = $this->getObjetoSql($sSql);\n while ($oRowBD = $result->fetch(PDO::FETCH_OBJ)) {\n $oModel = $oRowBD;\n $aRetorno[] = $oModel;\n }\n\n return $aRetorno;\n }", "function tab_project(){\n\tglobal $t_project_ids;\n\tglobal $f_version_id;\n\tglobal $t_version_type;\n\tstatic $i = 0;\n\n\n\t$f_columns = bug_list_columns('bug_list_columns_versions');\n\n\t$t_project_id = $t_project_ids[$i];\n\t$i++;\n\n\t/* get all project versions */\n\t$t_version_rows = version_get_all_rows($t_project_id, true, true);\n\n\tif($t_version_type == 'target_version')\n\t\t$t_version_rows = array_reverse($t_version_rows);\n\t\t\n\t$t_is_first_version = true;\n\n\t/* print sectin per version */\n\tforeach($t_version_rows as $t_version_row){\n\t\t$t_version_name = $t_version_row['version'];\n\t\t$t_released = $t_version_row['released'];\n\t\t$t_obsolete = $t_version_row['obsolete'];\n\n\t\t/* only show either released or unreleased versions */\n\t\tif(($t_version_type == 'target_version' && ($t_released || $t_obsolete)) || ($t_version_type != 'target_version' && !$t_released && !$t_obsolete))\n\t\t\tcontinue;\n\n\t\t/* Skip all versions except the specified one (if any) */\n\t\tif($f_version_id != -1 && $f_version_id != $t_version_row['id'])\n\t\t\tcontinue;\n\n\t\t/* query issue list */\n\t\t$t_issues_resolved = 0;\n\t\t$t_issue_ids = db_query_roadmap_info($t_project_id, $t_version_name, $t_version_type, $t_issues_resolved);\n\t\t$t_num_issues = count($t_issue_ids);\n\t\n\t\t/* print section */\n\t\tsection_begin('Version: ' . $t_version_name, !$t_is_first_version);\n\t\t\t/* print version description and progress */\n\t\t\tcolumn_begin('6-left');\n\n\t\t\t$t_progress = 0;\n\n\t\t\tif($t_num_issues > 0)\n\t\t\t\t$t_progress = (int)($t_issues_resolved * 100 / $t_num_issues);\n\n\t\t\t$t_release_date = date(config_get('short_date_format'), $t_version_row['date_order']);\n\n\t\t\tif(!$t_obsolete){\n\t\t\t\tif($t_released)\t$t_release_state = format_label('Released (' . $t_release_date . ')', 'label-success');\n\t\t\t\telse\t\t\t$t_release_state = format_label('Planned Release (' . $t_release_date . ')', 'label-info');\n\t\t\t}\n\t\t\telse\n\t\t\t\t$t_release_state = format_label('Obsolete (' . $t_release_date . ')', 'label-danger');\n\n\n\t\t\ttable_begin(array());\n\t\t\ttable_row(\n\t\t\t\tarray(\n\t\t\t\t\t$t_release_state,\n\t\t\t\t\tformat_progressbar($t_progress),\n\t\t\t\t\tformat_button_link($t_issues_resolved . ' of ' . $t_num_issues . ' issue(s) resolved', 'filter_apply.php', array('type' => 1, 'temporary' => 'y', FILTER_PROPERTY_PROJECT_ID => $t_project_id, FILTER_PROPERTY_TARGET_VERSION => $t_version_name), 'input-xxs')\n\t\t\t\t),\n\t\t\t\t'',\n\t\t\t\tarray('', 'width=\"100%\"', '')\n\t\t\t);\n\t\t\ttable_end();\n\n\t\t\t$t_description = $t_version_row['description'];\n\n\t\t\tif(!is_blank($t_description))\n\t\t\t\talert('warning', string_display($t_description));\n\n\t\t\tcolumn_end();\n\n\t\t\t/* print issues */\n\t\t\tcolumn_begin('6-right');\n\t\t\tactionbar_begin();\n\t\t\t\techo '<div class=\"pull-right\">';\n\t\t\t\t\t$t_menu = array(\n\t\t\t\t\t\tarray('label' => 'Select Columns', 'data' => array('link' => format_href('columns_select_page.php', column_select_input('bug_list_columns_versions', $f_columns, false, true, basename(__FILE__))), 'class' => 'inline-page-link')),\n\t\t\t\t\t);\n\n\t\t\t\t\tdropdown_menu('', $t_menu, '', '', 'dropdown-menu-right');\n\t\t\t\techo '</div>';\n\t\t\tactionbar_end();\n\n\t\t\tbug_list_print($t_issue_ids, $f_columns, 'table-condensed table-hover table-datatable no-border');\n\t\t\tcolumn_end();\n\t\tsection_end();\n\n\t\t$t_is_first_version = false;\n\t}\n\n\t/* print message if no versions have been shown */\n\tif($t_is_first_version){\n\t\techo '<p class=\"lead\">';\n\t\techo 'No Roadmap information available. Issues are included once projects have versions and issues have \"target version\" set.';\n\t\techo '</p>';\n\t}\n}", "public function run()\n\t{\n\n\t\t$items = array(\"1437556249-07\", \"1437556731-02\", \"1437303434-5\", \"1437223473-2015-06-24 21_31_38-Java EE - Eclipse\", \"1437228918-google\",\"1437223331-07-04200-midterm\",\"1437552346-database\",\"1437553542-08\",\"1437195042-5\",\"1437223422-EclipseTomcatServerPortSetup\",\"20150726164048\",\"20150726164357\",\"20150726164556\",\"20150726164809\",\"20150726164835\",\"20150726164944\",\"20150726165015\",\"20150726165123\",\"20150726165253\",\"20150726165324\",\"20150726165528\",\"20150726165604\",\"20150726165702\");\n\t\t$today = Carbon::now();\n\t\t\tProject::create([\n\t\t\t\t'name' => '金萱,新時代中文字型,培育新鮮台灣文字風景',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => '十五年來,台灣幾乎沒有設計自己的新字型。\n不過,這一次,我們將能自己開發、研製一系列的新中文字型。',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"-10 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"+30 day\")),\n\t\t\t\t'cover_img_path' => '/images/project/1.png' ,\n\t\t\t\t'video_link' => 'https://www.youtube.com/embed/8L35oJaggEk',\n\t\t\t\t'content' => '想到台灣,你會想到什麼?台北 101、夜市小吃,很棒。珍珠奶茶、蚵仔煎、滷肉飯,都很經典。\n\n不過,還有一位很具代表性的候選人:正體中文。想到正體中文的美麗與博大精深,或許大多數人會先想到書法。但其實,中文字普遍更以「字型」的形式存在於生活中。在資訊時代裡,「字型」拾俯即是,存在於各種媒介裡。一般大眾、專業人士,每天都在使用,比書法藝術更能凸顯一國的文化影響力。',\n\t\t\t\t'status' => '4',\n\t\t\t\t'hitpoint'=>rand(0,10000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1322055681,1358057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => '1', \n\t\t\t\t]);\n\t\t\t\n\t\t\tProject::create([\n\t\t\t\t'name' => 'SketchyNotebook',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => '市面上最多功能的筆記本!不論你想塗鴉、寫字或素描,一本在手,功用無窮!',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"-15 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"+25 day\")),\n\t\t\t\t'cover_img_path' => 'https://d29twh0lc6f62l.cloudfront.net/project/9ddd835c3faee73428ed94ea7a263b04.jpg' ,\n\t\t\t\t'video_link' => 'https://www.youtube.com/embed/LQOsJLy6tGU',\n\t\t\t\t'content' => '這是怎麼開始的?\n如同大多數的藝術家,當靈感一迸現時,我便立刻想把它寫下或畫出來以免忘記。但問題是,大多數的時候我會猶豫,因為我並不希望把筆記本的頁面弄得凌亂、沒有條理。\n\n有時候,我只是想塗鴉、繪製個網頁的版型、描繪一個 iPhone 的 app,或只是想記錄下一個念頭。當然,市面上有許多已經印有方格、點點、格線的筆記本,但這些預先存在的限制,總是讓我難以自在地把想法謄到紙上。\n\n筆記本裡預先存在的模板,侷限了我的創意與自由。我試著在空白的素描本上發揮,但它缺少了我所需要的精確度。\n\n我要的其實很簡單:我享受空白的自在,但我也喜歡指引的陪伴。有沒有可能,我可以同時擁有來自兩個世界的絕配,撇除餘下的一切?\n\n\n\n傳統筆記本的問題:\n\n單環或線圈筆記本易變形\n大小不一\n紙張易落,欠缺耐久度\n只能有一種格式\n圓滑的邊角與打洞孔易導致混亂的頁面',\n\t\t\t\t'status' => '2',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1372055681,1398057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => rand(1,30), \n\t\t\t\t]);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tProject::create([\n\t\t\t\t'name' => '割闌尾計劃 Appendectomy Project',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => '可割可棄,利大於弊\n5月3號,割闌尾行動正式動刀!\n5月5號,上午10:30北三區記者會開始!',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"-10 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"+30 day\")),\n\t\t\t\t'cover_img_path' => 'https://d29twh0lc6f62l.cloudfront.net/project/4e4866962ad2d1516563ba8380004960.jpg' ,\n\t\t\t\t'video_link' => 'https://www.youtube.com/embed/_F36LVanRE0',\n\t\t\t\t'content' => '【5月4號23:10更新:割闌尾募款結束預告:感謝你的每一份心意】\n\n割闌尾 VDemocracy 募資活動 (http://www.vdemocracy.tw/project/3080) 上線45小時以來,\n已有超過5400名夥伴加入支持的行列,我們非常感謝你的每一份心意!\n儘管這條路勢必艱辛,這場仗勢必嚴苛,有了你的火力支援,就能讓我們往前挺進。\n由於募資已達階段性目標,割闌尾 VDemocracy 募資活動將會於5/5(一)中午截止。\n\n戰役才正要開始,接下來我們更需要你的挺身而出。站出來行動吧!\n寫連署書、走出門、丟進郵筒-一個簡單的動作,\n你或許就能創造台灣的歷史:讓台灣人民首度成功行使罷免權。\n\n全國各地區的不適任立委罷免行動,也正由網友、民眾、公民團體自主發起。\n不管你位於何處,都可以透過網路平台參與後續活動、\n加入行動志工、或主動號召夥伴組成在地罷免團隊,讓全民監督代議士的力量遍地開花。\n\n再次呼籲,所有「蔡正元、林鴻池、吳育昇」立委選區的割友 ─ \n即日起,凡是台北市第4選區(南港、內湖)、新北市第6選區(板橋區中正里等65里)、\n新北市第1選區(包括石門區、三芝區、淡水區、八里區、林口區與泰山區)的民眾,\n皆可前往割闌尾行動官網(http://appy.tw/)下載實體連署書,\n',\n\t\t\t\t'status' => '2',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1322055681,1358057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => rand(1,30), \n\t\t\t\t]);\n\n\t\t\t\t\t\t\n\t\t\tProject::create([\n\t\t\t\t'name' => 'ZENLET -唯一帶給你簡單,安全,直覺的錢包',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => '\n重新思考錢包的需求與功能,將「禪」設計哲學貫徹於錢包設計, 故取名為ZENLET。',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"-10 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"+50 day\")),\n\t\t\t\t'cover_img_path' => 'https://d29twh0lc6f62l.cloudfront.net/project/478ddac72021217bc8fdafdc532f3c2d.jpg' ,\n\t\t\t\t'video_link' => 'https://www.youtube.com/embed/5ZDGRokY6lY',\n\t\t\t\t'content' => ' 你是否曾有過站在一個長長的排隊隊伍裡,輪到了你卻找不到卡片的窘境?你是否擔心下雨會讓你的卡片,支票濕掉?你知道一般人背部疼痛的原因可能來自於厚重的錢包嗎?甚至還有更多充斥在你身上的問題。看一下下面列表當你帶著你的錢包經常會發生的十個問題。 ',\n\t\t\t\t'status' => '2',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1322055681,1358057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => rand(1,30), \n\t\t\t\t]);\n\n\t\t\tProject::create([\n\t\t\t\t'name' => '流浪狗不再流浪,流浪狗家園計畫 ',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => '流浪動物的世界及環境與我們想像的不太相同,也有太多的事實大家都不知道。現在大部分的流浪狗相關協會都已有固定的募款對象及方法,就在這個時候我們看到了-小黑的故事,並進而找到了「高雄市愛護流浪狗協會」(汪媽媽狗園)。',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"-15 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"+30 day\")),\n\t\t\t\t'cover_img_path' => 'https://d15ds55abggjxg.cloudfront.net/project/f2519f81120a2dbe719b19302abbc23a.jpg' ,\n\t\t\t\t'video_link' => 'https://www.youtube.com/embed/S-3DNww1euI',\n\t\t\t\t'content' => '流浪狗的定義是指沒有主人的寵物犬,而最常見的原因包括飼主刻意遺棄、自行走失或野生繁殖等。\n\n  在台灣,棄養的問題非常不被重視;飼主不想飼養時就將動物丟至收容所,更惡劣的甚至會直接遺棄在郊區,這些行為對飼主來說雖不會受到嚴重的懲罰,但對狗狗來說卻是最可怕的噩夢。人的一生可以擁有過很多隻狗,但對狗狗來說你是牠的唯一、是牠的全世界,所以愛牠請不要遺棄牠。\n\n  被遺棄的狗兒或野生的流浪狗都會造成流浪狗繁殖,導致更多的流浪狗出現,而解決流浪狗的問題不是撲殺,是棄養問題及結紮的觀念,這樣才能正確又有效的減少流浪狗。',\n\t\t\t\t'status' => '2',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1322055681,1358057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => rand(1,30), \n\t\t\t\t]);\n\t\t\t\n\t\t\tProject::create([\n\t\t\t\t'name' => '歐洲M.i.樂團 音樂巡島計畫',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => '我在世界不同的角落,遇見了各個充滿奇特魅力的樂手,我一直告訴他們台灣的音樂是什麼,把台灣的音樂讓他們演奏,但我更想直接把他們帶到台灣來,看看什麼是台灣,也想讓台灣人看看這群充滿獨有魅力的音樂人。',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"-8 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"+30 day\")),\n\t\t\t\t'cover_img_path' => 'https://d29twh0lc6f62l.cloudfront.net/project/d573722cedd7785db17577bdc40c95f9.jpg' ,\n\t\t\t\t'video_link' => 'https://www.youtube.com/embed/TK1l52CEGN8',\n\t\t\t\t'content' => ' 大家好,我是M.i樂團的團長黃柏樹,我是一個吹竹笛的台灣小孩!但是我從小開始就是一個不太容易被旁人理解的小孩。或許是因為溝通的問題,很多時候在台灣的學校教育裡我總是感到太多的衝撞與苦痛,因此在國中畢業後我決定暫別家鄉台灣,去看看其他的世界。我不想放棄,我相信只要我用對方法,誠心誠意,一定可以和所有人有好的溝通。走出台灣後,我到了歐洲,重新認識自己,也重新認識了全世界的語言—音樂。我認識到一種充滿即興的樂種,在這種樂種裡你必須要用你自己的語言,說你自己的話,這個樂種,叫做爵士。從此,我用它和人溝通,開始試著將我的語言用爵士來傳達。',\n\t\t\t\t'status' => '2',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1322055681,1358057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => rand(1,30), \n\t\t\t\t]);\n\t\n\t\t\t\n\t\t\tProject::create([\n\t\t\t\t'name' => '2014跑步環島資助計畫',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => '影片是屬於我一個小部分的微電影,\n\n裡面說明著我練習的精神與不放棄,\n\n希望我能夠帶著這份勇氣完成計畫。\n\n因為時間的關係無法拍出相關性的影片,\n\n所以只好用一個精神來告訴大家我的勇氣。',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"-6 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"+50 day\")),\n\t\t\t\t'cover_img_path' => 'https://d29twh0lc6f62l.cloudfront.net/project/4a6f4a2c52163f1d8bd097db985792ae.jpg' ,\n\t\t\t\t'video_link' => 'https://www.youtube.com/embed/Zb1qVSEO1Ts',\n\t\t\t\t'content' => ' 【計畫緣起】\n\n兩年前高一的暑假,教練讓我們放一個禮拜的假期,而假期的目標是做一件有意義的事情,\n我心裡想著如果能靠著自己的雙腳跑到自己想要到地方那是不是會很有意義?\n\n\n於是我開始著手規劃路線並實現這一段小小的夢想,沿路上我看到了許多不同的景象,\n在捷運上、公車上你可能是玩著手機或著與朋友聊著天,\n但你一定從沒想過如果是用跑的或者是用走的卻可以那麼認真的觀察每一個地方,\n甚至是覺得原來自己所規劃完的夢想然而去實踐完成會是那麼的有意義。\n\n\n一年前高二,我擔任班上的愛心大使參加學校推動的世界展望會(World Vision)兒童資助計畫\n每個禮拜每個月收著這些小錢,寄出到國外資助這些有需要的小朋友。\n\n\n這一刻起\n我想嘗試完成去築另一個夢想,我想靠著自己的雙腳深入的走進台灣每一個小角落,\n在這個過程中去發現需要被幫助的人。這不禁讓我想起昔日的高中同學們,\n她們因為家裡的經濟狀況而無法與我們一起同行前往畢業旅行,\n但那時的我們卻沒有能力可以幫助她們什麼或者是為她們做點什麼,\n因此讓我更想要去做這件事情並幫助到所有需要被幫助的人。\n\n【計畫內容】\n\n學校所推動的兒童資助計畫讓我深刻了解到世界其他角落的小孩需要的是什麼,\n也進而關心到台灣的小孩呢? 是不是也同樣有這些問題或者需要的是什麼?\n是一雙鞋子? 一套衣服? 一份晚餐? 還是一個深深的擁抱?\n\n而最重要的是要讓大家知道不只是世界其他角落的孩子需要被幫助,\n就連台灣也有不少的孩子甚至有其他人也都需要我們去幫助。\n\n\n【計畫目標】\n\n透過網路群眾募資及環島過程中募資的方式,來幫助這些這些需要被資助的人,\n資金的要求不限,有多少就算多少,只要你願意出點力哪怕只是1元、5元、10元,。\n\n任何一個夢想所需要的資源是未知,\n但是一個創造成功的夢想卻是無價。\n\n將目標設定為100元,\n是希望你因為支持而樂捐,\n而目標的資金是無上限的。',\n\t\t\t\t'status' => '2',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1322055681,1358057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => rand(1,30), \n\t\t\t\t]);\n\n\n\t\t\tProject::create([\n\t\t\t\t'name' => 'DEMON ART : metal 金屬經典鍵盤',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => '期待已久的 DEMON ART :metal【金屬經典鍵盤】開始募資, 產品預計 2014年8~10月左右上市\n\n(此次贊助者為第一批出貨對象,預計出貨時間為 2014年7~8月左右)\n\n\n\n為了回報廣大台灣粉絲長期的支持和鼓勵 , 我們特別在 FlyingV 開放募資 ,\n\n讓喜歡 DEMON ART :metal的用戶能在上市前用【極優惠】的價格得到這經典鍵盤 ,\n\n同時也更加充實我們的產品資金!',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"-90 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"-30 day\")),\n\t\t\t\t'cover_img_path' => 'https://d15ds55abggjxg.cloudfront.net/project/bacd1f2435aabd7d65732496d55d6bac.jpg' ,\n\t\t\t\t'video_link' => 'https://www.youtube.com/embed/bmGLSqtItCc',\n\t\t\t\t'content' => '產品規格與注意事項\n長/寬/高:31cm*13cm*1.2cm (實際量產品會有些微調整)\n鍵盤重量:約 680g (實際量產品會有些微調整,不同版本也會有相對上的差異)\n作動結構:剪刀腳薄膜式鍵盤 (就像你的筆記型電腦鍵盤一樣)\n表面符號:台灣版為 英文 / 注音( 注意:本產品表面符號無 倉頡/大易 )\n使用時間:非發光版( 290 mAh,可充電鋰電池),約可使用 120小時\n 發光版( 1550 mAh,可充電鋰電池,) 約可使用 700小時(無開啟背光的情形下),\n充電方式 : 電池耗盡只要插上USB線即可輕鬆充電與使用\n商品保固:有限硬體保固一年 (人為或不可抗力之外力造成之損害不在保固範圍內)\n過保後維修 : 可寄送DEMON ART台灣原廠維修\n\n外殼 : 航太鋁合金CNC陽極處理\n按鍵表面 : 髮絲紋貼膜\n\n面板 : 防刮面板 (防刮等級: 指甲) / 符號背面印刷\n\nUSB線長 : 預定長度 1.5M(分離式設計)\n\n注意事項:以上照片為預覽版樣品機,實際外觀以出貨產品為準 (在以模具生產成商品前外觀有可能會有局部設計上的調整喔!) ',\n\t\t\t\t'status' => '2',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1322055681,1358057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => rand(1,30), \n\t\t\t\t]);\n\t\t\tProject::create([\n\t\t\t\t'name' => '癱瘓流浪狗Lucky的復健之路',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => '今年年初寒流最冷的時候,我們在公司的停車場發現一隻不斷發抖的小狗,看起來才出生不到兩三個月,看到人很興奮想討食。後來陸續遇過幾次,每次餵點小東西後,想帶牠到別處避雨時,牠就逃走了。',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"-10 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"+32 day\")),\n\t\t\t\t'cover_img_path' => 'https://d29twh0lc6f62l.cloudfront.net/project/5bfdf8dafbc0aa5b02d4800a2123437a.jpg' ,\n\t\t\t\t'video_link' => 'https://www.youtube.com/embed/Vpge10VnEYw',\n\t\t\t\t'content' => '今年年初寒流最冷的時候,我們在公司的停車場發現一隻不斷發抖的小狗,看起來才出生不到兩三個月,看到人很興奮想討食。後來陸續遇過幾次,每次餵點小東西後,想帶牠到別處避雨時,牠就逃走了。\n\n  2/24,有人開車時後方傳來一聲狗叫,對方看一下就開走了。同事發現躺在地上的,是之前的狗狗,後半身不能動且失禁了。我們在辦公室不知所措一小時後,決定帶牠去醫院。那時的想法是:「雖然很怕接下來的負擔,但我怕現在不做些什麼,以後會後悔一輩子。」',\n\t\t\t\t'status' => '2',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1322055681,1358057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => rand(1,30), \n\t\t\t\t]);\n\n\t\t\t\n\t\t\tProject::create([\n\t\t\t\t'name' => '全球第一台入侵者追蹤機器人',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => '全球第一台自動物件追蹤安控機器人\n 榮獲2015年CES全球最佳創新獎',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"-75 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"-20 day\")),\n\t\t\t\t'cover_img_path' => 'https://d15ds55abggjxg.cloudfront.net/project/82a45ad27db0f52897573df33207e309.jpg' ,\n\t\t\t\t'video_link' => 'https://www.youtube.com/embed/J4S5-6OeMNg',\n\t\t\t\t'content' => 'iCamPRO FHD 世界上第一台智慧家庭安防機器人.\n\n在美國募資平台創下前三天募得15萬美金的佳績\n\n不同於任何其他的家庭保全裝置,iCamPRO是第一個家庭安全攝像機器人,不但可以看,聽,感應,並追踪移動物體,同時還能與您溝通。 “在今天的聰明的小偷或破壞者盛行的同時,iCamPRO將完美的記錄每一個動作細節,因此您可以識別是否是安全威脅或普通盜賊,保護您的企業和家庭”,--大衛·羅德威爾,活動贊助者之一評論。',\n\t\t\t\t'status' => '2',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1322055681,1358057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => rand(1,30), \n\t\t\t\t]);\n\n\t\t\tProject::create([\n\t\t\t\t'name' => '跟你的孩子一樣,他們需要你的愛!幫台東天琪幼兒園的孩子籌一個月學費',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => '1963年於台東成立的「尚武會院」,基於孩童教育需要,附設「天琪幼稚園」。長期以來,支持貧童的教育,就算必須由教職員自願減薪來補貼全園支出,讓孩子們有好的受教環境,也在所不惜。',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"-14 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"+32 day\")),\n\t\t\t\t'cover_img_path' => 'https://d29twh0lc6f62l.cloudfront.net/project/1fc76370523c4cc742a0fed7803cc07d.jpg' ,\n\t\t\t\t'video_link' => 'https://www.youtube.com/embed/DyhbMZQi1XY',\n\t\t\t\t'content' => '天主教私立天琪幼兒園主任沈秀惠表示,二十多年來,園方好幾次面臨經營困難,都是靠聖十字架慈愛修女會補助,勉強度過難關。但是這幾年修女會已經無法再出資補助,有意要結束經營。瑞士籍院長宋玉潔修女到處奔波籌錢,甚至向遠在瑞士的親友們募款,為的就是一股「孩子的教育不能中斷」的信念。\n\n宋玉潔修女:\n「一定要給小孩子教育,才有機會脫離貧困,未來才有希望。」\n\n\n宋玉潔修女自願奉召來台服務35年,曾獲得2013年第23屆的醫療奉獻獎。宋修女始終秉持「哪裡需要我,就往那裡去」的精神,默默為後山貧困及原住民學子貢獻心力。即使自己是個癌症病人,也拒絕返回瑞士聖十字架慈愛修女總院療養,寧願將餘生分享給更多需要幫助的人。',\n\t\t\t\t'status' => '2',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1322055681,1358057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => rand(1,30), \n\t\t\t\t]);\n\t\t\t\n\t\t\tProject::create([\n\t\t\t\t'name' => 'iSensor Patio: 全球第一台迷你專業防雨智慧安控攝影機',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => 'iSensor HD Patio 是全球第一支迷你專業級的戶外監視器,它持續關注著你公司與住宅的一舉一動!',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"-45 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"-5 day\")),\n\t\t\t\t'cover_img_path' => 'https://d29twh0lc6f62l.cloudfront.net/project/99103d6c75b2147cf2e616cb1e2c7ca6.jpg' ,\n\t\t\t\t'video_link' => 'https://www.youtube.com/embed/3-NDA9aJZ2M',\n\t\t\t\t'content' => 'Amaryllo設計,測試和組裝所有產品及配件。在過去的幾個月,我們一直在試圖提高iSensor HD Patio外殼的防水性。\n\n現在已經達到專業等級的防水功能,為了避免消費者自行組裝產生漏水的情形,我們發貨前會進行密封。我們強烈建議您不要打開外殼,因為它可能會影響墊片並導致橡膠密封件洩漏的情況。',\n\t\t\t\t'status' => '2',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1322055681,1358057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => '1', \n\t\t\t\t]);\n\nProject::create([\n\t\t\t\t'name' => '聽,吉他說。第十七屆全國大學院校校際吉他音樂邀請賽',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => '在什麼時候我們還沒成熟就已經老了,\n\n一卡車載不動的夢想,就讓一把吉他,帶著你前行,\n\n關於那些過去及未來,聽吉他說、聽你說…。',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"-19 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"+50 day\")),\n\t\t\t\t'cover_img_path' => 'https://d29twh0lc6f62l.cloudfront.net/project/f5d77dfc311cc30e346ab35759d9be88.jpg' ,\n\t\t\t\t'video_link' => 'https://www.youtube.com/embed/DLtv_kQRAik',\n\t\t\t\t'content' => '# 17歲的大吉盃 舉辦說明\n\n活動地點:\n\n國立高雄大學圖書資訊館 2F 國際會議廳\n\n舉辦日期:\n\n104/1/19 : 獨唱組、創作組 \n\n104/1/20 : 鋼弦組、鋼弦創作組 \n\n104/1/21 : 團體組\n\n\n\n參加對象:\n\n大吉盃的比賽是全程公開的場合,雖比賽資格須符合國內大專院校的學生,\n\n但誠摯邀請一般民眾皆可來一同觀賞比賽,\n\n我們希望透過 flyingV 網站,讓大吉盃的消息傳播出去,傳給更多熱愛音樂的人,\n\n因為我們希望它不只是一個比賽,而是讓每個人都能享受吉他與音樂的美好。',\n\t\t\t\t'status' => '2',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1372055681,1398057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => rand(1,30), \n\t\t\t\t]);\t\n\t\t\t\n\t\t\tProject::create([\n\t\t\t\t'name' => '金萱,新時代中文字型,培育新鮮台灣文字風景',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => '十五年來,台灣幾乎沒有設計自己的新字型。\n不過,這一次,我們將能自己開發、研製一系列的新中文字型。',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"-36 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"-2 day\")),\n\t\t\t\t'cover_img_path' => 'https://d29twh0lc6f62l.cloudfront.net/project/aacd6f448cd08ade4de0edd21169626e.jpg' ,\n\t\t\t\t'video_link' => 'https://www.youtube.com/embed/8L35oJaggEk',\n\t\t\t\t'content' => '想到台灣,你會想到什麼?台北 101、夜市小吃,很棒。珍珠奶茶、蚵仔煎、滷肉飯,都很經典。\n\n不過,還有一位很具代表性的候選人:正體中文。想到正體中文的美麗與博大精深,或許大多數人會先想到書法。但其實,中文字普遍更以「字型」的形式存在於生活中。在資訊時代裡,「字型」拾俯即是,存在於各種媒介裡。一般大眾、專業人士,每天都在使用,比書法藝術更能凸顯一國的文化影響力。',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1322055681,1358057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => rand(1,30), \n\t\t\t\t]);\n\n\t\nProject::create([\n\t\t\t\t'name' => 'meArm.Joystick',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => 'meArm.Joystick 是甚麼\n\nmeArm.Joystick 是時下最夯的桌上型機器手臂,藉由DIY套件,它不只能帶你走入 maker 世界,更能透過 30 餘程式教程培養程式設計能力,從學生到社會人士都適合玩。meArm.Joystick 目的是要喚酷大家潛藏已久的自造魂,希望藉時下最夯的機器手臂來引發興趣,同時透過深入淺出的教程帶領大家進入程式設計殿堂。',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"-15 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"+42 day\")),\n\t\t\t\t'cover_img_path' => 'https://d29twh0lc6f62l.cloudfront.net/project/27e763ac327041a285c8ce31545b3319.jpg' ,\n\t\t\t\t'video_link' => 'https://www.youtube.com/embed/d9rGvIEFrJs',\n\t\t\t\t'content' => 'meArm.Joystick 不只是一條手臂\n\n除了機械手臂特質外,meArm.Joystick 更代表開源精神,因為它搭載開放的 Arduino 主板,我們特別設計的搖桿擴展板也會開源出來。不僅如此,它的軟體也是開源的,包括C語言和圖形語言開發環境,您所在上面修改的任何一條程式碼,都可以放到社群供大家分享,藉以融入廣大的國際 Arduino 和 MeArm 社群,透過 meArm.Joystick,您不僅能鍛鍊程設功力,並能融入國際社群,為未來開創無限可能。meArm.Joystick 品質如何?\n\n雖然我們是初次在國內募資,但實已長期累積許多軟硬體技術,不僅軟體教程,連 Arduino 擴展板都是我們自己佈的線,meArm.Joystick 已成功試作並在 Fablab Taipei 成功跑過親子組裝樂活動,是穩定實用的教育用電子產品,就連 meArm 最原始開發者都稱讚。下為台北活動剪影。',\n\t\t\t\t'status' => '2',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1322055681,1358057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => rand(1,30), \n\t\t\t\t]);\n\n\nProject::create([\n\t\t\t\t'name' => 'Lulus Hand - 讓人人都可以沖出好咖啡',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => '看著一流咖啡師專注的以陶瓷的濾杯搭配優美的尖嘴壺沖泡出濃香醇厚的咖啡的一幕,總是令我難以忘懷。不過輪到自己購買器具,費盡工夫得來的卻完全不是那回事。原來店中要價百元以上的單品咖啡,賣的不只是咖啡,更多的是背後磨出來的功夫。\n\n我在想,若是讓自己簡簡單單就能沖泡出接近名家所沖泡出的咖啡,那該有多好。',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"-20 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"+32 day\")),\n\t\t\t\t'cover_img_path' => 'https://d29twh0lc6f62l.cloudfront.net/project/b24947d584a22ad3efce45b305b43081.jpg' ,\n\t\t\t\t'video_link' => 'https://www.youtube.com/embed/cn5Lcc5NjZI',\n\t\t\t\t'content' => '專屬台灣設計的台灣咖啡濾杯\n\n近幾年來全球吹起了精品咖啡的風潮,濃郁的口感、酸甜的果香和堅果的香氣,各種多樣化的味道是他迷人的地方。\n\n我們是一群喜歡喝咖啡的人,也自己烘培咖啡、沖泡咖啡,甚至於自己研究咖啡。\n\n我們一直想著,大家聽過美式咖啡機、義大利濃縮咖啡機、法式濾壓壺等沖泡器具,那為何世界上不能有台灣咖啡濾杯呢?\n\n因此 Lulus Hand 誕生了!一個由台灣原創設計的咖啡沖泡器具。',\n\t\t\t\t'status' => '2',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1322055681,1358057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => rand(1,30), \n\t\t\t\t]);\nProject::create([\n\t\t\t\t'name' => '本草綱目粽---從中國第一藥典吃出健康',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => '【本草綱目】\n\n是由明朝的李時珍花了近20年的時間所著,有「中國第一藥典」之稱。\n\n我們站在這部擁有400多年的歷史、14萬字的big data為基礎,\n\n致力讓它成為一個能永續經營的企業,\n\n只要談到養生、健康、天然\n\n就會聯想到\n\n【本草綱目】',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"-16 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"+41 day\")),\n\t\t\t\t'cover_img_path' => 'https://d29twh0lc6f62l.cloudfront.net/project/85cec268b734ea81aca5035fbc6f5b6d.jpg' ,\n\t\t\t\t'video_link' => 'https://www.youtube.com/embed/6Q--f6kWH_I',\n\t\t\t\t'content' => '菜色介紹\n\n本草綱目團隊榮幸地邀請到中山醫大前校長&台灣營養學會理事長──王進崑博士,為我們的粽子,針對食材調配上的營養價值進行把關。以下四種粽子的功效、對人體的益處,由王校長為我們推薦。\n\n1.十全大補粽\n\n主:十全藥膳包煮糯米\n\n配:干貝、蝦米、魷魚、栗子、香菇、櫻花蝦、蘿蔔乾、黑芝麻 \n\n\n\n緣起:\n\n外食族的增加和食安危機,讓本草綱目團隊決定推出<補粽>來調理外食朋友的健康。十全大補粽帶領消費朋友們躲過太\n\n油太鹹的外食,一個十全大補當作正餐,讓您營養滿分!另外,比一般粽子更加大份量的<十全大補粽>,讓您不再有一\n\n顆吃不飽、兩顆吃太撐的困擾,作為您養生、健康又滿足的好朋友。\n\n\n\n2.香檳茸粽\n\n主:糯米\n\n配:香檳茸、十全藥膳包、干貝、蝦米、魷魚、栗子、櫻花蝦、蘿蔔乾',\n\t\t\t\t'status' => '2',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1322055681,1358057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => rand(1,30), \n\t\t\t\t]);\n\n\nProject::create([\n\t\t\t\t'name' => '臺灣婚姻平權貼紙計畫 LEGALIZE GAY MARRIAGE15',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => '我們是一群關心臺灣社會、同志權益的臺灣人,在兩年前的「1130反對多元成家遊行」後\n於網路集結募資,展開「婚姻平權貼紙計畫」。 去年我們在這裡成功地募集到了貼紙的製\n作經費,並完成回饋商品的製作及寄送。 在過去十一個月以來,以每個月製作、發送約一\n萬份貼紙的速度進行著貼紙計畫。',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"-61 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"-37 day\")),\n\t\t\t\t'cover_img_path' => 'https://d15ds55abggjxg.cloudfront.net/project/e050bcee7153fe139f9afa07467f8587.jpg' ,\n\t\t\t\t'video_link' => 'https://www.youtube.com/embed/sk_EXNNFTKM',\n\t\t\t\t'content' => '截至今年七月共印製、發出了約二十萬份的 LEGALIZE GAY MARRIAGE 婚姻平權貼紙,這個計劃最初期是由\nOkinafa Chen 建立,最初的目的是透過文字無聲的抗議,向反對立法保障同志權益的團體表達婚姻平權的訴求\n後來決定利用貼紙這個簡單又方便的媒材,希望能將支持婚姻平權的聲音,透過不一樣的方式傳遞到台灣的每一\n個角落。「婚姻平權」雖然爭取的是修改民法972條婚姻制度的法律草案,但「貼紙計畫」希望能將生硬的法律草案,簡化\n成一張悠遊卡大小的貼紙,讓貼紙去傳遞支持同志權益的訴求,經由任何一種想像,讓這個聲音變成簡單的、容易\n接觸的,而參與社會運動、關心同志或任何一個族群的權益,不再只侷限在上街抗議、高喊口號訴求,也可以透過\n很簡單、很輕鬆的方式,讓我們的聲音被社會聽見。\n\n\n\n「婚姻平權貼紙計畫」想做的,是打破原來社會對於抗爭的想像,就像婚姻平權草案,要打破的就是我們對於一男一女婚姻制度的想像,讓婚姻制度不再只是異性戀者專有的權利,同性戀者同樣該擁有一樣的權利去選擇要不要結婚,在一樣的制度下生存,才有機會走向平等、多元;跨性別、變性者、性別未定等任何一種生活方式,或是任何一種家庭結合方式的想像同樣,我們都該去尊重這每一種想像,認同這每一種方式,保障他們獲得應有的權利,才是建立多元社會的開始。',\n\t\t\t\t'status' => '2',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1322055681,1358057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => rand(1,30), \n\t\t\t\t]);\n\n\nProject::create([\n\t\t\t\t'name' => 'ch+u:超電能飛行腕錶',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => '預告了將近半年,中間收到了不下上百次讀者的熱情詢問,ch+u也都戰戰兢兢的回覆,為了呈現出最好的品質在大家面前,這隻腕錶上所有的細節ch+u都花了很多時間反覆檢視,試用。從第一隻sample到現在最新的版本,大大小小的修改總共超過了30項,花費了超過一年的時間,為的就是把這支 ch+u 心目中最理想的腕錶介紹給所有的時尚愛好者。 ',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"-40 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"-2 day\")),\n\t\t\t\t'cover_img_path' => 'https://d15ds55abggjxg.cloudfront.net/project/84e434f890df1ba3646c66361170dc3e.jpg' ,\n\t\t\t\t'video_link' => 'https://www.youtube.com/embed/bDTrOEF83mQ',\n\t\t\t\t'content' => '所有 ch+u 的讀者應該都知道我們喜歡好東西,一年多以來,我們嘗試著用自己的品味來說服影響讀者,介紹報導了許多我們認為適合讀者的產品,也都得到了很正面的回應。每個獨立的商品固然都有其優缺點,這樣的情況讓我們一直想到一個可能性,一個世界上大部分時尚網站都不曾嘗試過的挑戰:如果我們真的可以推出一個,自己心目中的理想商品,那該有多好? 當然,說了再多其實也沒有用,最好的辦法就是直接推出符合自己理念的產品。什麼樣的東西是你一定需要,中性/不分男女,它可以是一個基本工具,卻又是重要的時尚設計配件呢?答案已經呼之欲出– 『就是腕錶。』 ',\n\t\t\t\t'status' => '2',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1322055681,1358057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => rand(1,30), \n\t\t\t\t]);\n\nProject::create([\n\t\t\t\t'name' => '把愛傳下去-Adopt, dont Buy',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => '把愛傳下去 → 請以認養代替購買',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"-69 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"-25 day\")),\n\t\t\t\t'cover_img_path' => 'https://d29twh0lc6f62l.cloudfront.net/project/6042f84ae9b34228bee263a8fb923b37.jpg' ,\n\t\t\t\t'video_link' => 'https://ksr-ugc.imgix.net/projects/1389347/photo-original.jpg?v=1446677939&w=1024&h=768&fit=crop&auto=format&q=92&s=d7d60194fa11b1e409a57441912f36dc',\n\t\t\t\t'content' => '五年前,張媽媽義無反顧地投身於動物救援後,就再也沒有回頭了!\n\n\n\n在張媽媽流浪動物之家\n\n每一天有接不完的電話\n\n每一通大多都是求救電話\n\n『張媽媽...我看見有一隻狗被....』\n\n『張媽媽...我朋友說有一隻貓在....』\n\n『張媽媽...我家樓下有流浪狗好可憐該怎麼辦』',\n\t\t\t\t'status' => '2',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1322055681,1358057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => rand(1,30), \n\t\t\t\t]);\nProject::create([\n\t\t\t\t'name' => '《救助》台南鍾媽媽狗場---流浪毛小孩的【鍾】心期盼',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => '【台南鍾媽媽狗場】,需要您我的幫助!',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"-38 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"-5 day\")),\n\t\t\t\t'cover_img_path' => 'https://d15ds55abggjxg.cloudfront.net/project/c05c29cc30f27ed1c14a74956d7be264.jpg' ,\n\t\t\t\t'video_link' => 'https://ksr-ugc.imgix.net/projects/1964676/photo-original.jpg?v=1447104602&w=1024&h=768&fit=crop&auto=format&q=92&s=b475343efc900471ec425b7a0417f336',\n\t\t\t\t'content' => '鍾媽媽狗園摘要:\n20年前,鍾媽媽在一次偶然的機緣下,發現一隻不會走(受傷)的流浪狗⋯⋯,漸漸地,鍾媽媽收養了越來越多需要幫助的狗兒⋯⋯。光陰似箭,鍾媽媽現在已經是68歲的鍾奶奶了,由於鍾奶奶沒有足夠的錢來醫療本身的糖尿病,因此導致雙眼失明⋯⋯。\n這幾年,一切僅靠鍾爺爺獨立照顧狗園100多隻狗兒\n\n\n希望藉由各位的力量,募集到必須的費用:鍾爺爺與鍾奶奶的醫療及狗場的飼料費用。 ',\n\t\t\t\t'status' => '2',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1322055681,1358057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => rand(1,30), \n\t\t\t\t]);\nProject::create([\n\t\t\t\t'name' => '太陽花主題設計商品助印 4am 海報計畫',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => '用音樂改變世界?\n2014年3月22日,五月天阿信在紐約麥迪遜花園廣場演唱會謝幕時發表感言,那一幕讓許多人心碎了。一直以來,阿信要用他的音樂,告訴所有喜歡音樂的人,音樂也可以有力量,也能改變世界,可是一直到今天,原來喜歡音樂,卻還是不能大聲說出自己心裡的話,難道阿信錯了嗎',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"-129 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"-88 day\")),\n\t\t\t\t'cover_img_path' => 'https://d29twh0lc6f62l.cloudfront.net/project/4f3abd4ae93e0d764e440043551868f9.jpg' ,\n\t\t\t\t'video_link' => 'https://www.youtube.com/embed/ecihUDqLZNU',\n\t\t\t\t'content' => 'Democracy at 4 am\n2014年3月24日,太陽花學運遭到血腥鎮壓,為了記錄歷史性的一刻,由3621位公民發起群眾募資,並與設計師聶永真、網站工程師Evenwu Design與Bonana king 共同組織了 4am.tw 團隊,讓 Democracy at 4 am 廣告登上紐約時報,讓全世界看見台灣黑暗的一夜,也要讓大眾永遠記得,你們的鮮血不會白流,民主之火永遠不會被熄滅!\n\n\n現在就行動!\n受到4am.tw團隊的熱情與專業感召,我們希望能讓這個深具意義的廣告被更多人看見。因此,身為設計師的我們以太陽花學運為主題,設計了一系列的主題商品,希望透過創意的設計,傳達堅定的信念,喚起更多人關心,並參與聲援。(因為4月5日已經有傳言警方將準備攻堅,我們擔心募資完成後學生已經遭到驅離,因此我們已經事先掏腰包墊付了印製費用,並將於4月6日下午發放第一批海報數量共1500份,相關的消息請見設計就是力量粉絲團)\n\n\n讓更多人看見!\n如同4am.tw團隊的主張,我們僅是公民意志的代行,因此不希望也不會透過此計劃營利。下述太陽花主題商品銷售所得,扣除成本後均將用來印製經 4am.tw 團隊授權使用的海報,除於合法地區張貼外,並將無償贈送給參與太陽花學運的夥伴們。全數產品皆為在台灣製造,除海報與酷卡外,均採用高畫質數位直噴方式,非網版大量印刷,雖然成本較高,但速度較快。所有的費用均已包含台灣本島運費和手續費。',\n\t\t\t\t'status' => '2',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1322055681,1358057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => rand(1,30), \n\t\t\t\t]);\nProject::create([\n\t\t\t\t'name' => '山茶堂 - 100%原萃阿里山茶',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => '茶葉農藥超標、越南境外茶危機連環爆,喜歡喝茶的朋友買不到好茶,山上踏實打拼的茶農卻面臨好茶賤賣的困境。',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"-77 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"-43 day\")),\n\t\t\t\t'cover_img_path' => 'https://d29twh0lc6f62l.cloudfront.net/project/9c61b82725e5004bf02babefd39854c1.jpg' ,\n\t\t\t\t'video_link' => 'https://www.youtube.com/embed/isE5pY-Hs34',\n\t\t\t\t'content' => '我是從小住在阿里山下的劉倪維,也和許多朋友一樣獨自上台北打拼,每每看到遊客買阿里山茶,但在地人其實都知道,遊客買到的大部分都不是阿里山茶,而是包裝與內容物不符的假茶,大都是越南進口茶來混充的,而身邊愛喝茶朋友也總是希望我幫忙買茶,可是真正的純阿里山茶,一般外地遊客,怎麼會知道要去哪邊買呢? \n\n於是我們產生了一個想法 : 推廣阿里山茶,就讓我們一起來改變,讓真正的阿里山高山茶被看見!',\n\t\t\t\t'status' => '2',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1322055681,1358057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => rand(1,30), \n\t\t\t\t]);\n\n\nProject::create([\n\t\t\t\t'name' => 'SNAP! PRO-最專業的iPhone照相手機殼',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => '鏡頭及手工皮革腕繩開放加購中】\n感謝大家的支持,讓我們在3天內即達成目標\n接下來我們也開放大家加購鏡頭跟手工皮革手腕繩(黑/淺駝)\n請想要加購的朋友們\n直接在右邊的贊助選項中點選你想加購的品項\n我們會連同您原本贊助的品項一同寄出!',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"-79 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"-35 day\")),\n\t\t\t\t'cover_img_path' => 'https://d15ds55abggjxg.cloudfront.net/project/0d0f7a52283ab67d8f6dd99f0440efe3.jpg' ,\n\t\t\t\t'video_link' => 'https://www.youtube.com/embed/XvwWaGVnFZI',\n\t\t\t\t'content' => '拍照,就是為了抓住生活中的精彩片刻。而想拍照時,手機往往是最快速便利的,所以不知不覺中,手機已經默默地取代了傳統相機,變成最多人使用的相機!但,在使用手機拍了這麼多照片後,總覺得它不夠順手,少了以前使用相機時的一種...順暢感。\n\n2013年,我們在flyingV上,推出擁有實體快門鍵的SNAP! 5,獲得許多人的迴響,但是我們並沒有因此停止前進 ,反而更加努力地希望能讓台灣的品牌能被世界看到。於是在2014年,我們挑戰全球最大募資網站Kickstarter.com,推出了可以轉換不同外接鏡頭的SNAP! 6手機殼,最後也很成功的募得超過11萬美元。\n\n我們團隊真心地希望能讓iPhone攝影變得更簡單、帶來更多樂趣,所以我們不斷的傾聽使用者給我們的意見予以改良,今年2015,我們帶著我們有史以來最好的作品回來了:SNAP! PRO - 最專業的iPhone拍照手機殼。',\n\t\t\t\t'status' => '2',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1322055681,1358057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => rand(1,30), \n\t\t\t\t]);\nProject::create([\n\t\t\t\t'name' => 'AIESEC 盛夏海灘巾(經典復刻版)',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => '感謝大家對 AAGC 海灘巾的支持\n昨天(7/10)在 AAT 聚會上 AAGC 的相關產品詢問度也非常高\n團隊決定也在 FlyingV 上讓大家認購',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"-110 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"-72 day\")),\n\t\t\t\t'cover_img_path' => 'https://d29twh0lc6f62l.cloudfront.net/project/483f0de14a33fe18617e41b040805400.jpg' ,\n\t\t\t\t'video_link' => 'https://www.youtube.com/embed/XLe7hOmCrY4',\n\t\t\t\t'content' => '臺北一日票(8/22):\n傑出的企業家將在論壇中與各位分享未來趨勢以及在亞太的下一個機會與可能;科技廣場中,將看到許多亟欲打破遊戲規則的台灣新創公司,並親自體驗這些在台灣出發的創新軟硬整合實力。\n當然,在早上豐富的論壇及會議內容後,晚上的派對將使會議越夜越精采!\n\n\n高雄與 IC 同樂票(含8/23住宿及8/24 Gala Dinner):\n我們將在熱情的高雄與International Congress的青年領袖們會師,一同見證Alumni名人堂的榮耀以及會議精心準備的Taiwan Night-台灣夜市的精采節目!\n其中Alumni Talk的分享論壇中,我們將聽見在不同領域成為佼佼者的Alumni分享他們的故事;在晚上我們將與IC一同在Gala Dinner歡慶!',\n\t\t\t\t'status' => '2',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1322055681,1358057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => rand(1,30), \n\t\t\t\t]);\n\nProject::create([\n\t\t\t\t'name' => '《龐氏騙局》,翻轉你對桌上遊戲的想像',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => '大家好,我是Jesse,對大家來說這名字應該很陌生。 如果你曾經參加過台灣桌遊設計圈的一些聚會,那麼你可能聽過這個名字,知道有一個人「在桌遊設計圈混了很久,但總是等不到他的遊戲出版」。\n\n一切「不幸」的源頭是從我設計的第一款遊戲《歷史長流》開始,它是一款以競標機制推進的文明發展主題遊戲。「不幸」的咀咒就落在「文明發展」這四個字上。一開始的野心太大,加上學習過程的跌跌撞撞,一直到2年後才有信心帶著「完成」的版本向出版社投搞。',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"-95 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"-53 day\")),\n\t\t\t\t'cover_img_path' => 'https://d15ds55abggjxg.cloudfront.net/project/9140211b026b1ec229ad464a853cd62e.jpg' ,\n\t\t\t\t'video_link' => 'https://www.youtube.com/embed/u0x9NI9rvxE',\n\t\t\t\t'content' => '在尋求出版的過程中,又遇到了籠罩在台灣桌遊出版界上空的另一個魔咒:「策略遊戲的國內年銷量」。每當我自信滿滿向出版社推銷這款遊戲的「前瞻性」時,總是無法突破「《電力公司》國內年銷量之壁」(你說,你作的策略有多好玩,但你有信心賣得比《電力公司》還要好嗎?)。《歷史長流》最後的命運如何呢? 經歷過34次改版,共用掉2500張左右的測試代牌,去年有一整年在國外出版社那裡流浪,聽說最近有間國內出版有計畫出版,但目前也只是聽說而已。\n\n在2012年12月的時候,我開設了《紙貓咪》桌遊設計部落格,除了紀錄一些遊戲測試的心得,也嘗試著把桌遊設計上的一些想法,用理論化的文字進行整理。也就是在這段時間「桌遊不只該是有趣,還是可以更深刻的什麼……」的想像下,開始著手《龐氏騙局》的設計。\n\n',\n\t\t\t\t'status' => '2',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1322055681,1358057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => rand(1,30), \n\t\t\t\t]);\nProject::create([\n\t\t\t\t'name' => 'OVO!台灣電視讚起來',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => 'OVO 電視盒 (OVO TV Tomorrow),一款老人小孩都會用的雲端智慧電視盒。\n用一支遙控器,看電視、看網路影片、聽音樂、玩遊戲,還可以對電視節目按讚,\n參與全新的雲端收視率與滿意度調查,共同決定台灣電視的未來。',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"-63 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"-19 day\")),\n\t\t\t\t'cover_img_path' => 'https://d15ds55abggjxg.cloudfront.net/project/a1b3a2c05dc271e607bd7c56c43dd9d2.jpg' ,\n\t\t\t\t'video_link' => 'https://www.youtube.com/embed/PorWI1h6CJk',\n\t\t\t\t'content' => '台灣電視生態怎麼了?\n1. 「節目品質低落,自製節目愈來愈少,台灣文化逐漸喪失,最後將形同於亡國。」\n→ 電視亡國-電視生態沉淪下的文化大危機 / 今周刊 (2010/11/11)\n→ Mobile01 討論串 (2010/11/12)\n2. 「由他們來決定收視率,其結果就是成本低廉的本土劇、卡通片、及低俗談話節目收視居高不下,相反地,一些高水準及國際性的節目當然收視慘淡。」\n→ 尼爾森是怎麼調查台灣收視率的? / 李方儒 臉書貼文與討論串 (2013/05/28)\n3. 「台灣現行的收視率調查,是選定樣本戶,在電視機上裝設收視紀錄器,再將數據彙集整理。這樣的收視率調查,長期以來都被批評樣本數偏少,社經地位偏低,誤差偏高。但是這樣不精確、被質疑的收視調查,卻主導了全台灣電視節目的方向,甚至主宰了社會文化的走向。」',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1322055681,1358057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => rand(1,30), \n\t\t\t\t]);\nProject::create([\n\t\t\t\t'name' => '筆箸 PenstiX --史上最迷你、精巧的隨行筷',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => '計劃源起\n有美食天堂之稱的台灣以美味小吃聞名於世,食客們卻大多以含化工毒物的免洗筷進食,而每天的使用量竟超過\n280萬雙,這些毒害經年累月被吞下肚或棄於土地,嚴重危害健康又破壞環境,然而,在環保筷普及率最高的台灣\n,使用率卻不高,我們試圖找出主因並設計出幾近不可思議的尺寸,把 \"一雙筷子加一個筷架\" 變成 \"一支筆\" 的大小,打\n造出精巧實用、簡約時尚,令人愛不釋手的精品,藉以提高隨行筷的攜帶率。深切期盼不久的將來,台灣可以成為樂活\n又先進的美食之鄉。',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"-59 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"-9 day\")),\n\t\t\t\t'cover_img_path' => 'https://d29twh0lc6f62l.cloudfront.net/project/934e9c94a7c8d3b4e7a187d58738ef46.jpg' ,\n\t\t\t\t'video_link' => 'https://www.youtube.com/embed/XlyN2AJ3ljM',\n\t\t\t\t'content' => '筷子是源自六、七千年前老祖宗的發明,象徵著中華飲食的文化,亦是飲食文明的開始。隨著中、日、韓等料理的國際化與普及,用筷人口日益增長,用筷文化不僅深入餐廳,也成為越來越多家庭的食器之一。\n\n然而,外食人數的增加與尚未落實的環保政策導致每年全球約有800億雙免洗筷被丟棄,到現在大多數的店家人仍提供免洗筷,為了防腐與防霉,免洗筷需經過藥水與漂白劑浸泡處理,其中幾乎每雙含有有毒化學溶劑,不僅危害人體健康也造成環境資源的重大浪費與破壞。\n\n由於市場上遍尋不著真正適合現代人攜帶的環保筷,於是我們決定重新設計,針對外食者者的需求研發前所未有,更方便攜帶、展開、收納與清洗,以更佳的比例與材質,製作精緻質感的環保筷,讓它不僅環保實用,亦能成為搭配時尚衣著及配件的精品。經過一年多來不計其數的修正設計與打樣試驗,終於產出革命性創新的環保隨行筷 - 筆箸 PenstiX。',\n\t\t\t\t'status' => '2',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1322055681,1358057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => rand(1,30), \n\t\t\t\t]);\nProject::create([\n\t\t\t\t'name' => '進擊的新世代!2014創業論壇。',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => '如果今年你只想參與一場論壇,\n接下來請您務必分一點時間給我們.....',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"-115 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"-68 day\")),\n\t\t\t\t'cover_img_path' => 'https://d15ds55abggjxg.cloudfront.net/project/c5a38950e25b83e30b252f124d389c0e.jpg' ,\n\t\t\t\t'video_link' => 'https://www.youtube.com/embed/2LzpAzFsMHo',\n\t\t\t\t'content' => '2014 創業論壇暨 RYLA 青年領袖營\n \n\n21 世紀景氣的陰霾即將慢慢消散,在此時身處大環境對年輕人不甚友善的台灣,\n如何面對全球市場的挑戰,以及實踐自我目標是所有青年人的共同課題。\n\n懷抱創業夢想的青年朋友唯有發揮創意,加強執行力,才有機會撥雲見日,開創屬於自己的天空,\n而想要【懷抱創意成功創業】,分析創業環境、懂得尋找資源將是最重要的任務。\n\n創業論壇為 台北市新世代扶輪社 每年最重要的活動,\n今年與 RYLA 青年領袖營合併舉辦,主題定為【進擊的新世代】,\n希望藉由成功的青年創業家以及各界專家分享經驗,給予懷抱創業夢想的青年一條可循的軌跡,\n讓學員更了解現今的創業環境,做好準備,面對即將到來的挑戰,開創屬於自己的嶄新的世代,\n也期望能讓優秀的青年朋友更了解扶輪、進而參與扶輪。\n\n',\n\t\t\t\t'status' => '2',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1322055681,1358057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => rand(1,30), \n\t\t\t\t]);\nProject::create([\n\t\t\t\t'name' => '【青年返鄉投票專車計畫】青年投票、翻轉政治',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => '自己的未來自己投,自己的家鄉自己救!',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"-46 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"-9 day\")),\n\t\t\t\t'cover_img_path' => 'https://d15ds55abggjxg.cloudfront.net/project/bfbe0dc743b72d8cc97a1f275bd61a29.jpg' ,\n\t\t\t\t'video_link' => 'https://www.youtube.com/embed/UzGmbsWpz0E',\n\t\t\t\t'content' => '緣起\n\n有什麼方法可以不用像太陽花學運當時那樣餐風露宿睡柏油路,卻還是可以匯集人民的力量發揮影響力,改變台灣的未來?有的!今年的 11 月 29 日就有這樣的機會。你只要帶著身分證和印章到戶籍所在地的投票所,領取從村里長到縣市首長的各個選票,就可以換下或繼續支持代表你的聲音、為你做許多重大決定,影響你未來生活的民意代表與各級行政首長。 \n\n但這個看起來很簡單的方法,對許多遠在他鄉就學或工作的年輕人而言,卻是一個困難的決定,特別是對經濟狀況不是很好的人而言。兩年前的影片裡,這群返鄉青年的憂愁,至今仍懸而未決。以時薪 115 元,家住高雄、人卻在台北半工半讀的大學生為例,如果要返鄉投票,他必須請至少一天的假,而這正代表著他將失去一天最高 8 小時的工資 920 元,如果再加上往返北高的自強號火車票(單程 843 元,來回 1518 元),他的投票成本將高達 2438 元,約是半個月的伙食費。而這正是許多人猶豫著是否要放棄手上寶貴的一票的原因之一。',\n\t\t\t\t'status' => '2',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1322055681,1358057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => rand(1,30), \n\t\t\t\t]);\n\n\n\n\n\nProject::create([\n\t\t\t\t'name' => '白色的力量:自己的牛奶自己救',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => '我們不是胡亂成立的賣場,是想要用消費力量推動鮮乳革命的公平交易鮮乳平台\n除了市售牛奶,其實你有更好的選擇',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"+109 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"+169 day\")),\n\t\t\t\t'cover_img_path' => 'https://d15ds55abggjxg.cloudfront.net/project/2cdaa113d4b67ddb3db4c03f894cf716.jpg' ,\n\t\t\t\t'video_link' => 'https://www.youtube.com/embed/RDaGxjohZS8',\n\t\t\t\t'content' => '往下看之前,先問一個問題:你受夠層出不窮的食安問題了嗎?\n準備好了嗎,往下看,我們要展開一場革命了!\n\n我叫做阿嘉,台大獸醫研究所畢業,一位全台灣趴趴走的大動物獸醫師,每天在全台10個不同縣市的牧場出診,守護著30個牧場,超過6000頭乳牛的健康! \n\n每位酪農是如何飼養牛隻、對待牛隻,我都看在眼裡。因此我在今年成立鮮乳坊,希望能作為消費者和酪農的橋樑,協助小農成立自有品牌,將成分無調整、高品質的鮮乳透過網路販售的方式,交到顧客的手中。\n\n',\n\t\t\t\t'status' => '0',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1322055681,1358057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => rand(1,30), \n\t\t\t\t]);\nProject::create([\n\t\t\t\t'name' => '草地上的微旅行-台北親子野餐會',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => '是否已經膩了,假日吃飯總是要排隊?\n有多久沒有出去玩了?',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"+106 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"+195 day\")),\n\t\t\t\t'cover_img_path' => 'https://d29twh0lc6f62l.cloudfront.net/project/5dbcb399284aaa5736c0f813f775b187.jpg' ,\n\t\t\t\t'video_link' => 'https://ksr-ugc.imgix.net/projects/2137303/photo-original.png?v=1447748515&w=1024&h=768&fit=crop&auto=format&q=92&s=b54c2b63bc6b221f1120a7f62b51e650',\n\t\t\t\t'content' => '藍天草地白雲陽光,好靠近卻總是好遙遠。\n常常經過大安森林公園,除了遛狗和孩子們的盪鞦韆,你還想到什麼呢?\n那一大片綠色的草地和藍天白雲是不是總吸引著你的心,\n想要跟著風箏飛翔一下呢?\n\n\n或許,假日可不要再電視洋芋片,電影爆米花了。\n草地上可以奔跑和坐著的不會再只有拉布拉多或黃金獵犬。\n或許,還有,你和我們。\n這是一個城市生活的新選擇,\n走,我們到公園野餐去。',\n\t\t\t\t'status' => '0',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1322055681,1358057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => rand(1,30), \n\t\t\t\t]);\n\n\n\nProject::create([\n\t\t\t\t'name' => '「為什麼我結婚要經過2300萬人同意,核四不用?」--支持婚姻平權 LEGALIZE GAY MARRIAGE',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => '「為什麼我結婚要經過2300萬人同意,核四不用?」\n --支持婚姻平權 LEGALIZE GAY MARRIAGE',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"+45 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"+89 day\")),\n\t\t\t\t'cover_img_path' => 'https://d15ds55abggjxg.cloudfront.net/project/921039b9f0598b55026173a2b901ae56.jpg' ,\n\t\t\t\t'video_link' => 'https://www.youtube.com/embed/W-xYY6HI9g8',\n\t\t\t\t'content' => '我們是誰?\n\n我們不屬於任何一個民間團體,我們是迷你小團隊,兩個女生,一個讀生物,一個讀機械。我們關注婚姻平權的議題,身旁也有許多LGBT族群的朋友,我們認為這些朋友善良,沒有什麼不同或奇怪的地方。我們支持台灣伴侶權益推動聯盟(伴侶盟)提出的婚姻平權草案,我們是小人物,但我們想盡一份心力,為LGBT族群發聲,表達我們的支持,我們要我們的LGBT朋友都可以成家!\n\n註: LGBT為女同性戀者(Lesbians)、男同性戀者(Gays)、雙性戀者(Bisexuals)與跨性別者(Transgender)\n\n\n‧ 婚姻平權是什麼?\n\n伴侶盟在2013年提出多元成家草案,包含婚姻平權、伴侶制度、多人家屬,三項獨立但平行的草案。其中僅有婚姻平權草案獲得立委支持,得以提案,目前已通過一讀。\n\n\n關於婚姻平權草案,伴侶盟在網頁中寫道:\n同性婚姻主要是將民法中婚姻與家庭的性別要件中立化(例如:將「夫妻」改為「配偶」、「父母」改為「雙親」),狹義觀之,此舉似乎僅為了讓同性婚姻合法化,但更積極的意義,則是去除婚姻中的性別要件,使多元性別者可以自由進入婚姻,不需要受限於生理、心理、社會的性別規範,比如:一個正在進行變性手術的人,其所締結的婚姻應該稱之為「同性婚姻」或「異性婚姻」?恐怕對當事人而言都不自在。因此徹底去除性別二元對立的概念才有可能解決跨性者所遭遇的壓迫處境。\n\n\n\n註: 同性婚姻已改成婚姻平權。詳細草案內容請看 這裡\n\n\n\n\n這樣的內容,我們認為合理且友善LGBT族群,所以我們支持,我們相信愛與婚姻可以容納異性戀以外的可能。然而卻有特定基督教派,抹黑且扭曲草案內容,發佈抹黑影片,污名化LGBT族群,要求教徒簽署內容不合事實的反對連署書,並煽動人民加入仇恨的行列,甚至在1130那天發動一場大集會,事實上,許多人並不知道自己為什麼而去,反對什麼,那一天的集會究竟在做什麼。支持婚姻平權的民眾,還被他們所謂的「糾察隊」圍圈圈限制人身自由。而這隻仇恨的手甚至伸向了部份立委。話說到這裡,不再細數他們的作為了。\n\n\n同一天伴侶盟也有一場小集會,在立法院前,以人力排成婚姻平權四個大字,希望讓政府看見LGBT成家的心願。這些人當中,除了同志與跨性別,也包含了直同志(挺同志的異性戀),一同表達他們的支持。我們希望你加入正義的一方,和我們一同為人權努力,力抗仇恨。',\n\t\t\t\t'status' => '1',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1322055681,1358057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => '1', \n\t\t\t\t]);\nProject::create([\n\t\t\t\t'name' => 'Chic Bicycle® Playing Cards Deck',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => '【 ARMOUR Cardholder 多功能卡套 】',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"+49 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"+95 day\")),\n\t\t\t\t'cover_img_path' => 'https://d29twh0lc6f62l.cloudfront.net/project/a569f125a7df0c0f784634a05dbc67a7.jpg' ,\n\t\t\t\t'video_link' => 'https://www.youtube.com/embed/y0l2LHXMI6E',\n\t\t\t\t'content' => ' 頂級手染軟皮 \n\nArmour Cardholder 使用頂級的義大利手染軟皮,極佳的軟質手感加上手工染色氣質,讓您的卡夾外型優雅經典。拉條式的卡插設計,保留卡夾輕薄的美感外同時方便卡片抽取使用,前袋上方為名片插槽加上後袋卡片插槽,更能輕鬆分類使用。\n \n 不鏽鋼工具卡設計 \n\n特殊的不鏽鋼卡設計可以保護卡片不受損外並且可保持卡片直接感應,讓您輕鬆刷著走。\n\n多功能工具設計結合了啤酒開瓶器、工具尺、多尺寸的六角螺絲把手及手機架等功能,輕鬆解決日常遇到的問題,讓生活更加便利 。\n \n上方的三角形掛孔可以方便鑰匙圈結合或掛繩安裝,依您的攜帶習慣做調整。\n\n優雅的牛皮卡插結合俐落的不鏽鋼工具組,在在彰顯不凡的品味,簡潔的設計無疑是低調精品最好的隨身配件。\n\n\n\n\n【 日常生活使用 】\n\nArmour cardholder 適合每個日常生活場景。\n\n\n不論是搭乘巴士刷卡感應,超商買東西付款,繪畫時的隨身工具,\n\n吃飯缺少的手機架,修理時的六角板手,拜訪客戶所需的名片夾,\n\n或下班開趴的開瓶器,提供您最適當的工具解決生活上的問題。\n\n\n精巧的設計讓多種功能合而為一,加上意大利手染軟皮夾,讓外觀提升到極致。',\n\t\t\t\t'status' => '0',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1322055681,1358057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => '1', \n\t\t\t\t]);\nProject::create([\n\t\t\t\t'name' => '【新尺碼增加】denward ─ 極致舒適的台灣製牛仔褲',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => '我們是兩個商學院的學生,為了共同的理念,建立了denward這個品牌,命名是結合丹寧布的denim,以及象徵著前進的forward兩個字而組合成的,代表著我們的產品會從丹寧相關產品出發,並且逐漸延伸和進步。',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"+39 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"+75 day\")),\n\t\t\t\t'cover_img_path' => 'https://d29twh0lc6f62l.cloudfront.net/project/93e07c25eb231a1abb1a7fa1cd56e8db.jpg' ,\n\t\t\t\t'video_link' => 'https://www.youtube.com/embed/_GI4tWNqClk',\n\t\t\t\t'content' => '我們的理念\n\n\n我們常在想,為什麼台灣的產業總是只能外流到國外,逐水草而居般的往人工便宜的地方去;為什麼全世界最大的牛仔褲代工廠是台灣公司,但卻無法幫台灣製造多少工作機會?而最後我們買到的褲子,掛的也不是Made in Taiwan?\n很希望創造些有價值的東西,讓我們在昂貴品牌或低價卻品質不穩的商品以外,能有來自台灣的好選擇。\n經過半年的籌劃,我們想透過我們的品牌denward,來改變現況。\n\n台灣的紡織業雖然已不像70年代那樣的興盛,但仍舊具有很高的製造水準,我們想要發揮在地師傅的技術,台灣設計,並且台灣製造。',\n\t\t\t\t'status' => '0',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1322055681,1358057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => '1', \n\t\t\t\t]);\n\n\n\n\n\nProject::create([\n\t\t\t\t'name' => '臺灣特有種 - 動物親子桌上遊戲',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => '透過遊戲讓孩子認識台灣',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"+16 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"+55 day\")),\n\t\t\t\t'cover_img_path' => 'https://d29twh0lc6f62l.cloudfront.net/project/416fde48803a4920934ad8fd55966b80.jpg' ,\n\t\t\t\t'video_link' => 'https://www.youtube.com/embed/ym6aztVznpg',\n\t\t\t\t'content' => '曾經獲得 美國玩具界奧斯卡 ParentsChoice Awards 銀獎、以及 2014 年美國百大玩具獎 的設計團隊 綿羊犬,秉持著遊戲與教育結合的精神,開發出全國第一套以台灣生態、動物為主題的兒童桌上遊戲《臺灣特有種》。\n\n\n\n我們認為,對於孩子而言最有效的學習方式是透過遊戲。為了引起孩子對於台灣這塊土地的學習熱忱,我們設計了全國第一套以台灣特有物種、生態棲地為主要內容的兒童桌上遊戲,並於其中加入創新的玩法與立體結構的物件,讓家長與老師能帶著 3 歲以上的孩子以遊戲的方式認識本國的自然資產。',\n\t\t\t\t'status' => '2',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1322055681,1358057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => rand(1,30), \n\t\t\t\t]);\n\t\n\n\t\t\t\n\n\n\t\t\tProject::create([\n\t\t\t\t'name' => 'BASEQI:鋁合金神隱轉卡 Macbook Air / Retina 13吋 專用',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => '神隱轉卡是專為 MacBook Pro Retina / Air 13\" 所設計的MicroSD/TF卡套,體積精巧外觀精細,緊密的融為一體。',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"+18 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"+60 day\")),\n\t\t\t\t'cover_img_path' => 'https://d15ds55abggjxg.cloudfront.net/project/7bf4e0582f7846fb19aa924041cc7fbf.jpg' ,\n\t\t\t\t'video_link' => 'https://www.youtube.com/embed/I20xUlTKT7U',\n\t\t\t\t'content' => 'iSDA 103A : Apple Macbook Air 13\"\n適用 : MacBookAir3.2 (Late 2010) \n MacBookAir4.2 (Mid 2011) \n MacBookAir5.2 (Mid 2012) \n MacBookAir6.2 (Mid 2013) \n MacBookAir6.2 (Early 2014)\n\niSDA 303A : Apple Macbook Pro Retina 13\"\n適用 : MacBookPro10,2 (Early 2013) \n MacBookPro10,2 (Late 2012)\n\niSDA 303A : Apple Macbook Pro Retina 13\"\n適用 : MacBookPro11,1 (Late 2013)\n\nPS : 如何辨識機型\n選擇螢幕左上角 Apple()選單中的關於這台 Mac。\n按一下「更多資訊」。\n找出「硬體」區域下「硬體概覽」中列出的機型識別碼。',\n\t\t\t\t'status' => '2',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1322055681,1358057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => rand(1,30), \n\t\t\t\t]);\n\t\t\t\n\t\t\tProject::create([\n\t\t\t\t'name' => '原創遊戲社團NARRATOR新作-伴星~Companion~-實體化募款',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => '伴星~Companion~是我們Narrator所製作的第五款遊戲。',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"+25 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"+70 day\")),\n\t\t\t\t'cover_img_path' => 'https://d15ds55abggjxg.cloudfront.net/project/b11a6417b2b43615cd17dfd48891f33a.jpg' ,\n\t\t\t\t'video_link' => 'https://www.youtube.com/embed/QIWeXc469q0',\n\t\t\t\t'content' => '首先來介紹一下我們Narrator吧。\n\n我們是一群由各領域不同年紀的人,因為對遊戲的熱情而聚集在一起的人。\n\n雖然基本上沒有什麼獲益\n\n但我們憑藉著自己的熱血跟想要把心中美好的事物(不論是文字、圖片、或是影音)呈現出來的心\n\n製作出了一款又一款的遊戲\n\n希望讓大家在玩完我們的遊戲後可以在心中留下美好的回憶跟那股被感動後留下的悸動。\n\n我們是Narrator,我們是將美好的故事帶給大家的說書人。\n\n伴星~Companion~是我們Narrator所製作的第五款遊戲。\n\n這是一款以電子小說方式表現文字遊戲\n\n內容是在描述地球面臨了「伴星」這顆星體的撞擊,幾乎已經確定會造成地球上大多數的人類死亡。\n\n主角是因為是發現這件事的科學家,因此獲得了進入各國為了延續人類存在而建造的避難所。\n\n雖然可以保住性命,卻失去了對這個注定滅亡的世界的熱情,眼睛睜開就只能默默等待明天的到來。\n\n就在此時,他在街上遇到了一名讓他對於明天多了幾分期待的少女......\n\n整體遊玩時間大約3~4小時',\n\t\t\t\t'status' => '2',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1322055681,1358057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => rand(1,30), \n\t\t\t\t]);\n\n\t\t\t\n\t\t\tProject::create([\n\t\t\t\t'name' => 'Fotock | 你的互動留聲相框',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => '為什麼要讓照片說話?\n為了保留完整的回憶\n為了傳達真實的心意,',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"+14 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"+48 day\")),\n\t\t\t\t'cover_img_path' => 'https://d15ds55abggjxg.cloudfront.net/project/7848/c42896ba29ea3dc22afbb087e486a113.png' ,\n\t\t\t\t'video_link' => 'https://www.youtube.com/embed/Jxxxx5KHLkU',\n\t\t\t\t'content' => '我到過很多地方,拍下很多照片做成相框放在桌上或牆上,常常有人看著照片問我說:『你何時去的?』『這是那裡?』『去玩了什麼?』一開始都還記得,但隨著時間的久遠,慢慢很多細節都模糊了,\n\n我常常看著照片努力回想那生命中的美好,但我發現常常再怎麼想也想不起來,因此我想設計個東西,可以把畫面,跟回憶連結在一起。\n\n生命是由回憶所累積起來的,回憶包含了畫面,文字及聲音,我於是設計了Fotock,我利用一個金屬標籤,嵌在原木的相框上,標籤上面紀錄了照片的標題,跟副標題。這看起來很像一個資料夾,回憶的資料夾。當你想要再打開這個回憶時,你只要拉起標籤,你就可以看到內文,跟聽到聲音。',\n\t\t\t\t'status' => '2',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1322055681,1358057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => rand(1,30), \n\t\t\t\t]);\n\nProject::create([\n\t\t\t\t'name' => '《歲末祈願,心溫暖─創世公益桌曆》碳布x玄風聯名出版',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => '我是一個希望自己作品可以被應用在公益商品上的插畫家碳布;\n\n我是一個興趣手工書、熱愛文字,希望回報創世恩情的植物人家屬玄風。\n\n因緣際會下,我們開始攜手合作一圓彼此的公益夢。',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"+22 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"+64 day\")),\n\t\t\t\t'cover_img_path' => 'https://d15ds55abggjxg.cloudfront.net/project/859acbe5470ad461026e1e078308fdb6.jpg' ,\n\t\t\t\t'video_link' => 'https://www.youtube.com/embed/hSxEaj5vs8I',\n\t\t\t\t'content' => '創作緣起\n植物人家屬的自白\n 身為植物人家屬,我最能明白那心中的痛與對社工們的無限感激。\n 我曾經受過創世基金會的幫助,因為年邁的爺爺在一次心臟手術失敗而成了植物人。當時經濟狀況並不寬裕的我們,只能勉強吃力的照顧爺爺,能申請的補助都申請了卻只能應急。我們需要特殊的充氣床墊、餵食需要氣切後透過鼻胃管一點一滴的注入營養牛奶,我們要定時為他翻身,以免肌肉持續硬化。然而這都是只是基本的照護,隨著時間流逝家人們開始疲憊,望著睜著雙眼卻無意識的爺爺,我們除了心疼還有埋怨,為什麼當初要執意開刀導致現在的結果?\n 剎那我們忘了爺爺一輩子的辛勞付出,只是考慮著該輪到誰照顧他;我們忽略了爺爺為了家庭而失去健康,只是責備著彼此。\n 日子依然在走,對於植物人,時間不曾憐憫過,他們的時間一樣跳動。\n 然而在我們灰心喪志之際,創世基金會向我們伸出了援手。在正式入院前,仍因種種嚴苛的條件我們無法順利,但創世的志工們都熱心的協助我們,也時常來家裡幫忙與探望爺爺。這時我才知道,原來世界上需要幫助的人是那樣的多,比我們家條件要差的人多的是。\n 至今我能由衷感謝老天給我爺爺一個機會,剛好有一個床位入住,可以接受創世的照顧。在創世四年多,他一樣和健康的時候般是個難搞的爺爺,時而半夜發燒搞的護士忙碌奔走,儘管如此白衣天使們仍是細心的呵護他,讓他最後能安詳的離開。\n唯有親身經歷過,才能明白那無能為力的痛。\n只有真正看到,碰觸到,才知曉地獄是怎般場景。\n\n關於植物人\n  植物人是一種腦死狀態,無法言語與自理,是否有意識與能否清醒,至今依舊沒有答案。造成的原因多半是因為意外事件,手術失敗,我也曾看過一個例子是因為被蚊子盯咬,而感染日本腦膜炎成為植物人,那是個正值青年的大學生...。\n植物人V.S.漸凍人\n 植物人其實和漸凍人一樣,他們都失去了自主性,但植物人更少了那病症發作的緩衝時間。一旦被宣判腦死便無法在和心愛的家人告別,無法在有限的時間內做完想做事,受傷了只能任由傷口潰爛......。而基於人權道德觀念,家屬無法決定安樂死,但照顧植物人需要龐大的費用,加上心理衝擊,很多家庭和諧的家庭因此破碎。\n\n植物人照護問題\n 植物人多半會需要氣切手術,而這個手術也常影響著許多安養院是否收留的決定關鍵。答案很遺憾,氣切後的病患需要特殊儀器供應氧氣,加上植物人需要透過鼻胃管餵食,大大增加照護的困難度,因此安養院是無法收留植物人的。\n 敞若是失去經濟支柱的家庭而言,這不免是二度打擊,家屬無法24小時照護且安置在家裡需要添購許多特殊設備,例如:氣墊床。奶粉和尿布長期累積下來也是一筆令人擔憂的金額。',\n\t\t\t\t'status' => '2',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1322055681,1358057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => rand(1,30), \n\t\t\t\t]);\n\nProject::create([\n\t\t\t\t'name' => '黑色箱子裡的4am',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => '概念說明\n\n此次計畫的設計重點主要專注於在整個學運的起因與過程中,\n\n政府所回應給人民的一切黑箱作爲,\n\n其中就屬324凌晨開始以強力水柱與流血的鎮壓驅離,\n\n之後卻以拍背說簡單帶過最爲可恥,\n\n因此圖像中以簡潔的黑色箱子與4am做爲結合,\n\n提醒自己對於政府慣性回應給人民的黑箱作為,',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"+17 day\")),\n\t\t\t\t'end_date'=> date(\"Y-m-d\", strtotime($today.\"+53 day\")),\n\t\t\t\t'cover_img_path' => 'https://d15ds55abggjxg.cloudfront.net/project/357c1f3a57bc3c7812c43859aef56e4f.jpg' ,\n\t\t\t\t'video_link' => 'https://www.youtube.com/embed/rb6JYT77LrQ',\n\t\t\t\t'content' => '概念說明\n\n此次計畫的設計重點主要專注於在整個學運的起因與過程中,\n\n政府所回應給人民的一切黑箱作爲,\n\n其中就屬324凌晨開始以強力水柱與流血的鎮壓驅離,\n\n之後卻以拍背說簡單帶過最爲可恥,\n\n因此圖像中以簡潔的黑色箱子與4am做爲結合,\n\n提醒自己對於政府慣性回應給人民的黑箱作為,',\n\t\t\t\t'status' => '2',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1322055681,1358057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => rand(1,30), \n\t\t\t\t]);\n\n\n\nProject::create([\n\t\t\t\t'name' => 'Lomography Petzval 人像鏡頭',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => 'Lomography Petzval人像鏡頭\n\n 一顆源自於 19世紀的傳奇鏡頭,適合所有 Nikon F接環與 Canon EF接環的底片與數位相機。\n',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"+12 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"+50 day\")),\n\t\t\t\t'cover_img_path' => 'https://d15ds55abggjxg.cloudfront.net/project/9b9091df93f9ab947a99400ec3e075ca.jpg' ,\n\t\t\t\t'video_link' => 'https://www.youtube.com/embed/XvwWaGVnFZI',\n\t\t\t\t'content' => '使用 19世紀的 Petzval鏡頭拍攝\n \n在 19世紀初,絕大多數的照片是由這顆極受歡迎的鏡頭所拍攝,由維也納的 Joseph Petzval教授於 1840年所設計,而這個天才發明對攝影的發展也產生了巨大的影響。這顆 Petzval鏡頭的最大特徵就是它的中央影像超級銳利,而四周有著漸暈的散景效果。這樣特殊的 Petzval效果,很難使用 Photoshop或任何濾片辦到。\n\n\n在這個集資計畫中,為了 21世紀的攝影師們,我們改造了這顆 Petzval鏡頭,不管你喜歡用數位或是底片相機拍照,全新的 Lomography Petzval人像鏡頭專為 Canon EF與 Nikon F接環的相機所設計,你可以把它裝上你的 35mm 底片單眼相機,或是數位單眼相機,拍攝迷人 Petzval效果的照片,甚至是影片。\n\n\n我們預計鏡頭寄出的時間為 2014年 2月,不過我們希望能夠於 2013 年 12月便能完成首批鏡頭製作並寄送。預計上市的正式售價為 NT 17,490 ,參加此集資計畫,除了支持這顆鏡頭的誕生之外,你還可率先以優惠的價格擁有這顆美妙的鏡頭(之後不用補任何差價),甚至是個人專屬的名字雕刻。Petzval人像鏡頭具有高品質的光學鏡頭,這樣一個獨特的鏡頭,將為你增加攝影的無窮樂趣,甚至用它來拍攝一個永恆的藝術作品。\n\n\n \n\n請注意:網站中展示的 Petzval鏡頭商品照,為舊式的 Petzval鏡頭或是第一批樣品。然而我們還會繼續修改一些細節,特別是散景的效果,鏡頭外觀上也將會有一些設計上的更動。因此,請期待一顆完美且不平凡鏡頭的到來吧!',\n\t\t\t\t'status' => '2',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1322055681,1358057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => rand(1,30), \n\t\t\t\t]);\n\nProject::create([\n\t\t\t\t'name' => '瘋狂泡泡足球 Bubble Ball Taiwan',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => '開了口 故事就從這個夏天開始SONY質感新男聲 Eric周興哲 第一首發表夏悸好評抒情曲 以後別做朋友 ',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"+20 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"+69 day\")),\n\t\t\t\t'cover_img_path' => 'https://d15ds55abggjxg.cloudfront.net/project/72bb350e3185a9038bd162838bd6b618.jpg' ,\n\t\t\t\t'video_link' => 'https://www.youtube.com/embed/ObOd96kAZbw',\n\t\t\t\t'content' => '2014世界盃足球賽6月14日就要在巴西開踢了,雖然足球不是台灣的強項,但是不代表我們在台灣不能發揮創意玩一玩另類足球賽!瘋狂泡泡足球Bubble Football,紅遍足球大本營歐洲,現在只要到Flying V贊助我們,你也能“參一腳”跟親朋好友一起組隊PK!6月看完世足賽,馬上報名來踢球!瘋狂泡泡足球邀你一起瘋足球!\n\n\n泡泡足球(bubble football)是一種刺激好玩的新遊戲型態,參加者把自己套進大氣球裡,整場比賽每個­人在場上連滾帶摔也不用擔心受傷,這項風­靡歐洲、日本等地的活動,現在我們想將這個運動和娛樂效果兼具的有趣活動,帶給台灣的民眾!\n\n官網連結:http://www.bubbleball.com.tw/ \n\nEnglish booking and details for Bubble Football soccer in Taiwan see English website: http://www.bubbleball.com.tw/en/\n\n\n泡泡足球不是專業比賽,不分男女老少*、台灣人歪國人都可以玩! 可以自己來(單人體驗票)、糾團來PK:5人一隊和別隊PK或自己組兩隊(10人)一起來玩!',\n\t\t\t\t'status' => '2',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1322055681,1358057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => rand(1,30), \n\t\t\t\t]);\nProject::create([\n\t\t\t\t'name' => '打造你專屬的超能心臟',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => '從小我們總希望自己能像漫畫中的超級英雄一樣與眾不同,懷著滿腔熱血想告訴大家:「我也可以捍衛這個世界的和平!!」超級英雄以往都是基因超乎常人,不然就是身負神秘血統,再不然就是飛簷走壁來去自如,直到有一天我們發現,原來人類也可以利用高科技,為自己打造最適合的裝備,成為捍衛世界的英雄!',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"+12 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"+40 day\")),\n\t\t\t\t'cover_img_path' => 'https://d29twh0lc6f62l.cloudfront.net/project/e9815a00ead7869cafbde035aedaf7a7.jpg' ,\n\t\t\t\t'video_link' => 'https://www.youtube.com/embed/L2Bgca1Q5j4',\n\t\t\t\t'content' => '大家好,我是Tony,我相當喜歡超級英雄的系列,更是電影的頭號影迷,也曾經和喜好這些題材的人一樣,購買漫畫、DVD、和其他零零總總的週邊。在一次偶然的機會下,參考國外的手製影片,加上一整夜的趕工,我用鋁罐、漆包線、觸摸燈和濾水器等家用五金和材料打造出了這個專屬於我的原創配件,一圓成為超級英雄的低調奢華夢想。\n\n後來,我將整理的照片分享到網路上,得到的迴響竟然還不錯,許多影迷和朋友便開始詢問我是如何製作的。其實這不是一個很容易的過程。根據自己的喜好,會有不同的造型。而不論想呈現怎樣的風貌,料件都相當繁複、而且要把這些四處張羅的材料完好的組裝在一起、加工零件的過程也相當繁複,於是我開始思索「簡單化」這個過程的可能性。\n\n經過幾天的構圖、四處尋問材料行和切割店後,我終於得到一些有用的答案,也能夠將這個讓大家能簡單完成自行設計的配件逸品的夢想可以實現,甚至一起揪團以英雄的身分暢覽電影。最重要的是還是「自行打造」,透過簡單的整理,由自己的雙手完成專屬於自己的專屬配件。\n\n我很希望能跟大家一起分享這種喜悅,也希望大家能節省蒐羅材料、設計圖面的時間,因此我將這個想法分享到 flyingV上面,希望能讓透過教學的方式,讓同好一起動手製作心目中的超能心臟。\n\n 設計圖\n\n在本活動中,我將提供以兩種材料組合進行的製作演示:\n\n原始版本,根據我第一次嘗試製作的材料組合進行,如果很想體驗我篳路藍縷、割傷手指、挫傷挫折的過程,可以嘗試以這種組合製作。內容包含了背蓋、觸控燈、水龍頭過濾器、特殊口徑的寶特瓶、透明水管、遮光用的裝飾部件和組裝過程中的所有耗材如鞋用膠、訂書針等。水管、外框等加工需要極高的耐心和時間,如果不考慮製作過程中的意外損傷,組裝時間大約需要半天。\n\n訂做版本,重新整理設計後,為了降低組裝的難度和時間並提升美觀。除了原始的發光元件外,另外加上配合所有物料尺寸的訂做不鏽鋼外框和內裡透光支架,除了外型可以更緊密的結合外,料件透光度也比原始版本高很多。由於核心零件都計算過尺寸,組裝時間可以壓縮到一個半小時(已含等待膠乾的時間),不論開關燈都可以有不錯的效果。此版本會附上我製作前擬定的仿真設計草稿。',\n\t\t\t\t'status' => '2',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1322055681,1358057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => rand(1,30), \n\t\t\t\t]);\n\n\n\t\t\tProject::create([\n\t\t\t\t'name' => '核電員工的最後遺言蔓延計畫',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => '親愛的朋友,您關心核電嗎?\n\n除了參加遊行、掛上氣勢磅礡的反核旗、貼上搖滾炫亮的貼紙、穿著口號響亮的T-shirt外,我們對核電了解多少?\n\n我是一個已婚、尚未懷孕生子的女性,每日工作與孩童接觸,核電議題紛紛擾擾謠言滿天飛,人云亦云,我開始閱讀正負兩面相關知識。',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"+7 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"+37 day\")),\n\t\t\t\t'cover_img_path' => 'https://d29twh0lc6f62l.cloudfront.net/project/94025b79cf81793198f7f6f84cacec1f.jpg' ,\n\t\t\t\t'video_link' => 'https://www.youtube.com/embed/4Mr-8tZrnAs',\n\t\t\t\t'content' => '※計劃緣起:多數民眾沒有足夠的核電知識\n選擇此書是因為由已逝的核電工程師與駐日記者、前任奇異公司原子爐設計師等親述核電廠施工、運轉、內部工作弊病、歷史核電廠事故、核輻射對健康影響、以及台灣核電廠勘查分析。\n\n文字平易近人,內容不艱澀難懂,一般民眾皆可接受。\n\n※行動初始:讓書擴散\n2013年6月26日我在個人臉書建立《核電員工的最後遺言》索書活動 ,徵求各單位、機構、教室、營業場所向我索取此書,並在醒目場合公開擺放供民眾翻閱了解相關知識。\n\n此活動尚在進行當中,截至今日索書單位有:\n\n(私人)國中自然科教室、瑜珈館、義守大學推廣部、巧手作坊、嘉南藥理科技大學系會、鐵花村、魚蹦興業、藍月電影、紡織公司、禾果製作公司、Sababa中東料理、古名伸舞團、磐石室內裝修工程、松盈傳奇冰淇淋店、文化大學、高師大環境教育研究所、惠安醫療用品、Hi-Organic、姆姆咖啡、The Wall、賣捌所、中南海餐廳、大名物理治療所、草祭二手書店、台大資訊工程系 生物資訊實驗室、慕哲咖啡、彰化某OK便利商店、北市聯醫松德院區護理站、雲門教室南京館、春日館、安平館、靜宜大學、台南應用科大、台中安妮婚紗、白雨‧閑原工作室、中台灣不要核四五六、璽喜設計、小點心手繪工作室、(彭先生)早餐店、諸位個人教師等已回覆願意配合行動,截至今日已107本索書量,由我個人每月固定樂捐已寄出20本。\n\n託羅景壬導演、余彥芳老師、中台灣不要核四五六志工的福分享索書消息,也感謝眾多支持活動而把索書機會出讓的個人戶,小女子希望更多人挽起袖子加入這項活動。',\n\t\t\t\t'status' => '2',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1372055681,1398057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => rand(1,30), \n\t\t\t\t]);\t\t\n\n\t\t\t\tProject::create([\n\t\t\t\t'name' => '南希/嘉義:視覺藝術作品製作募資計劃',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => '各位親愛的朋友,我是ㄧ個獨立運作的藝術創作者,我的創作方式主要為攝影/ 錄像/ 裝置藝術。\n\n我近期的作品有\n\nJoachim女士的行李箱\n\n一路-(招待所/游泳池)\n\n南夜計劃\n\n祝您中獎\n\n更多關於我的作品以及資料,歡迎大家參觀我的作品集網站。\n\nwww.tsaochun.com\n\n\n\n今年有幸通過藝術銀行徵件的初審,\n\n希望能夠有更好的作品製作品質參加複審,\n\n因此透過募資平台尋求各位朋友的贊助。',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"+27 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"+67 day\")),\n\t\t\t\t'cover_img_path' => 'https://d29twh0lc6f62l.cloudfront.net/project/a86a01d6b275cb563d8e7760e2ca40cf.jpg' ,\n\t\t\t\t'video_link' => 'https://www.youtube.com/embed/oW6EAsDCxi8',\n\t\t\t\t'content' => '南希/ 嘉義\n\n本計劃主要關於兩個城市的地景。一個位於法國東邊的南希與位於台灣的嘉義,\n\n兩個相距一萬公里的城市,卻出現了似曾相似的情景。\n\n南希,是我在法國念書時居住了好長一陣子的城市;而嘉義,卻是在某次返台時首次前往的城市。\n\n兩個城市對我來說有不同的意義:\n\n一個就任何定義來說,都應該離我很遠,只是在其中生活過,因此感覺熟悉。\n\n而另一個離我很近,卻不知何故,拍下照片時是我與它的第一次見面。\n\n\n\n本計劃的成果為四張分別於南希與嘉義所拍攝的攝影作品。\n\n左邊是在南希拍攝的照片,右邊是在嘉義所拍攝的照片。\n\n有些情景在不同的城市重複出現,\n\n就像相互重疊的記憶。',\n\t\t\t\t'status' => '2',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1372055681,1398057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => rand(1,30), \n\t\t\t\t]);\t\n\n\t\t\t\t\tProject::create([\n\t\t\t\t'name' => '稻田裡的餐桌計劃 Season2',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => '『稻田裡的餐桌計劃』第一季共有265人跟著幸福果食團隊在台灣各地的鄉間擺下餐桌用餐。來賓們的寬容與愛護讓我們順利執行了第一季的計劃與回饋。\n\n除了各界優質的支持者外,同時也吸引了商周、壹週刊、財訊、看雜誌、蘋果日報、鄉間小路、旅人誌、GQ、大愛電視台、公共電視、中視等各大媒體的採訪與報導,而台灣最大飲食集團的董座與《跟著董事長遊台灣》的作者兩兄弟也帶著家人前來參與,並成為幸福果食的第四位Co-Founder。',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"+28 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"+59 day\")),\n\t\t\t\t'cover_img_path' => 'https://d29twh0lc6f62l.cloudfront.net/project/4b47066cc4e7169da6f1787efd7ab9b3.jpg' ,\n\t\t\t\t'video_link' => 'https://www.youtube.com/embed/mQRyHUKVz0k',\n\t\t\t\t'content' => '15個農夫\n\n快樂農夫有機農場-江漢錡、行健有機村-張美、好蝦囧男社-李正富、胭脂鰻-嚴竹英、竹山茶園製茶師-古亦茶、黃金山藥-簡秀忠、警政薯長、信義葡萄園-吳良乾、雙連埤紅鳳菜農、十分箭筍農、大溪稻農、虎尾棉花農、池上稻農、竹南有機草莓農-謝文崇等。\n\n11場餐會\n\n三星米其鄰、崎頂種幸福、幸福十分餐旅、竹山茶香香、菜園裡的麻辣鍋以及另外七場私人包場的餐會,其中包括生日派對、企業團體包場。\n\n6種創新的農產加工品\n\n米布丁、洛神花果醬、珠蔥Pizza Bread、山藥起司炸飯糰、鳴門金石芋泥麵包、茶香比司考提手工餅乾,當然還有等待來賓已於10/28日種下的草莓苗開花結果後之草莓加工品。',\n\t\t\t\t'status' => '2',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1372055681,1398057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => rand(1,30), \n\t\t\t\t]);\t\n\n\n\t\t\t\tProject::create([\n\t\t\t\t'name' => '《老鷹想飛》院線上映 X 教育推廣計劃',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => '你一定玩過「老鷹抓小雞」的遊戲。\n可是除了人類張牙舞爪地扮演老鷹之外,你見過真的老鷹嗎?',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"+19 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"+50 day\")),\n\t\t\t\t'cover_img_path' => 'https://d15ds55abggjxg.cloudfront.net/project/9c13245be24d778db1cf89b52ab20d22.jpg' ,\n\t\t\t\t'video_link' => 'https://www.youtube.com/embed/O4ddZoRGFRk',\n\t\t\t\t'content' => '但我發現常常再怎麼想也想不起來,因此我想設計個東西,可以把畫面,跟回憶連結在一起。\n\n生命是由回憶所累積起來的,回憶包含了畫面,文字及聲音,我於是設計了Fotock,我利用一個金屬標籤,嵌在原木的相框上,標籤上面紀錄了照片的標題,跟副標題。這看起來很像一個資料夾,回憶的資料夾。當你想要再打開這個回憶時,你只要拉起標籤,你就可以看到內文,跟聽到聲音。',\n\t\t\t\t'status' => '1',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1372055681,1398057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => '1', \n\t\t\t\t]);\t\n\n\t\t\t\tProject::create([\n\t\t\t\t'name' => '婚姻平權貼紙計畫',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => '開了口 故事就從這個夏天開始\n\t\t\t\tSONY質感新男聲 Eric周興哲 \n\t\t\t\t第一首發表夏悸好評抒情曲 以後別做朋友 ',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"+19 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"+50 day\")),\n\t\t\t\t'cover_img_path' => 'https://d15ds55abggjxg.cloudfront.net/project/6beb8753c6c6d24ff5320f8275975f46.jpg' ,\n\t\t\t\t'video_link' => 'https://www.youtube.com/embed/sk_EXNNFTKM',\n\t\t\t\t'content' => '二十年了,看著老鷹的生存困境,我們不禁要想: 「今日鳥類,明日人類?」\n你曾經為了什麼事情守護整整二十年?\n是與青梅竹馬的友誼,一段刻骨銘心的愛情,還是傾注無盡的愛的親情?\n沈振中老師的答案是-他對黑鳶的愛,已經整整歷經二十年的時光了。\n從基隆到屏東,沈老師在黑鳶可能出沒的山林蹲點,只為了觀察屬於天空的他們。\n沒想到這一觀察竟是延續了整整二十年,跨越了時間,也跨出台灣,到香港、印度、尼泊爾與日本進行海外的探訪,電影中完整的記錄了黑鳶的生態變化,以及這群與沈老師「鷹緣際會」下一起觀察黑鳶的志工們的身影。\n\n看著許多老鷹遭遇到的環境傷害,我們不免想著這些環境變遷是否也對人類有所影響。\n老鷹是生態系統健全與否的重要指標,身為生物鏈的頂端掠食者,若老鷹的數量開始下降,被掠食者的壓力解除,便會大大影響生態系的平衡。\n也許我們一時間看不出生態系受到破壞的影響,但認識並了解老鷹消失的原因,讓我們意識到一件事:不論是老鷹還是人類,還是所有與我們共享這片土地與天空的朋友們,都暴露在亟需改變的惡劣環境之下。\n\n我們透過影像說故事,希望全台灣能有更多個像你一樣關心動物與環境的人,能有機會一起深入認識猛禽物種,感受猛禽和人類的相依性,感受我們共同和這片土地與天空的緊密連結。',\n\t\t\t\t'status' => '0',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1372055681,1398057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => '1', \n\t\t\t\t]);\t\n\n\t\t\t\tProject::create([\n\t\t\t\t'name' => '顛覆你的旅行方式──滾出趣任務手札',\n\t\t\t\t'class' => rand(1,7),\n\t\t\t\t'pre_amount' => rand(5000,50000),\n\t\t\t\t'outline' => '\n● 名人推薦\n\n● 為什麼要顛覆以往的旅行方式? (滾出趣初衷動畫)\n\n● 如何顛覆旅行方式\n\n● 用任務改變旅行行為\n\n● 手札內容介紹\n\n● 為什麼任務手札值得你贊助\n\n● 經費如何運用\n\n● 滾後三部曲:除了手札,更多有趣的後續活動\n\n● 回饋方式\n\n● 關於滾出趣',\n\t\t\t\t'start_date' => date(\"Y-m-d\", strtotime($today.\"+19 day\")),\n\t\t\t\t'end_date'=>date(\"Y-m-d\", strtotime($today.\"+50 day\")),\n\t\t\t\t'cover_img_path' => 'https://d29twh0lc6f62l.cloudfront.net/project/f895cbec4ccef0163736a6d57cd4115e.jpg' ,\n\t\t\t\t'video_link' => 'https://www.youtube.com/embed/4zIqvXEGvQQ',\n\t\t\t\t'content' => '大學四年級,我獨自前往歐洲旅行,一個人,接觸了許多歐洲的年輕人,自己打理生活,自己搭乘交通工具在完全陌生的國家遊走。\n\n \n\n跟一群歐洲青年討論事情時,我發現亞洲人的害羞和默默不語;\n\n看到許多新朋友都在做著很酷的夢想事業,我發現勇敢追求夢想的美麗;\n\n跟德國女生交談時,我很驚訝她能與我侃侃而談台灣的歷史和政治;\n\n仔細看著路上的街景、交通工具上的人們時,我才明白許多以往的刻板印象事實上都不是那樣;\n\n靠自己找到正確的列車搭往下一個城市時,我開始不再那麼害怕陌生的環境。\n\n \n\n每一個經驗,都讓我重新發現旅行另一個意義:出國旅行除了觀光休閒之外,它其實也可以是「衝擊與改變一個人的過程」,它可以顛覆你以往的思想,重新讓你認識世界和自己,看到許多以往都不知道的事。 \n\n \n\n前提是你要真的「走進」世界。',\n\t\t\t\t'status' => '0',\n\t\t\t\t'hitpoint'=>rand(0,1000),\n\t\t\t\t'created_at'=>date('Y-m-d',mt_rand(1372055681,1398057681)),\n\t\t\t\t'updated_at'=>date('Y-m-d',mt_rand(1402055681,1418057681)),\n\t\t\t\t'starter_id' => '1', \n\t\t\t\t]);\t\n\t}", "private function getProjectNameAndProjectID(){\r\n $this->jsonOutput[\"projectID\"] = utils\\Encryption::encode($this->settingVars->projectID);\r\n $this->jsonOutput[\"projectName\"] = $this->settingVars->pageArray[\"PROJECT_NAME\"];\r\n }", "function get_title_lectura($lectura)\n{\n $cadena = $lectura->libro_nombre . ' ' . $lectura->capitulo . ': ' . $lectura->inicio\n . '-' . $lectura->final;\n\n return $cadena;\n}", "private function projectPath()\n { }", "public abstract function getProjectFieldName();", "public function getProjectName() : string\n {\n return $this->projectName;\n }", "public function addproject() {\n\t\t\t\n\t\t\t\n\t\t}", "function getSolution() {\n \techo \"getSolution was not implemented, this is a severe error!\";\n }", "function rawpheno_function_user_project($user_id) {\n $trait_type = rawpheno_function_trait_types();\n $my_project = array();\n\n $sql = \"SELECT\n t1.name,\n t1.project_id,\n COUNT(CASE WHEN t2.type = :essential_trait THEN 1 END) AS essential_count\n FROM\n {project} AS t1\n INNER JOIN pheno_project_cvterm AS t2 USING (project_id)\n LEFT JOIN pheno_project_user AS t3 USING (project_id)\n WHERE t3.uid = :user_id\n GROUP BY t1.project_id\n ORDER BY t1.project_id DESC\";\n\n $args = array(':essential_trait' => $trait_type['type1'], ':user_id' => $user_id);\n $p = chado_query($sql, $args);\n\n if ($p->rowCount() > 0) {\n foreach($p as $a) {\n if ($a->essential_count > 0) {\n $my_project[$a->project_id] = $a->name;\n }\n }\n }\n\n return $my_project;\n}", "public static function getProjectName()\n {\n $name = array();\n $items = Cart::getCart();\n foreach($items as $key => $item) {\n $name[] = $item['title'];\n }\n \n return implode(', ', $name);\n }", "function show_project() {\n require_once __DIR__ . '/../../../../lib/Gocdb_Services/Factory.php';\n require_once __DIR__ . '/../utils.php';\n require_once __DIR__ . '/../../../../htdocs/web_portal/components/Get_User_Principle.php';\n\n if (!isset($_GET['id']) || !is_numeric($_GET['id']) ){\n throw new Exception(\"An id must be specified\");\n }\n $projId = $_GET['id'];\n\n $serv=\\Factory::getProjectService();\n $project = $serv->getProject($projId);\n $allRoles = $project->getRoles();\n $roles = array();\n foreach ($allRoles as $role){\n if($role->getStatus() == \\RoleStatus::GRANTED &&\n $role->getRoleType()->getName() != \\RoleTypeName::CIC_STAFF){\n $roles[] = $role;\n }\n }\n\n //get user for case that portal is read only and user is admin, so they can still see edit links\n $dn = Get_User_Principle();\n $user = \\Factory::getUserService()->getUserByPrinciple($dn);\n $params['ShowEdit'] = false;\n if (\\Factory::getRoleActionAuthorisationService()->authoriseAction(\\Action::EDIT_OBJECT, $project, $user)->getGrantAction()) {\n $params['ShowEdit'] = true;\n }\n// if(count($serv->authorize Action(\\Action::EDIT_OBJECT, $project, $user))>=1){\n// $params['ShowEdit'] = true;\n// }\n\n // Overload the 'authenticated' key for use to disable display of personal data\n list(, $params['authenticated']) = getReadPDParams($user);\n\n // Add RoleActionRecords to params\n $params['RoleActionRecords'] = \\Factory::getRoleService()->getRoleActionRecordsById_Type($project->getId(), 'project');\n\n $params['Name'] = $project->getName();\n $params['Description'] = $project->getDescription();\n $params['ID']=$project->getId();\n $params['NGIs'] = $project->getNgis();\n $params['Sites']= $serv->getSites($project);\n $params['Roles'] =$roles;\n $params['portalIsReadOnly'] = portalIsReadOnlyAndUserIsNotAdmin($user);\n show_view('project/view_project.php', $params, $params['Name']);\n}", "function cs_get_project_url() {\n\tif (function_exists('get_field')) {\n\t\tglobal $post;\n\t\t$project_url = get_field('project_url', $post->ID);\n\t\techo $project_url;\n\t}\n}", "private function createProject()\n {\n $input = file_get_contents('prj.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/projects?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/projects?owner=wawong\";\n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n //echo \"\\nCreate project:\".$response.\"\\n\";\n \n $result = json_decode($response);\n $id = $result->_id;\n \n return $id;\n }", "function plugin_version_estimation() {\n return [\n 'name' => 'Оценка качества работы с заявкой',\n 'version' => PLUGIN_ESTIMATION_VERSION,\n 'author' => 'Roman Gonyukov',\n 'license' => '',\n 'homepage' => '',\n 'requirements' => [\n 'glpi' => [\n 'min' => '9.2',\n ]\n ]\n ];\n}", "function get_lib_contenance(){\n return $this->contenance.\" L\";\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create('zh_TW');\n Project::create([\n 'raising_user_id' => 23,\n 'fundraiser' => 'RIG group',\n 'email' => $faker->email,\n 'name' => '典藏版《球場諜對諜》棒球鬥智精品桌遊',\n 'category_id' => 12,\n 'started_at' => '2018-10-5 ',\n 'ended_at' => '2018-12-10',\n 'curr_amount' => 16670,\n 'goal_amount' => 100000,\n 'relative_web' => 'www.zeczec.com/projects/MatchFixing?r=k2898470057',\n 'backer' => 32,\n 'brief' => '這是一款藉由互相猜忌對方身份,需要一定的運氣與智力才能做出正確決定的棒球桌遊。',\n 'description' => '影片無法播放請點選右側網址收看 https://pse.is/B6BWW #\n你知道這「黑襪事件」對美國運動史帶來的意義嗎?#\n一九一九年,號稱「球界最強」的芝加哥白襪隊驚爆八名選手集體放水、故意輸掉唾手可得的世界冠軍,自此「黑襪事件」四個字成為球壇遭封印的闇黑符號。\n但也正因如此,才有今日乾淨打球、純粹展現全球最高棒球技藝,被暱稱為「國家娛樂」的美國職棒大聯盟棒球。\n熱愛棒球的我們,絕對無法認同打假球的行為,因此特別設計了這款遊戲,讓玩家透過遊戲身歷其境體會歷史的傷痛,讓喜愛棒球或桌遊的玩家更認同乾淨打球的真義。',\n ]);\n Feedback::create([\n 'project_id' => 23,\n 'date' => '2018-12-31',\n 'price' => 499,\n 'backer' => 11,\n 'description' => '典藏版《球場諜對諜》精品桌遊1套 \n限量回饋搶先出手相挺者 \n搶先價499元(市價:699元) \n本產品只有一種版本,先搶先贏! \n(((臺灣本島離島免運))) \nps: \n香港澳門250元 \n其餘海外運費標準 \n依照包裹重量與地區另訂 \n有任何問題請洽[email protected]',\n ]);\n Feedback::create([\n 'project_id' => 23,\n 'date' => '2018-12-31',\n 'price' => 549,\n 'backer' => 11,\n 'description' => '典藏版《球場諜對諜》精品桌遊1套 \n早鳥價549元(市價:699元) \n(((臺灣本島離島免運))) \nps: \n香港澳門250元 \n其餘海外運費標準 \n依照包裹重量與地區另訂 \n有任何問題請洽[email protected]',\n ]);\n Feedback::create([\n 'project_id' => 23,\n 'date' => '2018-12-31',\n 'price' => 998,\n 'backer' => 10,\n 'description' => '典藏版《球場諜對諜》精品桌遊2套 \n送《美國職棒》雜誌1本(市價168元) \n市價:1566元 現省568元 \n(((臺灣本島離島免運))) \n\n全球華文出版市場唯一針對大聯盟(Major League Baseball)棒球進行介紹的官方授權刊物,內容兼具深度與廣度。除了球季戰況的精闢剖析,還包括知名選手、各隊新星傳記;最新熱門話題;造訪大聯盟球場的實用旅遊資訊以及投打技術剖析。 \nps: \n港澳運費250元 \n其餘海外運費標準 \n依照包裹重量與地區另訂 \n有任何問題請洽[email protected]',\n ]);\n\n Project::create([\n 'raising_user_id' => 24,\n 'fundraiser' => ' 玩思once實境遊戲 ',\n 'email' => $faker->email,\n 'name' => '街道的隱匿者|當你用牠的眼睛看世界-流浪動物實境遊戲',\n 'category_id' => 12,\n 'started_at' => '2018-10-23',\n 'ended_at' => '2018-12-25',\n 'curr_amount' => 459695,\n 'goal_amount' => 700000,\n 'relative_web' => 'www.zeczec.com/projects/once-reality-game?r=k2751470057',\n 'backer' => 39,\n 'brief' => '一款體會毛孩處境的實境遊戲。在這個由人類掌控的世界,街上流浪動物要如何生存下去?如果是你,你會怎麼做?',\n 'description' => '把你變成流浪動物,你能存活多久?#\n一個以流浪動物的視角體驗人類社會的實境遊戲\n在街頭遇到流浪動物的時候,你是什麼心情呢?是覺得他們好可愛、好可憐,或者你是固定餵食的愛媽愛爸,照顧流浪動物的飲食,還是對於流浪動物帶來的髒亂覺得困擾?\n《街道的隱匿者》是一款從流浪動物角度出發的遊戲,帶你從動物的角度認識人類世界,認識流浪動物在街頭上的困境,不是人類的你,該怎麼生存下去呢?',\n ]);\n Feedback::create([\n 'project_id' => 24,\n 'date' => '2019-5-1',\n 'price' => 450,\n 'backer' => 20,\n 'description' => '【個人早鳥優惠_早鳥送限定酷卡】 \n原價為550元,集資期間現省100元。\n\n◇ 街道的隱匿者-遊玩券一張 \n◇ 集資限定酷卡一套\n\n注意事項: \n*免郵資,票券以掛號方式寄出。 \n*遊戲建議人數為4~8人,低於4人以併團方式進行遊玩。 \n*需要統編可以留言在備註欄',\n ]);\n Feedback::create([\n 'project_id' => 24,\n 'date' => '2019-5-1',\n 'price' => 2400,\n 'backer' => 18,\n 'description' => '【團體早鳥優惠_早鳥送限定酷卡】 \n原價為3300元,集資期間現省900元。\n\n◇ 街道的隱匿者-團體遊玩券一張(6人) \n◇ 集資限定酷卡六套\n\n注意事項: \n*免郵資,票券以掛號方式寄出。 \n*遊戲建議人數為4~8人,低於4人以併團方式進行遊玩。 \n*此方案為6人團體券,如果同團超過6人,現場以400元/人,加收費用。 \n*需要統編可以留言在備註欄',\n ]);\n Feedback::create([\n 'project_id' => 24,\n 'date' => '2019-5-1',\n 'price' => 600,\n 'backer' => 1,\n 'description' => '【個人票套組】 \n原價為700元,集資期間現省100元。\n\n◇ 街道的隱匿者-遊玩券一張 \n◇ 集資限定酷卡一套 \n◇ 快樂結局帆布包一個\n\n注意事項: \n*免郵資,票券以掛號方式寄出。 \n*遊戲建議人數為4~8人,低於4人以併團方式進行遊玩。 \n*需要統編可以留言在備註欄',\n ]);\n\n }", "function RellenarTitulo()\r\n {\r\n $this->Imprimir('ANÁLSIS DE FALLAS DE DISTRIBUCIÓN');\r\n\r\n $this->Imprimir($this->convocatoria->getLugar(), 93, 10);\r\n\r\n $this->Imprimir(strftime(\"%A %d de %B de %Y\", strtotime($this->convocatoria->getFecha())) .\r\n ' - Hora: ' . $this->convocatoria->getHoraIni() . ' a ' .\r\n $this->convocatoria->getHoraFin(), 95, 10, 16);\r\n }", "function mod_project($pro, $l) {\n /* @var $lib libs\\libs */\n global $lib;\n\n if ($pro['viwtype'] == \"categories\") {\n \n \n \n $r .= $lib->coms->project->com_project_getCategories($pro['catgories']);\n } else {\n\n $r .= $lib->coms->project->com_project_getblocks(mod_project_getData($pro), $l, $pro);\n }\n return $r;\n}", "protected function getNewProjectName() {\n\t\tdo {\n\t\t\t$t_name = $this->getName() . '_' . rand();\n\t\t\t$t_id = $this->client->mc_project_get_id_from_name( $this->userName, $this->password, $t_name );\n\t\t} while( $t_id != 0 );\n\t\treturn $t_name;\n\t}", "private function getProject() {\r\n $this->clientOwnsProject();\r\n\r\n $select = ('lpc.landingpage_collectionid, lpc.testtype, lpc.name, lpc.config, lpc.creation_date, lpc.start_date, ' .\r\n ' lpc.end_date, lpc.restart_date, lpc.status, lpc.progress, lpc.autopilot, lpc.allocation, lpc.last_sample_date, lpc.sample_time, ' .\r\n ' lpc.personalization_mode, lpc.smartmessage, lpc.ignore_ip_blacklist, lpc.device_type, lp.rule_id, ' .\r\n ' lp.landing_pageid AS originalid, lp.lp_url, lp.canonical_url ');\r\n\r\n $lpcid = mysql_real_escape_string($this->project);\r\n $lp = \"(SELECT landing_pageid, landingpage_collectionid, lp_url, canonical_url, rule_id, allocation \" .\r\n \" FROM landing_page WHERE landingpage_collectionid = $lpcid AND pagetype = 1 AND page_groupid = -1 \" .\r\n \" GROUP BY landingpage_collectionid ORDER BY landing_pageid ASC LIMIT 1 ) lp \";\r\n\r\n $this->db->select($select)\r\n ->from('landingpage_collection lpc')\r\n ->join($lp, 'lp.landingpage_collectionid = lpc.landingpage_collectionid', 'INNER')\r\n ->where('lpc.landingpage_collectionid', $this->project);\r\n\r\n if ($this->usertype == 'api-tenant') {\r\n $this->db->join('api_client ac', 'ac.clientid = lpc.clientid', 'INNER')\r\n ->where('lpc.clientid', $this->account)\r\n ->where('(ac.api_tenant = ' . $this->apiclientid . ' OR ac.api_clientid = ' . $this->apiclientid . ')');\r\n } else {\r\n $this->db->where('lpc.clientid', $this->clientid);\r\n }\r\n\r\n $query = $this->db->get();\r\n\r\n if ($query->num_rows() <= 0) {\r\n throw new Exception('', 403203);\r\n }\r\n\r\n $row = $query->row();\r\n $res = self::returnPojectFields($row, TRUE);\r\n return $this->successResponse(200, $res);\r\n }", "public function getName()\n {\n return \"The Proving Grounds\";\n }", "protected function getGameName( )\n {\n return \"pi\";\n }", "function getProjetos($atuacao, $nome){\n $projetos = array();\n $nomeInst = attr($atuacao)['NOME-INSTITUICAO'];\n //Verificação de existência\n if(isset($atuacao['ATIVIDADES-DE-PARTICIPACAO-EM-PROJETO']['PARTICIPACAO-EM-PROJETO'])){\n // Recebendo as participacoes\n $participacoes = $atuacao['ATIVIDADES-DE-PARTICIPACAO-EM-PROJETO']['PARTICIPACAO-EM-PROJETO'];\n // Vendo se existe apenas uma\n if(array_keys($participacoes)[0] === '@attributes')\n $participacoes = array($participacoes);\n // Iterando sobre elas\n foreach ($participacoes as $participacao) {\n if(isset($participacao['PROJETO-DE-PESQUISA'])):\n $projsPesquisa = $participacao['PROJETO-DE-PESQUISA'];\n //Verificação de quantidade\n if(array_keys($projsPesquisa)[0] === \"@attributes\")\n $projsPesquisa = array($projsPesquisa);\n //Percorrer projetos de pesquisa\n foreach ($projsPesquisa as $projPesquisa) {\n $coordProj_ = new CoordProjeto();\n $coordProj_->responsavel = isOrientador($projPesquisa['EQUIPE-DO-PROJETO']['INTEGRANTES-DO-PROJETO'], $nome);\n $coordProj_->nomeInstituicao = $nomeInst;\n $coordProj_->anoInicio = attr($projPesquisa)['ANO-INICIO'];\n $coordProj_->anoFim = attr($projPesquisa)['ANO-FIM'];\n $coordProj_->nomeProj = attr($projPesquisa)['NOME-DO-PROJETO'];\n $coordProj_->situacao = attr($projPesquisa)['SITUACAO'];\n $coordProj_->natureza = attr($projPesquisa)['NATUREZA'];\n $coordProj_->descricao = attr($projPesquisa)['DESCRICAO-DO-PROJETO'];\n $coordProj_->equipe = getEquipe($projPesquisa['EQUIPE-DO-PROJETO']['INTEGRANTES-DO-PROJETO']);\n\n array_push($projetos, $coordProj_);\n }\n endif;\n }\n }\n // var_dump($projetos);\n return $projetos;\n }", "function get_cur_project() {\n\t\tif (!isset($_SESSION['dfl_project'])) {\n\t\t\tlgi_mysql_fetch_session(\"SELECT `dfl_project` AS `dfl_project` FROM %t(users) WHERE `name`='%%'\", $this->userid);\n\t\t\t// if not set, return first project found\n\t\t\tif (!isset($_SESSION['dfl_project']))\n\t\t\t\tlgi_mysql_fetch_session(\"SELECT `name` AS `dfl_project` FROM %t(userprojects) AS p, %t(usercerts) AS c WHERE p.`usercertid`=c.`id` AND c.`user`='%%' LIMIT 1\", $this->userid);\n\t\t\tif (!isset($_SESSION['dfl_project']))\n\t\t\t\tthrow new LGIPortalException(\"No LGI projects for user: check certificate.\");\n\t\t}\n\t\treturn $_SESSION['dfl_project'];\n\t}", "function myCreator(){\n return \"Adokiye is my creator he is currently in stage 4 of the HNG internship, he will soon advance to stage 5\";\n}", "public function getProject($league_id = 0)\n\t{\n\t $app = JFactory::getApplication();\n $db = sportsmanagementHelper::getDBConnection(); \n $query = $db->getQuery(true);\n \n //$app->enqueueMessage(JText::_(__METHOD__.' '.__LINE__.' _project<br><pre>'.print_r($this->_project,true).'</pre>'),'Notice');\n //$app->enqueueMessage(JText::_(__METHOD__.' '.__LINE__.' _project_id<br><pre>'.print_r(self::$_project_id,true).'</pre>'),'Notice');\n \n\t\tif (!$this->_project)\n\t\t{\n\t\t\tif (!self::$_project_id && !$league_id ) \n {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n $query->select('p.id, p.name,p.league_id');\n $query->select('CONCAT_WS(\\':\\',p.id,p.alias) AS project_slug');\n $query->select('CONCAT_WS(\\':\\',s.id,s.alias) AS saeson_slug');\n $query->select('CONCAT_WS(\\':\\',l.id,l.alias) AS league_slug');\n $query->select('CONCAT_WS(\\':\\',r.id,r.alias) AS round_slug');\n $query->select('p.season_id, p.league_id, p.current_round');\n \n $query->from('#__sportsmanagement_project AS p');\n $query->join('INNER','#__sportsmanagement_season AS s on s.id = p.season_id');\n \n $query->join('INNER','#__sportsmanagement_league AS l on l.id = p.league_id');\n //$query->join('INNER','#__sportsmanagement_round AS r on p.id = r.project_id ');\n $query->join('LEFT','#__sportsmanagement_round AS r on p.current_round = r.id ');\n \n// $query->where('p.id = ' . self::$_project_id);\n \n if ( $league_id )\n {\n $query->where('p.league_id = ' . $league_id);\n }\n else\n {\n $query->where('p.id = ' . self::$_project_id);\n }\n\t\t\t$db->setQuery($query);\n \n //$app->enqueueMessage(JText::_(__METHOD__.' '.__LINE__.' <br><pre>'.print_r($query->dump(),true).'</pre>'),'Notice');\n \n\t\t\t$this->_project = $db->loadObject();\n self::$_project_id = $this->_project->id;\n\t\t\t$this->_project_slug = $this->_project->project_slug;\n $this->_saeson_slug = $this->_project->saeson_slug;\n $this->_league_slug = $this->_project->league_slug;\n $this->_round_slug = $this->_project->round_slug;\n\t\t}\n \n\t\treturn $this->_project;\n\t}", "public static function retrieveProjectTitle($projectID) {\n try {\n $project = ArmyDB::retrieveProjectInfo($projectID);\n //var_dump($unit);\n return $project['projectname'];\n }\n catch (Exception $e) {\n throw new Exception($e->getMessage());\n }\n }", "function __($phrase){\n\tglobal $lg_contenidos;\n\t\n\t// Chequea que exista la frase en el array\n\tif(isset($lg_contenidos[$phrase])) { echo $lg_contenidos[$phrase]; }\n\telse {\n\t\tif (DEVELOPE) { echo '???'; }\n\t}\n\t\n}", "private function createProject() {\n\n require_once('../ProjectController.php');\n $maxMembers = $this->provided['maxMembers'];\n $minMembers = $this->provided['minMembers'];\n $difficulty = $this->provided['difficulty'];\n $name = $this->provided['name'];\n $description = $this->provided['description'];\n //TODO REMOVE ONCE FETCHED\n //$tags = $this->provided['tags'];\n setcookie('userId', \"userId\", 0, \"/\");\n // TODO FIX ISSUE HERE: you have to reload the page to get the result with a cookie set\n $tags = array(new Tag(\"cool\"), new Tag(\"java\"), new Tag(\"#notphp\"));\n $project = new Project($maxMembers, $minMembers, $difficulty, $name, $description, $tags);\n foreach (ProjectController::getAllPools() as $pool) {\n if ($pool->hasID($this->provided['sessionID'])) {\n $pool->addProject($project, $tags);\n ProjectController::redirectToHomeAdmin($pool);\n }\n }\n }", "function get_project($projectId)\n{\n global $airavataclient;\n\n try\n {\n return $airavataclient->getProject($projectId);\n }\n catch (InvalidRequestException $ire)\n {\n print_error_message('<p>There was a problem getting the project.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>InvalidRequestException: ' . $ire->getMessage() . '</p>');\n }\n catch (AiravataClientException $ace)\n {\n print_error_message('<p>There was a problem getting the project.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>AiravataClientException: ' . $ace->getMessage() . '</p>');\n }\n catch (AiravataSystemException $ase)\n {\n print_error_message('<p>There was a problem getting the project.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>AiravataSystemException!<br><br>' . $ase->getMessage() . '</p>');\n }\n\n}", "#[Route(path: '/project/ajax/{id}', name: 'translationalresearch_get_project_ajax', methods: ['GET'], options: ['expose' => true])]\n #[Template('AppTranslationalResearchBundle/Project/review.html.twig')]\n public function getProjectAction(Request $request, Project $project)\n {\n if (false == $this->isGranted('ROLE_TRANSRES_USER')) {\n return $this->redirect($this->generateUrl('translationalresearch-nopermission'));\n }\n\n $em = $this->getDoctrine()->getManager();\n $transresUtil = $this->container->get('transres_util');\n\n if( $transresUtil->isUserAllowedSpecialtyObject($project->getProjectSpecialty()) === false ) {\n $this->addFlash(\n 'warning',\n \"You don't have a permission to access the \".$project->getProjectSpecialty().\" project specialty\"\n );\n return $this->redirect($this->generateUrl('translationalresearch-nopermission'));\n }\n\n $projectPisArr = array();\n foreach($project->getPrincipalInvestigators() as $pi) {\n $projectPisArr[] = $pi->getId();\n }\n\n $billingContactId = null;\n $billingContact = $project->getBillingContact();\n if( $billingContact ) {\n $billingContactId = $project->getBillingContact()->getId();\n }\n\n $implicitExpirationDate = null;\n if( $project->getImplicitExpirationDate() ) {\n $implicitExpirationDate = $project->getImplicitExpirationDate()->format(\"m/d/Y\");\n }\n\n $fundedStr = \"Not-Funded\";\n if( $project->getFunded() ) {\n $fundedStr = \"Funded\";\n }\n\n //if project type = \"USCAP Submission\", set the default value for the Business Purpose of the new Work Request as \"USCAP-related\"\n $businessPurposesArr = array();\n if( $project->getProjectType() && $project->getProjectType()->getName() == \"USCAP Submission\" ) {\n //process.py script: replaced namespace by ::class: ['AppTranslationalResearchBundle:BusinessPurposeList'] by [BusinessPurposeList::class]\n $businessPurpose = $em->getRepository(BusinessPurposeList::class)->findOneByName(\"USCAP-related\");\n //echo \"businessPurpose=\".$businessPurpose.\"<br>\";\n if( $businessPurpose ) {\n $businessPurposesArr[] = $businessPurpose->getId();\n }\n }\n\n $output = array(\n \"fundedAccountNumber\" => $project->getFundedAccountNumber(),\n \"implicitExpirationDate\" => $implicitExpirationDate,\n \"principalInvestigators\" => $projectPisArr,\n \"contact\" => $billingContactId, //BillingContact,\n \"fundedStr\" => $fundedStr,\n \"businessPurposes\" => $businessPurposesArr\n );\n\n $response = new Response();\n $response->headers->set('Content-Type', 'application/json');\n $response->setContent(json_encode($output));\n return $response;\n }", "public function getDefaultProject(){\n $sql = 'SELECT rowid FROM `llx_projet` ORDER BY rowid ASC LIMIT 1';\n $resql = $this->db->query($sql);\n $idproj = $resql->fetch_assoc()[\"rowid\"];\n return $idproj;\n }", "function is_project( $user )\n {\n //Unimplemented\n }", "public function getPractice()\r\n {\r\n\t\t$url = \"http://www.kloudtransact.com/cobra-deals\";\r\n\t $msg = \"<h2 style='color: green;'>A new deal has been uploaded!</h2><p>Name: <b>My deal</b></p><br><p>Uploaded by: <b>A Store owner</b></p><br><p>Visit $url for more details.</><br><br><small>KloudTransact Admin</small>\";\r\n\t\t$dt = [\r\n\t\t 'sn' => \"Tee\",\r\n\t\t 'em' => \"[email protected]\",\r\n\t\t 'sa' => \"KloudTransact\",\r\n\t\t 'subject' => \"A new deal was just uploaded. (read this)\",\r\n\t\t 'message' => $msg,\r\n\t\t];\r\n \treturn $this->helpers->bomb($dt);\r\n }", "public static function getJefePlaneacion()\n {\n $jefes = file_get_contents('http://sws.itvillahermosa.edu.mx/ws/jefes?nivel=3');\n $jefes = json_decode($jefes, true);\n\n foreach($jefes as $jefe)\n {\n if($jefe['descripcion'] == 'DEPARTAMENTO DE PLANEACION, PROGRAMACION Y PRESUPUESTACION')\n {\n $pla = array_values($jefe);\n \n #Se pasa a mayúscula\n $pla[0]= mb_strtoupper($pla[0]);\n $pla[1]= mb_strtoupper($pla[1]);\n $pla[2]= mb_strtoupper($pla[2]);\n $pla[]= SWS_API::buscarID($pla[1]);\n $pla[]= 'JEFE(A) DE DEPTO. DE PLANEACIÓN, PROGRAMACIÓN Y PRESUPUESTACIÓN';\n\n return $pla;\n }\n }\n }", "public function getProjectInfo(): ProjectInfoInterface;", "public function getProjectTItle() {\n $project = \"Yii2\";\n return $project;\n }", "private function getProject()\n {\n $url = $this->base_uri.\"project/\".$this->project;\n $project = $this->request($url);\n return $project;\n }", "public static function openProject($p)\n\t{\n\t\tGLOBAL $_REQ;\n\t\t$_SESSION['currentProject']= $p['pk_project'];\n\t\t$_SESSION['currentProjectName']= $p['name'];\n\t\t$_SESSION['currentProjectDir']= Mind::$projectsDir.$p['name'];\n\t\t$p['path']= Mind::$projectsDir.$p['name'];\n\t\t$p['sources']= Mind::$projectsDir.$p['name'].'/sources';\n\t\t$ini= parse_ini_file(Mind::$projectsDir.$p['name'].'/mind.ini');\n\t\t$p= array_merge($p, $ini);\n\n\t\tMind::$currentProject= $p;\n\t\tMind::$curLang= Mind::$currentProject['idiom'];\n\t\tMind::$content= '';\n\t\t\n\t\t// loading entities and relations from cache\n\t\t$path= Mind::$currentProject['path'].\"/temp/\";\n\t\t$entities= $path.\"entities~\";\n\t\t$relations= $path.\"relations~\";\n\t\t\n\t\t$pF= new DAO\\ProjectFactory(Mind::$currentProject);\n\t\tMind::$currentProject['version']= $pF->data['version'];\n\t\tMind::$currentProject['pk_version']= $pF->data['pk_version'];\n\t\t\n\t\tMind::write('projectOpened', true, $p['name']);\n\t\treturn true;\n\t}", "public function getProject()\r\n {\r\n return $this->_params['project'];\r\n }", "public function games_dox()\n\t{\n\t\tif (preg_match('/(\\[[\\d#]+\\]-\\[.+?\\]-\\[.+?\\]-)\\[ (.+?) \\][- ]\\[\\d+\\/\\d+\\] - \"(.+?)\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t}\n\t\t//[NEW DOX] The.King.of.Fighters.XIII.Update.v1.1c-RELOADED [1/6] - \"The.King.of.Fighters.XIII.Update.v1.1c-RELOADED.par2\" yEnc\n\t\t//[NEW DOX] Crysis.3.Crackfix.3.INTERNAL-RELOADED [00/12] \".nzb\" yEnc\n\t\tif (preg_match('/^\\[NEW DOX\\][ _-]{0,3}(.+?)[ _-]{0,3}\\[\\d+\\/\\d+\\][ _-]{0,3}\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[NEW DOX] Minecraft.1.6.2.Installer.Updated.Server.List - \"Minecraft 1 6 2 Cracked Installer Updater Serverlist.nfo\" - yEnc\n\t\tif (preg_match('/^\\[NEW DOX\\][ _-]{0,3}(.+?)[ _-]{0,3}\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[ Assassins.Creed.3.UPDATE 1.01.CRACK.READNFO-P2P 00/17 ] \"Assassins.Creed.3.UPDATE 1.01.nzb\" yEnc\n\t\tif (preg_match('/^\\[ ([a-zA-Z0-9-\\._ ]+) \\d+\\/(\\d+ \\]) \".+?' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\t//[01/16] - GRID.2.Update.v1.0.83.1050.Incl.DLC-RELOADED - \"reloaded.nfo\" - yEnc\n\t\t//[12/17] - Call.of.Juarez.Gunslinger.Update.v1.03-FTS - \"fts-cojgsu103.vol00+01.PAR2\" - PC - yEnc\n\t\tif (preg_match('/^\\[\\d+\\/(\\d+\\]) - ([a-zA-Z0-9-\\.\\&_ ]+) - \".+?' . $this->e0 .\n\t\t\t\t\t '( - PC)? - yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t} //[36/48] NASCAR.The.Game.2013.Update.2-SKIDROW - \"sr-nascarthegame2013u2.r33\" yEnc\n\t\tif (preg_match('/^\\[\\d+\\/(\\d+\\]) ([a-zA-Z0-9-\\._ ]+) \".+?' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t} //[Grand_Theft_Auto_Vice_City_1.1_Blood_NoCD_Patch-gimpsRus]- \"grugtavc11bcd.nfo\" yEnc\n\t\tif (preg_match('/^\\[([a-zA-Z0-9-\\._ ]+)\\]- \".+?' . $this->e1, $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //[OLD DOX] (0001/2018) - \"18.Wheels.of.Steel.American.Long.Haul.CHEAT.CODES-RETARDS.7z\" - 1,44 GB - yEnc\n\t\tif (preg_match('/^\\[OLD DOX\\][ _-]{0,3}\\(\\d+\\/\\d+\\)[ _-]{0,3}\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 . '[-_\\s]{0,3}\\d+[,.]\\d+ [mMkKgG][bB][-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Endless.Space.Disharmony.v1.1.1.Update-SKIDROW - [1/6] - \"Endless.Space.Disharmony.v1.1.1.Update-SKIDROW.nfo\" - yEnc\n\t\tif (preg_match('/^([a-zA-Z0-9-\\._ ]+) - \\[\\d+\\/(\\d+\\]) - \".+?' . $this->e0 . '{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(F.E.A.R.3.Update.1-SKIDROW) [01/12] - \"F.E.A.R.3.Update.1-SKIDROW.par2\" yEnc\n\t\tif (preg_match('/^\\(([a-zA-Z0-9-\\._ ]+)\\) \\[\\d+\\/(\\d+\\]) - \".+?' . $this->e0 .\n\t\t\t\t\t '{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(Company.of.Heroes.2.Update.v3.0.0.9704.Incl.DLC.GERMAN-0x0007) - \"0x0007.nfo\" yEnc\n\t\tif (preg_match('/^\\(([a-zA-Z0-9-\\._ ]+)\\) - \".+?' . $this->e1, $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t}\n\t\treturn array(\n\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject), \"properlynamed\" => false\n\t\t);\n\t}", "public function get_title() {\n\t\treturn __( 'Team', 'qazana' );\n\t}", "private function showProjectInfo()\n {\n // URLs\n $this->output->writeln('');\n $this->output->writeln('<info>'. $this->project->getName(false) .'</info> has now been created.');\n $this->output->writeln('<comment>Development:</comment> ' . $this->project->getDevUrl());\n $this->output->writeln('<comment>Staging:</comment> ' . $this->project->getStagingUrl());\n $this->output->writeln('<comment>Production:</comment> N/A');\n\n // Database credentials\n $databaseCredentials = $this->project->getDatabaseCredentials('dev');\n $this->output->writeln('');\n $this->output->writeln('<info>Development MySQL credentials</info>');\n $this->output->writeln('Username: ' . $databaseCredentials['username']);\n $this->output->writeln('Password: ' . $databaseCredentials['password']);\n $this->output->writeln('Database: ' . $databaseCredentials['database']);\n\n $databaseCredentials = $this->project->getDatabaseCredentials('staging');\n $this->output->writeln('');\n $this->output->writeln('<info>Staging MySQL credentials</info>');\n $this->output->writeln('Username: ' . $databaseCredentials['username']);\n $this->output->writeln('Password: ' . $databaseCredentials['password']);\n $this->output->writeln('Database: ' . $databaseCredentials['database']);\n $this->output->writeln('');\n\n // We're done!\n $this->output->writeln('<info>You can now run \"cd '. $this->project->getName() .' && vagrant up\"</info>');\n }", "function info()\n{\nglobal $client; ←\u0004\nLa programmation objet\nCHAPITRE 9 249\n//Utilisation de variables globales et d'un tableau superglobal\necho \"<h2> Bonjour $client, vous êtes sur le serveur: \",\n➥$_SERVER[\"HTTP_HOST\"],\"</h2>\"; ←\u0007\necho \"<h3>Informations en date du \",date(\"d/m/Y H:i:s\"),\"</h3>\";\necho \"<h3>Bourse de {$this–>bourse[0]} Cotations de {$this–>bourse[1]}\n➥à {$this–>bourse[2]} </h3>\"; ←\u0005\n//Informations sur les horaires d'ouverture\n$now=getdate();\n$heure= $now[\"hours\"];\n$jour= $now[\"wday\"];\necho \"<hr />\";\necho \"<h3>Heures des cotations</h3>\";\nif(($heure>=9 && $heure <=17)&& ($jour!=0 && $jour!=6))\n{ echo \"La Bourse de Paris ( \", self:: PARIS,\" ) est ouverte\n➥<br>\"; } ←\u0006\nelse\n{ echo \"La Bourse de Paris ( \", self:: PARIS,\" ) est fermée <br>\"; }", "function createProject() {\n $dbConnection = mysqli_connect(Config::HOST, Config::UNAME,\n Config::PASSWORD, Config::DB_NAME) or die('Unable to connect to DB.');\n\n //Taking the values and inserting it into the user table\n $sqlQuery = \"INSERT INTO PROJECT VALUES ('$this->id','$this->title','$this->description','$this->year','$this->category',\n '$this->picture','$this->sid')\";\n\n if(mysqli_query($dbConnection,$sqlQuery)){\n echo \"Project created successfully\";\n }\n\n else {\n echo \"Project not added! \" . mysqli_error($dbConnection);\n }\n mysqli_close($dbConnection);\n }", "public function listProjects(){\n\t\t$word = new word();\n\t\t$url = curPageURL();\n\t\t$arr = array();\n\t\t$qr = $this->fetchdata('kp_projects_cat',\"where status = 1 and is_delete=0 order by sort desc limit 0,6\");\n\t\twhile($res = $qr->fetch_object()){\n\t\t\t\t$project_cat_id = $res->project_cat_id;\n\t\t\t\t$slug = $res->slug;\n\t\t\t\t$getdevice = detectDevice();\n\t\t\t\tif($getdevice==\"Computer\"){\n\t\t\t\t\tif($_SESSION['lg']==\"TH\"){\n\t\t\t\t\t\t$project_cat_name = $res->project_cat_name_th;\n\t\t\t\t\t\t$project_cat_shortdetail = truncateStr(strip_tags($res->project_cat_shortdetail_th),110,\"...\");\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$project_cat_name = $res->project_cat_name_en;\n\t\t\t\t\t\t$project_cat_shortdetail = truncateStr(strip_tags($res->project_cat_shortdetail_en),110,\"...\");\n\t\t\t\t\t}\n\t\t\t\t}elseif($getdevice==\"Tablet\"){\n\t\t\t\t\tif($_SESSION['lg']==\"TH\"){\n\t\t\t\t\t\t$project_cat_name = $res->project_cat_name_th;\n\t\t\t\t\t\t$project_cat_shortdetail = truncateStr(strip_tags($res->project_cat_shortdetail_th),80,\"...\");\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$project_cat_name = $res->project_cat_name_en;\n\t\t\t\t\t\t$project_cat_shortdetail = truncateStr(strip_tags($res->project_cat_shortdetail_en),80,\"...\");\n\t\t\t\t\t}\n\t\t\t\t}elseif($getdevice==\"Mobile\"){\n\t\t\t\t\tif($_SESSION['lg']==\"TH\"){\n\t\t\t\t\t\t$project_cat_name = $res->project_cat_name_th;\n\t\t\t\t\t\t$project_cat_shortdetail = truncateStr(strip_tags($res->project_cat_shortdetail_th),70,\"...\");\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$project_cat_name = $res->project_cat_name_en;\n\t\t\t\t\t\t$project_cat_shortdetail = truncateStr(strip_tags($res->project_cat_shortdetail_en),70,\"...\");\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tif($_SESSION['lg']==\"TH\"){\n\t\t\t\t\t\t$project_cat_name = $res->project_cat_name_th;\n\t\t\t\t\t\t$project_cat_shortdetail = truncateStr(strip_tags($res->project_cat_shortdetail_th),110,\"...\");\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$project_cat_name = $res->project_cat_name_en;\n\t\t\t\t\t\t$project_cat_shortdetail = truncateStr(strip_tags($res->project_cat_shortdetail_en),110,\"...\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$link = \"$url/$slug\";\n\t\t\t\tif(!empty($res->project_cat_logo)){\n\t\t\t\t\tif(file_exists(\"images/projects_cat/$res->project_cat_logo\")==true){\n\t\t\t\t\t\t$imglogo = img_webp(\"images/projects_cat/$res->project_cat_logo\");\n\t\t\t\t\t\t$imglogo = \"<img src=\\\"$imglogo\\\" class=\\\"c-center\\\" style=\\\"height:50px;width: auto;margin: 0 auto;\\\"/>\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$imglogo = \"\";\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$imglogo = \"\";\n\t\t\t\t}\n\t\t\t\t$imgcover = $this->getImgcover($project_cat_id);\n\n\t\t\t\t$data = \"<div class=\\\"c-content-person-1 c-option-2\\\">\n\t\t\t\t\t<div class=\\\"c-caption c-content-overlay\\\">\n\t\t\t\t\t\t<img src=\\\"$imgcover\\\" class=\\\"img-responsive c-overlay-object\\\" alt=\\\"\\\">\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\\\"c-body\\\">\n\t\t\t\t\t\t<div class=\\\"c-center\\\" >\n\t\t\t\t\t\t\t$imglogo\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\\\"c-center\\\" style=\\\"margin-top:10px;\\\">\n\t\t\t\t\t\t\t<div class=\\\"c-name c-font-uppercase c-font-bold c-center\\\" style=\\\"font-size:25px;\\\">$project_cat_name</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<p class=\\\"c-center\\\" style=\\\"height:70px;\\\">\n\t\t\t\t\t\t\t$project_cat_shortdetail\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t<!--<div class=\\\"c-center\\\">\n\t\t\t\t\t\t\t<div class=\\\"c-name c-font-uppercase c-font-bold c-center\\\">test</div>\n\t\t\t\t\t\t</div>-->\n\t\t\t\t\t\t<div class=\\\"c-center\\\">\n\t\t\t\t\t\t\t<a href=\\\"$link\\\" class=\\\"btn c-btn-orange\\\">\".$word->wordvar('View Detail').\"</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\t\tarray_push($arr,$data);\n\t\t}\n\n\t\treturn implode('',$arr);\n\t}", "function getProjects() {\n\n\tglobal $db;\n\treturn $db->getProjectsByGroup ( $GLOBALS [\"targetId\"] );\n\n}", "function get_projects( $user )\n {\n //Unimplemented\n }", "public function engToGeDescription ( $eng = NULL ) {\n if ( !$eng ) return false;\n\n $dict = array();\n\n $dict['Chance of rain'] = 'მოსალოდნელია წვიმა';\n $dict['Chance of rain or sleet'] = 'მოსალოდნელია წვიმა ან სველი თოვლი';\n $dict['Chance of sleet or snow'] = 'მოსალოდნელია თოვლჭყაპი ან თოვლი';\n $dict['Chance of snow'] = 'უღრუბლო ამინდი';\n $dict['Clear weather'] = 'უღრუბლო ამინდი';\n $dict['Cloudy skies'] = 'ღრუბლიანი ცა';\n $dict['Few clouds'] = 'მცირედი ღრუბელი';\n $dict['Heavy rain'] = 'ძლიერი წვიმა';\n $dict['Heavy rain or sleet'] = 'ძლიერი წვიმა ან თოვლჭყაპი';\n $dict['Heavy sleet or snow'] = 'ძლიერი თოვლჭყაპი ან თოვლი';\n $dict['Light rain'] = 'მცირედი წვიმა';\n $dict['Light rain or sleet'] = 'მცირედი წვიმა ან თოვლჭყაპი';\n $dict['Light sleet or snow'] = 'მცირედი თოვლჭყაპი ან თოვლი';\n $dict['Light snow'] = 'მცირედი თოვლი';\n $dict['Partly cloudy skies'] = 'ნაწილობრივ ღრუბლიანი ცა';\n $dict['Rain'] = 'წვიმა';\n $dict['Rain and possible heavy thunderstorm'] = 'წვიმა, მოსალოდნელია ძლიერი ჭექა-ქუხილი';\n $dict['Rain and possible thunder'] = 'წვიდა და ჭექა-ქუხილი';\n $dict['Rain or sleet'] = 'წვიმა ან თოვლჭყაპი';\n $dict['Rain or sleet and possible heavy thunder'] = 'წვიმა ან თოვლჭყაპი და შესაძლებელია ჭექა-ქუხილი';\n $dict['Sleet or snow'] = 'თოვლჭყაპი ან თოვლი';\n $dict['Snow'] = 'თოვლი';\n\n\n return $dict[trim($eng)];\n }", "function getProjectsForResearcher($researcherId) {\r\n\r\n $sql= sprintf(\"SELECT project.id, project.title,\r\n dept.name as departmentName, CONCAT(users.first_name, ' ', users.last_name) as supervisor,\r\n project.presentationType\r\n FROM student_research_projects as project\r\n LEFT JOIN student_research AS link ON (link.researchProjectID = project.id)\r\n LEFT JOIN departments as dept ON (project.departmentID = dept.department_id)\r\n LEFT JOIN users ON (project.supervisorID = users.user_id)\r\n WHERE link.studentResearcherID = %s\r\n GROUP BY project.id\", $researcherId);\r\n\r\n global $db;\r\n $projects = $db->getAll($sql);\r\n\r\n if(count($projects)>0){\r\n foreach($projects as $key=>$project){\r\n if(strlen($project['title'])>50) $projects[$key]['title']=substr($project['title'],0,50) . '...';\r\n }\r\n }\r\n\r\n return $projects;\r\n}", "public function getProjectInformation() {\n $query = \"select * from projects\";\n $result = mysql_query($query);\n return $result;\n }", "public static function getAssignedProject()\n {\n $res_des = Auth::user()->designation;\n $res_id = Auth::user()->id;\n $current_team_id = \"\";\n $result_project = \"\";\n\n if ($res_des == 'Developer' || $res_des == 'Project Manager') {\n\t\t\t// Get Team that current user has been assigned to\n $result_teams = DB::table('dev_team')->where('user_id', '=', $res_id)->get();\n\n foreach ($result_teams as $result_team) {\n $current_team_id = $result_team->team_id;\n }\n\n\t\t\t// Get Project that the Team has been assigned to\n $result_project_ids = DB::table('assign_teams')->where('team_id', '=', $current_team_id)->get();\n\n foreach ($result_project_ids as $result_project_id) {\n $result_projectID = $result_project_id->ProjectID;\n }\n\n }\n\n return $result_projectID;\n }", "private function add_project()\n {\n \t$helperPluginManager = $this->getServiceLocator();\n \t$serviceManager = $helperPluginManager->getServiceLocator();\n \t$projects = $serviceManager->get('PM/Model/Projects');\n \t$result = $projects->getProjectById($this->pk);\t\n \t\n \tif($result)\n \t{\n \t\t$company_url = $this->view->url('companies/view', array('company_id' => $result['company_id']));\n \t\t$project_url = $this->view->url('projects/view', array('company_id' => FALSE, 'project_id' => $result['id']));\n \t\t\n \t\t$this->add_breadcrumb($company_url, $result['company_name']);\n \t\t$this->add_breadcrumb($project_url, $result['name'], TRUE);\n \t}\n }", "public function getSport()\n {\n return \"Football\";\n }", "function fantacalcio_trova_titolari($vote_round) {\n drupal_set_title(filter_xss('Risultati ' . $vote_round . '&ordf; giornata'));\n\n $out = \"\";\n\n// $vote_round = get_last_votes();\n\n $teams = get_teams();\n $votes = get_votes($vote_round);\n $competitions = get_competitions();\n\n $pl_votes = array();\n foreach ($votes as $vote)\n $pl_votes[] = $vote->pl_id;\n\n $elenco_pl_ids = implode(',', $pl_votes);\n \n $sqlx = \"SELECT * FROM {fanta_rounds_competitions} \" .\n \"WHERE round = '%d'\";\n $resultx = db_query($sqlx, $vote_round);\n while ($row = db_fetch_array($resultx)) {\n\n $c_id = $row['c_id'];\n $competition_round = $row['competition_round'];\n \n $out .= \"<h3>\" . $competitions[$c_id]->name . \"</h3>\";\n \n //resetto i valori \n $sql = \"UPDATE {fanta_lineups} \n SET has_played = 0 \n WHERE round = '%d' \n AND c_id = '%d'\";\n $result = db_query($sql, $competition_round, $c_id);\n\n #titolari con voto\n $sql = \"UPDATE {fanta_lineups} \" .\n \"SET has_played = 1 \" .\n \"WHERE position = 1 \" .\n \"AND round = '%d' \" .\n \"AND c_id = '%d'\" .\n \"AND pl_id IN ($elenco_pl_ids)\";\n //echo $sql;\n $result = db_query($sql, $competition_round, $c_id);\n \n switch (variable_get(\"fantacalcio_riserve_fisse\", 0) ) {\n case 0: //riserve libere\n fantacalcio_get_titolari_riserve_libere($pl_votes, $competition_round, $c_id);\n break;\n case 1: //riserve fisse\n fantacalcio_get_titolari_riserve_fisse($pl_votes, $competition_round, $c_id);\n break;\n default:\n fantacalcio_get_titolari_riserve_fisse($pl_votes, $competition_round, $c_id);\n }\n\n #report\n $sql = \"SELECT count(*) AS n, t_id FROM {fanta_lineups} \" .\n \"WHERE has_played = 1 \" .\n \"AND c_id = '%d' \" .\n \"AND round = '%d'\" .\n \"GROUP BY t_id\";\n $result = db_query($sql, $c_id, $competition_round);\n $played = array();\n $i = 0;\n while ($row = db_fetch_array($result)) {\n $i++;\n $played[$i]['t_id'] = $row['t_id'];\n $played[$i]['n'] = $row['n'];\n }\n\n $players = get_players();\n\n $sql = \"SELECT * FROM {fanta_lineups} \" .\n \"WHERE c_id = '%d' \" .\n \"AND round = '%d'\";\n $result = db_query($sql, $c_id, $competition_round);\n $formazioni = array();\n while ($row = db_fetch_object($result)) {\n\n $role = $players[$row->pl_id]->role;\n\n if ($row->position == 1) $formazioni[$row->t_id][\"titolari\"][$role]++;\n if ($row->has_played == 1) $formazioni[$row->t_id][\"played\"][$role]++;\n }\n\n #riepilogo titolari squadre\n $header = array(\"Squadra\", \"N&deg; Titolari\", \"Modulo Titolari\", \"Modulo Formazione\");\n\n $rows = array();\n foreach ($formazioni as $key => $value) {\n $n_titolari = array_sum($formazioni[$key][\"played\"]);\n\n $style = ($n_titolari == 11) ? \"\" : \"font-weight: bold; color: red;\";\n\n ksort($formazioni[$key][\"played\"]);\n ksort($formazioni[$key][\"titolari\"]);\n\n $rows[$key][] = $teams[$key]->name;\n $rows[$key][] = array(\"data\" => $n_titolari, \"style\" => $style);\n $rows[$key][] = implode(\"-\", $formazioni[$key][\"played\"]);\n $rows[$key][] = implode(\"-\", $formazioni[$key][\"titolari\"]);\n }\n $out .= theme_table($header, $rows);\n\n }\n\n return $out;\n\n}", "function opcion__info()\n\t{\n\t\t$p = $this->get_proyecto();\n\t\t$param = $this->get_parametros();\n\t\t$this->consola->titulo( \"Informacion sobre el PROYECTO '\" . $p->get_id() . \"' en la INSTANCIA '\" . $p->get_instancia()->get_id() . \"'\");\n\t\t$this->consola->mensaje(\"Version de la aplicación: \".$p->get_version_proyecto().\"\\n\");\n\t\tif ( isset( $param['-c'] ) ) {\n\t\t\t// COMPONENTES\n\t\t\t$this->consola->subtitulo('Listado de COMPONENTES');\n\t\t\t$this->consola->tabla( $p->get_resumen_componentes_utilizados() , array( 'Tipo', 'Cantidad') );\n\t\t} elseif ( isset( $param['-g'] ) ) {\n\t\t\t// GRUPOS de ACCESO\n\t\t\t$this->consola->subtitulo('Listado de GRUPOS de ACCESO');\n\t\t\t$this->consola->tabla( $p->get_lista_grupos_acceso() , array( 'ID', 'Nombre') );\n\t\t} else {\n\t\t\t$this->consola->subtitulo('Reportes');\n\t\t\t$subopciones = array( \t'-c' => 'Listado de COMPONENTES',\n\t\t\t\t\t\t\t\t\t'-g' => 'Listado de GRUPOS de ACCESO' ) ;\n\t\t\t$this->consola->coleccion( $subopciones );\n\t\t}\n\t}", "#[Route(path: '/project/show-simple/{id}', name: 'translationalresearch_project_show_simple', methods: ['GET'], options: ['expose' => true])]\n #[Template('AppTranslationalResearchBundle/Project/show-simple.html.twig')]\n public function includeProjectDetailsAction(Request $request, Project $project)\n {\n\n ////////////////// rendering using the original project show ////////////////\n return $this->showAction($request,$project);\n ////////////////// EOF rendering using the original project show ////////////////\n\n ////////////////// custom rendering ////////////////\n $transresPermissionUtil = $this->container->get('transres_permission_util');\n\n if( false === $transresPermissionUtil->hasProjectPermission(\"view\",$project) ) {\n return $this->redirect($this->generateUrl('translationalresearch-nopermission'));\n }\n\n $transresUtil = $this->container->get('transres_util');\n\n $cycle = \"show\";\n\n $form = $this->createProjectForm($project,$cycle,$request); //show show-simple\n\n //append “ Approved Budget: $xx.xx” at the end of the title again,\n //only for users listed as PIs or Billing contacts or\n //Site Admin/Executive Committee/Platform Admin/Deputy Platform Admin) and\n //ONLY for projects with status = Final Approved or Closed\n// $approvedProjectBudgetInfo = \"\";\n// if( $transresUtil->isAdminPrimaryRevExecutiveOrRequester($project) ) {\n// $approvedProjectBudget = $project->getApprovedProjectBudget();\n// if( $approvedProjectBudget ) {\n// //$approvedProjectBudget = $project->toMoney($approvedProjectBudget);\n// $approvedProjectBudget = $transresUtil->dollarSignValue($approvedProjectBudget);\n// $approvedProjectBudgetInfo = \" (Approved Budget: $approvedProjectBudget)\"; //show simple\n// }\n// }\n\n $approvedProjectBudgetInfo = \"\";\n if( $transresUtil->isAdminPrimaryRevExecutiveOrRequester($project) ) {\n\n $projectBudgetInfo = array();\n\n $approvedProjectBudget = $project->getApprovedProjectBudget();\n if( $approvedProjectBudget ) {\n $approvedProjectBudget = $transresUtil->dollarSignValue($approvedProjectBudget);\n $projectBudgetInfo[] = \"Approved Budget: $approvedProjectBudget\";\n }\n $remainingProjectBudget = $project->getRemainingBudget();\n if( $remainingProjectBudget ) {\n $remainingProjectBudget = $transresUtil->dollarSignValue($remainingProjectBudget);\n $projectBudgetInfo[] = \"Remaining Budget: $remainingProjectBudget\"; //show page\n }\n $totalProjectBudget = $project->getTotal();\n if( $totalProjectBudget ) {\n $totalProjectBudget = $transresUtil->dollarSignValue($totalProjectBudget);\n $projectBudgetInfo[] = \"Total Value: $totalProjectBudget\"; //show page\n }\n\n if( count($projectBudgetInfo) > 0 ) {\n $approvedProjectBudgetInfo = \" (\".implode(\", \",$projectBudgetInfo).\")\";\n }\n }\n\n $resArr = array(\n 'project' => $project,\n 'form' => $form->createView(),\n 'cycle' => $cycle,\n 'title' => $project->getProjectInfoName().$approvedProjectBudgetInfo, //show: \"Project request \".$project->getOid(),\n 'messageToUsers' => null\n );\n\n return $this->render(\"AppTranslationalResearchBundle/Project/show-simple.html.twig\",\n $resArr\n );\n ////////////////// EOF custom rendering ////////////////\n }", "public function getInvolvedProjects()\n {\n return array(\n 'spatie/last-fm-now-playing' => 'https://github.com/spatie/last-fm-now-playing',\n 'mjmlio/mjml' => 'https://github.com/mjmlio/mjml',\n 'Superbalist/monolog-google-cloud-json-formatter' => 'https://github.com/Superbalist/monolog-google-cloud-json-formatter',\n );\n }", "function get_projects() {\n\t\tif (!isset($_SESSION['projects']))\n\t\t\tlgi_mysql_fetch_session(\"SELECT GROUP_CONCAT(`name`) AS `projects` FROM %t(userprojects) AS p, %t(usercerts) AS c WHERE p.`usercertid`=c.`id` AND c.`user`='%%'\", $this->userid);\n\t\treturn explode(',', $_SESSION['projects']);\t\n\t}", "public function run()\n {\n\n\n $str = \"\n5838,28001,渋谷,東京メトロ銀座線,G01,G,01,,,●,,銀座線 駅事務室付近(改札内),●, ,2023/1/21\n5837,28001,表参道,東京メトロ銀座線,G02,G,02,,,●,,青山通り方面改札付近(改札外),●, ,2023/1/21\n5836,28001,外苑前,東京メトロ銀座線,G03,G,03,,,●,,駅事務室付近(改札外),●, ,2023/1/21\n5835,28001,青山一丁目,東京メトロ銀座線,G04,G,04,,,●,,駅事務室付近(改札外),●, ,2023/1/21\n5834,28001,赤坂見附,東京メトロ銀座線,G05,G,05,,,●,,駅事務室付近(改札内),●, ,2023/1/21\n5833,28001,溜池山王,東京メトロ銀座線,G06,G,06,,,●,,駅事務室付近(改札内),●, ,2023/1/21\n5832,28001,虎ノ門,東京メトロ銀座線,G07,G,07,,,●,,1番出口付近(改札外),●, ,2023/1/21\n5831,28001,新橋,東京メトロ銀座線,G08,G,08,,,●,,3番出口付近(改札外),●, ,2022/12/3\n5830,28001,銀座,東京メトロ銀座線,G09,G,09,,,●,,駅事務室付近(改札内),●, ,2023/1/8\n5829,28001,京橋,東京メトロ銀座線,G10,G,10,京橋 駅事務室付近(改札外),,,,駅事務室付近(改札外),, ,\n5828,28001,日本橋,東京メトロ銀座線,G11,G,11,,,●,,A6出口付近(改札外),●, ,2023/1/28\n5827,28001,三越前,東京メトロ銀座線,G12,G,12,,,●,,銀座線 駅事務室付近(改札外) / B5出口付近(改札外),●, ,2023/1/28\n5826,28001,神田,東京メトロ銀座線,G13,G,13,,,●,,3番出口付近(改札外),●, ,2023/1/28\n5825,28001,末広町,東京メトロ銀座線,G14,G,14,,,●,,2番出口付近(改札外) / 3番出口付近(改札外),●, ,2023/1/28\n5824,28001,上野広小路,東京メトロ銀座線,G15,G,15,,,●,,A1出口方面付近(改札外),●, ,2023/1/28\n5823,28001,上野,東京メトロ銀座線,G16,G,16,,,●,,駅事務室付近(改札外),●, ,2023/1/28\n5822,28001,稲荷町,東京メトロ銀座線,G17,G,17,,,●,,1番出口方面付近(改札外),●, ,2023/1/28\n5821,28001,田原町,東京メトロ銀座線,G18,G,18,,,●,,西浅草1丁目側エレベーター専用改札付近(改札外),●, ,2023/1/28\n5820,28001,浅草,東京メトロ銀座線,G19,G,19,,,●,,吾妻橋方面改札付近(改札外),●, ,2023/1/28\n5863,28002,荻窪,東京メトロ丸ノ内線,M01,M,01,,,●,,駅事務室付近(改札外),●, ,2022/12/30\n5862,28002,南阿佐ケ谷,東京メトロ丸ノ内線,M02,M,02,,,●,,杉並郵便局方面改札付近(改札外),●, ,2022/12/30\n5861,28002,新高円寺,東京メトロ丸ノ内線,M03,M,03,,,●,,駅事務室付近(改札外),●, ,2022/12/30\n5860,28002,東高円寺,東京メトロ丸ノ内線,M04,M,04,,,●,,蚕糸の森公園方面改札付近(改札外),●, ,2022/12/30\n5859,28002,新中野,東京メトロ丸ノ内線,M05,M,05,,,●,,鍋屋横丁交差点南改札付近(改札内),●, ,2022/12/30\n5858,28002,中野坂上,東京メトロ丸ノ内線,M06,M,06,,,●,,駅事務室付近(改札外),●, ,2022/12/30\n5857,28002,西新宿,東京メトロ丸ノ内線,M07,M,07,,,●,,駅事務室付近(改札外),●, ,2022/12/30\n5856,28002,新宿,東京メトロ丸ノ内線,M08,M,08,,,●,,東改札付近(改札外),●, ,2022/12/30\n5855,28002,新宿三丁目,東京メトロ丸ノ内線,M09,M,09,新宿三丁目 丸ノ内線 駅事務室付近(改札外) E5出口付近(改札外),,,,丸ノ内線 駅事務室付近(改札外) / E5出口付近(改札外),, ,\n5854,28002,新宿御苑前,東京メトロ丸ノ内線,M10,M,10,新宿御苑前 新宿門方面改札付近(改札内),,,,新宿門方面改札付近(改札内),, ,\n5853,28002,四谷三丁目,東京メトロ丸ノ内線,M11,M,11,四谷三丁目 駅事務室付近(改札外),,,,駅事務室付近(改札外),, ,\n5852,28002,四ツ谷,東京メトロ丸ノ内線,M12,M,12,四ツ谷 赤坂方面改札付近(改札内) 南北線 駅事務室付近(改札内),,,,,, ,\n5851,28002,赤坂見附,東京メトロ丸ノ内線,M13,M,13,,,●,,駅事務室付近(改札内),●, ,2023/1/21\n5850,28002,国会議事堂前,東京メトロ丸ノ内線,M14,M,14,国会議事堂前 3番出口付近(改札外),,,,3番出口付近(改札外),, ,\n5849,28002,霞ケ関,東京メトロ丸ノ内線,M15,M,15,,,●,,丸ノ内線 桜田通り方面改札付近(改札内) / 千代田線 駅事務室付近(改札内),●, ,2023/1/15\n5848,28002,銀座,東京メトロ丸ノ内線,M16,M,16,,,●,,駅事務室付近(改札内),●, ,2023/1/8\n5847,28002,東京,東京メトロ丸ノ内線,M17,M,17,東京 中央改札きっぷうりば付近(改札外),,,,中央改札きっぷうりば付近(改札外),, ,\n5846,28002,大手町,東京メトロ丸ノ内線,M18,M,18,,,●,,東西線 駅事務室付近(改札外) / 半蔵門線 駅事務室付近(改札外),●, ,2023/1/21\n5845,28002,淡路町,東京メトロ丸ノ内線,M19,M,19,淡路町 小川町方面改札付近(改札外),,,,小川町方面改札付近(改札外),, ,\n5844,28002,御茶ノ水,東京メトロ丸ノ内線,M20,M,20,御茶ノ水 1番出口付近(改札外),,,,1番出口付近(改札外),, ,\n5843,28002,本郷三丁目,東京メトロ丸ノ内線,M21,M,21,本郷三丁目 駅事務室付近(改札内),,,,駅事務室付近(改札内),, ,\n5842,28002,後楽園,東京メトロ丸ノ内線,M22,M,22,後楽園 南北線 駅事務室付近(改札外),,,,南北線 駅事務室付近(改札外),, ,\n5841,28002,茗荷谷,東京メトロ丸ノ内線,M23,M,23,茗荷谷 春日通り方面改札付近(改札内),,,,春日通り方面改札付近(改札内),, ,\n5840,28002,新大塚,東京メトロ丸ノ内線,M24,M,24,新大塚 北改札付近(改札外),,,,北改札付近(改札外),, ,\n5839,28002,池袋,東京メトロ丸ノ内線,M25,M,25,,,●,,西通路西改札付近(改札外) / 有楽町線 駅事務室付近(改札外),●, ,2023/1/3\n5866,28002,方南町,東京メトロ丸ノ内線,Mb03,M,b03,,,●,,駅事務室付近(改札外),●, ,2022/1/30\n5865,28002,中野富士見町,東京メトロ丸ノ内線,Mb04,M,b04,,,●,,改札付近(改札内),●, ,2022/1/30\n5864,28002,中野新橋,東京メトロ丸ノ内線,Mb05,M,b05,,,●,,改札付近(改札内),●, ,2022/1/30\n5888,28003,中目黒,東京メトロ日比谷線,H01,H,01,中目黒 恵比寿駅 2番出口付近(改札外),,,,恵比寿駅 2番出口付近(改札外),, ,\n5887,28003,恵比寿,東京メトロ日比谷線,H02,H,02,恵比寿 2番出口付近(改札外),,,,2番出口付近(改札外),, ,\n5886,28003,広尾,東京メトロ日比谷線,H03,H,03,広尾 4番出口付近(改札外),,,,4番出口付近(改札外),, ,\n5885,28003,六本木,東京メトロ日比谷線,H04,H,04,,,●,,駅事務室付近(改札外),●, ,2023/1/21\n5884,28003,神谷町,東京メトロ日比谷線,H05,H,05,,,●,,虎ノ門方面改札付近(改札外),●, ,2023/1/21\n5883,28003,虎ノ門ヒルズ,東京メトロ日比谷線,H06,H,06,,,●,,駅事務室付近(改札外),●, ,2023/1/21\n5882,28003,霞ケ関,東京メトロ日比谷線,H07,H,07,,,●,,丸ノ内線 桜田通り方面改札付近(改札内) / 千代田線 駅事務室付近(改札内),●, ,2023/1/15\n5881,28003,日比谷,東京メトロ日比谷線,H08,H,08,,,●,,駅事務室付近(改札外),●, ,2023/1/21\n5880,28003,銀座,東京メトロ日比谷線,H09,H,09,,,●,,駅事務室付近(改札内),●, ,2023/1/8\n5879,28003,東銀座,東京メトロ日比谷線,H10,H,10,東銀座 4番出口付近(改札外),,,,4番出口付近(改札外),, ,\n5878,28003,築地,東京メトロ日比谷線,H11,H,11,築地 3b出口付近(改札外),,,,3b出口付近(改札外),, ,\n5877,28003,八丁堀,東京メトロ日比谷線,H12,H,12,八丁堀 八丁堀交差点方面改札付近(改札外),,,,八丁堀交差点方面改札付近(改札外),, ,\n5876,28003,茅場町,東京メトロ日比谷線,H13,H,13,,,●,,8番出口付近(改札外),●, ,2022/12/3\n5875,28003,人形町,東京メトロ日比谷線,H14,H,14,,,●,,駅事務室付近(改札外),●, ,2023/1/28\n5874,28003,小伝馬町,東京メトロ日比谷線,H15,H,15,小伝馬町 本町方面改札付近(改札外),,,,本町方面改札付近(改札外),, ,\n5873,28003,秋葉原,東京メトロ日比谷線,H16,H,16,,,●,,駅事務室付近(改札外),●, ,2023/1/28\n5872,28003,仲御徒町,東京メトロ日比谷線,H17,H,17,仲御徒町 中央改札付近(改札内),,,,中央改札付近(改札内),, ,\n5871,28003,上野,東京メトロ日比谷線,H18,H,18,,,●,,駅事務室付近(改札外),●, ,2023/1/28\n5870,28003,入谷,東京メトロ日比谷線,H19,H,19,,,●,,4番出口付近(改札外),●, ,2023/1/28\n5869,28003,三ノ輪,東京メトロ日比谷線,H20,H,20,,,●,,駅事務室付近(改札外),●, ,2023/1/28\n5868,28003,南千住,東京メトロ日比谷線,H21,H,21,,,●,,駅事務室付近(改札内),●, ,2023/1/22\n5867,28003,北千住,東京メトロ日比谷線,H22,H,22,,,●,,千代田線 駅事務室付近(改札内),●, ,2023/1/22\n5889,28004,中野,東京メトロ東西線,T01,T,01,,,●,,落合駅 1番出口付近(改札外),●, ,2022/12/10\n5890,28004,落合,東京メトロ東西線,T02,T,02,,,●,,1番出口付近(改札外),●, ,2022/12/10\n5891,28004,高田馬場,東京メトロ東西線,T03,T,03,,,●,,5番出口付近(改札外),●, ,2022/1/29\n5892,28004,早稲田,東京メトロ東西線,T04,T,04,早稲田 早稲田大学方面改札付近(改札外) 早稲田大学穴八幡方面改札付近(改札外),,,,早稲田大学方面改札付近(改札外) / 早稲田大学穴八幡方面改札付近(改札外),, ,\n5893,28004,神楽坂,東京メトロ東西線,T05,T,05,神楽坂 駅事務室付近(改札内),,,,駅事務室付近(改札内),, ,\n5894,28004,飯田橋,東京メトロ東西線,T06,T,06,,,●,,飯田橋交差点方面改札付近(改札内) / 有楽町線・南北線駅事務室付近(改札外),●, ,2023/1/4\n5895,28004,九段下,東京メトロ東西線,T07,T,07,九段下 駅事務室付近(改札外),,,,駅事務室付近(改札外),, ,\n5896,28004,竹橋,東京メトロ東西線,T08,T,08,竹橋 大手町方面改札付近(改札外),,,,大手町方面改札付近(改札外),, ,\n5897,28004,大手町,東京メトロ東西線,T09,T,09,,,●,,東西線 駅事務室付近(改札外) / 半蔵門線 駅事務室付近(改札外),●, ,2023/1/21\n5898,28004,日本橋,東京メトロ東西線,T10,T,10,,,●,,A6出口付近(改札外),●, ,2023/1/28\n5899,28004,茅場町,東京メトロ東西線,T11,T,11,,,●,,8番出口付近(改札外),●, ,2022/12/3\n5900,28004,門前仲町,東京メトロ東西線,T12,T,12,,,●,,富岡八幡宮方面改札付近(改札内),●, ,2023/1/12\n5901,28004,木場,東京メトロ東西線,T13,T,13,木場 駅事務室付近(改札外),,,,駅事務室付近(改札外),, ,\n5902,28004,東陽町,東京メトロ東西線,T14,T,14,,,●,,西改札付近(改札内),●, ,2023/1/11\n5903,28004,南砂町,東京メトロ東西線,T15,T,15,,,●,,駅事務室付近(改札内),●, ,2023/1/19\n5904,28004,西葛西,東京メトロ東西線,T16,T,16,西葛西 駅事務室付近(改札外),,,,駅事務室付近(改札外),, ,\n5905,28004,葛西,東京メトロ東西線,T17,T,17,葛西 西口出口付近(改札外),,,,西口出口付近(改札外),, ,\n5906,28004,浦安,東京メトロ東西線,T18,T,18,,,●,,2階 西船橋方面ホーム行階段下付近(改札内),●, ,2023/1/8\n5907,28004,南行徳,東京メトロ東西線,T19,T,19,,,●,,駅事務室付近(改札内),●, ,2023/1/18\n5908,28004,行徳,東京メトロ東西線,T20,T,20,,,●,,改札付近(改札内),●, ,2023/1/11\n5909,28004,妙典,東京メトロ東西線,T21,T,21,,,●,,2階 中野方面ホーム行階段下付近(改札内),●, ,2023/1/12\n5910,28004,原木中山,東京メトロ東西線,T22,T,22,,,●,,駅事務室付近(改札外),●, ,2023/1/21\n5911,28004,西船橋,東京メトロ東西線,T23,T,23,,,●,,原木中山駅 事務室付近(改札外),●, ,2023/1/21\n5931,28005,代々木上原,東京メトロ千代田線,C01,C,01,,,●,,代々木公園駅 2番出口付近(改札外),●, ,2023/1/21\n5930,28005,代々木公園,東京メトロ千代田線,C02,C,02,,,●,,2番出口付近(改札外),●, ,2023/1/21\n5929,28005,明治神宮前〈原宿〉,東京メトロ千代田線,C03,C,03,,,●,,千代田線 駅事務室付近(改札外),●, ,2023/1/21\n5928,28005,表参道,東京メトロ千代田線,C04,C,04,,,●,,青山通り方面改札付近(改札外),●, ,2023/1/21\n5927,28005,乃木坂,東京メトロ千代田線,C05,C,05,乃木坂 外苑東通り方面改札付近(改札内),,,,外苑東通り方面改札付近(改札内),, ,\n5926,28005,赤坂,東京メトロ千代田線,C06,C,06,赤坂 1番・2番出口方面付近(改札外),,,,1番・2番出口方面付近(改札外),, ,\n5925,28005,国会議事堂前,東京メトロ千代田線,C07,C,07,国会議事堂前 3番出口付近(改札外),,,,3番出口付近(改札外),, ,\n5924,28005,霞ケ関,東京メトロ千代田線,C08,C,08,,,●,,丸ノ内線 桜田通り方面改札付近(改札内) / 千代田線 駅事務室付近(改札内),●, ,2023/1/15\n5923,28005,日比谷,東京メトロ千代田線,C09,C,09,,,●,,駅事務室付近(改札外),●, ,2023/1/21\n5922,28005,二重橋前,東京メトロ千代田線,C10,C,10,,,●,,駅事務室付近(改札外),●, ,2023/1/21\n5921,28005,大手町,東京メトロ千代田線,C11,C,11,,,●,,東西線 駅事務室付近(改札外) / 半蔵門線 駅事務室付近(改札外),●, ,2023/1/21\n5920,28005,新御茶ノ水,東京メトロ千代田線,C12,C,12,新御茶ノ水 駅事務室付近(改札外),,,,駅事務室付近(改札外),, ,\n5919,28005,湯島,東京メトロ千代田線,C13,C,13,湯島 駅事務室付近(改札外),,,,駅事務室付近(改札外),, ,\n5918,28005,根津,東京メトロ千代田線,C14,C,14,,,●,,根津交差点方面改札付近(改札内),●, ,2023/2/25\n5917,28005,千駄木,東京メトロ千代田線,C15,C,15,千駄木 団子坂方面改札付近(改札外),,,,団子坂方面改札付近(改札外),, ,\n5916,28005,西日暮里,東京メトロ千代田線,C16,C,16,,,●,,道灌山方面改札付近(改札内),●, ,2023/2/25\n5915,28005,町屋,東京メトロ千代田線,C17,C,17,,,●,,町屋方面改札(改札外),●, ,2023/2/25\n5914,28005,北千住,東京メトロ千代田線,C18,C,18,,,●,,千代田線 駅事務室付近(改札内),●, ,2023/1/22\n5913,28005,綾瀬,東京メトロ千代田線,C19,C,19,,,●,,駅事務室付近(改札内),●, ,2023/2/25\n5912,28005,北綾瀬,東京メトロ千代田線,C20,C,20,,,●,,中央改札付近(改札外),●, ,2023/2/25\n5932,28006,和光市,東京メトロ有楽町線,Y01,Y,01,,,●,,地下鉄成増駅 事務室付近(改札外),●, ,2023/1/3\n5933,28006,地下鉄成増,東京メトロ有楽町線,Y02,Y,02,,,●,,駅事務室付近(改札外),●, ,2023/1/3\n5934,28006,地下鉄赤塚,東京メトロ有楽町線,Y03,Y,03,,,●,,駅事務室付近(改札外),●, ,2023/1/3\n5935,28006,平和台,東京メトロ有楽町線,Y04,Y,04,,,●,,駅事務室付近(改札外),●, ,2023/1/3\n5936,28006,氷川台,東京メトロ有楽町線,Y05,Y,05,,,●,,2番出口付近(改札外),●, ,2023/1/3\n5937,28006,小竹向原,東京メトロ有楽町線,Y06,Y,06,,,●,,4番出口付近(改札外),●, ,2023/1/3\n5938,28006,千川,東京メトロ有楽町線,Y07,Y,07,,,●,,駅事務室付近(改札外),●, ,2023/1/3\n5939,28006,要町,東京メトロ有楽町線,Y08,Y,08,,,●,,2番出口付近(改札外),●, ,2023/1/3\n5940,28006,池袋,東京メトロ有楽町線,Y09,Y,09,,,●,,西通路西改札付近(改札外) / 有楽町線 駅事務室付近(改札外),●, ,2023/1/3\n5941,28006,東池袋,東京メトロ有楽町線,Y10,Y,10,東池袋 駅事務室付近(改札外),,,,駅事務室付近(改札外),, ,\n5942,28006,護国寺,東京メトロ有楽町線,Y11,Y,11,護国寺 音羽方面改札付近(改札外),,,,音羽方面改札付近(改札外),, ,\n5943,28006,江戸川橋,東京メトロ有楽町線,Y12,Y,12,江戸川橋 駅事務室付近(改札外),,,,駅事務室付近(改札外),, ,\n5944,28006,飯田橋,東京メトロ有楽町線,Y13,Y,13,,,●,,飯田橋交差点方面改札付近(改札内) / 有楽町線・南北線駅事務室付近(改札外),●, ,2023/1/4\n5945,28006,市ケ谷,東京メトロ有楽町線,Y14,Y,14,,,●,,市谷田町方面改札付近(改札内),●, ,2023/1/12\n5946,28006,麹町,東京メトロ有楽町線,Y15,Y,15,,,●,,6番出口方面付近(改札外),●, ,2023/1/4\n5947,28006,永田町,東京メトロ有楽町線,Y16,Y,16,永田町 紀尾井町方面改札付近(改札内) 駅事務室付近(改札内),,,,紀尾井町方面改札付近(改札内) / 駅事務室付近(改札内),, ,\n5948,28006,桜田門,東京メトロ有楽町線,Y17,Y,17,,,●,,4番出口付近(改札外),●, ,2023/1/21\n5949,28006,有楽町,東京メトロ有楽町線,Y18,Y,18,,,●,,JR有楽町駅方面改札付近(改札外),●, ,2023/1/21\n5950,28006,銀座一丁目,東京メトロ有楽町線,Y19,Y,19,銀座一丁目 駅事務室付近(改札外),,,,駅事務室付近(改札外),, ,\n5951,28006,新富町,東京メトロ有楽町線,Y20,Y,20,新富町 5番出口付近(改札外),,,,5番出口付近(改札外),, ,\n5952,28006,月島,東京メトロ有楽町線,Y21,Y,21,月島 駅事務室付近(改札外),,,,駅事務室付近(改札外),, ,\n5953,28006,豊洲,東京メトロ有楽町線,Y22,Y,22,豊洲 駅事務室付近(改札内),,,,駅事務室付近(改札内),, ,\n5954,28006,辰巳,東京メトロ有楽町線,Y23,Y,23,辰巳 駅事務室付近(改札内),,,,駅事務室付近(改札内),, ,\n5955,28006,新木場,東京メトロ有楽町線,Y24,Y,24,新木場 駅事務室付近(改札内),,,,駅事務室付近(改札内),, ,\n5956,28008,渋谷,東京メトロ半蔵門線,Z01,Z,01,,,●,,銀座線 駅事務室付近(改札内),●, ,2023/1/21\n5957,28008,表参道,東京メトロ半蔵門線,Z02,Z,02,,,●,,青山通り方面改札付近(改札外),●, ,2023/1/21\n5958,28008,青山一丁目,東京メトロ半蔵門線,Z03,Z,03,,,●,,駅事務室付近(改札外),●, ,2023/1/21\n5959,28008,永田町,東京メトロ半蔵門線,Z04,Z,04,永田町 紀尾井町方面改札付近(改札内) 駅事務室付近(改札内),,,,紀尾井町方面改札付近(改札内) / 駅事務室付近(改札内),, ,\n5960,28008,半蔵門,東京メトロ半蔵門線,Z05,Z,05,,,●,,3番出口付近(改札外),●, ,2023/1/11\n5961,28008,九段下,東京メトロ半蔵門線,Z06,Z,06,九段下 駅事務室付近(改札外),,,,駅事務室付近(改札外),, ,\n5962,28008,神保町,東京メトロ半蔵門線,Z07,Z,07,神保町 専修大学方面改札付近(改札外),,,,専修大学方面改札付近(改札外),, ,\n5963,28008,大手町,東京メトロ半蔵門線,Z08,Z,08,,,●,,東西線 駅事務室付近(改札外) / 半蔵門線 駅事務室付近(改札外),●, ,2023/1/21\n5964,28008,三越前,東京メトロ半蔵門線,Z09,Z,09,,,●,,銀座線 駅事務室付近(改札外) / B5出口付近(改札外),●, ,2023/1/28\n5965,28008,水天宮前,東京メトロ半蔵門線,Z10,Z,10,,,●,,水天宮方面改札付近(改札外),●, ,2023/1/28\n5966,28008,清澄白河,東京メトロ半蔵門線,Z11,Z,11,,,●,,B1出口付近(改札外),●, ,2023/1/28\n5967,28008,住吉,東京メトロ半蔵門線,Z12,Z,12,,,●,,B1出口付近(改札外),●, ,2023/1/28\n5968,28008,錦糸町,東京メトロ半蔵門線,Z13,Z,13,,,●,,定期券うりば付近(改札外),●, ,2023/1/28\n5969,28008,押上〈スカイツリー前〉,東京メトロ半蔵門線,Z14,Z,14,,,●,,業平方面改札付近(改札外),●, ,2023/1/28\n5988,28009,目黒,東京メトロ南北線,N01,N,01,目黒 白金台駅 事務室付近(改札外),,,,白金台駅 事務室付近(改札外),, ,\n5987,28009,白金台,東京メトロ南北線,N02,N,02,白金台 駅事務室付近(改札外),,,,駅事務室付近(改札外),, ,\n5986,28009,白金高輪,東京メトロ南北線,N03,N,03,白金高輪 駅事務室付近(改札外),,,,駅事務室付近(改札外),, ,\n5985,28009,麻布十番,東京メトロ南北線,N04,N,04,麻布十番 駅事務室付近(改札外),,,,駅事務室付近(改札外),, ,\n5984,28009,六本木一丁目,東京メトロ南北線,N05,N,05,,,●,,3番出口方面付近(改札外),●, ,2023/1/21\n5983,28009,溜池山王,東京メトロ南北線,N06,N,06,,,●,,駅事務室付近(改札内),●, ,2023/1/21\n5982,28009,永田町,東京メトロ南北線,N07,N,07,永田町 紀尾井町方面改札付近(改札内) 駅事務室付近(改札内),,,,紀尾井町方面改札付近(改札内) / 駅事務室付近(改札内),, ,\n5981,28009,四ツ谷,東京メトロ南北線,N08,N,08,四ツ谷 赤坂方面改札付近(改札内) 南北線 駅事務室付近(改札内),,,,赤坂方面改札付近(改札内) / 南北線 駅事務室付近(改札内),, ,\n5980,28009,市ケ谷,東京メトロ南北線,N09,N,09,,,●,,市谷田町方面改札付近(改札内),●, ,2023/1/12\n5979,28009,飯田橋,東京メトロ南北線,N10,N,10,,,●,,飯田橋交差点方面改札付近(改札内) / 有楽町線・南北線駅事務室付近(改札外),●, ,2023/1/4\n5978,28009,後楽園,東京メトロ南北線,N11,N,11,後楽園 南北線 駅事務室付近(改札外),,,,南北線 駅事務室付近(改札外),, ,\n5977,28009,東大前,東京メトロ南北線,N12,N,12,東大前 駅事務室付近(改札外),,,,駅事務室付近(改札外),, ,\n5976,28009,本駒込,東京メトロ南北線,N13,N,13,本駒込 駅事務室付近(改札外),,,,駅事務室付近(改札外),, ,\n5975,28009,駒込,東京メトロ南北線,N14,N,14,駒込 駅事務室付近(改札外),,,,駅事務室付近(改札外),, ,\n5974,28009,西ケ原,東京メトロ南北線,N15,N,15,西ケ原 駅事務室付近(改札外),,,,駅事務室付近(改札外),, ,\n5973,28009,王子,東京メトロ南北線,N16,N,16,王子 駅事務室付近(改札外),,,,駅事務室付近(改札外),, ,\n5972,28009,王子神谷,東京メトロ南北線,N17,N,17,王子神谷 駅事務室付近(改札内),,,,駅事務室付近(改札内),, ,\n5971,28009,志茂,東京メトロ南北線,N18,N,18,志茂 1番出口付近(改札外),,,,1番出口付近(改札外),, ,\n5970,28009,赤羽岩淵,東京メトロ南北線,N19,N,19,赤羽岩淵 駅事務室付近(改札内),,,,駅事務室付近(改札内),, ,\n5989,28010,和光市,東京メトロ副都心線,F01,F,01,,,●,,地下鉄成増駅 事務室付近(改札外),●, ,2023/1/3\n5990,28010,地下鉄成増,東京メトロ副都心線,F02,F,02,,,●,,駅事務室付近(改札外),●, ,2023/1/3\n5991,28010,地下鉄赤塚,東京メトロ副都心線,F03,F,03,,,●,,駅事務室付近(改札外),●, ,2023/1/3\n5992,28010,平和台,東京メトロ副都心線,F04,F,04,,,●,,駅事務室付近(改札外),●, ,2023/1/3\n5993,28010,氷川台,東京メトロ副都心線,F05,F,05,,,●,,2番出口付近(改札外),●, ,2023/1/3\n5994,28010,小竹向原,東京メトロ副都心線,F06,F,06,,,●,,4番出口付近(改札外),●, ,2023/1/3\n5995,28010,千川,東京メトロ副都心線,F07,F,07,,,●,,駅事務室付近(改札外),●, ,2023/1/3\n5996,28010,要町,東京メトロ副都心線,F08,F,08,,,●,,2番出口付近(改札外),●, ,2023/1/3\n5997,28010,池袋,東京メトロ副都心線,F09,F,09,,,●,,西通路西改札付近(改札外) / 有楽町線 駅事務室付近(改札外),●, ,2023/1/3\n5998,28010,雑司が谷,東京メトロ副都心線,F10,F,10,雑司が谷 2番出口方面付近(改札外),,,,2番出口方面付近(改札外),, ,\n5999,28010,西早稲田,東京メトロ副都心線,F11,F,11,西早稲田 早大理工方面改札付近(改札外),,,,早大理工方面改札付近(改札外),, ,\n6000,28010,東新宿,東京メトロ副都心線,F12,F,12,東新宿 駅事務室付近(改札外),,,,駅事務室付近(改札外),, ,\n6001,28010,新宿三丁目,東京メトロ副都心線,F13,F,13,新宿三丁目 丸ノ内線 駅事務室付近(改札外) E5出口付近(改札外),,,,丸ノ内線 駅事務室付近(改札外) / E5出口付近(改札外),, ,\n6002,28010,北参道,東京メトロ副都心線,F14,F,14,北参道 改札付近(改札外),,,,改札付近(改札外),, ,\n6003,28010,明治神宮前〈原宿〉,東京メトロ副都心線,F15,F,15,,,●,,千代田線 駅事務室付近(改札外),●, ,2023/1/21\n6004,28010,渋谷,東京メトロ副都心線,F16,F,16,,,●,,銀座線 駅事務室付近(改札内),●, ,2023/1/21\n\n \";\n\n\n DB::table('t_station_stamp')->delete();\n\n\n $ex_str = explode(\"\\n\", $str);\n\n foreach ($ex_str as $v) {\n\n\n if (trim($v) == \"\") {\n continue;\n }\n\n\n $ex_v = explode(\",\", trim($v));\n $insert = [\n \"station_code\" => trim($ex_v[0]),\n \"train_code\" => trim($ex_v[1]),\n \"image_folder\" => trim($ex_v[5]),\n \"image_code\" => trim($ex_v[6]),\n \"poster_position\" => trim($ex_v[11]),\n \"stamp_get_date\" => (trim($ex_v[14]) == '') ? '' : date($ex_v[14]),\n\n \"station_name\" => trim($ex_v[2]),\n \"train_name\" => trim($ex_v[3]),\n ];\n DB::table('t_station_stamp')->insert($insert);\n }\n\n\n }", "public function comics_dcp()\n\t{\n\t\tif (preg_match('/\\d{4}\\.(\\d{2}\\.){2} - \"(.+?)\\.cb[rz]\" yEnc$/i', $this->subject, $match)) {\n\t\t\treturn array('cleansubject' => $match[2], 'properlynamed' => false);\n\t\t}\n\t\t//Re: Req: Dark Tower - The Battle of Jericho Hill 05 (of 05) TIA - File 1 of 1 - yEnc\n\t\tif (preg_match('/(Req?: )+(.+?) - File \\d+ of \\d+ - yEnc$/i', $this->subject, $match)) {\n\t\t\treturn array('cleansubject' => $match[2], 'properlynamed' => false);\n\t\t}\n\t\t//Amazing Spider-man 306 || FB-DCP scan || 1988 || - \"Amazing Spider-man 306 (1988)(FB-DCP)(C2C).CBR\" [3/7] yEnc\n\t\tif (preg_match('/\\|\\| \\d{4} \\|\\| - \"(.+?)\\.cb[rz]\" \\[\\d+\\/\\d+\\] yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn array('cleansubject' => $match[1], 'properlynamed' => false);\n\t\t}\n\t\t//All-Star Squadron Preview 00 (1981) [HQ rescan] [1/5] - All-Star Squadron Preview 00 (Aug 1981) [HQ rescan] [RexTyler].cbr yEnc\n\t\t//Mad Color Classics (1st time as true CBR) - [1/1] Mad Color Classics 04 {FIXED} (c2c) [True CBR by RexTyler].cbr yEnc\n\t\t//Comico Christmas Special (1988) - [1/5] Comico Christmas Special (1988) [starv].cbr.par2 yEnc\n\t\tif (preg_match('/\\s+\\[\\d+\\/\\d+\\]\\s+(-\\s+)?([A-Z0-9].+?)(\\[.*?(starv|RexTyler).*?\\])?\\.cb[rz](\\.par2)?\\s+yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn array('cleansubject' => $match[2], 'properlynamed' => false);\n\t\t}\n\t\t//0-Day 2013.8.28 - \"Ultimate Comics Spider-Man 026 (2013) complete/unbroken - File 1 of 1 - Ultimate Comics Spider-Man 026 (2013) (Digital) (Zone-Empire).cbr yEnc\n\t\t//Ultimate Comics Spider-Man 026 - File 1 of 1 - Ultimate Comics Spider-Man 026 (2013) (Digital) (Zone-Empire).rar yEnc\n\t\tif (preg_match('/\\s+-\\s+File \\d+ of \\d+\\s+-\\s+([A-Z0-9].+?)\\.(cb[rz]|rar)\\s+yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn array('cleansubject' => $match[1], 'properlynamed' => false);\n\t\t}\n\t\t//Grimm Fairy Tales Myths & Legends 12 - File 1 of 1 - yEnc\n\t\tif (preg_match('/^([a-z0-9].+?)\\s+-\\s+File \\d+ of \\d+\\s+-\\s+yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn array('cleansubject' => $match[1], 'properlynamed' => false);\n\t\t}\n\t\t// Return anything between the quotes.\n\t\tif (preg_match('/.*\"(.+?)(\\.part\\d*|\\.rar)?(\\.vol.+?\"|\\.[A-Za-z0-9]{2,4}\").+?yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\tif (strlen($match[1]) > 7 && !preg_match('/\\.vol.+/', $match[1])) {\n\t\t\t\treturn array('cleansubject' => $match[1], 'properlynamed' => false);\n\t\t\t} else {\n\t\t\t\treturn array(\n\t\t\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject),\n\t\t\t\t\t\"properlynamed\" => false\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn array(\n\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject), \"properlynamed\" => false\n\t\t);\n\t}", "function qualificationServ(): string\n{\n $FtPqr = getFtPqr();\n $FtPqrCalificacion = $FtPqr->getLastCalificacion();\n\n return $FtPqrCalificacion ? $FtPqrCalificacion->getFieldValue('experiencia_servicio') : '-';\n}", "public function get_title()\r\n {\r\n return esc_html__('Portfolio Grid: 02', 'aapside-master');\r\n }", "public function view(w2p_Core_CAppUI $AppUI) {\r\n $perms = $this->AppUI->acl();\r\n\r\n $output = '';\r\n $data = $this->scrubbedData;\r\n\r\n $reader = simplexml_load_string($data);\r\n\r\n $project_name = $reader->proj->summary['Title'];\r\n if (empty($project_name)) {\r\n $project_name=$this->proName;\r\n\t\t}\r\n\r\n $output .= '\r\n\t\t\t<table width=\"100%\">\r\n\t\t\t<tr>\r\n\t\t\t<td align=\"right\">' . $this->AppUI->_('Company Name') . ':</td>';\r\n\r\n\t\t$projectClass = new CProject();\r\n\t\t$output .= $this->_createCompanySelection($this->AppUI, $tree['COMPANY']);\r\n\t\t$output .= $this->_createProjectSelection($this->AppUI, $project_name);\r\n\r\n\t\t$users = $perms->getPermittedUsers('projects');\r\n\t\t$output .= '<tr><td align=\"right\">' . $this->AppUI->_('Project Owner') . ':</td><td>';\r\n\t\t$output .= arraySelect( $users, 'project_owner', 'size=\"1\" style=\"width:200px;\" class=\"text\"', $this->AppUI->user_id );\r\n\t\t$output .= '<td/></tr>';\r\n\r\n\t\t$pstatus = w2PgetSysVal( 'ProjectStatus' );\r\n\t\t$output .= '<tr><td align=\"right\">' . $this->AppUI->_('Project Status') . ':</td><td>';\r\n\t\t$output .= arraySelect( $pstatus, 'project_status', 'size=\"1\" class=\"text\"', $row->project_status, true );\r\n\t\t$output .= '<td/></tr>';\r\n\r\n\t\t$startDate = $this->_formatDate($this->AppUI, $reader->proj->summary['Start']);\r\n\t\t$endDate = $this->_formatDate($this->AppUI, $reader->proj->summary['Finish']);\r\n\r\n\t\t$output .= '\r\n <tr>\r\n <td align=\"right\">' . $this->AppUI->_('Start Date') . ':</td>\r\n <td>\r\n\t\t\t\t\t<input type=\"hidden\" name=\"project_start_date\" value=\"'.$startDate.'\" class=\"text\" />\r\n\t\t\t\t\t<input type=\"text\" name=\"start_date\" value=\"'.$reader->proj->summary['Start'].'\" class=\"text\" />\r\n\t\t\t\t</td>\r\n </tr>\r\n <tr>\r\n <td align=\"right\">' . $this->AppUI->_('End Date') . ':</td>\r\n <td>\r\n\t\t\t\t\t<input type=\"hidden\" name=\"project_end_date\" value=\"'.$endDate.'\" class=\"text\" />\r\n\t\t\t\t\t<input type=\"text\" name=\"end_date\" value=\"'.$reader->proj->summary['Finish'].'\" class=\"text\" />\r\n\t\t\t\t</td>\r\n </tr><!--\r\n <tr>\r\n <td align=\"right\">' . $this->AppUI->_('Do Not Import Users') . ':</td>\r\n <td><input type=\"checkbox\" name=\"nouserimport\" value=\"true\" onclick=\"ToggleUserFields()\" /></td>\r\n </tr>\r\n <tr>\r\n <td colspan=\"2\">' . $this->AppUI->_('Users') . ':</td>\r\n </tr>\r\n <tr>\r\n <td colspan=\"2\"><div name=\"userRelated\"><br /><em>'.$this->AppUI->_('userinfo').'</em></td>\r\n\t\t\t</tr>-->\r\n\t\t\t<tr>\r\n\t\t\t\t<td colspan=\"2\"><table>';\r\n\r\n $percent = array(0 => '0', 5 => '5', 10 => '10', 15 => '15', 20 => '20', 25 => '25', 30 => '30', 35 => '35', 40 => '40', 45 => '45', 50 => '50', 55 => '55', 60 => '60', 65 => '65', 70 => '70', 75 => '75', 80 => '80', 85 => '85', 90 => '90', 95 => '95', 100 => '100');\r\n\r\n\t\t// Users (Resources)\r\n\t\t$workers = $perms->getPermittedUsers('tasks');\r\n $resources = array(0 => '');\r\n\r\n\t\t$q = new w2p_Database_Query();\r\n if ($this->user_control) {\t\t//check the existence of resources before trying to import\r\n $trabalhadores=$reader->proj->resources->children();\r\n foreach($trabalhadores as $r) {\r\n $q->clear();\r\n $q->addQuery('user_id');\r\n $q->addTable('users');\r\n $q->leftJoin('contacts', 'c', 'user_contact = contact_id');\r\n $q->addWhere(\"user_username LIKE '{$r['name']}' OR CONCAT_WS(contact_first_name, ' ', contact_last_name) = '{$r['name']}'\");\r\n $r['LID'] = $q->loadResult();\r\n if (!empty($r['name'])) {\r\n $output .= '\r\n\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td>' . $this->AppUI->_('User name') . ': </td>\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t<input type=\"text\" name=\"users[' . $r['uid'] . '][user_username]\" value=\"' . ucwords(strtolower($r['name'])) . '\"' . (empty($r['LID'])?'':' readonly') . ' />\r\n\t\t\t\t\t\t<input type=\"hidden\" name=\"users[' . $r['uid'] . '][user_id]\" value=\"' . $r['LID'] . '\" />\r\n\t\t\t\t\t\t(' . $this->AppUI->_('Resource UID').\": \".$r['uid'] . ')';\r\n\r\n if (function_exists('w2PUTF8strlen')) {\r\n if (w2PUTF8strlen($r['name']) < w2PgetConfig('username_min_len')) {\r\n $output .= ' <em>' . $this->AppUI->_('username_min_len.') . '</em>';\r\n }\r\n } else {\r\n if (strlen($r['name']) < w2PgetConfig('username_min_len')) {\r\n $output .= ' <em>' . $this->AppUI->_('username_min_len.') . '</em>';\r\n }\r\n }\r\n $output .= '</td></tr>';\r\n $resources[sizeof($resources)] = strtolower($r['name']);\r\n }\r\n }\r\n }\r\n\t\t$resources = arrayMerge($resources, $workers);\r\n\r\n $output .= '\r\n </table>\r\n </div></td></tr>';\r\n\r\n\t\t// Insert Tasks\r\n $output .= '\r\n <tr>\r\n <td colspan=\"2\">' . $this->AppUI->_('Tasks') . ':</td>\r\n </tr>\r\n <tr>\r\n <td colspan=\"2\">\r\n <table width=\"100%\" class=\"tbl\" cellspacing=\"1\" cellpadding=\"2\" border=\"0\">\r\n <tr>\r\n <th>' . $this->AppUI->_('Name') . '</th>\r\n <th>' . $this->AppUI->_('Start Date') . '</th>\r\n <th>' . $this->AppUI->_('End Date') . '</th>\r\n <th>' . $this->AppUI->_('Assigned Users') . '</th>\r\n </tr>';\r\n\r\n foreach($reader->proj->tasks->children() as $task) {\r\n if (trim($task['Name']) != '') {\r\n $k = $task['ID'];\r\n\t\t\t\t$newWBS = $this->montar_wbs($task['OutlineLevel']);\r\n $note= htmlentities($task['NOTES']);\r\n $output .= '<tr><td>';\r\n $output .= '<input type=\"hidden\" name=\"tasks['.$k.'][UID]\" value=\"' . $k . '\" />';\r\n $output .= '<input type=\"hidden\" name=\"tasks['.$k.'][OUTLINENUMBER]\" value=\"' . $newWBS . '\" />';\r\n $output .= '<input type=\"hidden\" name=\"tasks['.$k.'][task_name]\" value=\"' . $task['Name'] . '\" />';\r\n $output .= '<input type=\"hidden\" name=\"tasks['.$k.'][task_description]\" value=\"' . $note . '\" />';\r\n\r\n $priority = 0;\r\n $output .= '<input type=\"hidden\" name=\"tasks['.$k.'][task_priority]\" value=\"' . $priority . '\" />';\r\n $output .= '<input type=\"hidden\" name=\"tasks['.$k.'][task_start_date]\" value=\"' . $task['Start'] . '\" />';\r\n $output .= '<input type=\"hidden\" name=\"tasks['.$k.'][task_end_date]\" value=\"' . $task['Finish'] . '\" />';\r\n\r\n $myDuration = $this->dur($task['Duration']);\r\n\t\t\t\t$output .= '<input type=\"hidden\" name=\"tasks['.$k.'][task_duration]\" value=\"' . $myDuration . '\" />';\r\n\t\t\t\t$output .= '<input type=\"hidden\" name=\"tasks['.$k.'][task_duration_type]\" value=\"1\" />';\r\n\r\n $percentComplete = isset($task['PercentComplete']) ? $task['PercentComplete'] : 0;\r\n $output .= '<input type=\"hidden\" name=\"tasks['.$k.'][task_percent_complete]\" value=\"' . $percentComplete . '\" />';\r\n $output .= '<input type=\"hidden\" name=\"tasks['.$k.'][task_owner]\" value=\"'.$this->AppUI->user_id.'\" />';\r\n $output .= '<input type=\"hidden\" name=\"tasks['.$k.'][task_type]\" value=\"0\" />';\r\n\r\n $milestone = ($task['Milestone'] == 'yes') ? 1 : 0;\r\n $output .= '<input type=\"hidden\" name=\"tasks['.$k.'][task_milestone]\" value=\"' . $milestone . '\" />';\r\n\r\n $temp = 0;\r\n if (!empty($task['UniqueIDPredecessors'])) {\r\n $x=strpos($task['UniqueIDPredecessors'],\",\");\r\n foreach ($task['UniqueIDPredecessors'] as $dependency) {\r\n $output .= '<input type=\"hidden\" name=\"tasks['.$k.'][dependencies][]\" value=\"' . $dependency['UniqueIDPredecessors'] . '\" />';\r\n ++$temp;\r\n }\r\n }\r\n\r\n $tasklevel = (int) $task['OutlineLevel'];\r\n\t\t\t\tif ($tasklevel) {\r\n\t\t\t\t\tfor($i = 0; $i < $tasklevel; $i++) {\r\n\t\t\t\t\t\t$output .= '&nbsp;&nbsp;';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$output .= '<img src=\"' . w2PfindImage('corner-dots.gif') . '\" border=\"0\" />&nbsp;';\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$output .= $task['Name'];\r\n\r\n if ($milestone) {\r\n $output .= '<img src=\"' . w2PfindImage('icons/milestone.gif', $m) . '\" border=\"0\" />';\r\n }\r\n//TODO: the formatting for the dates should be better\r\n $output .= '</td>\r\n\t\t\t\t\t\t\t<td class=\"center\">'.$task['Start'].'</td>\r\n\t\t\t\t\t\t\t<td class=\"center\">'.$task['Finish'].'</td>\r\n\t\t\t\t\t\t\t<td class=\"center\">';\r\n\r\n //This is a bizarre function i've made to associate the resources with their tasks\r\n //If there's only one resource associate to a task, it skip the while. If there's more than one\r\n //the loop take care of it until the last resource\r\n //strange but it works, that's my moto.\r\n if (!empty($task['Resources'])) {\r\n $x=0;\r\n $y=strpos($task['Resources'],';');\r\n while (!empty($y)) {\r\n $recurso=substr($task['Resources'],$x,($y-$x));\r\n\t\t\t\t\t\t$output .= '<div name=\"userRelated\">';\r\n $output.= arraySelect($resources, 'tasks['.$k.'][resources][]', 'size=\"1\" class=\"text\"', $recurso);\r\n\t\t\t\t\t\t$output .= '&nbsp;';\r\n\t\t\t\t\t\t$output .= arraySelect($percent, 'tasks['.$k.'][resources_alloc][]', 'size=\"1\" class=\"text\"', 100) . '%';\r\n\t\t\t\t\t\t$output .= '</div>';\r\n $x=$y+1;\r\n $y=strpos($task['Resources'],';',$x);\r\n }\r\n } else {\r\n\t\t\t\t\t$output .= '<div name=\"userRelated\">';\r\n\t\t\t\t\t$output.= arraySelect($resources, 'tasks['.$k.'][resources][]', 'size=\"1\" class=\"text\"', $recurso);\r\n\t\t\t\t\t$output .= '&nbsp;';\r\n\t\t\t\t\t$output .= arraySelect($percent, 'tasks['.$k.'][resources_alloc][]', 'size=\"1\" class=\"text\"', 100) . '%';\r\n\t\t\t\t\t$output .= '</div>';\r\n\t\t\t\t}\r\n $output .= '</td></tr>';\r\n }\r\n }\r\n $output .= '</table></td></tr>';\r\n\r\n $output .= '</table>';\r\n return $output;\r\n }", "public function get_project_all(){\n }", "function i18n() {\n\tload_theme_textdomain( 'project', Project_PATH . '/languages' );\n }", "public function show()\n {\n $service = Config::get(\"ProjectLister::service\");\n $method = \"fetch_$service\";\n // Fetch\n $projects = self::$method();\n // Sort the list\n $projects = Project::sort( $projects );\n\n $output = '';\n foreach($projects as $project)\n {\n $template = ( Config::get(\"ProjectLister::template\") ) ? Config::get(\"ProjectLister::template\") : Project::getProjectTemplate();\n\n $template = str_replace('{{PROJECT_URL}}', $project->url, $template);\n $template = str_replace('{{PROJECT_NAME}}', htmlentities($project->name), $template);\n $template = str_replace('{{PROJECT_WATCHER_COUNT}}', $project->watchers, $template);\n $template = str_replace('{{PROJECT_DESCRIPTION}}', htmlentities($project->description), $template);\n $template = str_replace('{{PROJECT_SOURCE}}', $project->source, $template);\n $template = str_replace('{{PROJECT_WATCHER_NOUN}}', $project->watcher_noun, $template);\n\n $output .= $template . \"\\n\";\n }\n return $output;\n }", "function getProjectName($lm_id){\n if (empty($lm_id)){\n $reply = array(0,'?');\n }else{\n $m = $this->getMember($lm_id);\n $reply = array($m['lm_value'],$m['lm_key']);\n }\n //b_debug::print_r($reply);\n return $reply;\n }", "public function mojo()\n\t{\n\t\tif (preg_match('/^\\[\\d+\\/\\d+\\] - \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e0 .\n\t\t\t\t\t ' - \\d+[,.]\\d+ [mMkKgG][bB] - yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\treturn array(\n\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject), \"properlynamed\" => false\n\t\t);\n\t}", "static function name(): string { return 'Archival website'; }", "public function run()\n {\n \n $provinces = array(\n array('01','01', 'Chachapoyas'),\n array('01','02', 'Bagua'),\n array('01','03', 'Bongará'),\n array('01','04', 'Condorcanqui'),\n array('01','05', 'Luya'),\n array('01','06', 'Rodríguez de Mendoza'),\n array('01','07', 'Utcubamba'),\n array('02','01', 'Huaraz'),\n array('02','02', 'Aija'),\n array('02','03', 'Antonio Raymondi'),\n array('02','04', 'Asunción'),\n array('02','05', 'Bolognesi'),\n array('02','06', 'Carhuaz'),\n array('02','07', 'Carlos Fermín Fitzcarrald'),\n array('02','08', 'Casma'),\n array('02','09', 'Corongo'),\n array('02','10', 'Huari'),\n array('02','11', 'Huarmey'),\n array('02','12', 'Huaylas'),\n array('02','13', 'Mariscal Luzuriaga'),\n array('02','14', 'Ocros'),\n array('02','15', 'Pallasca'),\n array('02','16', 'Pomabamba'),\n array('02','17', 'Recuay'),\n array('02','18', 'Santa'),\n array('02','19', 'Sihuas'),\n array('02','20', 'Yungay'),\n array('03','01', 'Abancay'),\n array('03','02', 'Andahuaylas'),\n array('03','03', 'Antabamba'),\n array('03','04', 'Aymaraes'),\n array('03','05', 'Cotabambas'),\n array('03','06', 'Chincheros'),\n array('03','07', 'Grau'),\n array('04','01', 'Arequipa'),\n array('04','02', 'Camaná'),\n array('04','03', 'Caravelí'),\n array('04','04', 'Castilla'),\n array('04','05', 'Caylloma'),\n array('04','06', 'Condesuyos'),\n array('04','07', 'Islay'),\n array('04','08', 'La Uniòn'),\n array('05','01', 'Huamanga'),\n array('05','02', 'Cangallo'),\n array('05','03', 'Huanca Sancos'),\n array('05','04', 'Huanta'),\n array('05','05', 'La Mar'),\n array('05','06', 'Lucanas'),\n array('05','07', 'Parinacochas'),\n array('05','08', 'Pàucar del Sara Sara'),\n array('05','09', 'Sucre'),\n array('05','10', 'Víctor Fajardo'),\n array('05','11', 'Vilcas Huamán'),\n array('06','01', 'Cajamarca'),\n array('06','02', 'Cajabamba'),\n array('06','03', 'Celendín'),\n array('06','04', 'Chota'),\n array('06','05', 'Contumazá'),\n array('06','06', 'Cutervo'),\n array('06','07', 'Hualgayoc'),\n array('06','08', 'Jaén'),\n array('06','09', 'San Ignacio'),\n array('06','10', 'San Marcos'),\n array('06','11', 'San Miguel'),\n array('06','12', 'San Pablo'),\n array('06','13', 'Santa Cruz'),\n array('07','01', 'Prov. Const. del Callao'),\n array('08','01', 'Cusco'),\n array('08','02', 'Acomayo'),\n array('08','03', 'Anta'),\n array('08','04', 'Calca'),\n array('08','05', 'Canas'),\n array('08','06', 'Canchis'),\n array('08','07', 'Chumbivilcas'),\n array('08','08', 'Espinar'),\n array('08','09', 'La Convención'),\n array('08','10', 'Paruro'),\n array('08','11', 'Paucartambo'),\n array('08','12', 'Quispicanchi'),\n array('08','13', 'Urubamba'),\n array('09','01', 'Huancavelica'),\n array('09','02', 'Acobamba'),\n array('09','03', 'Angaraes'),\n array('09','04', 'Castrovirreyna'),\n array('09','05', 'Churcampa'),\n array('09','06', 'Huaytará'),\n array('09','07', 'Tayacaja'),\n array('10','01', 'Huánuco'),\n array('10','02', 'Ambo'),\n array('10','03', 'Dos de Mayo'),\n array('10','04', 'Huacaybamba'),\n array('10','05', 'Huamalíes'),\n array('10','06', 'Leoncio Prado'),\n array('10','07', 'Marañón'),\n array('10','08', 'Pachitea'),\n array('10','09', 'Puerto Inca'),\n array('10','10', 'Lauricocha '),\n array('10','11', 'Yarowilca '),\n array('11','01', 'Ica '),\n array('11','02', 'Chincha '),\n array('11','03', 'Nasca '),\n array('11','04', 'Palpa '),\n array('11','05', 'Pisco '),\n array('12','01', 'Huancayo '),\n array('12','02', 'Concepción '),\n array('12','03', 'Chanchamayo '),\n array('12','04', 'Jauja '),\n array('12','05', 'Junín '),\n array('12','06', 'Satipo '),\n array('12','07', 'Tarma '),\n array('12','08', 'Yauli '),\n array('12','09', 'Chupaca '),\n array('13','01', 'Trujillo '),\n array('13','02', 'Ascope '),\n array('13','03', 'Bolívar '),\n array('13','04', 'Chepén '),\n array('13','05', 'Julcán '),\n array('13','06', 'Otuzco '),\n array('13','07', 'Pacasmayo '),\n array('13','08', 'Pataz '),\n array('13','09', 'Sánchez Carrión '),\n array('13','10', 'Santiago de Chuco '),\n array('13','11', 'Gran Chimú '),\n array('13','12', 'Virú '),\n array('14','01', 'Chiclayo '),\n array('14','02', 'Ferreñafe '),\n array('14','03', 'Lambayeque '),\n array('15','01', 'Lima '),\n array('15','02', 'Barranca '),\n array('15','03', 'Cajatambo '),\n array('15','04', 'Canta '),\n array('15','05', 'Cañete '),\n array('15','06', 'Huaral '),\n array('15','07', 'Huarochirí '),\n array('15','08', 'Huaura '),\n array('15','09', 'Oyón '),\n array('15','10', 'Yauyos '),\n array('16','01', 'Maynas '),\n array('16','02', 'Alto Amazonas '),\n array('16','03', 'Loreto '),\n array('16','04', 'Mariscal Ramón Castilla '),\n array('16','05', 'Requena '),\n array('16','06', 'Ucayali '),\n array('16','07', 'Datem del Marañón '),\n array('16','08', 'Putumayo'),\n array('17','01', 'Tambopata '),\n array('17','02', 'Manu '),\n array('17','03', 'Tahuamanu '),\n array('18','01', 'Mariscal Nieto '),\n array('18','02', 'General Sánchez Cerro '),\n array('18','03', 'Ilo '),\n array('19','01', 'Pasco '),\n array('19','02', 'Daniel Alcides Carrión '),\n array('19','03', 'Oxapampa '),\n array('20','01', 'Piura '),\n array('20','02', 'Ayabaca '),\n array('20','03', 'Huancabamba '),\n array('20','04', 'Morropón '),\n array('20','05', 'Paita '),\n array('20','06', 'Sullana '),\n array('20','07', 'Talara '),\n array('20','08', 'Sechura '),\n array('21','01', 'Puno '),\n array('21','02', 'Azángaro '),\n array('21','03', 'Carabaya '),\n array('21','04', 'Chucuito '),\n array('21','05', 'El Collao '),\n array('21','06', 'Huancané '),\n array('21','07', 'Lampa '),\n array('21','08', 'Melgar '),\n array('21','09', 'Moho '),\n array('21','10', 'San Antonio de Putina '),\n array('21','11', 'San Román '),\n array('21','12', 'Sandia '),\n array('21','13', 'Yunguyo '),\n array('22','01', 'Moyobamba '),\n array('22','02', 'Bellavista '),\n array('22','03', 'El Dorado '),\n array('22','04', 'Huallaga '),\n array('22','05', 'Lamas '),\n array('22','06', 'Mariscal Cáceres '),\n array('22','07', 'Picota '),\n array('22','08', 'Rioja '),\n array('22','09', 'San Martín '),\n array('22','10', 'Tocache '),\n array('23','01', 'Tacna '),\n array('23','02', 'Candarave '),\n array('23','03', 'Jorge Basadre '),\n array('23','04', 'Tarata '),\n array('24','01', 'Tumbes '),\n array('24','02', 'Contralmirante Villar '),\n array('24','03', 'Zarumilla '),\n array('25','01', 'Coronel Portillo '),\n array('25','02', 'Atalaya '),\n array('25','03', 'Padre Abad '),\n array('25','04', 'Purús'), \n );\n \n \n for ($i=0; $i < count($provinces) ; $i++) { \n DB::table('provinces')->insert([\n 'region' =>$provinces[$i][0],\n 'code' => $provinces[$i][1],\n 'name' => $provinces[$i][2]\n ]); \n }\n\n\n }", "function _survey_cygnal_script_build_file($datos){\n\t\t#$path = drupal_get_path('module', 'survey_cygnal');\n\t\t#require_once $path.\"/includes/survey_cygnal.word.inc\";\n\t\t\n\t\t$data=$datos;\n\t\t/*$data = array();\n\t\t$data['node']['logo_cygnal'] \t\t= $path.\"/theme/img/logo_cygnal_transparent.png\";\n\t\t$data['node']['logo_custamer'] \t\t= $path.\"/theme/img/logos/logo_empresa.png\";\n\t\t$data['node']['text_header'] \t\t= \"Cygnal Pulse Survey Platform\";\n\n\t\t$data['node']['show_text_header'] \t= 1; // 0:No 1:Si\n\n\t\t$data['node']['text_zone'] \t\t\t= \"Florida Statewide\";\n\t\t$data['node']['text_client'] \t\t= \"Frontline Strategies\";\n\t\t$data['node']['text_status'] \t\t= \"- APROVED -\";\n\t\t$data['node']['text_project_id'] \t= \"171229L-FLS-FL\";\n\t\t$data['node']['text_title'] \t\t= \"Survey of Likely General Election Voters\";\n\t\t$data['node']['text_date'] \t\t\t= $fecha;\n\t\t$data['node']['text_intro'] \t\t= \"Hi. I’m _________________ with Seminole [SIM-uh-nole] Research. We are conducting an issue survey in Florida today and need your help. Your confidential responses will play an important role in the legislative process.\";\n\t\t\n\t\t# ---------------------------------------------------------------------------\n\t\t# PREGUNTA 1\n\t\t$data['node']['questions'][] = array(\n\t\t\t'question_type' \t=> '2',\t\n\t\t\t'question_head' \t=> array(),\n\t\t\t'question' \t\t\t=> 'How likely are you to vote in the 2018 General Election for Senate, Congress, Governor, state legislature, and local offices next November?',\n\t\t\t'answer_head' \t\t=> array(),\n\t\t\t'answers' => array(\n\t\t\t\t'a' => array(\n\t\t\t\t\t'answer_text' => 'Definitely voting', \n\t\t\t\t\t'answer_info' => ''\n\t\t\t\t),\n\t\t\t\t'b' => array(\n\t\t\t\t\t'answer_text' => 'Probably voting',\n\t\t\t\t\t'answer_info' => ''\n\t\t\t\t),\n\t\t\t\t'c' => array(\n\t\t\t\t\t'answer_text' => 'Probably not voting',\n\t\t\t\t\t'answer_info' => ''\n\t\t\t\t),\n\t\t\t\t'd' => array(\n\t\t\t\t\t'answer_text' => 'Definitely not voting',\n\t\t\t\t\t'answer_info' => ''\n\t\t\t\t),\n\t\t\t\t'e' => array(\n\t\t\t\t\t'answer_text' => 'Not sure',\n\t\t\t\t\t'answer_info' => '[DO NOT READ]'\n\t\t\t\t),\n\t\t\t),\n\t\t\t'question_footer' => array(\n\t\t\t\t'IF DEF VOTING, PROB VOTING OR NOT SURE, GO TO Q2',\n\t\t\t\t'IF NOT VOTING, SAY “Thank You” AND TERMINATE'\n\t\t\t),\n\t\t);\n\n\t\t\n\t\t# ---------------------------------------------------------------------------\n\t\t// ADICIONALES.\n\t\t$data['node']['aditionals'][] = array(\n\t\t\t'aditional_text' => 'Congressional District',\n\t\t\t'aditional_info' => '[FROM VOTER FILE]',\n\t\t);\n\t\t*/\n\n\t\treturn _survey_cygnal_script_word( $data );\n\t}", "static function description(): string {\r\n return 'A website owned or used by The Medium'; \r\n }", "function getNota_txt()\n {\n $nota_txt = 'Hollla';\n $id_situacion = $this->getId_situacion();\n switch ($id_situacion) {\n case '3': // Magna\n $nota_txt = 'Magna cum laude (8,6-9,5/10)';\n break;\n case '4': // Summa\n $nota_txt = 'Summa cum laude (9,6-10/10)';\n break;\n case '10': // Nota numérica\n $num = $this->getNota_num();\n $max = $this->getNota_max();\n $nota_txt = $num . '/' . $max;\n if ($max == 10) {\n if ($num > 9.5) {\n $nota_txt .= ' ' . _(\"Summa cum laude\");\n } elseif ($num > 8.5) {\n $nota_txt .= ' ' . _(\"Magna cum laude\");\n }\n }\n break;\n default:\n $oNota = new Nota($id_situacion);\n $nota_txt = $oNota->getDescripcion();\n break;\n }\n return $nota_txt;\n }", "function the_project_link($project) {\n $link = '';\n \n if ($project['project_url']) {\n $link = '<a class=\"project-link\" href=\"'. $project['project_url'].'\" target=\"_blank\">#</a>';\n }\n \n echo $link;\n}", "public function getSponsorlogo() {}" ]
[ "0.61927676", "0.60495484", "0.5837259", "0.5774588", "0.5567576", "0.55544007", "0.55217516", "0.54825443", "0.5466723", "0.5451838", "0.54471207", "0.5443457", "0.5427075", "0.5417912", "0.5379392", "0.5357099", "0.53562605", "0.5332895", "0.53327525", "0.5327575", "0.5284878", "0.5259041", "0.5235838", "0.52333647", "0.52249694", "0.52185243", "0.5216156", "0.5197557", "0.5193218", "0.5181901", "0.5134326", "0.5126172", "0.5105605", "0.5100412", "0.50973785", "0.5086683", "0.50775486", "0.5073128", "0.505906", "0.505905", "0.50574523", "0.5048619", "0.5040049", "0.50392437", "0.50307566", "0.5011869", "0.50099343", "0.5000356", "0.49951717", "0.4973302", "0.4968726", "0.4960453", "0.49587175", "0.49360484", "0.4927685", "0.49223444", "0.49167705", "0.49144277", "0.4900638", "0.4898068", "0.48978814", "0.48864147", "0.48837748", "0.48834306", "0.48768672", "0.487494", "0.48722237", "0.48683748", "0.48618326", "0.48496577", "0.48474234", "0.4844394", "0.48393768", "0.48343033", "0.4833566", "0.48312056", "0.4830362", "0.4825382", "0.48213732", "0.48149586", "0.48084417", "0.48039138", "0.4802264", "0.47998038", "0.47963303", "0.47962162", "0.4793341", "0.47902626", "0.4780459", "0.47782806", "0.47642812", "0.47641453", "0.4763218", "0.4755602", "0.475501", "0.47547916", "0.4751757", "0.47445267", "0.47391847", "0.47365624", "0.47357762" ]
0.0
-1
Function that is called by moodle when right after the installation of this plugin.
function xmldb_block_gmcs_install() { $PLUGIN = 'block_gmcs'; set_default_scheme_settings($PLUGIN); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function afterInstall()\n\t{}", "protected function afterInstall()\n {\n }", "public function afterUpdate()\n {\n ((Settings::get('use_plugin') == FALSE)? $this->update_plugin_versions(TRUE) : $this->update_plugin_versions(FALSE));\n }", "protected function onFinishSetup()\n {\n }", "protected function afterUninstall()\n {\n }", "public function _postSetup()\n {\n }", "protected function _afterInit() {\n\t}", "public function after_setup_theme()\n {\n }", "public function after_update() {}", "function after_update() {}", "function power_up_setup_callback ( )\n\t{\n\t\t$this->admin->power_up_setup_callback();\n\t}", "protected function afterUpdate() {\n\t}", "protected function after_execute() {\n// \t$this->add_related_files('mod_vcubeseminar', 'intro', null);\n// \t$this->add_related_files('mod_vcubeseminar', 'vcubeseminar', null);\n }", "protected function after_load(){\n\n\n }", "public function postInstallCmd(){\n\n \\Disco\\manage\\Manager::install();\n\n }", "public function onAfterInitialise()\n\t{\n\t\t$this->call(array('System\\\\Command', 'execute'));\n\n\t\tif ($this->params->get('tranAlias', 1))\n\t\t{\n\t\t\t$this->call(array('Article\\\\Translate', 'translateAlias'), $this);\n\t\t}\n\n\t\tif ($this->params->get('languageOrphan', 0))\n\t\t{\n\t\t\t$this->call(array('System\\\\Language', 'orphan'));\n\t\t}\n\n\t\t@include $this->includeEvent(__FUNCTION__);\n\t}", "public function execute_uninstall_hooks() {\r\n\t\t\r\n }", "public static function onAfterInitialise() {\r\t\t$mainframe =& JFactory::getApplication();\r\t\t\r\t\t// Check to see that component is not in the admin section of the site\r\t\tif($mainframe->isAdmin()) {\r\t\t\t// Return false to not run the plugin\r\t\t\treturn false;\r\t\t}\r\t\t\r\t\t// Check to see if this is a qlue404 redirect from .htaccess file\r\t\t$htaccess = JRequest::getInt('qlue404', 0);\r\t\t\r\t\t// Get document Object\r\t\t$document =& JFactory::getDocument();\r\t\t\r\t\t// This is redirect from htaccess so force the websites format to html\r\t\tif($htaccess == 1) {\r\t\t\t\t\r\t\t\t// Force the format to be HTML\r\t\t\tJRequest::setVar('format', 'html');\r\t\t\t\r\t\t\t// Set the document type to html\r\t\t\t$document->setType('html');\t\r\t\t}\t\t\r\t}", "public function onAfterInstall()\n {\n craft()->amForms_install->install();\n }", "public function afterSetup()\n {\n }", "function install_plugin_information()\n {\n }", "public function finish() {\n\t\t$this->_check();\n\t\t$d['title_for_layout'] = __(\"Installation complete\");\n\t\t$path = PLUGIN_CONFIG.'bootstrap.php';\n\t\tif(!$this->Install->changeConfiguration('Database.installed', 'true', $path)){\n\t\t\t$this->Session->setFlash(__(\"Cannot modify Database.installed variable in app/Plugin/Install/Config/bootstrap.php\"), 'Install.alert');\n\t\t}\n\t\t\n\t\tif($this->request->is('post')) {\n\t\t\tCakeSession::delete('Install.create');\n\t\t\tCakeSession::delete('Install.salt');\n\t\t\tCakeSession::delete('Install.seed');\n\t\t\t\n\t\t\t$this->redirect('/');\n\t\t}\n\t\n\t\t$this->set($d);\n\t}", "function plugins_loaded(){\r\n // $current_time = current_time('timestamp');\r\n // $this->logger->debug( 'plugins_loaded ' . $current_time );\r\n \r\n // perform recover from member mail\r\n add_action( 'wp_loaded', array( &$this->cartController, 'restore_abandon_cart' ) );\r\n }", "protected function afterUpdate()\n {\n }", "protected function afterUpdate()\n {\n }", "protected function MetaAfterLoad() {\n\t\t}", "public function afterLoad() { }", "protected function afterLoad()\n {\n }", "public function additional_plugin_setup() {\n\n $page_main = $this->_admin_pages['swpm'];\n\n if (!get_option('swpm_dashboard_widget_options')) {\n $widget_options['swpm_dashboard_recent_entries'] = array(\n 'items' => 5,\n );\n update_option('swpm_dashboard_widget_options', $widget_options);\n }\n }", "public function after_run() {}", "public function beforeInstall()\n\t{}", "function instant_ide_manager_activate_post() {\n\n\tif ( ! get_option( 'instant_ide_manager_version_number' ) )\n\t\tupdate_option( 'instant_ide_manager_version_number', IIDEM_VERSION );\n\t\t\n\tinstant_ide_manager_dir_check( instant_ide_manager_get_uploads_path() );\n\n}", "function on_uninstall ()\n{\n}", "function on_uninstall ()\n{\n}", "protected function after_execute() {\n // Add iadlearning related files, no need to match by itemname (just internally handled context).\n $this->add_related_files('mod_iadlearning', 'intro', null);\n }", "protected function after(){}", "protected function after(){}", "protected function after(){}", "protected function afterAction () {\n\t}", "function qa_initialize_postdb_plugins()\n{\n\tglobal $qa_pluginManager;\n\n\trequire_once QA_INCLUDE_DIR . 'app/options.php';\n\tqa_preload_options();\n\n\t$qa_pluginManager->loadPluginsAfterDbInit();\n\tqa_load_override_files();\n\n\tqa_report_process_stage('plugins_loaded');\n}", "protected function after_core_update($update_result)\n {\n }", "protected function afterUpdating()\n {\n }", "public function after() {}", "function hookInstall() {\n// $db = get_db()cou;\n//die(\"got to the installer method...\");\n $this->_saveVocabularies();\n }", "public function init_plugin()\n {\n }", "public function afterRegistry()\n {\n // parent::afterRegistry();\n }", "protected function afterAction() {\n\n }", "protected function afterAdd() {\n\t}", "public function onAfterInitialise()\n\t{\n\t\t// Only for site\n\t\tif (!$this->app->isSite())\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// Register listeners for JHtml helpers\n\t\tif (!JHtml::isRegistered('bootstrap.loadCss'))\n\t\t{\n\t\t\tJHtml::register('bootstrap.loadCss', 'PlgSystemBootstrap4::loadCss');\n\t\t}\n\n\t\tif (!JHtml::isRegistered('bootstrap.carousel'))\n\t\t{\n\t\t\tJHtml::register('bootstrap.carousel', 'PlgSystemBootstrap4::carousel');\n\t\t}\n\t\t\n\t\tif (!JHtml::isRegistered('calendar'))\n\t\t{\n\t\t\tJHtml::register('calendar', 'PlgSystemBootstrap4::calendar');\n\t\t}\n\t\t\n\t\tif (!JHtml::isRegistered('bootstrap.modal'))\n\t\t{\t\t\n\t\t\tJHtml::register('bootstrap.modal', 'PlgSystemBootstrap4::modal');\n\t\t}\n\t}", "protected function after()\n {\n }", "protected function after()\n {\n }", "public function finalize() {\n\t\t$ini = sprintf(\"; Forum installed on %s\", date('Y-m-d H:i:s')) . PHP_EOL;\n\n\t\tforeach (array('prefix', 'database', 'table') as $key) {\n\t\t\t$ini .= $key . ' = \"' . $this->install[$key] . '\"' . PHP_EOL;\n\t\t}\n\n\t\tfile_put_contents(FORUM_PLUGIN . 'Config/install.ini', $ini);\n\n\t\t$this->hr(1);\n\t\t$this->out('Forum installation complete! Your admin credentials:');\n\t\t$this->out();\n\t\t$this->out(sprintf('Username: %s', $this->install['username']));\n\t\t$this->out(sprintf('Email: %s', $this->install['email']));\n\t\t$this->out();\n\t\t$this->out('Please read the documentation for further configuration instructions.');\n\t\t$this->hr(1);\n\t}", "function refresh_plugins_transient()\n {\n }", "public function onPluginsInitialized()\n {\n $this->processDeprecatedSettings();\n }", "function uninstall_hook()\n\t\t{\n\t\t\t// Delete plugin options\t\t\t\n\t\t\tdelete_option('verify-meta-tags');\n\t\t}", "protected function _after()\n\t{\n\t\t\n\t}", "protected function _after()\n\t{\n\t\t\n\t}", "public function after()\n\t{\n\t}", "public static function after() {\n\n\t}", "protected function after(){\n\n }", "private function _after_install() {\n global $COURSE, $DB;\n \n if(!$this->_found) { // if the block's instance hasn't been cached\n // lookup the DB to check if this block instance already 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 already exist in the DB\n $this->_found = true;\n }\n else { // if this block instance doesn't exist we insert a first set of preferences\n $entries = new stdClass();\n $entries->instance_id = $this->instance->id;\n $entries->course_id = $COURSE->id;\n $entries->showgroups = 1;\n $entries->maxmembers = 2;\n $entries->allowchangegroups = 0;\n $entries->allowstudentteams = 1;\n $entries->allowmultipleteams = 0;\n $DB->insert_record('block_group_choice', $entries);\n }\n }\n }", "function PostInit()\n {\n }", "public function init() {\r\n\r\n // Check WooLentor Free version\r\n if( !is_plugin_active('woolentor-addons/woolentor_addons_elementor.php') ){\r\n add_action( 'admin_notices', [ $this, 'admin_notice_missing_main_plugin' ] );\r\n return;\r\n }\r\n\r\n // Include File\r\n $this->include_files();\r\n\r\n // After Active Plugin then redirect to setting page\r\n $this->plugin_redirect_option_page();\r\n\r\n }", "public function on_plugin_uninstall(): void {\n\t\tif ( is_multisite() ) {\n\t\t\tdelete_site_option( self::OPTION_SHOW_ACTIVATION_NOTICE );\n\t\t}\n\t\tdelete_option( self::OPTION_SHOW_ACTIVATION_NOTICE );\n\t}", "protected function after() {\n\t\t// Empty default implementation. Should be implemented by descendant classes if needed\n\t}", "function allonsy_plugin_activation() {\n\n\tadd_option( 'allonsy_plugin_activated', 1, '', 'no' );\n}", "function plugin_install_now()\n{\n global $pi_name, $pi_version, $gl_version, $pi_url, $NEWTABLE, $DEFVALUES, $NEWFEATURE;\n global $_TABLES, $_CONF;\n\n COM_errorLog(\"Attempting to install the $pi_name Plugin\",1);\n $uninstall_plugin = 'plugin_uninstall_' . $pi_name;\n\n // Create the Plugins Tables\n require_once($_CONF['path'] . 'plugins/forum/sql/mysql_install_2.6.php');\n\n for ($i = 1; $i <= count($_SQL); $i++) {\n $progress .= \"executing \" . current($_SQL) . \"<br\" . XHTML . \">\\n\";\n COM_errorLOG(\"executing \" . current($_SQL));\n DB_query(current($_SQL),'1');\n if (DB_error()) {\n COM_errorLog(\"Error Creating $table table\",1);\n $uninstall_plugin ('DeletePlugin');\n return false;\n exit;\n }\n next($_SQL);\n }\n COM_errorLog(\"Success - Created $table table\",1);\n \n // Insert Default Data\n \n foreach ($DEFVALUES as $table => $sql) {\n COM_errorLog(\"Inserting default data into $table table\",1);\n DB_query($sql,1);\n if (DB_error()) {\n COM_errorLog(\"Error inserting default data into $table table\",1);\n $uninstall_plugin ();\n return false;\n exit;\n }\n COM_errorLog(\"Success - inserting data into $table table\",1);\n }\n \n // Create the plugin admin security group\n COM_errorLog(\"Attempting to create $pi_name admin group\", 1);\n DB_query(\"INSERT INTO {$_TABLES['groups']} (grp_name, grp_descr) \"\n . \"VALUES ('$pi_name Admin', 'Users in this group can administer the $pi_name plugin')\",1);\n if (DB_error()) {\n $uninstall_plugin();\n return false;\n exit;\n }\n COM_errorLog('...success',1);\n $query = DB_query(\"SELECT max(grp_id) FROM {$_TABLES['groups']} \");\n list ($group_id) = DB_fetchArray($query);\n\n // Save the grp id for later uninstall\n COM_errorLog('About to save group_id to vars table for use during uninstall',1);\n DB_query(\"INSERT INTO {$_TABLES['vars']} VALUES ('{$pi_name}_admin', $group_id)\",1);\n if (DB_error()) {\n $uninstall_plugin ();\n return false;\n exit;\n }\n COM_errorLog('...success',1);\n \n // Add plugin Features\n foreach ($NEWFEATURE as $feature => $desc) {\n COM_errorLog(\"Adding $feature feature\",1);\n DB_query(\"INSERT INTO {$_TABLES['features']} (ft_name, ft_descr) \"\n . \"VALUES ('$feature','$desc')\",1);\n if (DB_error()) {\n COM_errorLog(\"Failure adding $feature feature\",1);\n $uninstall_plugin ();\n return false;\n exit;\n }\n $query = DB_query(\"SELECT max(ft_id) FROM {$_TABLES['features']} \");\n list ($feat_id) = DB_fetchArray($query);\n\n COM_errorLog(\"Success\",1);\n COM_errorLog(\"Adding $feature feature to admin group\",1);\n DB_query(\"INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES ($feat_id, $group_id)\");\n if (DB_error()) {\n COM_errorLog(\"Failure adding $feature feature to admin group\",1);\n $uninstall_plugin ();\n return false;\n exit;\n }\n COM_errorLog(\"Success\",1);\n } \n \n // OK, now give Root users access to this plugin now! NOTE: Root group should always be 1\n COM_errorLog(\"Attempting to give all users in Root group access to $pi_name admin group\",1);\n DB_query(\"INSERT INTO {$_TABLES['group_assignments']} VALUES ($group_id, NULL, 1)\");\n if (DB_error()) {\n $uninstall_plugin ();\n return false;\n exit;\n }\n\n // Register the plugin with Geeklog\n COM_errorLog(\"Registering $pi_name plugin with Geeklog\", 1);\n DB_delete($_TABLES['plugins'],'pi_name',$pi_name);\n DB_query(\"INSERT INTO {$_TABLES['plugins']} (pi_name, pi_version, pi_gl_version, pi_homepage, pi_enabled) \"\n . \"VALUES ('$pi_name', '$pi_version', '$gl_version', '$pi_url', 1)\");\n\n if (DB_error()) {\n $uninstall_plugin ();\n return false;\n exit;\n }\n\n COM_errorLog(\"Succesfully installed the $pi_name Plugin!\",1);\n return true;\n}", "public function after_run(){}", "public function after_install( $response, $hook_extra, $result ) {\n global $wp_filesystem;\n $install_directory = SALESFORCE__PLUGIN_DIR;\n $wp_filesystem->move( $result['destination'], $install_directory );\n $result['destination'] = $install_directory;\n if ( $this->active ) {\n activate_plugin( $this->basename );\n }\n return $result;\n }", "public function postConnect()\n {\n $this->Lexer->addExitPattern('</' . self::getElementName() . '>', 'plugin_' . webcomponent::PLUGIN_NAME . '_' . $this->getPluginComponent());\n\n }", "function mp_theme_bundle_theme_activation_one() {\n\n\tglobal $mp_core_options;\n\n\t$mp_core_options['mp_theme_bundle_activation_set_up_plugin'] = true;\n\n\tupdate_option( 'mp_core_options', $mp_core_options );\n\n}", "protected function _afterLoad()\n {\n return parent::_afterLoad();\n }", "function shutdown() {\n // Safety for themes not using wp_footer\n SLPlus_Actions::ManageTheScripts();\n\t\t}", "protected function _after() {\n\t\t$this->yumlModelsCreator = null;\n\t\tparent::_after ();\n\t}", "protected function after() {\n }", "function _init_plugin() {\n\t\tglobal $db, $apcms;\n\t\t\n\t\treturn true;\n\t}", "function after_theme_activation () {\n\t\t\tfunction plugin_activation( $plugin ) {\n\t\t\t if( ! function_exists('activate_plugin') ) {\n\t\t\t require_once ABSPATH . 'wp-admin/includes/plugin.php';\n\t\t\t }\n\n\t\t\t if( ! is_plugin_active( $plugin ) ) {\n\t\t\t activate_plugin( $plugin );\n\t\t\t }\n\t\t\t}\n\t\t\tplugin_activation('advanced-custom-fields-pro/acf.php');\n\t\t\tplugin_activation('classic-editor/classic-editor.php');\n\t\t\tplugin_activation('wp-nested-pages/nestedpages.php');\n\t\t\tplugin_activation('contact-form-7/wp-contact-form-7.php');\n\t\t}", "function adrotate_licensed_update() {\n\tadd_filter('site_transient_update_plugins', 'adrotate_update_check');\n\tadd_filter('plugins_api', 'adrotate_get_plugin_information', 20, 3);\n}", "protected function after(): void\n {\n }", "function wlms_plugin_install()\n{\n wlms_create_table();\n wlms_settings_data();\n}", "public function postInit()\n {\n }", "public function postInit()\n {\n }", "public function postInit()\n {\n }", "public function init(){\n\t\tadd_action( 'admin_init', array( $this, 'init_plugin' ), 20 );\n\t}", "function plugin_postinstall()\n{\n global $_CONF, $_TABLES, $pi_admin;\n\n require_once $_CONF['path_system'] . 'classes/config.class.php';\n\n $plg_config = config::get_instance();\n $_PLG_CONF = $plg_config->get_config('{plugin}');\n\n $admin_group_id = DB_getItem($_TABLES['groups'], 'grp_id', \"grp_name = '{$pi_admin}'\");\n $blockadmin_id = DB_getItem($_TABLES['groups'], 'grp_id', \"grp_name = 'Block Admin'\");\n\n $DEFVALUES = array();\n $DEFVALUES[] = \"INSERT INTO {$_TABLES['{plugin}']} (up_title, up_value, owner_id, group_id) \"\n . \"VALUES ('Sample Data', 100, 2, #group#)\";\n $DEFVALUES[] = \"INSERT INTO {$_TABLES['{plugin}']} (up_title, up_value, owner_id, group_id) \"\n . \"VALUES ('More Sample Data', 200, 2, #group#)\";\n\n foreach ($DEFVALUES as $sql) {\n $sql = str_replace('#group#', $admin_group_id, $sql);\n DB_query($sql, 1);\n if (DB_error()) {\n COM_error(\"SQL error in {plugin} plugin postinstall, SQL: \" . $sql);\n return false;\n }\n }\n\n return true;\n}", "function onAfterRoute() {\r\n\t\t$this->loadLanguage ( null, JPATH_ADMINISTRATOR);\r\n\t\t\r\n\t\tt3import ( 'core.framework' );\r\n\r\n\t\t$app = JFactory::getApplication('administrator');\r\n\t\t\r\n\t\tif ($app->isAdmin()) {\r\n\t\t\tt3import ('core.admin.util');\r\n\t\t\t//Clean cache if there's something changed backend\r\n\t\t\tif (JRequest::getCmd ('jat3action') || in_array(JRequest::getCmd ('task'), array('save', 'delete', 'remove', 'apply', 'publish', 'unpublish'))) {\r\n\t\t\t\tif (JRequest::getCmd ('jat3action')) {\r\n\t\t\t\t\t//if template parameter updated => clear cache\r\n\t\t\t\t\tt3_import('core/cache');\r\n\t\t\t\t\tT3Cache::clean(2);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$params = T3Common::get_template_based_params();\r\n\t\t\t\t\t$cache = $params->get('cache');\r\n\t\t\t\t\tif ($cache) {\r\n\t\t\t\t\t\t//if other update: clear cache if cache is enabled\r\n\t\t\t\t\t\tt3_import('core/cache');\r\n\t\t\t\t\t\tT3Cache::clean(1);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (JAT3_AdminUtil::checkPermission()) {\r\n\t\t\t\r\n\t\t\t\tif (JAT3_AdminUtil::checkCondition_for_Menu()) {\r\n\t\t\t\t\tJHTML::stylesheet ('', JURI::root().T3_CORE.'/element/assets/css/japaramhelper.css' );\r\n\t\t\t\t\tJHTML::script \t ('', JURI::root().T3_CORE.'/element/assets/js/japaramhelper.js', true);\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t\tif (JRequest::getCmd ( 'jat3type' ) == 'plugin') {\r\n\t\t\t\t\t$action = JRequest::getCmd ( 'jat3action' );\r\n\t\t\t\t\t\r\n\t\t\t\t\tt3import ('core.ajax');\r\n\t\t\t\t\t$obj = new JAT3_Ajax ( );\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ($action && method_exists ( $obj, $action )) {\r\n\t\t\t\t\t\t$obj->$action ();\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn;\r\n\t\t\t\t} \r\n\t\t\t\t\r\n\t\t\t\tif (! T3Common::detect ())\treturn;\r\n\t\t\t\t\r\n\t\t\t\tJAT3_AdminUtil::loadStyle();\r\n\t\t\t\tJAT3_AdminUtil::loadScipt();\r\n\t\t\t\t\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\telseif (JRequest::getCmd ( 'jat3type' ) == 'plugin') {\r\n\t\t\t\t$result['error'] = 'Session has expired. Please login before continuing.';\r\n\t\t\t\techo json_encode($result);\r\n\t\t\t\texit;\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tif (! $app->isAdmin () && T3Common::detect ()) {\r\n\t\t\t$action = JRequest::getCmd ( 'jat3action' );\r\n\t\t\t//process request ajax like action - public\r\n\t\t\tif ($action) {\r\n\t\t\t\tt3import ('core.ajaxsite');\r\n\t\t\t\tif (method_exists ('T3AjaxSite', $action)) {\r\n\t\t\t\t\tT3AjaxSite::$action ();\r\n\t\t\t\t\t$app->close(); //exit after finish action\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//load core library\r\n\t\t\tT3Framework::t3_init ( $this->plgParams );\r\n\t\t\t//Init T3Engine\r\n\t\t\t//get list templates\t\t\t\r\n\t\t\t$themes = T3Common::get_active_themes ();\r\n\t\t\t$path = T3Path::getInstance ();\r\n\t\t\t//path in t3 engine\r\n\t\t\t//active themes path\r\n\t\t\tif ($themes && count ( $themes )) {\r\n\t\t\t\tforeach ( $themes as $theme ) {\r\n\t\t\t\t\tif ($theme[0] == 'engine') {\r\n\t\t\t\t\t\t$path->addPath ( $theme [0] . '.' . $theme [1], T3Path::path (T3_BASE.'/base-themes/'.$theme[1]), T3Path::url (T3_BASE.'/base-themes/'.$theme[1]) );\r\n\t\t\t\t\t} else if ($theme[0] == 'template') {\r\n\t\t\t\t\t\t$path->addPath ( $theme [0] . '.' . $theme [1], T3Path::path (T3_TEMPLATE), T3Path::url (T3_TEMPLATE) );\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$path->addPath ( $theme [0] . '.' . $theme [1], T3Path::path (T3_TEMPLATE) . DS . $theme [0] . DS . 'themes' . DS . $theme [1], T3Path::url (T3_TEMPLATE) . \"/{$theme[0]}/themes/{$theme[1]}\" );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tT3Framework::init_layout ();\r\n\t\t}\r\n\t}", "public function after_custom_props() {}", "protected function afterActivation() {\n self::createReportMainMenuEntries();\n }", "public function onPostInstall() {\n $moduleName = 'siteevent';\n $db = $this->getDb();\n $select = new Zend_Db_Select($db);\n $select\n ->from('engine4_core_modules')\n ->where('name = ?', 'sitemobile')\n ->where('enabled = ?', 1);\n $is_sitemobile_object = $select->query()->fetchObject();\n if (!empty($is_sitemobile_object)) {\n $db->query(\"INSERT IGNORE INTO `engine4_sitemobile_modules` (`name`, `visibility`) VALUES\n('$moduleName','1')\");\n $select = new Zend_Db_Select($db);\n $select\n ->from('engine4_sitemobile_modules')\n ->where('name = ?', $moduleName)\n ->where('integrated = ?', 0);\n $is_sitemobile_object = $select->query()->fetchObject();\n if ($is_sitemobile_object) {\n $actionName = Zend_Controller_Front::getInstance()->getRequest()->getActionName();\n $controllerName = Zend_Controller_Front::getInstance()->getRequest()->getControllerName();\n if ($controllerName == 'manage' && $actionName == 'install') {\n $view = new Zend_View();\n $baseUrl = (!empty($_ENV[\"HTTPS\"]) && 'on' == strtolower($_ENV[\"HTTPS\"]) ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . str_replace('install/', '', $view->url(array(), 'default', true));\n $redirector = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector');\n $redirector->gotoUrl($baseUrl . 'admin/sitemobile/module/enable-mobile/enable_mobile/1/name/' . $moduleName . '/integrated/0/redirect/install');\n }\n }\n }\n //END - SITEMOBILE CODE TO CALL MY.SQL ON POST INSTALL\n //WORK FOR THE WORD CHANGES IN THE ADVANCED EVENT PLUGIN .CSV FILE.\n $actionName = Zend_Controller_Front::getInstance()->getRequest()->getActionName();\n $controllerName = Zend_Controller_Front::getInstance()->getRequest()->getControllerName();\n if ($controllerName == 'manage' && ($actionName == 'install' || $actionName == 'query')) {\n $view = new Zend_View();\n $baseUrl = (!empty($_ENV[\"HTTPS\"]) && 'on' == strtolower($_ENV[\"HTTPS\"]) ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . str_replace('install/', '', $view->url(array(), 'default', true));\n $redirector = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector');\n if ($actionName == 'install') {\n $redirector->gotoUrl($baseUrl . 'admin/siteevent/settings/language/redirect/install');\n } else {\n $redirector->gotoUrl($baseUrl . 'admin/siteevent/settings/language/redirect/query');\n }\n }\n }", "protected function _after()\n {\n }", "public function onLoad() {\n $this->getLogger()->info(TextFormat::YELLOW . \"Loading MaxPlugin v1.0 by Max Koeth...\");\n }", "public function afterInstall()\r\n {\r\n\r\n // $test = $this::getInstance();\r\n//print_r(Yii::getAlias('@'.($this->id)));\r\n\r\n\r\n // $fileName2 = (new \\ReflectionClass(new \\panix\\engine\\WebModule($this->id)))->getFileName();\r\n\r\n // $fileName = (new \\ReflectionClass(get_called_class()))->getFileName();\r\n // print_r($fileName2);\r\n\r\n\r\n /// print_r($reflectionClass->getNamespaceName());\r\n //die;\r\n\r\n // if ($this->uploadAliasPath && !file_exists(Yii::getPathOfAlias($this->uploadAliasPath)))\r\n // CFileHelper::createDirectory(Yii::getPathOfAlias($this->uploadAliasPath), 0777);\r\n //Yii::$app->cache->flush();\r\n // Yii::app()->widgets->clear();\r\n return true;\r\n }", "protected function MetaAfterSave() {\n\t\t}", "function initPlugin()\n {\n $this->getAdminOptions();\n }", "function custom_config_postinstall_callback() {\n // Call function to run post install routines.\n custom_config_run_postinstall_hooks();\n}", "public function __after()\t{\n\t}", "function wp_footer() {\n SLPlus_Actions::ManageTheScripts();\n\t\t}", "protected function markModuleAsInstalled()\n {\n Mongez::updateStorageFile();\n }", "function deactivated_plugins_notice()\n {\n }", "protected function after_foo()\n {\n }", "protected function _after()\n {\n }" ]
[ "0.74393463", "0.72572464", "0.68784064", "0.677829", "0.6668639", "0.6595464", "0.647528", "0.6462731", "0.6434316", "0.6429974", "0.64074475", "0.6398625", "0.63899547", "0.63840526", "0.63769233", "0.6371893", "0.6315229", "0.63095266", "0.6303232", "0.6264743", "0.62509465", "0.62421435", "0.62198585", "0.6214227", "0.6214227", "0.6210487", "0.62092423", "0.62041897", "0.62018263", "0.61953443", "0.6168092", "0.61490965", "0.6139503", "0.6139503", "0.61309487", "0.61283094", "0.61283094", "0.61283094", "0.6103098", "0.6096823", "0.6095295", "0.60917133", "0.6084711", "0.6064529", "0.6054719", "0.6054347", "0.6048374", "0.604646", "0.6034343", "0.6030755", "0.6030755", "0.60256535", "0.60214657", "0.6021358", "0.60198385", "0.6011735", "0.6011735", "0.6004159", "0.5994289", "0.5984151", "0.5982677", "0.5982292", "0.5980753", "0.5980285", "0.5977101", "0.59746647", "0.5971909", "0.5966767", "0.59621406", "0.59575933", "0.5953345", "0.5951975", "0.59373623", "0.59339124", "0.5931231", "0.59312147", "0.5923316", "0.59195757", "0.5918016", "0.5914089", "0.59056157", "0.59056157", "0.59056157", "0.58948624", "0.5890954", "0.58877873", "0.58875436", "0.5886131", "0.5884407", "0.5879369", "0.5875432", "0.58693695", "0.58666116", "0.58642185", "0.58642095", "0.5863545", "0.58589387", "0.5843896", "0.5843412", "0.58420587", "0.5840161" ]
0.0
-1
print "Update [$id] on ".time();
function upd($id=NULL){ $ID = $id ? $id : $this->Id; if(!$ID)return false; if($ID)$this->HDB->q("update Objects set Updated = ".time()." where Id = $ID"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateTime($abrv){\n\t$time = time();\n\t$sql = \"UPDATE updated set $abrv='$time' where ID='0'\";\n db_query($sql, \"update the time record\");\n}", "public function update($id)\n\t{\n\t\t//\n\t\techo 'update';\n\t}", "function last_update($id) {\n\n \n $data = array( \n 'updated_at' => unix_to_human(now(), TRUE, 'eu') \n );\n \n $this->db->where('id', $id);\n return $this->db->update('patients', $data); \n\n }", "public function update($id)\n\t{\n\t\t//\n\t\techo \"update\";\n\t}", "function ajan_core_print_generation_time() {\n?>\n\n<!-- Generated in <?php timer_stop(1); ?> seconds. (<?php echo get_num_queries(); ?> q) -->\n\n\t<?php\n}", "function process_one()\r\n{\r\n global $debug;\r\n $update_id = 0;\r\n echo \"-\";\r\n \r\n if (file_exists(\"last_update_id\")) \r\n $update_id = (int)file_get_contents(\"last_update_id\");\r\n \r\n $updates = get_updates($update_id);\r\n\r\n // jika debug=0 atau debug=false, pesan ini tidak akan dimunculkan\r\n if ((!empty($updates)) and ($debug) ) {\r\n echo \"\\r\\n===== isi diterima \\r\\n\";\r\n print_r($updates);\r\n }\r\n \r\n foreach ($updates as $message)\r\n {\r\n echo '+';\r\n $update_id = process_message($message);\r\n\t}\r\n \r\n\t// @TODO nanti ganti agar update_id disimpan ke database\r\n // update file id, biar pesan yang diterima tidak berulang\r\n file_put_contents(\"last_update_id\", $update_id + 1);\r\n}", "public function run_update($id='', $data=[]){\n $sql = $this->prepare_update($id, $data);\n $req = $this->run($sql);\n if(is_numeric($req)){\n return \"Updated $req record\" . ($req > 1 ? \"s\" : \"\");\n }\n return $req;\n }", "public function update($id)\n\t{\n\t\treturn 'update';\n\t}", "protected function setUpdated(){\n if($this->_id > 0){\n $pfDB = DB\\Database::instance()->getDB('PF');\n\n $pfDB->exec(\n [\"UPDATE \" . $this->table . \" SET updated=NOW() WHERE id=:id\"],\n [\n [':id' => $this->_id]\n ]\n );\n }\n }", "public function increment() {\n $this->db->query('UPDATE '.TABLE_PREFIX.'tickers SET last_run = '.time().' WHERE id = '.$this->id);\n }", "function log_update($type) {\n $this->updates_counter[$type] += 1;\n }", "public function idUpdate(){\n return $this->idUpdate;\n }", "function log($ID = \"\") {\n if($ID) {\n $date_time = @date(\"YmdHis\");\n $SQL = \"UPDATE User \".\n \"SET LastLogin = '$date_time' \".\n \"WHERE ID = '$ID'\"; \n mysqli_query($this->db_link, $SQL);\n\t\t\t$this->LastLoin = $date_time;\n } else {\n echo \"Missing info...update aborted\";\n exit;\n }\n }", "function tbl_update ($db, $table) {\n\tinclude (__DIR__).\"/../conn.php\";\n\t$abfrage = \"SHOW TABLE STATUS FROM $db LIKE '$table'\";\n\t$ergebnis = $con->query($abfrage);\n\t$array = mysqli_fetch_assoc($ergebnis);\n\t$update = $array[\"Update_time\"];\n\t$date = date_create($update);\n\t$update_frm = date_format($date, 'd.m.Y H:i:s');\n\techo $update_frm;\n}", "function sqlite_now()\n{\n\treturn date('Y-m-d H:i:s');\n}", "public function notify_Time($id,$table){\n $this->date = date(\"h:i A\");\n $sql = \"UPDATE {$table} SET SENT_Time = '$this->date' WHERE ID = '$id'\";\n $query = mysqli_query($this->con,$sql);\n }", "public function displaynow()\n\t{\n\t\treturn $this->CLI->stringQuery($this->SqueezePlyrID.\" displaynow ? ?\");\n\t}", "public function Do_update_Example1(){\n\n\t}", "function uLog($site_id, $up_id, $action, $info)\n{\n $toolkit = systemToolkit::getInstance();\n $updateLogMapper = $toolkit->getMapper('update', 'updateLog');\n\n $log = $updateLogMapper->create();\n $log->setSiteId($site_id);\n $log->setUpId($up_id);\n $log->setAction($action);\n $log->setInfo($info);\n $log->setTime(new SQLFunction(\"UNIX_TIMESTAMP\"));\n\n $updateLogMapper->save($log);\n}", "function alog($line){\n $cur_user = $_SESSION['user']['user_username'];\n $time = getTimestamp();\n writeLineToLog(\"$time - $cur_user - $line\");\n}", "function _update ($table_name) {\n\t\treturn \"UPDATE `{$table_name}`\";\n\t}", "public function db_update() {}", "function lewati($id){\n\t\t$updateArray = array(\n\t\t\t\"status\" \t\t=> \"4\",\n\t\t);\n\n\t\t$this->db->update(\"antrian\", $updateArray, array(\"req_queue_id\" => $id));\n\t\t// End\n\n\t\t// Update to table master_req_antrian\n\t\t$updateArray = array(\n\t\t\t\"status\" \t\t=> \"8\",\n\t\t\t\"updated_date\" => date('Y-m-d H:i:s'),\n\t\t\t\"updated_by\" => $this->sessionData['user_id']\n\t\t);\n\n\t\t$update = $this->db->update(\"master_req_queue\", $updateArray, array(\"id\" => $id));\n\t\techo $update;\n\t\t// End\n\t}", "public function getOnUpdate(): string;", "public function update($id)\n\t{\n\t\techo 'update edited gaan';\n\t}", "public function SQL_UPDATE() {\r\n\t}", "function econsole_update_instance($econsole) {\r\n\r\n $econsole->timemodified = time();\r\n $econsole->id = $econsole->instance;\r\n\r\n # May have to add extra stuff in here #\r\n\r\n return update_record(\"econsole\", $econsole);\r\n}", "function mentioned_notification_seen($uid, $pid) {\n try {\n $db = \\Db::dbc();\n\n $sql=\"UPDATE MENTIONNER SET LUMENT = CURRENT_TIMESTAMP WHERE IDUSER=:uid AND IDTWEET=:pid;\";\n $stmt=$db->prepare($sql);\n $stmt->execute(array(\n \t':uid'=>$uid,\n ':pid'=>$pid\n ));\n } catch (\\PDOException $e) {\n\t\techo $e->getMessage();\n\t}\n\t$db=NULL;\n}", "function update_entry_time() {\n\t$query = \"SELECT `id` FROM `blog` WHERE `time` = '0000-00-00 00:00:00'\";\n\t$result = mysql_query($query);\n\twhile ($row = mysql_fetch_array($result)) {\n\t\t$datepos = strpos($row[0],\",\");\n\t\t$date = substr($row[0],$datepos+1,10);\n\t\t$hr = rand(0,24);\n\t\tif ($hr<10)\n\t\t\t$hr = \"0\" . $hr;\n\t\t$mn = rand(0,59);\n\t\t$sc = rand(0,59);\n\t\tif ($mn<10)\n\t\t\t$mn = \"0\" . $mn;\n\t\tif ($sc<10)\n\t\t\t$sc = \"0\" . $sc;\n\t\t$date .= \" \" . $hr . \":\" . $mn . \":\" . $sc;\n\t\t$query = \"UPDATE `blog` SET `time` = '\" . $date . \"' WHERE `id` = '\" . $row[0] . \"'\";\n\t\t//print $query . '<br />';\n\t\tmysql_query($query);\n\t}\n}", "function list_core_update($update)\n {\n }", "function show_query($query) {\n global $debug;\n if($debug)\n echo \"<p>Records have been changed.</p>\" ;\n}", "function proxy_set($host,$status,$timex=0){\n\tglobal $DB_proxypool;\n\t$time_current=date('Y-m-d H:i:s');\n\t$sql=\"update proxypool set status='$status',timex='$timex' ,updatetime='$time_current' where host='$host'\";\n\t//echo $sql.\"\\n\";\n\t$DB_proxypool->query($sql);\n\n}", "function getUpdateCommand()\r\n\t{\r\n\t\t\t//\t\t\t\t->update( )\r\n\t}", "public static function update(){\r\n }", "public function update();", "public function update();", "public function update();", "public function update();", "function update_driver($id,$params)\n {\n $this->company_db = $this->load->database('company_db', TRUE);\n $this->company_db->set('data_update', 'NOW()', FALSE);\n $this->company_db->where('MDist_BatchNum',$id);\n $this->company_db->update('tbl_mdist_batch',$params);\n }", "public static function update(){\n }", "public function trackMe($msg){\n\t\t$mt = explode(' ', microtime());\n\t\t// $time = ((int)$mt[1]) * 1000 + ((int)round($mt[0] * 1000));\n\t\t$time = time();\n\t\techo \"<hr noshade>\";\n\t\techo \"<hr >\";\n\t\techo $time . \" -- \" .$msg;\n\t\techo \"<hr>\";\n\t\techo \"<hr noshade>\";\n\t}", "function showResult($script)\n{\n\tglobal $dbQuery;\n\tglobal $siteSerialID;\n\n\techo $script;\n\techo 'adm.system(' . $siteSerialID . ', ' . (microtime(true) - $_SERVER['REQUEST_TIME_FLOAT']) . ', ' . $dbQuery . ');';\n\texit;\n}", "public function update_entry($id, $name, $time, $action)\n\t\t{\n\t\t\t$this->query(\"UPDATE $this->table SET name='$name', time='$time', action='$action', editor='$this->username', editor_ip='$this->address', edit_time=NOW() WHERE aid='$id'\");\n\t\t}", "function update_right_now_message()\n {\n }", "protected function formatDbLog($msg_id, $sql,$time, $timeuse, $memory){\n\t\treturn \"[$msg_id] # \" . date('Y-m-d H:i:s',$time).\" Access from {$_SERVER['REQUEST_URI']} [time used: {$timeuse}] [memory used: {$memory}]\\n$sql\\n\";\n\t}", "function startUpdate()\r\n {\r\n $this->_updatecounter++;\r\n }", "function terminal_log($message){\n echo date('H:i:s ') . $message . PHP_EOL;\n}", "function time_now() {\n return date(\"H:i:s\");\n}", "public function notification_message_time_update()\n {\n echo $this->Home_model->notification_message_time_update_model();\n }", "function update_last_login($id)\n{\n $conn = db_connect();\n\n // Generate a time stamp\n $timestamp = date(\"Y-m-d G:i:s\");\n\n // Update last login time\n $user_update_login_time_stmt = pg_prepare($conn, \"user_update_login_time_stmt\", \"UPDATE users SET last_access = $1 WHERE email_address = $2\");\n\n $result = pg_execute($conn, \"user_update_login_time_stmt\", array($timestamp, $id));\n}", "function lastupdatetime($table){\n if (first(\"SHOW TABLE STATUS FROM \" . $GLOBALS[\"database\"] . \" LIKE '\" . $table . \"';\", true , \"API.lastupdatetime\")[\"Engine\"] == \"InnoDB\") {\n $filename = first('SHOW VARIABLES WHERE Variable_name = \"datadir\"', true , \"API.lastupdatetime\")[\"Value\"] . $GLOBALS[\"database\"] . '/' . $table . '.ibd';\n return filemtime($filename);//UNIX datestamp\n }\n return first(\"SELECT UPDATE_TIME FROM information_schema.tables WHERE TABLE_SCHEMA = '\" . $GLOBALS[\"database\"] . \"' AND TABLE_NAME = '\" . $table . \"'\", true , \"API.lastupdatetime\")[\"UPDATE_TIME\"];//unknown format\n}", "public function updateTime($data, $id)\n\t{\n\t\t$sql = $this->db->getSQL($data);\n\t\treturn $this->db->update($sql, \"id = '$id'\");\n\t}", "public function updating()\n {\n # code...\n }", "function now() {\n return microtime(true)*1000;\n}", "function e107_db_debug() {\n\t\tglobal $eTimingStart;\n\n\t\t$this->aTimeMarks[0]=array(\n\t\t'Index' => 0,\n\t\t'What' => 'Start',\n\t\t'%Time' => 0,\n\t\t'%DB Time' => 0,\n\t\t'%DB Count' => 0,\n\t\t'Time' => ($eTimingStart),\n\t\t'DB Time' => 0,\n\t\t'DB Count' => 0\n\t\t);\n\t\t\n\t\tregister_shutdown_function('e107_debug_shutdown');\n\t}", "public function updateQueryTime()\n\t{\n\t\t$this->setLastQueryTime(time());\n\t\t$this->save();\n\t}", "function log_message($message)\n{\n $total_message = date('[H:m:s] ') . $message . '<br />';\n echo $total_message;\n}", "protected function doUpdate() {\n return '';\n }", "function updateLoginTime($id)\n {\n $connect = new Config();\n $date = date(\"Y-m-d H:i:s\");\n $sql = \"UPDATE user_db SET last_login = :last_login WHERE id = :id\";\n $query = $connect->connectPDO()->prepare($sql);\n $query->bindParam(':last_login', $date);\n $query->bindParam(':id', $id, \\PDO::PARAM_INT);\n $query->execute();\n }", "function informaImpressao(){\r\n $sql \t= \"update interpretacao set int_data_impressao = now(), int_status = 'impresso' where int_id = \".$this->get(\"int_id\");\r\n\t\t$rs\t\t= Db::sql($sql, \"Interpretacao::informaImpressao()\");\r\n\t}", "public function actionUpdate() {}", "public function actionUpdate() {}", "private function updateOperation() {\n sleep(1);\n }", "function devlyQueries() {\n\t\n\techo 'ran ' . get_num_queries() . ' queries in ' . timer_stop(1) . ' seconds';\n\t\n}", "function bbTime( $print = true, $die = true ) {\n\t$time \t= round(microtime() - BB_START, 4);\n\t$stime\t= $time . 's.';\n\tif ($print === 2 && Configure::read('debug')) {\n\t\tdebug($stime); \n\t} elseif ($print) {\n\t\techo $stime;\n\t}\n\tif ($die) {\n\t\tdie();\n\t}\n\treturn $time;\n}", "function update_info()\n {\n }", "public function update()\n\t{\n\n\t}", "public function updatedAt();", "public function update () {\n\n }", "public function getUpdate_time()\r\n {\r\n return $this->update_time;\r\n }", "public function update($id) //Ändra befintlig boking\n\t{\n\t\t//\n\t}", "public function update()\n {\n # code...\n }", "function updateSMS($requestID){\n\t$processed = 32;\n\t$subLogs=\"About to update \". count($processed) .\" requests\";\n\tlogSubs($subLogs, $_SERVER[\"SCRIPT_FILENAME\"]);\n\t\n\tfor ($x=0;$x<(count($requestID)); $x++){\n\t\t$sql_update = \"update incomingRequests set processed = $processed where requestID = $requestID[$x] limit 1\";\n\t\t$result = mysql_query($sql_update);\n\t\t//log db errors\n\t\tif(!$result){\n\t\t\t$dbErr = \"SQL Error: \".mysql_error().\"SQL CODE: \".$sql_update;\n\t\t\tflog($dbErr, $_SERVER[\"SCRIPT_FILENAME\"]);\n\t\t}else{\n\t\t\t$subLogs = \"Just finished processing a new request. SQL CODE: \".$sql_update;\n\t\t\tlogSubs($subLogs, $_SERVER[\"SCRIPT_FILENAME\"]);\n\t\t}\n\t\t\n\t}\n\t\n}", "public function update() {\r\n\r\n\t}", "function update_start()\n {\n }", "function updateUser()\n{\n return 'Updating user';\n}", "public static function timestamp() {\n return time(); \n }", "public function testUpdate(): void { }", "function followed_notification_seen($followed_id, $follower_id) {\n\ttry {\n \t$db = \\Db::dbc();\n\n $sql=\"UPDATE SUIVRE SET LUSUIT = CURRENT_TIMESTAMP WHERE IDUSERSUIT = :idsuit AND IDUSERFAN = :idfan;\";\n $stmt=$db->prepare($sql);\n $stmt->execute(array(\n ':idsuit'=>$followed_id,\n ':idfan'=>$follower_id\n ));\n } catch (\\PDOException $e) {\n\t\techo $e->getMessage();\n\t}\n\t$db = NULL;\n}", "public static function _mysqlNow() {\n \treturn date('Y-m-d H:i:s');\n }", "public function updateQuery(): string\n {\n return 'UPDATE products \n SET name = :name, quantity = :quantity, price = :price, msrp = :msrp \n WHERE id = :id';\n }", "public function onUpdate();", "public function onUpdate();", "public function onUpdate();", "function update($id, $data){\n $data['updated_at'] = date('Y-m-d H:i:s');\n\t\t$this->db->where('id', $id);\n\t\t$this->db->update($this->table, $data);\n\t}", "public function update()\r\n {\r\n //\r\n }", "protected function _update()\n {\r\n $this->date_updated = new Zend_Db_Expr(\"NOW()\");\n parent::_update();\n }", "function getLastRunEndId(){\n$sql = \"SELECT * FROM sportssocialrank.twitter_dbupdates;\";\n$row = runQuery($sql,false);\n$endId = $row['endId'];\nreturn $endId;\n}", "public function log($content) {\n\t\t$time = time('m/d/Y h:i:s a', time());\n\t echo \"# \" . $time . \" # \" . $content;\n\t}", "function update() {\n\n\t\t\t}", "function logAddEquipment($userid, $equipid){\n\n\t$mysqldate = getCurrentMySQLDateTime();\n\t\n\taddToLog($userid, \"equipment\", \"Created Equipment \".$equipid);\n\t\n}", "function log_act($text, $name, $detail) {\n\n\tglobal $zurich;\t\n\t\n\t$text = addslashes($text);\n\tdb_write(\"INSERT INTO log (name, action, detail, time) \n\t\t\t\tVALUES ('$name', '$text', '$detail', '$zurich->time')\");\n}", "protected function _update()\n\t{\n\t}", "public function time($id){\n if(!array_key_exists($id,$this->times)) return false;\n $time = $this->times[$id];\n if($this->_id == $id) $time += microtime(true) - $this->_start;\n return $time;\n }", "function output_debug($str) {\n\techo date('Y-m-d H:i:s') . \": $str\\r\\n\";\n}", "function NSLogf() {\n\t\tglobal $db;\n\t\t$args = func_get_args();\n\t\t$db->Execute(sprintf(\"INSERT INTO `nslog_messages` (`message`, `timestamp`) VALUES('%s', NOW())\", $db->prepare_input(array_pop(sNSLog($args)))));\n\t}", "function after_update() {}", "protected function _update()\n\t{\n\t\t$this->date_modified = \\Core\\Date::getInstance(null,\\Core\\Date::SQL_FULL, true)->toString();\n\t\t$this->last_online = $this->date_modified;\n\t}", "protected function _generateId()\n {\n return str_replace('.', '', microtime(true));\n }", "function Update($s, $id, &$original, &$update) { return true; }" ]
[ "0.63941413", "0.61073565", "0.6095042", "0.606517", "0.6021265", "0.60165334", "0.59954923", "0.59560037", "0.57597655", "0.57498896", "0.5709991", "0.5647548", "0.5636185", "0.5604193", "0.5601299", "0.5592766", "0.5591733", "0.55595136", "0.5542369", "0.553572", "0.55340195", "0.55106574", "0.5467038", "0.546605", "0.5432914", "0.54255116", "0.54246473", "0.5418512", "0.54074055", "0.53995454", "0.5399023", "0.53960186", "0.5388849", "0.53804094", "0.53781796", "0.53781796", "0.53781796", "0.53781796", "0.5366722", "0.53525156", "0.5330425", "0.53268445", "0.53235537", "0.531284", "0.5309046", "0.5307813", "0.52785647", "0.52719045", "0.5269568", "0.5268102", "0.5267534", "0.52658856", "0.52655804", "0.52567774", "0.5255748", "0.5242053", "0.52249515", "0.52124983", "0.5212457", "0.518919", "0.5188812", "0.5188812", "0.51856303", "0.5175997", "0.51722527", "0.51708233", "0.5168456", "0.51652026", "0.5161687", "0.51553124", "0.51527727", "0.51511174", "0.5149127", "0.5148488", "0.5141356", "0.51386005", "0.51236784", "0.51229084", "0.51210994", "0.51173395", "0.51166743", "0.5116305", "0.5116305", "0.5116305", "0.51149166", "0.51112247", "0.5108337", "0.51004833", "0.50907815", "0.5090652", "0.50870544", "0.50860125", "0.50855285", "0.5083554", "0.5082766", "0.5078579", "0.50781816", "0.50778884", "0.507728", "0.5076709" ]
0.5934163
8
Create class instance if required
public static function &get_instance() { if(!isset(self::$instance)) { self::$instance = new self(); } // Return class instance return self::$instance; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static abstract function createInstance();", "public function newInstance(): object;", "public function create(){\r\n\treturn new $this->class();\r\n }", "public static function create() {}", "public static function create() {}", "public static function create() {}", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }", "public static function &CreateInstanceIfNotExists(){\n static $oInstance = null;\n\n if(!$oInstance instanceof self)\n $oInstance = new self();\n\n return $oInstance;\n }", "public function newInstance();", "public function newInstance();", "public static function init() {\n $class = __CLASS__;\n new $class;\n }", "static function create(): self;", "protected function instantiate()\n\t{\n\t\t$class = get_class($this);\n\t\t$model = new $class(null);\n\t\treturn $model;\n\t}", "function new_instance($class)\n {\n }", "public function create(string $class);", "function _new() {\n\tglobal $__classes;\n\n\t$args = func_get_args();\n\t$class=$args[0];\n\tif($__classes[$class] != \"\" && $class != \"db\") {\n\t\t$res = $__classes[$class];\n\t} else {\n\t\tif(!class_exists($class)) {\n\t\t\t//init class\n\t\t\tif (file_exists(BACKEND.$class.\".class.php\"))\n\t\t\t\tinclude(BACKEND.$class.\".class.php\");\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\n\t\tfor($i = 1; $i< count($args);$i++) $_args[] .= \"\\$args['\".$i.\"']\";\n\n\t\t$__args = \"\";\n\t\tif(@count($_args) > '0') {\n\t\t\t$__args = \"(\".implode(\",\",$_args).\")\";\n\t\t}\n\n\t\t$res = \"\";\n\t\teval(\"\\$res = new \".$class.$__args.\";\");\n\t\tdebuglog(\"neue Klasse\",\"Neue Klasse initiert:\".$class);\n\t\t$__classes[$class] = $res;\n\t}\n\treturn $res;\n }", "public function &create()\n {\n $obj = null;\n\n if (class_exists($this->_class_name)) {\n // Assigning the return value of new by reference\n $obj = new $this->_class_name();\n }\n\n return $obj;\n }", "function createInstance(ClassDefinition $classDefinition);", "abstract public function instance();", "private function __construct()\r\n {\r\n // Prevent direct instantiation\r\n }", "public abstract function createInstance($parameters);", "function __construct($service) {\n // return new $class;\n }", "public function fn_construct_class() {\n\t}", "private static function _instantiateThisObject() {\r\n $className = get_called_class();\r\n return new $className();\r\n }", "function _construct(){ }", "public function make() {}", "public function be_instantiatable() {\n\t\t$this->assertInstanceOf( Cache::class, $this->make_instance() );\n\t}", "private function __construct() {\n \n trace('***** Creating new '.__CLASS__.' object. *****');\n \n }", "final private function __construct() {}", "final private function __construct() {}", "public function construct() {\n\n }", "public function create()\n {\n return new $this->class;\n }", "public function instance();", "public static function factory($flags = null, $class_name = null) {}", "public static function factory($flags = null, $class_name = null) {}", "public function createClass()\n {\n return $this->addExcludesNameEntry($this->classes);\n }", "public function getInstance(/* ... */)\n {\n $reflection = new ReflectionClass($this->getClass());\n return $reflection->newInstanceArgs(func_get_args());\n }", "function __construct()\n {\n\n //Create a new instance of the View class\n $this->view = new View();\n\n //Create a new instance of the Template class\n $this->template = new Template();\n\n //Create a new instance of the Validator class\n $this->validator = new Validator();\n\n }", "protected function create() {\n\t}", "public function create(){}", "abstract function create();", "abstract protected function create ();", "public static function factory() {\n\t\tstatic $instance = false;\n\t\tif ( ! $instance ) {\n\t\t\t$instance = new self();\n\t\t\t$instance->setup();\n\t\t}\n\t\treturn $instance;\n\t}", "public function getInstance(): object;", "public function instantiate($className);", "protected function createItem()\n {\n return new PHP_Depend_Code_Class('clazz', 0);\n }", "protected abstract function __construct();", "public function getInstance()\n\t{\n\t\tif($this->classname === null) {\n\t\t\tthrow new BuildException('The classname attribute must be specified');\n\t\t}\n\t\t\n\t\tif($this->instance === null) {\n\t\t\ttry {\n\t\t\t\tPhing::import($this->classname, $this->classpath);\n\t\t\t}\n\t\t\tcatch (BuildException $be) {\n\t\t\t\t/* Cannot import the file. */\n\t\t\t\tthrow new BuildException(sprintf('Object from class %s cannot be instantiated', $this->classname), $be);\n\t\t\t}\n\t\t\t\n\t\t\t$class = $this->classname;\n\t\t\t$this->instance = new $class();\n\t\t}\n\t\treturn $this->instance;\n\t}", "private static function precall_getInstance(){\n $in = func_get_args();\n $reflect = new \\ReflectionClass(__CLASS__);\n return $reflect->newInstanceArgs($in);\n }", "public function newInstance(): object\n {\n return $this->instantiator->instantiate($this->name);\n }", "function __constructor(){}", "public function construct()\n\t\t{\n\t\t}", "private final function __construct() {}", "public function createInstance($processor);", "function get_instance($class)\n {\n }", "public abstract function make();", "protected final function __construct() {}", "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 }", "abstract protected function createObject();", "public function create() {}", "public function regularNew() {}", "abstract protected function onCreateInstance();", "final private function __construct() { }", "final private function __construct() { }", "final private function __construct() { }", "protected function construct(){\n\n }", "public static function factory() {\n\t\tstatic $instance = false;\n\n\t\tif ( ! $instance ) {\n\t\t\t$instance = new self();\n\t\t\t$instance->setup();\n\t\t}\n\n\t\treturn $instance;\n\t}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}" ]
[ "0.71257204", "0.68859786", "0.68807006", "0.68237764", "0.68237764", "0.68237764", "0.6819914", "0.6795121", "0.6771119", "0.6771119", "0.67241126", "0.67046785", "0.66990554", "0.66628236", "0.66607094", "0.6659983", "0.66365415", "0.6601006", "0.6595878", "0.652317", "0.6453263", "0.64463764", "0.6438084", "0.6432629", "0.6400564", "0.6396731", "0.6374786", "0.6365671", "0.6341586", "0.6341586", "0.6336594", "0.631894", "0.62904453", "0.62793094", "0.62793094", "0.6277179", "0.6273059", "0.6260903", "0.6251526", "0.62410575", "0.62351674", "0.6229222", "0.6223762", "0.62193775", "0.6212", "0.6210581", "0.62098414", "0.6205309", "0.62030077", "0.62028986", "0.61955", "0.6194345", "0.61891025", "0.6187067", "0.6185533", "0.6174506", "0.6159416", "0.6152853", "0.6151912", "0.6149979", "0.6135298", "0.6133969", "0.6129705", "0.6129705", "0.6129705", "0.6125109", "0.61055744", "0.61000633", "0.61000633", "0.61000633", "0.61000633", "0.61000633", "0.61000633", "0.61000633", "0.61000633", "0.61000633", "0.61000633", "0.61000633", "0.61000633", "0.61000633", "0.61000633", "0.61000633", "0.61000633", "0.61000633", "0.61000633", "0.61000633", "0.61000633", "0.61000633", "0.61000633", "0.61000633", "0.61000633", "0.61000633", "0.61000633", "0.61000633", "0.61000633", "0.61000633", "0.61000633", "0.61000633", "0.61000633", "0.61000633", "0.61000633" ]
0.0
-1
check used get parameters
private function __construct() { $action = isset($_GET['action']) ? sanitize_key($_GET['action']) : ''; $copy = isset($_GET['copy']) ? intval($_GET['copy']) : 0; if(!empty($copy)) { $this->copy_event = new EL_Event($copy); add_filter('get_object_terms', array(&$this, 'set_copied_categories')); } $this->options = &EL_Options::get_instance(); $this->is_new = 'edit' !== $action; add_action('add_meta_boxes', array(&$this, 'add_eventdata_metabox')); add_action('edit_form_top', array(&$this, 'form_top_content')); add_action('edit_form_after_title', array(&$this, 'form_after_title_content')); add_action('admin_print_scripts', array(&$this, 'embed_scripts')); add_action('save_post_el_events', array(&$this, 'save_eventdata'), 10, 3); add_filter('enter_title_here', array(&$this, 'change_default_title')); add_filter('post_updated_messages', array(&$this, 'updated_messages')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nvp_CheckGet($params) {\r\n $result=true;\r\n if (!empty ($params)) {\r\n foreach ($params as $eachparam) {\r\n if (isset($_GET[$eachparam])) {\r\n if (empty ($_GET[$eachparam])) {\r\n $result=false; \r\n }\r\n } else {\r\n $result=false;\r\n }\r\n }\r\n }\r\n return ($result);\r\n }", "public function checkParams()\n {\n if (!isset($_GET['params'])) {\n die($this->error('404'));\n } else {\n $id = $_GET['params'];\n }\n }", "function cpay_CheckGet($params) {\r\n $result = true;\r\n if (!empty($params)) {\r\n foreach ($params as $eachparam) {\r\n if (isset($_GET[$eachparam])) {\r\n if (empty($_GET[$eachparam])) {\r\n $result = false;\r\n }\r\n } else {\r\n $result = false;\r\n }\r\n }\r\n }\r\n return ($result);\r\n}", "private function verify_parameters(){\n if( empty( $_GET['email'] ) || empty( $_GET['pms_key'] ) || empty( $_GET['subscription_id'] ) )\n return false;\n\n return true;\n }", "function check_required_param($param = array(),$method){\n //set up method\n if (strtolower($method) == \"post\"){\n $r = $_POST;\n }else if (strtolower($method) == \"get\"){\n $r = $_GET;\n }\n //check of required param\n foreach ($param as $par){\n if (!isset($r[$par]) || empty($r[$par])){\n return false;\n break;\n }\n }\n return true;\n}", "function getParamInfo() {\n\t\treturn FALSE;\n\t}", "protected function checkParameters()\n\t{\n\t\t$this->dbResult['REQUEST'] = array(\n\t\t\t'GET' => $this->request->getQueryList()->toArray(),\n\t\t\t'POST' => $this->request->getPostList()->toArray(),\n\t\t);\n\n\t\t$this->arParams['PATH_TO_LOCATIONS_LIST'] = CrmCheckPath('PATH_TO_LOCATIONS_LIST', $this->arParams['PATH_TO_LOCATIONS_LIST'], '');\n\t\t$this->arParams['PATH_TO_LOCATIONS_EDIT'] = CrmCheckPath('PATH_TO_LOCATIONS_EDIT', $this->arParams['PATH_TO_LOCATIONS_EDIT'], '?loc_id=#loc_id#&edit');\n\t\t//$this->arParams['PATH_TO_LOCATIONS_ADD'] = CrmCheckPath('PATH_TO_LOCATIONS_ADD', $this->arParams['PATH_TO_LOCATIONS_ADD'], '?add');\n\t\t\n\t\t$this->componentData['LOCATION_ID'] = isset($this->arParams['LOC_ID']) ? intval($this->arParams['LOC_ID']) : 0;\n\n\t\tif($this->componentData['LOCATION_ID'] <= 0)\n\t\t{\n\t\t\t$locIDParName = isset($this->arParams['LOC_ID_PAR_NAME']) ? intval($this->arParams['LOC_ID_PAR_NAME']) : 0;\n\n\t\t\tif($locIDParName <= 0)\n\t\t\t\t$locIDParName = 'loc_id';\n\n\t\t\t$this->componentData['LOCATION_ID'] = isset($this->dbResult['REQUEST']['GET'][$locIDParName]) ? intval($this->dbResult['REQUEST']['GET'][$locIDParName]) : 0;\n\t\t}\n\n\t\treturn true;\n\t}", "public function checkRequiredParamsSet() : bool {\n }", "protected function verifyParams() {\n\t\t\treturn true;\n\t\t}", "function checkAllParams(){\n\t\tif(isset($_REQUEST['appid'][100]) || isset($ref[1000]) || isset($_REQUEST['uid'][200]) ){\n\t\t\tthrow new Exception('paramater length error',10001);\n\t\t}\n\t\tif(isset($_REQUEST['ref']))$_REQUEST['ref']=substr($_REQUEST['ref'], 0,990);\n\t\t\n\t\tif(!$this->check(\"appid\",$_REQUEST['appid']) && !isset($_REQUEST['json'])){\n\t\t\t//ea_write_log(APP_ROOT.\"/error_log/\".date('Y-m-d').\".log\", \"error_appid=\".$_REQUEST['appid'].\" \".$_REQUEST['event'].\" \".$_REQUEST['logs'].\" \\n\");\n\t\t\tthrow new Exception('appid error',10001);\n\t\t}\n\t\t\n\t\t$_REQUEST['appid']=strtolower($_REQUEST['appid']);\n\t\t$this->appidmap();\n\t}", "public function hasParams(){\n return $this->_has(8);\n }", "function getParams()\n {\n }", "public function get_params()\n {\n }", "public function get_params()\n {\n }", "function checkParametersValid($validParameters, $requestType) {\n\t\t//If no format supplied on get request, default to xml\n\t\tif ($requestType == \"get\" && !isset($_GET['format'])){\n\t\t\t$_GET['format'] = \"xml\";\n\t\t}\n \n\t\t$parameters = array_keys($_GET);\n \n //Valid values for the action parameter used when making put, post or delete requests\n\t\t$validActionParameters = array(\"put\", \"post\", \"del\");\n\t\t\n\t\t//Checks each $_GET parameter has an associating value, and returns the corresponding error code depending on which doesn't have a value. Or if parameter is action, ensures its a valid one.\n\t\tforeach($_GET as $parameter => $value){\n\t\t\tif (empty($value)){\n\t\t\t\tif ($requestType == \"get\"){\n //Print error code 1000\n\t\t\t\t\techo getErrorResponse(MISSING_PARAM);\n\t\t\t\t} else { //If its not a get request, return error if action is empty, otherwise it'll be the missing currency error\n\t\t\t\t\techo $parameter == \"action\" ? getErrorResponse(UNKOWN_ACTION) : getErrorResponse(MISSING_CURRENCY);\n\t\t\t\t}\n //Return false if any parameter is empty\n\t\t\t\treturn false;\t\t\t\n\t\t\t}\n \n\t\t\t//If not a get request and action parameter value is not put, post or delete, return error 2000\n\t\t\tif ($requestType != \"get\" && $parameter == \"action\" && !in_array($value, $validActionParameters)){\n\t\t\t\techo getErrorResponse(UNKOWN_ACTION);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Checks if the supplied $_GET parameters match the number of validParameters passed in\n\t\tif (count(array_diff($validParameters, $parameters)) != 0){\n\t\t\t//RETURN error codes 1000 or 2000\n\t\t\techo $requestType == \"get\" ? getErrorResponse(MISSING_PARAM) : getErrorResponse(UNKOWN_ACTION);\n\t\t\treturn false;\n\t\t} \n\t\t\n\t\t//Checks the reverse of the above to catch extra garbage parameters and also checks there are no duplicate valid parameters\n\t\tif (count(array_diff($parameters, $validParameters)) != 0 || urlHasDuplicateParameters($_SERVER['QUERY_STRING'])){\n\t\t\techo $requestType == \"get\" ? getErrorResponse(UNKOWN_PARAM) : getErrorResponse(UNKOWN_ACTION);\n\t\t\treturn false;\n\t\t\t//Return invalid parameter code 1100 or 2000\n\t\t}\n\t\t\n\t\t//At this point we can be sure all parameters exist and have a value, so we can set $codes array\n\t\t$codes = array();\n //Push codes in depending on the requestType\n\t\t$requestType == \"get\" ? array_push($codes, $_GET['to'], $_GET['from']) : array_push($codes, $_GET['cur']); \n\t\t\n //Check all codes exist within the rateCurrencies file\n if (!checkCurrencyCodesExists($codes)){\n echo $requestType == \"get\" ? getErrorResponse(UNKOWN_CURRENCY) : getErrorResponse(CURRENCY_NOT_FOUND);\n return false;\n }\n \n\t\t//Check currency codes are live if not making a put request\n\t\tif ($requestType != \"put\" && !checkCurrencyCodesLive($codes)){\n\t\t\techo $requestType == \"get\" ? getErrorResponse(UNKOWN_CURRENCY) : getErrorResponse(CURRENCY_NOT_FOUND);\n\t\t\treturn false;\t\n\t\t}\n\t\t\n\t\t//Get request specific errors\n\t\tif ($requestType == \"get\"){\n\t\t\t//Check if amount parameter submitted is decimal\n $amount = $_GET['amnt'];\n\t\t\tif (!is_numeric($amount)){\n echo getErrorResponse(CURRENCY_NOT_DECIMAL);\n\t\t\t\t return false;\n\t\t\t}\n //Cast parameter to float, after checking is_numeric and check its a float\n $convAmount = (float) $amount;\n if (!is_float($convAmount)){ \n echo getErrorResponse(CURRENCY_NOT_DECIMAL);\n\t\t\t\t return false;\n }\n\t\t\t\n\t\t\t//Check format parameter is valid, if not return error as xml\n\t\t\tif (!checkFormatValueValid($_GET['format'])){\n\t\t\t\techo getErrorResponse(INCORRECT_FORMAT);\n\t\t\t\treturn false;\n\t\t\t\t//Return format must be xml/json 1400\n\t\t\t}\n \n //If making a put, post or delete request and targetting the base currency, return error 2400\n\t\t} else if ($requestType != \"get\"){ //Action specific errors\n\t\t\tif ($_GET['cur'] == getBaseRate()){\n\t\t\t\techo getErrorResponse(IMMUTABLE_BASE_CURRENCY);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public function has_url_get_parameters() {\r\n\t\treturn (strlen($this->url_get_parameters) > 3);\r\n\t}", "function getParams()\n {\n }", "public function hasParameters(){\n return $this->_has(2);\n }", "public function testMissingParameterGetCheck() {\n $this->pingdom->getCheck(null);\n }", "public function hasParam(){\n return $this->_has(2);\n }", "public function hasParam(){\n return $this->_has(2);\n }", "public function hasParam(){\n return $this->_has(2);\n }", "public function hasParam(){\n return $this->_has(2);\n }", "public function hasParam(){\n return $this->_has(2);\n }", "public static function getRequiredParams();", "function isTheseParametersAvailable($params){\n //assuming all parameters are available \n $available = true; \n $missingparams = \"\"; \n \n foreach($params as $param){\n if(!isset($_POST[$param]) || strlen($_POST[$param])<=0){\n $available = false; \n $missingparams = $missingparams . \", \" . $param; \n }\n }\n \n //if parameters are missing \n if(!$available){\n $response = array(); \n $response['error'] = true; \n $response['message'] = 'Parameters ' . substr($missingparams, 1, strlen($missingparams)) . ' missing';\n \n //displaying error\n echo json_encode($response);\n \n //stopping further execution\n die();\n }\n }", "function get_params() {\r\n global $action;\r\n global $cur;\r\n\r\n // If action isn't set, return a 2000 error, otherwise save it in a variable\r\n if (isset($_GET[\"action\"])) {\r\n $action = $_GET[\"action\"];\r\n } else {\r\n throw_error(2000, \"Action not recognized or is missing\");\r\n }\r\n // If cur isn't set, return a 2000 error, otherwise save it in a variable\r\n if (isset($_GET[\"cur\"])) {\r\n $cur = $_GET[\"cur\"];\r\n } else {\r\n throw_error(2100, \"Currency code in wrong format or is missing\");\r\n }\r\n\r\n // Check if the action is post, put or del otherwise throw a 2000 error\r\n $actions = [\"post\", \"put\", \"del\"]; \r\n if (!in_array($action, $actions)) {\r\n throw_error(2000, \"Action not recognized or is missing\");\r\n }\r\n // Check the format of the cur and throw a 2100 error if it is incorrect\r\n if (strlen($cur) != 3 || is_numeric($cur)) {\r\n throw_error(2100, \"Currency code in wrong format or is missing\");\r\n }\r\n\r\n // Cannot update the base currency so throw a 2400 error\r\n if (strtoupper($cur) == \"GBP\") {\r\n throw_error(2400, \"Cannot update base currency\");\r\n }\r\n }", "abstract protected function getRequiredRequestParameters();", "function getParameters()\r\n {\r\n }", "function check_required_params($stage = null) {\n\tif ($_SERVER[\"REQUEST_METHOD\"] == \"GET\") {\n\t\tif ($stage == \"specific_floor\") {\n\t\t\t// Getting a specific floor.\n\t\t\tif (!(isset($_GET[\"id\"]) || isset($_GET[\"number\"]))) {\n\t\t\t\thttp_response_code(424);\n\t\t\t\techo json_encode(array(\n\t\t\t\t\t\"info\" => array(\n\t\t\t\t\t\t\"level\" => 0,\n\t\t\t\t\t\t\"status\" => \"error\",\n\t\t\t\t\t\t\"message\" => \"Required parameter 'id' or 'number' wasn't specified.\"\n\t\t\t\t\t)\n\t\t\t\t));\n\n\t\t\t\texit(1);\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// User requested with a method that is not supported by us.\n\t\thttp_response_code(400);\n\t\techo json_encode(array(\n\t\t\t\"info\" => array(\n\t\t\t\t\"level\" => 0,\n\t\t\t\t\"status\" => \"error\",\n\t\t\t\t\"message\" => \"Invalid request method \" . $_SERVER[\"REQUEST_METHOD\"] . \".\"\n\t\t\t)\n\t\t));\n\n\t\texit(1);\n\t}\n}", "public function getParams() {}", "function CheckSearchParms() {\n\n\t\t// Check basic search\n\t\tif ($this->BasicSearch->IssetSession())\n\t\t\treturn TRUE;\n\t\treturn FALSE;\n\t}", "function CheckSearchParms() {\n\n\t\t// Check basic search\n\t\tif ($this->BasicSearch->IssetSession())\n\t\t\treturn TRUE;\n\t\treturn FALSE;\n\t}", "function CheckSearchParms() {\n\n\t\t// Check basic search\n\t\tif ($this->BasicSearch->IssetSession())\n\t\t\treturn TRUE;\n\t\treturn FALSE;\n\t}", "function isTheseParametersAvailable($params){\n\t\t\n\t\t//traversing through all the parameters \n\t\tforeach($params as $param){\n\t\t\t//if the paramter is not available\n\t\t\tif(!isset($_POST[$param])){\n\t\t\t\t//return false \n\t\t\t\treturn false; \n\t\t\t}\n\t\t}\n\t\t//return true if every param is available \n\t\treturn true; \n\t}", "function CheckSearchParms() {\r\n\r\n\t\t// Check basic search\r\n\t\tif ($this->BasicSearch->IssetSession())\r\n\t\t\treturn TRUE;\r\n\t\treturn FALSE;\r\n\t}", "function required_param($parname, $type=PARAM_CLEAN, $errMsg=\"err_param_requis\") {\n\n // detect_unchecked_vars addition\n global $CFG;\n if (!empty($CFG->detect_unchecked_vars)) {\n global $UNCHECKED_VARS;\n unset ($UNCHECKED_VARS->vars[$parname]);\n }\n\n if (isset($_POST[$parname])) { // POST has precedence\n $param = $_POST[$parname];\n } else if (isset($_GET[$parname])) {\n $param = $_GET[$parname];\n } else {\n erreur_fatale($errMsg,$parname);\n }\n // ne peut pas �tre vide !!! (required)\n $tmpStr= clean_param($param, $type); //PP test final\n // attention \"0\" est empty !!!\n\n if (!empty($tmpStr) || $tmpStr==0) return $tmpStr;\n else erreur_fatale(\"err_param_suspect\",$parname.' '.$param. \" \".__FILE__ );\n\n\n}", "public function hasParams()\r\n\t{\r\n\t\treturn (is_array($this->pathParameters) && !empty($this->pathParameters));\r\n\t}", "protected function check() {\n if (empty($this->method_map)\n || empty($this->param)\n || empty($this->service_url)\n ) {\n throw new Exception('Param or method map is empty');\n }\n }", "private function checkRequiredParameters()\n {\n $missingParameters = array();\n\n foreach ($this->parameters as $name => $properties) {\n $required = $properties['required'];\n $value = $properties['value'];\n if ($required && is_null($value)) {\n $missingParameters[] = $name;\n }\n }\n\n if (count($missingParameters) > 0) {\n $missingParametersList = implode(', ', $missingParameters);\n throw new IndexParameterException('The following required\n parameters were not set: '.$missingParametersList.'.');\n }\n }", "function allowed_get_params($allowed_params = []){\r\n //$allowed_array will contain only allowed url parameters\r\n $allowed_array = [];\r\n foreach($allowed_params as $param){\r\n if(isset($_GET[$param])){\r\n $allowed_array[$param] = $_GET[$param];\r\n }else{\r\n $allowed_array[$param] = NULL;\r\n }\r\n }\r\n return $allowed_array;\r\n\r\n}", "public function testGetGetParams()\n {\n $expected = array('document' => array('filesize' => 100),\n 'get_test1' => 'true', 'get_test2' => 'go mets');\n $this->assertEquals($expected, $this->_req->getGetParams());\n }", "private function loadGetParams()\n {\n if(isset($_GET)) {\n $this->getParams = $_GET;\n }\n }", "function has_keep_parameters()\n{\n static $answer = null;\n if ($answer !== null) {\n return $answer;\n }\n\n foreach (array_keys($_GET) as $key) {\n if (\n isset($key[0]) &&\n $key[0] == 'k' &&\n substr($key, 0, 5) == 'keep_'\n //&& $key != 'keep_devtest' && $key != 'keep_show_loading'/*If testing memory use we don't want this to trigger it as it breaks the test*/\n ) {\n $answer = true;\n return $answer;\n }\n }\n $answer = false;\n return $answer;\n}", "public function isGet();", "public function getRequiredParameters();", "public function getRequiredParameters();", "public function hasParameters()\n {\n return !empty($this->params);\n }", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "private static function getGetParams()\n\t{\n\t\treturn $_GET;\n\t}", "function getParameters();", "function getParameters();", "public function testGetParameterFromGet(): void\n {\n // setup\n $_GET['get-parameter'] = 'get value';\n\n $requestParams = $this->getRequestParamsMock();\n\n // test body\n /** @var string $param */\n $param = $requestParams->getParam('get-parameter');\n\n // assertions\n $this->assertEquals('get value', $param, 'Value from $_GET must be fetched but it was not');\n }", "public function IsAccessParams ()\n {\n if (($this->token_type != null) && ($this->access_token != null)) {\n return TRUE;\n }\n return FALSE;\n }", "function getParams() {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $data_source;\n global $tab;\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($data_source)) {\n $this->data_source=$data_source;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n}", "function getParams() {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $data_source;\n global $tab;\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($data_source)) {\n $this->data_source=$data_source;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n}", "function getParams() {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $data_source;\n global $tab;\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($data_source)) {\n $this->data_source=$data_source;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n}", "function getParams() {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $data_source;\n global $tab;\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($data_source)) {\n $this->data_source=$data_source;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n}", "private function validateParams(){\n\t\t$name\t = $this->param['name']; \n\t\t$ic\t\t = $this->param['ic']; \n\t\t$mobile\t= $this->param['mobile']; \n\t\t$email\t= $this->param['email']; \n\t\t$statusCode = array();\n\t\tif(!$name){\n\t\t\t$statusCode[] = 115;\n\t\t}\n\t\tif(!$ic){\n\t\t\t$statusCode[] = 116;\n\t\t}\n\t\tif(!$email){\n\t\t\t$statusCode []= 101;\n\t\t}elseif (!filter_var($email, FILTER_VALIDATE_EMAIL)) {\n\t\t $statusCode[] = 105;\n\t\t}\n\t\treturn $statusCode;\n\t}", "function get_exists($parameter){\n return key_exists($parameter, $_GET) && strlen(trim($_GET[$parameter])) > 0;\n}", "private function checkrequest()\n {\n // This method checks if there is user input, and returns the request_method if evaluated to be true\n if ($_SERVER['REQUEST_METHOD'] == \"POST\") {\n $this->request = \"post\";\n return true;\n } elseif ($_SERVER['REQUEST_METHOD'] == \"GET\") {\n $this->request = \"get\";\n return true;\n } else {\n $this->request = false;\n }\n }", "function getParams()\n {\n global $id;\n global $mode;\n global $data_source;\n global $view_mode;\n global $edit_mode;\n global $tab;\n if (isset($id)) {\n $this->id = $id;\n }\n if (isset($mode)) {\n $this->mode = $mode;\n }\n if (isset($data_source)) {\n $this->data_source = $data_source;\n }\n if (isset($view_mode)) {\n $this->view_mode = $view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode = $edit_mode;\n }\n if (isset($tab)) {\n $this->tab = $tab;\n }\n }", "function hasParam($name)\n {\n return isset($_REQUEST[$name]);\n }", "public function checkGetArticle(){\n\t\tif(isset($_GET[self::$article])){\n\t\t\treturn TRUE;\n\t\t}\n\t\treturn FALSE;\n\t}", "protected function check() {\n if (empty($this->method_map)\n || empty($this->service_url)\n ) {\n throw new Exception('Param or method map is empty');\n }\n }", "function hasParam($name) {\n\t\tif (isset($this->getvars[$name])) {\n\t\t\treturn TRUE;\n\t\t}\n\t\tif (isset($this->postvars[$name])) {\n\t\t\treturn TRUE;\n\t\t}\n\t\treturn FALSE;\n\t}", "protected function validateParams() {\r\n $user = $this->user;\r\n $userId = $this->userId;\r\n if ($user === NULL) {\r\n $lang = $this->getLanguage();\r\n $this->addErrorMessage($lang->getMessage('error.userNotFound', htmlspecialchars($userId)));\r\n return FALSE;\r\n }\r\n return TRUE;\r\n }", "function getParams() {\r\n global $id;\r\n global $mode;\r\n global $view_mode;\r\n global $edit_mode;\r\n global $data_source;\r\n global $tab;\r\n if (isset($id)) {\r\n $this->id=$id;\r\n }\r\n if (isset($mode)) {\r\n $this->mode=$mode;\r\n }\r\n if (isset($view_mode)) {\r\n $this->view_mode=$view_mode;\r\n }\r\n if (isset($edit_mode)) {\r\n $this->edit_mode=$edit_mode;\r\n }\r\n if (isset($data_source)) {\r\n $this->data_source=$data_source;\r\n }\r\n if (isset($tab)) {\r\n $this->tab=$tab;\r\n }\r\n}", "public function getValidParameters()\n {\n return null;\n }", "public function getParameters() {}", "function get_required_param($param)\n{\n global $params;\n\n if (empty($params[$param]))\n {\n header('HTTP/1.0 400 Bad Request');\n die('Invalid Request - Missing \"' . $param . '\"');\n }\n\n return $params[$param];\n}", "function isTheseParametersAvailable($required_fields)\n{\n $error = false;\n $error_fields = \"\";\n $request_params = $_REQUEST;\n\n foreach ($required_fields as $field) {\n if (!isset($request_params[$field]) || strlen(trim($request_params[$field])) <= 0) {\n $error = true;\n $error_fields .= $field . ', ';\n }\n }\n\n if ($error) {\n $response = array();\n $response[\"error\"] = true;\n $response[\"message\"] = 'Required field(s) ' . substr($error_fields, 0, -2) . ' is missing or empty';\n echo json_encode($response);\n return false;\n }\n return true;\n}", "function getParams() {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $tab;\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n\n\n\n}", "public function has_param($key)\n {\n }", "function check_required_vars($params = array())\n\t{\n\t\tglobal $SID, $phpEx, $data;\n\n\t\twhile( list($var, $param) = @each($params) )\n\t\t{\n\t\t\tif (empty($data[$param]))\n\t\t\t{\n\t\t\t\tredirect(append_sid(\"garage.$phpEx?mode=error&EID=3\", true));\n\t\t\t}\n\t\t}\n\n\t\treturn ;\n\t}", "function getParams() {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $tab;\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n}", "function getParams() {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $tab;\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n}", "function getParams() {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $tab;\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n}", "public function getRequestParams();", "public function getValidParams()\n {\n if ($this->isModuleActive() && empty($this->scriptRan)) {\n $userIdKey = Mage::helper('kproject_sas')->getAffiliateIdentifierKey();\n if (!empty($userIdKey) && !isset($this->validParams[$userIdKey])) {\n $this->validParams[$userIdKey] = false;\n unset($this->validParams['userID']);\n }\n\n $clickIdKey = Mage::helper('kproject_sas')->getClickIdentifierKey();\n if (!empty($clickIdKey) && !isset($this->validParams[$clickIdKey])) {\n $this->validParams[$clickIdKey] = false;\n unset($this->validParams['sscid']);\n }\n $this->scriptRan = true;\n }\n\n return parent::getValidParams();\n }", "function getParams()\n {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $tab;\n if (isset($id)) {\n $this->id = $id;\n }\n if (isset($mode)) {\n $this->mode = $mode;\n }\n if (isset($view_mode)) {\n $this->view_mode = $view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode = $edit_mode;\n }\n if (isset($tab)) {\n $this->tab = $tab;\n }\n }", "public static function isGet()\n {\n return !empty($_GET);\n }", "function __checkImgParams() {\n\t\t/* check file type */\n\t\t$this->__checkType($this->request->data['Upload']['file']['type']);\n\t\t\n\t\n\t\t\n\t\t/* check file size */\n\t\t$this->__checkSize($this->request->data['Upload']['file']['size']);\n\t\t\n\t\t\n\t\t\n\t\t/* check image dimensions */\n\t\t$this->__checkDimensions($this->request->data['Upload']['file']['tmp_name']);\n\t\t\n\t\t\t\n\t}", "public function goCheck(){\n $request = Request::instance();\n\n $params = $request->param();\n\n //check the input params\n $result = $this->batch()->check($params);\n\n //adjust the checked result\n if($result){\n return true;\n }else{\n $ex = new InputParamsErr();\n $ex->errMsg = $this->getError();\n throw $ex;\n }\n }", "private function check_request_variables()\n {\n $page_var = $this->prefix . 'page';\n $results_var = $this->prefix . 'results';\n if ( array_key_exists($page_var, $_REQUEST)\n && !empty($_REQUEST[$page_var]))\n {\n $this->current_page = $_REQUEST[$page_var];\n }\n if ( array_key_exists($results_var, $_REQUEST)\n && !empty($_REQUEST[$results_var]))\n {\n $this->results_per_page = $_REQUEST[$results_var];\n }\n $this->offset = ($this->current_page-1) * $this->results_per_page;\n if ($this->offset < 0)\n {\n $this->offset = 0;\n }\n return;\n }", "private function checkParams($params){\n\n if(count($params) == 3)\n return true;\n else\n return false;\n }", "function getParams() {\r\n global $id;\r\n global $mode;\r\n global $view_mode;\r\n global $edit_mode;\r\n global $tab;\r\n if (isset($id)) {\r\n $this->id=$id;\r\n }\r\n if (isset($mode)) {\r\n $this->mode=$mode;\r\n }\r\n if (isset($view_mode)) {\r\n $this->view_mode=$view_mode;\r\n }\r\n if (isset($edit_mode)) {\r\n $this->edit_mode=$edit_mode;\r\n }\r\n if (isset($tab)) {\r\n $this->tab=$tab;\r\n }\r\n}", "function getParams() {\r\n global $id;\r\n global $mode;\r\n global $view_mode;\r\n global $edit_mode;\r\n global $tab;\r\n if (isset($id)) {\r\n $this->id=$id;\r\n }\r\n if (isset($mode)) {\r\n $this->mode=$mode;\r\n }\r\n if (isset($view_mode)) {\r\n $this->view_mode=$view_mode;\r\n }\r\n if (isset($edit_mode)) {\r\n $this->edit_mode=$edit_mode;\r\n }\r\n if (isset($tab)) {\r\n $this->tab=$tab;\r\n }\r\n}", "function validateRequest(){\n // if ($_GET['key'] != getenv(\"LAB_NODE_KEY\")){\n // exit;\n // }\n if ($_GET['key'] != ''){\n exit;\n }\n }", "function exist_param($fieldname){\n return array_key_exists($fieldname, $_REQUEST);\n }", "function ValidRequiredQueryString($name) {\n return isset($_GET[$name]) && $_GET[$name] != \"\";\n}", "public function getParameters()\n\t{\n\n\t}" ]
[ "0.75109357", "0.75027996", "0.73769987", "0.7195657", "0.71902996", "0.70217556", "0.69933057", "0.69877213", "0.6933584", "0.6928373", "0.6922809", "0.6921744", "0.69183916", "0.69183916", "0.69051754", "0.6864304", "0.6846635", "0.68395513", "0.68095434", "0.6742939", "0.6742939", "0.6742939", "0.6742939", "0.6742939", "0.6732688", "0.6726776", "0.6717542", "0.67003953", "0.66558266", "0.66540486", "0.65987885", "0.65865105", "0.65865105", "0.65865105", "0.65576065", "0.65496224", "0.6533377", "0.65187854", "0.6509756", "0.649111", "0.64882326", "0.6473587", "0.64719003", "0.6468966", "0.6441221", "0.6437841", "0.6437841", "0.64107984", "0.6406804", "0.6406804", "0.6406804", "0.6406804", "0.6406804", "0.6406804", "0.6406804", "0.6406804", "0.6406804", "0.6406804", "0.6375697", "0.6365833", "0.6365833", "0.636117", "0.63426346", "0.6340979", "0.6340979", "0.6340979", "0.6340979", "0.6311605", "0.6311168", "0.63102186", "0.6303934", "0.6301158", "0.63007474", "0.6291897", "0.6279305", "0.62660706", "0.62631965", "0.625847", "0.62566286", "0.6241476", "0.6239766", "0.6230834", "0.62299174", "0.6228039", "0.62179494", "0.62179494", "0.62179494", "0.6216068", "0.6208037", "0.62066245", "0.61967695", "0.61763066", "0.6170096", "0.61532265", "0.61518306", "0.61408025", "0.61408025", "0.6137992", "0.6129287", "0.6126807", "0.61237246" ]
0.0
-1
set post values if an event gets copied
public function form_top_content() { if(!empty($this->copy_event)) { global $post; $post->post_title = $this->copy_event->title; $post->post_content = $this->copy_event->content; } // show label for event title echo ' <label class="event-option">'.__('Event Title','event-list').':</label>'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function OnAfterCopy($original_id, $copy_id){\n }", "protected function onBeforeCopy()\n\t{\n\t\tself::$recordBeforeCopy = $this->getClone();\n\n\t\t$this->onBeforeCopyVersioned();\n\t}", "function &postCopy () {\n \t\t/* override to copy fields as necessary to complete the full copy. */\n \t\treturn $this;\n \t}", "function capture_customize_post_value_set_actions() {\n\t\t$action = current_action();\n\t\t$args = func_get_args();\n\t\t$this->captured_customize_post_value_set_actions[] = compact( 'action', 'args' );\n\t}", "public function duplicatePost()\n {\n global $wpdb;\n\n if (!(isset($_GET['post']) || isset($_POST['post']) || (isset($_REQUEST['action']) && 'duplicate_post' == $_REQUEST['action']))) {\n wp_die(__('No post to duplicate has been supplied!', 'event-manager'));\n }\n\n $post_id = (isset($_GET['post']) ? absint($_GET['post']) : absint($_POST['post']));\n $post = get_post($post_id);\n\n $current_user = wp_get_current_user();\n $new_post_author = $current_user->ID;\n\n if (!isset($post) || empty($post)) {\n wp_die(__('Event creation failed, could not find original event', 'event-manager').': ' . $post_id);\n return;\n }\n\n $args = array(\n 'comment_status' => $post->comment_status,\n 'ping_status' => $post->ping_status,\n 'post_author' => $new_post_author,\n 'post_content' => $post->post_content,\n 'post_excerpt' => $post->post_excerpt,\n 'post_name' => '',\n 'post_parent' => $post->post_parent,\n 'post_password' => $post->post_password,\n 'post_status' => 'draft',\n 'post_title' => '',\n 'post_type' => $post->post_type,\n 'to_ping' => $post->to_ping,\n 'menu_order' => $post->menu_order\n );\n\n $new_post_id = wp_insert_post($args);\n\n // get current post terms and set them to the new event draft\n $taxonomies = get_object_taxonomies($post->post_type);\n foreach ($taxonomies as $taxonomy) {\n $post_terms = wp_get_object_terms($post_id, $taxonomy, array('fields' => 'slugs'));\n wp_set_object_terms($new_post_id, $post_terms, $taxonomy, false);\n }\n\n // duplicate all post meta\n $post_meta_infos = $wpdb->get_results(\"SELECT meta_key, meta_value FROM $wpdb->postmeta WHERE post_id=$post_id\");\n\n if (count($post_meta_infos) != 0) {\n $sql_query = \"INSERT INTO $wpdb->postmeta (post_id, meta_key, meta_value) \";\n // Filter certain values from imported events\n foreach ($post_meta_infos as $meta_info) {\n $meta_key = $meta_info->meta_key;\n switch ($meta_key) {\n case 'import_client':\n continue 2;\n\n case 'imported_post':\n $meta_value = addslashes(0);\n break;\n\n case 'sync':\n $meta_value = addslashes(0);\n break;\n\n default:\n $meta_value = addslashes($meta_info->meta_value);\n break;\n }\n\n $sql_query_sel[]= \"SELECT $new_post_id, '$meta_key', '$meta_value'\";\n }\n\n $sql_query.= implode(\" UNION ALL \", $sql_query_sel);\n $wpdb->query($sql_query);\n }\n\n wp_redirect(admin_url('post.php?action=edit&post=' . $new_post_id.'&duplicate=' . $post_id));\n exit;\n }", "public function postEventadd();", "function dp_save_event_info($post_id) {\n // if not, then return\n if ('event' != $_POST['post_type']) {\n return;\n }\n\n // checking for the 'save' status\n $is_autosave = wp_is_post_autosave($post_id);\n $is_revision = wp_is_post_revision($post_id);\n $is_valid_nonce = (isset($_POST['dp-event-info-nonce']) && (wp_verify_nonce($_POST['dp-event-info-nonce'], basename(__FILE__)))) ? true : false;\n\n // exit depending on the save status or if the nonce is not valid\n if ($is_autosave || $is_revision || !$is_valid_nonce) {\n return;\n }\n\n // checking for the values and performing necessary actions\n if (isset($_POST['dp-event-date'])) {\n update_post_meta($post_id, 'event-date', strtotime($_POST['dp-event-date']));\n }\n\n if (isset($_POST['dp-event-glat'])) {\n update_post_meta($post_id, 'event-glat', sanitize_text_field($_POST['dp-event-glat']));\n }\n\n if (isset($_POST['dp-event-glng'])) {\n update_post_meta($post_id, 'event-glng', sanitize_text_field($_POST['dp-event-glng']));\n }\n\n if (isset($_POST['dp-event-url'])) {\n update_post_meta($post_id, 'event-url', sanitize_text_field($_POST['dp-event-url']));\n }\n}", "function _wp_customize_changeset_filter_insert_post_data($post_data, $supplied_post_data)\n {\n }", "function acf_copy_postmeta($from_post_id = 0, $to_post_id = 0)\n{\n}", "function _save_post_hook()\n {\n }", "function save_meta_info( $post_id, $post ) {\n if($post->post_type != 'events')\n return $post_id;\n\n /* Verify the nonce before proceeding. */\n if ( !isset( $_POST['mindevents_event_meta_nonce'] ) || !wp_verify_nonce( $_POST['mindevents_event_meta_nonce'], basename( __FILE__ ) ) )\n return $post_id;\n\n\n\n $field_key = 'event_meta';\n /* Get the posted data and sanitize it for use as an HTML class. */\n $new_meta_values = (isset( $_POST[$field_key]) ? $_POST[$field_key] : '' );\n if($new_meta_values) :\n foreach ($new_meta_values as $key => $value) :\n update_post_meta( $post_id, $key, $value);\n endforeach;\n endif;\n\n return $post_id;\n }", "public function postEventDel();", "function postCopyHook()\n {\n foreach ($this->plugins as &$plugin) {\n $plugin->postCopyHook();\n }\n unset($plugin);\n }", "function save_QRCode_Event_BA_DM_Plugin(){\n\t\tglobal $post;\n\t\t# prüft zerst $post, ist er nicht vorhanden dann lohnen sich die unteren Abfragen nicht, da es ja noch keine Posts dazu gibt und es zu lauter Fehlermeldungen führen würde (wegen nicht vorhandener Post-Einträge)\n\t\tif (!empty($post)) {\n\t\t\tupdate_post_meta($post->ID, \"qrCode_event_name\", $_POST['qrCode_event_name']);\n\t\t\tupdate_post_meta($post->ID, \"qrCode_event_start\", $_POST['qrCode_event_start']);\n\t\t\tupdate_post_meta($post->ID, \"qrCode_event_end\", $_POST['qrCode_event_end']);\n\t\t\tupdate_post_meta($post->ID, \"qrCode_event_location\", $_POST['qrCode_event_location']);\n\t\t\tupdate_post_meta($post->ID, \"qrCode_event_description\", $_POST['qrCode_event_description']);\n\t\t\tupdate_post_meta($post->ID, \"qrCode_event_size\", $_POST['qrCode_event_size']);\n\t\t\tupdate_post_meta($post->ID, \"qrCode_event_ecc_level\", $_POST['qrCode_event_ecc_level']);\n\t\t}\n\n\t}", "public function handleCopy(CopyEvent $event)\n {\n $document = $event->getDocument();\n if (!$document instanceof ArticleDocument) {\n return;\n }\n\n $uuid = $event->getCopiedNode()->getIdentifier();\n $this->documents[$uuid] = [\n 'uuid' => $uuid,\n 'locale' => $document->getLocale(),\n ];\n }", "protected function _postSave()\r\n\t{\r\n\t}", "protected function getPostValues() {}", "public function process_post() {\n\t\t$name = $this->node->attr('name');\n\n\n\t\tif (!empty($_POST) && $this->get_post_value($name)) {\n//\t\t\t$this->value = $this->get_post_value($name);\n\t\t\t$this->value($this->get_post_value($name));\n\t\t}\n\t}", "function save_meta_box_data( $post_id, $post, $update ) {\n\n\t\t// Disregard on autosave.\n\t\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Make sure user has permissions.\n\t\t$post_type_object = get_post_type_object( $post->post_type );\n\t\t$user_has_cap = $post_type_object && isset( $post_type_object->cap->edit_post ) ? current_user_can( $post_type_object->cap->edit_post ) : false;\n\n\t\tif ( ! $user_has_cap ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Proceed depending on post type.\n\t\tswitch( $post->post_type ) {\n\n\t\t\tcase 'schedule':\n\n\t\t\t\t// Make sure fields are set.\n\t\t\t\tif ( isset( $_POST[ 'conf_schedule' ] ) && isset( $_POST[ 'conf_schedule' ][ 'event' ] ) ) {\n\n\t\t\t\t\t// Check if our nonce is set because the 'save_post' action can be triggered at other times.\n\t\t\t\t\tif ( isset( $_POST[ 'conf_schedule_save_event_details_nonce' ] ) ) {\n\n\t\t\t\t\t\t// Verify the nonce.\n\t\t\t\t\t\tif ( wp_verify_nonce( $_POST[ 'conf_schedule_save_event_details_nonce' ], 'conf_schedule_save_event_details' ) ) {\n\n\t\t\t\t\t\t\t// Make sure date is set.\n\t\t\t\t\t\t\tif ( isset( $_POST[ 'conf_schedule' ][ 'event' ][ 'date' ] ) ) {\n\n\t\t\t\t\t\t\t\t// Sanitize the value.\n\t\t\t\t\t\t\t\t$event_date = sanitize_text_field( $_POST[ 'conf_schedule' ][ 'event' ][ 'date' ] );\n\n\t\t\t\t\t\t\t\t// Update/save value.\n\t\t\t\t\t\t\t\tupdate_post_meta( $post_id, 'conf_sch_event_date', $event_date );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Make sure times are set.\n\t\t\t\t\t\t\tforeach ( array( 'start_time', 'end_time' ) as $time_key ) {\n\n\t\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t\t * If we have a value, store it.\n\t\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t\t * Otherwise, clear it out.\n\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\tif ( isset( $_POST[ 'conf_schedule' ][ 'event' ][ $time_key ] ) ) {\n\n\t\t\t\t\t\t\t\t\t// Sanitize the value.\n\t\t\t\t\t\t\t\t\t$time_value = sanitize_text_field( $_POST[ 'conf_schedule' ][ 'event' ][ $time_key ] );\n\n\t\t\t\t\t\t\t\t\t// If we have a time, format it.\n\t\t\t\t\t\t\t\t\tif ( ! empty( $time_value ) ) {\n\t\t\t\t\t\t\t\t\t\t$time_value = date( 'H:i', strtotime( $time_value ) );\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// Update/save value.\n\t\t\t\t\t\t\t\t\tupdate_post_meta( $post_id, \"conf_sch_event_{$time_key}\", $time_value );\n\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tupdate_post_meta( $post_id, \"conf_sch_event_{$time_key}\", null );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t * Set the event type relationships.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tif ( isset( $_POST[ 'conf_schedule' ][ 'event' ][ 'event_types' ] ) ) {\n\n\t\t\t\t\t\t\t\t$event_types = $_POST[ 'conf_schedule' ][ 'event' ][ 'event_types' ];\n\n\t\t\t\t\t\t\t\t// Make sure its an array.\n\t\t\t\t\t\t\t\tif ( ! is_array( $event_types ) ) {\n\t\t\t\t\t\t\t\t\t$event_types = explode( ',', $event_types );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Make sure it has only IDs.\n\t\t\t\t\t\t\t\t$event_types = array_filter( $event_types, 'is_numeric' );\n\n\t\t\t\t\t\t\t\t// Convert to integer.\n\t\t\t\t\t\t\t\t$event_types = array_map( 'intval', $event_types );\n\n\t\t\t\t\t\t\t\t// Set the terms.\n\t\t\t\t\t\t\t\twp_set_object_terms( $post_id, $event_types, 'event_types', false );\n\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\twp_delete_object_term_relationships( $post_id, 'event_types' );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t * Make sure session categories are set.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tif ( isset( $_POST[ 'conf_schedule' ][ 'event' ][ 'session_categories' ] ) ) {\n\n\t\t\t\t\t\t\t\t$session_categories = $_POST[ 'conf_schedule' ][ 'event' ][ 'session_categories' ];\n\n\t\t\t\t\t\t\t\t// Make sure its an array.\n\t\t\t\t\t\t\t\tif ( ! is_array( $session_categories ) ) {\n\t\t\t\t\t\t\t\t\t$session_categories = explode( ',', $session_categories );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Make sure it has only IDs.\n\t\t\t\t\t\t\t\t$session_categories = array_filter( $session_categories, 'is_numeric' );\n\n\t\t\t\t\t\t\t\t// Convert to integer.\n\t\t\t\t\t\t\t\t$session_categories = array_map( 'intval', $session_categories );\n\n\t\t\t\t\t\t\t\t// Set the terms.\n\t\t\t\t\t\t\t\twp_set_object_terms( $post_id, $session_categories, 'session_categories', false );\n\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\twp_delete_object_term_relationships( $post_id, 'session_categories' );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Make sure location is set.\n\t\t\t\t\t\t\tif ( isset( $_POST[ 'conf_schedule' ][ 'event' ][ 'location' ] ) ) {\n\n\t\t\t\t\t\t\t\t// Sanitize the value.\n\t\t\t\t\t\t\t\t$event_location = sanitize_text_field( $_POST[ 'conf_schedule' ][ 'event' ][ 'location' ] );\n\n\t\t\t\t\t\t\t\t// Update/save value.\n\t\t\t\t\t\t\t\tupdate_post_meta( $post_id, 'conf_sch_event_location', $event_location );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t * Make sure speakers are set.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tif ( isset( $_POST[ 'conf_schedule' ][ 'event' ][ 'speakers' ] ) ) {\n\n\t\t\t\t\t\t\t\t$event_speakers = $_POST[ 'conf_schedule' ][ 'event' ][ 'speakers' ];\n\n\t\t\t\t\t\t\t\t// Make sure its an array.\n\t\t\t\t\t\t\t\tif ( ! is_array( $event_speakers ) ) {\n\t\t\t\t\t\t\t\t\t$event_speakers = explode( ',', $event_speakers );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Make sure it has only IDs.\n\t\t\t\t\t\t\t\t$event_speakers = array_filter( $event_speakers, 'is_numeric' );\n\n\t\t\t\t\t\t\t\t// Convert to integer.\n\t\t\t\t\t\t\t\t$event_speakers = array_map( 'intval', $event_speakers );\n\n\t\t\t\t\t\t\t\t// Update/save value.\n\t\t\t\t\t\t\t\tupdate_post_meta( $post_id, 'conf_sch_event_speakers', $event_speakers );\n\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tupdate_post_meta( $post_id, 'conf_sch_event_speakers', null );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t * Make sure 'sch_link_to_post' is set.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tif ( isset( $_POST[ 'conf_schedule' ][ 'event' ][ 'sch_link_to_post' ] ) ) {\n\t\t\t\t\t\t\t\tupdate_post_meta( $post_id, 'conf_sch_link_to_post', '1' );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tupdate_post_meta( $post_id, 'conf_sch_link_to_post', '0' );\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/*\n\t\t\t\t\t * Check if our session details nonce is set because\n\t\t\t\t\t * the 'save_post' action can be triggered at other times.\n\t\t\t\t\t */\n\t\t\t\t\tif ( isset( $_POST[ 'conf_schedule_save_session_details_nonce' ] ) ) {\n\n\t\t\t\t\t\t// Verify the nonce.\n\t\t\t\t\t\tif ( wp_verify_nonce( $_POST[ 'conf_schedule_save_session_details_nonce' ], 'conf_schedule_save_session_details' ) ) {\n\n\t\t\t\t\t\t\t// Process each field.\n\t\t\t\t\t\t\tforeach ( array( 'livestream_url', 'slides_url', 'feedback_url', 'feedback_reveal_delay_seconds', 'follow_up_url', 'video_url' ) as $field_name ) {\n\t\t\t\t\t\t\t\tif ( isset( $_POST[ 'conf_schedule' ][ 'event' ][ $field_name ] ) ) {\n\n\t\t\t\t\t\t\t\t\t// Sanitize the value.\n\t\t\t\t\t\t\t\t\t$field_value = sanitize_text_field( $_POST[ 'conf_schedule' ][ 'event' ][ $field_name ] );\n\n\t\t\t\t\t\t\t\t\t// Update/save value.\n\t\t\t\t\t\t\t\t\tupdate_post_meta( $post_id, \"conf_sch_event_{$field_name}\", trim( $field_value ) );\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t * Process the session file.\n\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t * Check to see if our\n\t\t\t\t\t\t\t * 'conf_schedule_event_delete_slides_file'\n\t\t\t\t\t\t\t * hidden input is included.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tif ( ! empty( $_FILES ) && isset( $_FILES[ 'conf_schedule_event_slides_file' ] ) && ! empty( $_FILES[ 'conf_schedule_event_slides_file' ][ 'name' ] ) ) {\n\n\t\t\t\t\t\t\t\t// Upload the file to the server.\n\t\t\t\t\t\t\t\t$upload_file = wp_handle_upload( $_FILES[ 'conf_schedule_event_slides_file' ], array( 'test_form' => false ) );\n\n\t\t\t\t\t\t\t\t// If the upload was successful...\n\t\t\t\t\t\t\t\tif ( $upload_file && ! isset( $upload_file[ 'error' ] ) ) {\n\n\t\t\t\t\t\t\t\t\t// Should be the path to a file in the upload directory.\n\t\t\t\t\t\t\t\t\t$file_name = $upload_file[ 'file' ];\n\n\t\t\t\t\t\t\t\t\t// Get the file type.\n\t\t\t\t\t\t\t\t\t$file_type = wp_check_filetype( $file_name );\n\n\t\t\t\t\t\t\t\t\t// Prepare an array of post data for the attachment.\n\t\t\t\t\t\t\t\t\t$attachment = array( 'guid' => $upload_file[ 'url' ], 'post_mime_type' => $file_type[ 'type' ], 'post_title' => preg_replace( '/\\.[^.]+$/', '', basename( $file_name ) ), 'post_content' => '', 'post_status' => 'inherit' );\n\n\t\t\t\t\t\t\t\t\t// Insert the attachment.\n\t\t\t\t\t\t\t\t\tif ( $attachment_id = wp_insert_attachment( $attachment, $file_name, $post_id ) ) {\n\n\t\t\t\t\t\t\t\t\t\t// Generate the metadata for the attachment and update the database record.\n\t\t\t\t\t\t\t\t\t\tif ( $attach_data = wp_generate_attachment_metadata( $attachment_id, $file_name ) ) {\n\t\t\t\t\t\t\t\t\t\t\twp_update_attachment_metadata( $attachment_id, $attach_data );\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t// Update/save value.\n\t\t\t\t\t\t\t\t\t\tupdate_post_meta( $post_id, 'conf_sch_event_slides_file', $attachment_id );\n\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else if ( isset( $_POST[ 'conf_schedule_event_delete_slides_file' ] )\n\t\t\t\t\t\t\t\t&& $_POST[ 'conf_schedule_event_delete_slides_file' ] > 0 ) {\n\n\t\t\t\t\t\t\t\t// Clear out the meta.\n\t\t\t\t\t\t\t\tupdate_post_meta( $post_id, 'conf_sch_event_slides_file', null );\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t/*\n\t\t\t\t\t * Check if our social media nonce is set because\n\t\t\t\t\t * the 'save_post' action can be triggered at other times.\n\t\t\t\t\t */\n\t\t\t\t\tif ( isset( $_POST[ 'conf_schedule_save_event_social_media_nonce' ] ) ) {\n\n\t\t\t\t\t\t// Verify the nonce.\n\t\t\t\t\t\tif ( wp_verify_nonce( $_POST[ 'conf_schedule_save_event_social_media_nonce' ], 'conf_schedule_save_event_social_media' ) ) {\n\n\t\t\t\t\t\t\t// Process each field.\n\t\t\t\t\t\t\tforeach ( array( 'hashtag' ) as $field_name ) {\n\t\t\t\t\t\t\t\tif ( isset( $_POST[ 'conf_schedule' ][ 'event' ][ $field_name ] ) ) {\n\n\t\t\t\t\t\t\t\t\t// Sanitize the value.\n\t\t\t\t\t\t\t\t\t$field_value = sanitize_text_field( $_POST[ 'conf_schedule' ][ 'event' ][ $field_name ] );\n\n\t\t\t\t\t\t\t\t\t// Remove any possible hashtags.\n\t\t\t\t\t\t\t\t\t$field_value = preg_replace( '/\\#/i', '', $field_value );\n\n\t\t\t\t\t\t\t\t\t// Update/save value.\n\t\t\t\t\t\t\t\t\tupdate_post_meta( $post_id, \"conf_sch_event_{$field_name}\", $field_value );\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'speakers':\n\n\t\t\t\t// Make sure event fields are set.\n\t\t\t\tif ( isset( $_POST[ 'conf_schedule' ] ) && isset( $_POST[ 'conf_schedule' ][ 'speaker' ] ) ) {\n\n\t\t\t\t\t/*\n\t\t\t\t\t * Check if our speaker details nonce is set because the\n\t\t\t\t\t * 'save_post' action can be triggered at other times.\n\t\t\t\t\t */\n\t\t\t\t\tif ( isset( $_POST[ 'conf_schedule_save_speaker_details_nonce' ] ) ) {\n\n\t\t\t\t\t\t// Verify the nonce.\n\t\t\t\t\t\tif ( wp_verify_nonce( $_POST[ 'conf_schedule_save_speaker_details_nonce' ], 'conf_schedule_save_speaker_details' ) ) {\n\n\t\t\t\t\t\t\t// Process each field.\n\t\t\t\t\t\t\tforeach ( array( 'user_id', 'position', 'url', 'company', 'company_url' ) as $field_name ) {\n\t\t\t\t\t\t\t\tif ( isset( $_POST[ 'conf_schedule' ][ 'speaker' ][ $field_name ] ) ) {\n\n\t\t\t\t\t\t\t\t\t// Sanitize the value.\n\t\t\t\t\t\t\t\t\t$field_value = sanitize_text_field( $_POST[ 'conf_schedule' ][ 'speaker' ][ $field_name ] );\n\n\t\t\t\t\t\t\t\t\t// Update/save value.\n\t\t\t\t\t\t\t\t\tupdate_post_meta( $post_id, \"conf_sch_speaker_{$field_name}\", $field_value );\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t/*\n\t\t\t\t\t * Check if our social media nonce is set because the\n\t\t\t\t\t * 'save_post' action can be triggered at other times.\n\t\t\t\t\t */\n\t\t\t\t\tif ( isset( $_POST[ 'conf_schedule_save_speaker_social_media_nonce' ] ) ) {\n\n\t\t\t\t\t\t// Verify the nonce.\n\t\t\t\t\t\tif ( wp_verify_nonce( $_POST[ 'conf_schedule_save_speaker_social_media_nonce' ], 'conf_schedule_save_speaker_social_media' ) ) {\n\n\t\t\t\t\t\t\t// Process each field.\n\t\t\t\t\t\t\tforeach ( array( 'facebook', 'instagram', 'twitter', 'linkedin' ) as $field_name ) {\n\t\t\t\t\t\t\t\tif ( isset( $_POST[ 'conf_schedule' ][ 'speaker' ][ $field_name ] ) ) {\n\n\t\t\t\t\t\t\t\t\t// Sanitize the value.\n\t\t\t\t\t\t\t\t\t$field_value = sanitize_text_field( $_POST[ 'conf_schedule' ][ 'speaker' ][ $field_name ] );\n\n\t\t\t\t\t\t\t\t\t// Update/save value.\n\t\t\t\t\t\t\t\t\tupdate_post_meta( $post_id, \"conf_sch_speaker_{$field_name}\", $field_value );\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'locations':\n\n\t\t\t\t// Make sure location fields are set.\n\t\t\t\tif ( isset( $_POST[ 'conf_schedule' ] ) && isset( $_POST[ 'conf_schedule' ][ 'location' ] ) ) {\n\n\t\t\t\t\t/*\n\t\t\t\t\t * Check if our location details nonce is set because the\n\t\t\t\t\t * 'save_post' action can be triggered at other times.\n\t\t\t\t\t */\n\t\t\t\t\tif ( isset( $_POST[ 'conf_schedule_save_location_details_nonce' ] ) ) {\n\n\t\t\t\t\t\t// Verify the nonce.\n\t\t\t\t\t\tif ( wp_verify_nonce( $_POST[ 'conf_schedule_save_location_details_nonce' ], 'conf_schedule_save_location_details' ) ) {\n\n\t\t\t\t\t\t\t// Process each field.\n\t\t\t\t\t\t\tforeach ( array( 'address', 'google_maps_url' ) as $field_name ) {\n\n\t\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t\t * If we have a value, update the value.\n\t\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t\t * Otherwise, clear out the value.\n\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\tif ( isset( $_POST[ 'conf_schedule' ][ 'location' ][ $field_name ] ) ) {\n\n\t\t\t\t\t\t\t\t\t// Sanitize the value.\n\t\t\t\t\t\t\t\t\t$field_value = sanitize_text_field( $_POST[ 'conf_schedule' ][ 'location' ][ $field_name ] );\n\n\t\t\t\t\t\t\t\t\t// Update/save value.\n\t\t\t\t\t\t\t\t\tupdate_post_meta( $post_id, \"conf_sch_location_{$field_name}\", $field_value );\n\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tupdate_post_meta( $post_id, \"conf_sch_location_{$field_name}\", null );\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}\n\n\t\t\t\tbreak;\n\n\t\t}\n\n\t}", "public function onPostSerialize(ObjectEvent $event)\n {\n\n }", "function save_postdata( $post_id ) {\n\n \tif ( wp_is_post_revision( $post_id ) )\n \t\treturn;\n\n // verify if this is an auto save routine.\n // If it is our form has not been submitted, so we dont want to do anything\n if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )\n return;\n\n // verify this came from the our screen and with proper authorization,\n // because save_post can be triggered at other times\n\n if ( !wp_verify_nonce( $_POST['agenda_noncename'], 'save_agenda' ) )\n return;\n\n\n // Check permissions\n if ( 'page' == $_POST['post_type'] )\n {\n\t if ( !current_user_can( 'edit_page', $post_id ) )\n\t return;\n }\n else\n {\n\t if ( !current_user_can( 'edit_post', $post_id ) )\n\t return;\n }\n\n\n $data_inicial = '_pan_data_inicial';\n $data_final = '_pan_data_final';\n\n // Testes com a data\n if ( $_POST[$data_inicial] )\n {\n\n\t $initial_date_pt = explode('/', trim($_POST[$data_inicial]));\n\t $initial_date_en = $initial_date_pt[2].'-'.$initial_date_pt[1].'-'.$initial_date_pt[0];\n\n\t if ($_POST[$data_final]) {\n\t $final_date_pt = explode('/', trim($_POST[$data_final]));\n\t $final_date_en = $final_date_pt[2].'-'.$final_date_pt[1].'-'.$final_date_pt[0];\n\t }\n\t else\n\t $final_date_en = $initial_date_en;\n\n }\n\n // Recebe o contexto / taxonomia da agenda (evento ou reunião)\n $context = $_POST['tax_input']['agenda_tipo'];\n $context_slug = get_term_by( 'id', $context, 'agenda_tipo' )->slug;\n\n foreach ( self::$custom_meta_fields as $field )\n\t\t{\n\t\t\t$old = get_post_meta( $post_id, $field['id'], true );\n\n\t\t\t// Testes para adicionar a data no formato correto\n\t\t\tif ( $field['id'] == $data_inicial )\n\t\t\t\t$new = date( 'Y-m-d h:i', strtotime( $initial_date_en ) );\n\t\t\telseif ( $field['id'] == $data_final )\n\t\t\t\t$new = date( 'Y-m-d h:i', strtotime( $final_date_en ) );\n\t\t\telse\n\t\t\t\t$new = $_POST[$field['id']];\n\n\t\t\tif ( in_array( $context_slug, $field['context'] ) )\n\t\t\t{\n\t\t\t\tif ( empty( $old ) && ! empty( $new ) )\n\t\t\t\t\tadd_post_meta( $post_id, $field['id'], $new, true );\n\t\t\t\telseif ( ! empty( $new ) )\n\t\t\t\t\tupdate_post_meta( $post_id, $field['id'], $new );\n\t\t\t\telse\n\t\t\t\t\tdelete_post_meta( $post_id, $field['id'] );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// O post está fora do contexto\n\t\t\t\tdelete_post_meta( $post_id, $field['id'] );\n\t\t\t}\n\n\t }\n }", "function save_meta_box_data( $post_id, $post, $update ) {\n\n\t\t// Disregard on autosave.\n\t\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Not for auto drafts.\n\t\tif ( 'auto-draft' == $post->post_status ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Make sure user has permissions.\n\t\t$post_type_object = get_post_type_object( $post->post_type );\n\t\t$user_has_cap = $post_type_object && isset( $post_type_object->cap->edit_post ) ? current_user_can( $post_type_object->cap->edit_post, $post_id ) : false;\n\n\t\tif ( ! $user_has_cap ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Proceed depending on post type.\n\t\tswitch ( $post->post_type ) {\n\n\t\t\tcase 'schedule':\n\n\t\t\t\t// Make sure fields are set.\n\t\t\t\tif ( isset( $_POST['conf_schedule'] ) && isset( $_POST['conf_schedule']['event'] ) ) {\n\n\t\t\t\t\t// Check if our nonce is set because the 'save_post' action can be triggered at other times.\n\t\t\t\t\tif ( isset( $_POST['conf_schedule_save_event_details_nonce'] ) ) {\n\n\t\t\t\t\t\t// Verify the nonce.\n\t\t\t\t\t\tif ( wp_verify_nonce( $_POST['conf_schedule_save_event_details_nonce'], 'conf_schedule_save_event_details' ) ) {\n\n\t\t\t\t\t\t\t// Make sure date is set.\n\t\t\t\t\t\t\tif ( isset( $_POST['conf_schedule']['event']['date'] ) ) {\n\n\t\t\t\t\t\t\t\t// Sanitize the value.\n\t\t\t\t\t\t\t\t$event_date = sanitize_text_field( $_POST['conf_schedule']['event']['date'] );\n\n\t\t\t\t\t\t\t\t// Update/save value.\n\t\t\t\t\t\t\t\tupdate_post_meta( $post_id, 'conf_sch_event_date', $event_date );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Make sure times are set.\n\t\t\t\t\t\t\tforeach ( [ 'start_time', 'end_time' ] as $time_key ) {\n\n\t\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t\t * If we have a value, store it.\n\t\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t\t * Otherwise, clear it out.\n\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\tif ( isset( $_POST['conf_schedule']['event'][ $time_key ] ) ) {\n\n\t\t\t\t\t\t\t\t\t// Sanitize the value.\n\t\t\t\t\t\t\t\t\t$time_value = sanitize_text_field( $_POST['conf_schedule']['event'][ $time_key ] );\n\n\t\t\t\t\t\t\t\t\t// If we have a time, format it.\n\t\t\t\t\t\t\t\t\tif ( ! empty( $time_value ) ) {\n\t\t\t\t\t\t\t\t\t\t$time_value = date( 'H:i', strtotime( $time_value ) );\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// Update/save value.\n\t\t\t\t\t\t\t\t\tupdate_post_meta( $post_id, \"conf_sch_event_{$time_key}\", $time_value );\n\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tupdate_post_meta( $post_id, \"conf_sch_event_{$time_key}\", null );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Make sure location is set.\n\t\t\t\t\t\t\tif ( isset( $_POST['conf_schedule']['event']['location'] ) ) {\n\n\t\t\t\t\t\t\t\t// Sanitize the value.\n\t\t\t\t\t\t\t\t$event_location = sanitize_text_field( $_POST['conf_schedule']['event']['location'] );\n\n\t\t\t\t\t\t\t\t// Update/save value.\n\t\t\t\t\t\t\t\tupdate_post_meta( $post_id, 'conf_sch_event_location', $event_location );\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t/*\n\t\t\t\t\t * Check if our session details nonce is set because\n\t\t\t\t\t * the 'save_post' action can be triggered at other times.\n\t\t\t\t\t */\n\t\t\t\t\tif ( isset( $_POST['conf_schedule_save_session_details_nonce'] ) ) {\n\n\t\t\t\t\t\t// Verify the nonce.\n\t\t\t\t\t\tif ( wp_verify_nonce( $_POST['conf_schedule_save_session_details_nonce'], 'conf_schedule_save_session_details' ) ) {\n\n\t\t\t\t\t\t\t// Process each field.\n\t\t\t\t\t\t\tforeach ( [ 'livestream_url', 'slides_url', 'feedback_url', 'feedback_reveal_delay_seconds', 'follow_up_url' ] as $field_name ) {\n\t\t\t\t\t\t\t\tif ( isset( $_POST['conf_schedule']['event'][ $field_name ] ) ) {\n\n\t\t\t\t\t\t\t\t\t// Sanitize the value.\n\t\t\t\t\t\t\t\t\t$field_value = sanitize_text_field( $_POST['conf_schedule']['event'][ $field_name ] );\n\n\t\t\t\t\t\t\t\t\t// Update/save value.\n\t\t\t\t\t\t\t\t\tupdate_post_meta( $post_id, \"conf_sch_event_{$field_name}\", trim( $field_value ) );\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t * Process the session file.\n\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t * Check to see if our\n\t\t\t\t\t\t\t * 'conf_schedule_event_delete_slides_file'\n\t\t\t\t\t\t\t * hidden input is included.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tif ( ! empty( $_FILES ) && isset( $_FILES['conf_schedule_event_slides_file'] ) && ! empty( $_FILES['conf_schedule_event_slides_file']['name'] ) ) {\n\n\t\t\t\t\t\t\t\t// Upload the file to the server.\n\t\t\t\t\t\t\t\t$upload_file = wp_handle_upload( $_FILES['conf_schedule_event_slides_file'], [ 'test_form' => false ] );\n\n\t\t\t\t\t\t\t\t// If the upload was successful...\n\t\t\t\t\t\t\t\tif ( $upload_file && ! isset( $upload_file['error'] ) ) {\n\n\t\t\t\t\t\t\t\t\t// Should be the path to a file in the upload directory.\n\t\t\t\t\t\t\t\t\t$file_name = $upload_file['file'];\n\n\t\t\t\t\t\t\t\t\t// Get the file type.\n\t\t\t\t\t\t\t\t\t$file_type = wp_check_filetype( $file_name );\n\n\t\t\t\t\t\t\t\t\t// Prepare an array of post data for the attachment.\n\t\t\t\t\t\t\t\t\t$attachment = [\n\t\t\t\t\t\t\t\t\t\t'guid' => $upload_file['url'],\n\t\t\t\t\t\t\t\t\t\t'post_mime_type' => $file_type['type'],\n\t\t\t\t\t\t\t\t\t\t'post_title' => preg_replace( '/\\.[^.]+$/', '', basename( $file_name ) ),\n\t\t\t\t\t\t\t\t\t\t'post_content' => '',\n\t\t\t\t\t\t\t\t\t\t'post_status' => 'inherit',\n\t\t\t\t\t\t\t\t\t];\n\n\t\t\t\t\t\t\t\t\t// Insert the attachment.\n\t\t\t\t\t\t\t\t\t$attachment_id = wp_insert_attachment( $attachment, $file_name, $post_id );\n\t\t\t\t\t\t\t\t\tif ( $attachment_id > 0 ) {\n\n\t\t\t\t\t\t\t\t\t\t// Generate the metadata for the attachment and update the database record.\n\t\t\t\t\t\t\t\t\t\t$attach_data = wp_generate_attachment_metadata( $attachment_id, $file_name );\n\t\t\t\t\t\t\t\t\t\tif ( ! empty( $attach_data ) ) {\n\t\t\t\t\t\t\t\t\t\t\twp_update_attachment_metadata( $attachment_id, $attach_data );\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t// Update/save value.\n\t\t\t\t\t\t\t\t\t\tupdate_post_meta( $post_id, 'conf_sch_event_slides_file', $attachment_id );\n\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} elseif ( isset( $_POST['conf_schedule_event_delete_slides_file'] )\n\t\t\t\t\t\t\t && $_POST['conf_schedule_event_delete_slides_file'] > 0 ) {\n\n\t\t\t\t\t\t\t\t// Clear out the meta.\n\t\t\t\t\t\t\t\tupdate_post_meta( $post_id, 'conf_sch_event_slides_file', null );\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t/*\n\t\t\t\t\t * Check if our event social media nonce is set because\n\t\t\t\t\t * the 'save_post' action can be triggered at other times.\n\t\t\t\t\t */\n\t\t\t\t\tif ( isset( $_POST['conf_schedule_save_event_social_media_nonce'] ) ) {\n\n\t\t\t\t\t\t// Verify the nonce.\n\t\t\t\t\t\tif ( wp_verify_nonce( $_POST['conf_schedule_save_event_social_media_nonce'], 'conf_schedule_save_event_social_media' ) ) {\n\n\t\t\t\t\t\t\t// Process each field.\n\t\t\t\t\t\t\tforeach ( [ 'hashtag' ] as $field_name ) {\n\t\t\t\t\t\t\t\tif ( isset( $_POST['conf_schedule']['event'][ $field_name ] ) ) {\n\n\t\t\t\t\t\t\t\t\t// Sanitize the value.\n\t\t\t\t\t\t\t\t\t$field_value = sanitize_text_field( $_POST['conf_schedule']['event'][ $field_name ] );\n\n\t\t\t\t\t\t\t\t\t// Remove any possible hashtags.\n\t\t\t\t\t\t\t\t\t$field_value = preg_replace( '/\\#/i', '', $field_value );\n\n\t\t\t\t\t\t\t\t\t// Update/save value.\n\t\t\t\t\t\t\t\t\tupdate_post_meta( $post_id, \"conf_sch_event_{$field_name}\", $field_value );\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Clear the proposal cache.\n\t\t\t\t$proposal_id = conference_schedule()->get_session_proposal_id( $post_id );\n\t\t\t\t$this->clear_proposal_cache( $proposal_id );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'locations':\n\n\t\t\t\t// Make sure location fields are set.\n\t\t\t\tif ( isset( $_POST['conf_schedule'] ) && isset( $_POST['conf_schedule']['location'] ) ) {\n\n\t\t\t\t\t/*\n\t\t\t\t\t * Check if our location details nonce is set because the\n\t\t\t\t\t * 'save_post' action can be triggered at other times.\n\t\t\t\t\t */\n\t\t\t\t\tif ( isset( $_POST['conf_schedule_save_location_details_nonce'] ) ) {\n\n\t\t\t\t\t\t// Verify the nonce.\n\t\t\t\t\t\tif ( wp_verify_nonce( $_POST['conf_schedule_save_location_details_nonce'], 'conf_schedule_save_location_details' ) ) {\n\n\t\t\t\t\t\t\t// Process each field.\n\t\t\t\t\t\t\tforeach ( [ 'address', 'google_maps_url' ] as $field_name ) {\n\n\t\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t\t * If we have a value, update the value.\n\t\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t\t * Otherwise, clear out the value.\n\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\tif ( isset( $_POST['conf_schedule']['location'][ $field_name ] ) ) {\n\n\t\t\t\t\t\t\t\t\t// Sanitize the value.\n\t\t\t\t\t\t\t\t\t$field_value = sanitize_text_field( $_POST['conf_schedule']['location'][ $field_name ] );\n\n\t\t\t\t\t\t\t\t\t// Update/save value.\n\t\t\t\t\t\t\t\t\tupdate_post_meta( $post_id, \"conf_sch_location_{$field_name}\", $field_value );\n\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tupdate_post_meta( $post_id, \"conf_sch_location_{$field_name}\", null );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t * Make sure 'sch_link_to_post' is set.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tif ( isset( $_POST['conf_schedule']['location']['sch_link_to_post'] ) ) {\n\t\t\t\t\t\t\t\tupdate_post_meta( $post_id, 'conf_sch_link_to_post', '1' );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tupdate_post_meta( $post_id, 'conf_sch_link_to_post', '0' );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t * Make sure 'is_session_track' is set.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tif ( ! empty( $_POST['conf_schedule']['location']['is_session_track'] ) ) {\n\t\t\t\t\t\t\t\tupdate_post_meta( $post_id, 'conf_sch_is_session_track', '1' );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tupdate_post_meta( $post_id, 'conf_sch_is_session_track', '0' );\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\n\t\t\t\tbreak;\n\n\t\t}\n\t}", "public function postEventedit();", "function wp_after_insert_post($post, $update, $post_before)\n {\n }", "private function processPostData() {\n\n if (isset($this->postDataArray['week']) && isset($this->postDataArray['year']))\n {\n\n $this->weekSelected = $this->cleanse_input($this->postDataArray['week']);\n $this->yearSelected = $this->cleanse_input($this->postDataArray['year']);\n }\n else\n {\n $this->weekSelected = $this->weeks[0];\n $this->yearSelected = $this->years[0];\n }\n }", "protected function _postUpdate()\n\t{\n\t}", "public function postProcess() {\n\t\t//\t\t$this->setSubmittedValue(strtoupper($this->getSubmittedValue()));\n\t}", "function copy()\n\t{\n\t\tif (count($_POST[\"p_id\"]) > 0)\n\t\t{\n\t\t\tforeach ($_POST[\"p_id\"] as $key => $value)\n\t\t\t{\n\t\t\t\t$this->object->copyToClipboard($value);\n\t\t\t}\n\t\t\tilUtil::sendInfo($this->txt(\"copy_insert_clipboard\"), true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tilUtil::sendInfo($this->txt(\"copy_select_none\"), true);\n\t\t}\n\t\t$this->ctrl->redirect($this, \"pairs\");\n\t}", "function cs_events_meta_save($cs_post_id) {\n global $wpdb;\n if (empty($_POST[\"sub_title\"])){ $_POST[\"sub_title\"] = \"\";}\n if (empty($_POST[\"header_banner_options\"])){ $_POST[\"header_banner_options\"] = \"\";}\n if (empty($_POST[\"header_banner\"])){ $_POST[\"header_banner\"] = \"\";}\n if (empty($_POST[\"slider_id\"])){ $_POST[\"slider_id\"] = \"\";}\n if (empty($_POST[\"inside_event_thumb_view\"])){ $_POST[\"inside_event_thumb_view\"] = \"\";}\n if (empty($_POST[\"inside_event_featured_image_as_thumbnail\"])){ $_POST[\"inside_event_featured_image_as_thumbnail\"] = \"\";}\n\tif (empty($_POST[\"inside_event_thumb_audio\"])){ $_POST[\"inside_event_thumb_audio\"] = \"\";}\n\tif (empty($_POST[\"inside_event_thumb_video\"])){ $_POST[\"inside_event_thumb_video\"] = \"\";}\n\tif (empty($_POST[\"inside_event_thumb_slider\"])){ $_POST[\"inside_event_thumb_slider\"] = \"\";}\n\tif (empty($_POST[\"inside_event_thumb_slider_type\"])){ $_POST[\"inside_event_thumb_slider_type\"] = \"\";}\n\tif (empty($_POST[\"inside_event_thumb_map_lat\"])){ $_POST[\"inside_event_thumb_map_lat\"] = \"\";}\n if (empty($_POST[\"inside_event_thumb_map_lon\"])){ $_POST[\"inside_event_thumb_map_lon\"] = \"\";}\n if (empty($_POST[\"inside_event_thumb_map_zoom\"])){ $_POST[\"inside_event_thumb_map_zoom\"] = \"\";}\n if (empty($_POST[\"inside_event_thumb_map_address\"])){ $_POST[\"inside_event_thumb_map_address\"] = \"\";}\n if (empty($_POST[\"inside_event_thumb_map_controls\"])){ $_POST[\"inside_event_thumb_map_controls\"] = \"\";}\n if (empty($_POST[\"event_social_sharing\"])){ $_POST[\"event_social_sharing\"] = \"\";}\n\tif (empty($_POST[\"event_related\"])){ $_POST[\"event_related\"] = \"\";}\n\tif (empty($_POST[\"inside_event_related_post_title\"])){ $_POST[\"inside_event_related_post_title\"] = \"\";}\n\tif (empty($_POST[\"switch_footer_widgets\"])){ $_POST[\"switch_footer_widgets\"] = \"\";}\n\tif (empty($_POST[\"event_start_time\"])){ $_POST[\"event_start_time\"] = \"\";}\n\tif (empty($_POST[\"event_end_time\"])){ $_POST[\"event_end_time\"] = \"\";}\n if (empty($_POST[\"event_all_day\"])){ $_POST[\"event_all_day\"] = \"\";}\n if (empty($_POST[\"event_rating\"])){ $_POST[\"event_rating\"] = \"\";}\n if (empty($_POST[\"event_buy_now\"])){ $_POST[\"event_buy_now\"] = \"\";}\n if (empty($_POST[\"event_ticket_price\"])){ $_POST[\"event_ticket_price\"] = \"\";}\n if (empty($_POST[\"event_gallery\"])){ $_POST[\"event_gallery\"] = \"\";}\n if (empty($_POST[\"event_address\"])){ $_POST[\"event_address\"] = \"\";}\n if (empty($_POST[\"event_map\"])){ $_POST[\"event_map\"] = \"\";}\n if (empty($_POST[\"event_artists\"])){ $_POST[\"event_artists\"] = \"\";}\n \t\n $sxe = new SimpleXMLElement(\"<event></event>\");\n\t\t$sxe->addChild('sub_title', $_POST['sub_title'] );\n\t\t$sxe->addChild('header_banner_options', $_POST['header_banner_options'] );\n\t\t$sxe->addChild('header_banner', $_POST['header_banner'] );\n\t\t$sxe->addChild('slider_id', $_POST['slider_id'] );\n\t\t$sxe->addChild('inside_event_thumb_view', $_POST['inside_event_thumb_view'] );\n\t\t$sxe->addChild('inside_event_featured_image_as_thumbnail', $_POST['inside_event_featured_image_as_thumbnail'] );\n\t\t$sxe->addChild('inside_event_thumb_audio', $_POST['inside_event_thumb_audio'] );\n\t\t$sxe->addChild('inside_event_thumb_video', $_POST['inside_event_thumb_video'] );\n\t\t$sxe->addChild('inside_event_thumb_slider', $_POST['inside_event_thumb_slider'] );\n\t\t$sxe->addChild('inside_event_thumb_slider_type', $_POST['inside_event_thumb_slider_type'] );\n\t\t$sxe->addChild('inside_event_thumb_map_lat', $_POST['inside_event_thumb_map_lat'] );\n\t\t$sxe->addChild('inside_event_thumb_map_lon', $_POST['inside_event_thumb_map_lon'] );\n\t\t$sxe->addChild('inside_event_thumb_map_zoom', $_POST['inside_event_thumb_map_zoom'] );\n\t\t$sxe->addChild('inside_event_thumb_map_address', $_POST['inside_event_thumb_map_address'] );\n\t\t$sxe->addChild('inside_event_thumb_map_controls', $_POST['inside_event_thumb_map_controls'] );\n\t\t$sxe->addChild('event_social_sharing', $_POST[\"event_social_sharing\"]);\n\t\t$sxe->addChild('event_related', $_POST[\"event_related\"]);\n\t\t$sxe->addChild('inside_event_related_post_title', $_POST[\"inside_event_related_post_title\"]);\n\t\t$sxe->addChild('switch_footer_widgets', $_POST[\"switch_footer_widgets\"]);\n \t\t$sxe->addChild('event_start_time', $_POST[\"event_start_time\"]);\n\t\t$sxe->addChild('event_end_time', $_POST[\"event_end_time\"]);\n\t\t$sxe->addChild('event_all_day', $_POST[\"event_all_day\"]);\n\t\t$sxe->addChild('event_rating', $_POST[\"event_rating\"]);\n\t\t$sxe->addChild('event_buy_now', $_POST[\"event_buy_now\"]);\n\t\t$sxe->addChild('event_ticket_price', $_POST[\"event_ticket_price\"]);\n\t\t$sxe->addChild('event_gallery', $_POST[\"event_gallery\"]);\n \t\t$sxe->addChild('event_address', $_POST[\"event_address\"]);\n\t\t$sxe->addChild('event_map', $_POST[\"event_map\"]);\n\t\t\tif ( $_POST['event_artists'] ) {\n\t\t\t\t$artists_list = $sxe->addChild('artists_list');\n\t\t\t\tforeach ( $_POST['event_artists'] as $key => $val ) {\n\t\t\t\t\t$artists_list->addChild('artists', $val );\n\t\t\t\t}\n\t\t\t}\n $sxe = save_layout_xml($sxe);\n update_post_meta($cs_post_id, 'cs_event_meta', $sxe->asXML());\n}", "private function getPostData()\n {\n $postData = $this->request->getPostValue();\n\n /** Magento may adds the SID session parameter, depending on the store configuration.\n * We don't need or want to use this parameter, so remove it from the retrieved post data. */\n unset($postData['SID']);\n\n //Set original postdata before setting it to case lower.\n $this->originalPostData = $postData;\n\n //Create post data array, change key values to lower case.\n $postDataLowerCase = array_change_key_case($postData, CASE_LOWER);\n $this->postData = $postDataLowerCase;\n }", "function postToVar() {\n foreach ($this->fields() as $f) {\n if ($this->$f === false) $this->$f = $this->input->post($f);\n }\n }", "public function save_eventdata($pid, $post, $update) {\n\t\tif((defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) || 'auto-draft' === $post->post_status) {\n\t\t\treturn $pid;\n\t\t}\n\t\t$eventdata = $_POST;\n\t\t// provide iso start- and end-date\n\t\tif(!empty($eventdata['startdate-iso'])) {\n\t\t\t$eventdata['startdate'] = $eventdata['startdate-iso'];\n\t\t}\n\t\tif(!empty($eventdata['enddate-iso'])) {\n\t\t\t$eventdata['enddate'] = $eventdata['enddate-iso'];\n\t\t}\n\t\t// set end_date to start_date if multiday is not selected\n\t\tif(empty($eventdata['multiday'])) {\n\t\t\t$eventdata['enddate'] = $eventdata['startdate'];\n\t\t}\n\t\treturn (bool)EL_Event::save_postmeta($pid, $eventdata);\n\t}", "public function post_publish()\n\t{\n\t\t$this->get_publish();\n\t}", "public function action_publish_post($post, $form)\n\t{\n\t\tswitch( $post->content_type ) {\n\t\t\tcase Post::type( 'entry' ):\n\t\t\t\n\t\t\t\t$post->info->extra = $form->extra_textarea->value;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn;\n\t\t}\n\t}", "function _wp_rest_api_force_autosave_difference($prepared_post, $request)\n {\n }", "protected function setPostData()\n\t{\n\t\t$this->request->addPostFields($this->query->getParams());\n\t}", "function acf_copy_metadata($from_post_id = 0, $to_post_id = 0)\n{\n}", "public function store_posted_changes($post_val)\n {\n $post_val = strip_tags(html_entity_decode($post_val), '<b><strong><i><em><u>');\n\n if($this->data != $post_val)\n {\n $this->data = $post_val;\n $this->modified = 1;\n }\n }", "function WoopPost( $post ) { $this->post = $post; }", "function bfa_ata_save_postdata( $post_id ) {\r\n\r\n /* verify this came from the our screen and with proper authorization,\r\n because save_post can be triggered at other times */\r\n// Before using $_POST['value'] \r\nif (isset($_POST['bfa_ata_noncename'])) \r\n{ \r\n\r\n\tif ( !wp_verify_nonce( $_POST['bfa_ata_noncename'], plugin_basename(__FILE__) )) {\r\n\t\treturn $post_id;\r\n\t}\r\n\r\n\tif ( 'page' == $_POST['post_type'] ) {\r\n\t\tif ( !current_user_can( 'edit_page', $post_id ))\r\n\t\t\treturn $post_id;\r\n\t} else {\r\n\t\tif ( !current_user_can( 'edit_post', $post_id ))\r\n\t\t\treturn $post_id;\r\n\t\t}\r\n\r\n\t// Save the data\r\n\t\r\n\t$new_body_title = $_POST['bfa_ata_body_title'];\r\n\t$new_display_body_title = !isset($_POST[\"bfa_ata_display_body_title\"]) ? NULL : $_POST[\"bfa_ata_display_body_title\"];\r\n\t$new_body_title_multi = $_POST['bfa_ata_body_title_multi'];\r\n\t$new_meta_title = $_POST['bfa_ata_meta_title'];\r\n\t$new_meta_keywords = $_POST['bfa_ata_meta_keywords'];\r\n\t$new_meta_description = $_POST['bfa_ata_meta_description'];\r\n\r\n\tupdate_post_meta($post_id, 'bfa_ata_body_title', $new_body_title);\r\n\tupdate_post_meta($post_id, 'bfa_ata_display_body_title', $new_display_body_title);\r\n\tupdate_post_meta($post_id, 'bfa_ata_body_title_multi', $new_body_title_multi);\r\n\tupdate_post_meta($post_id, 'bfa_ata_meta_title', $new_meta_title);\r\n\tupdate_post_meta($post_id, 'bfa_ata_meta_keywords', $new_meta_keywords);\r\n\tupdate_post_meta($post_id, 'bfa_ata_meta_description', $new_meta_description);\r\n\r\n}}", "public function processData() {\r\r\n if ( is_array($this->data) && isset($this->data['args']) )\r\r\n $this->args = array_merge($this->args, $this->data['args']);\r\r\n\r\r\n if ( is_array($this->data) && isset($this->data['value']) ) {\r\r\n // If called from back-end non-post context\r\r\n $this->data = $this->data['value'];\r\r\n }\r\r\n }", "public function postSave(EntityEvent $event) {\n $GLOBALS['feeds_test_events'][] = (__METHOD__ . ' called');\n }", "public function setPostFields(array $post_data) {}", "function event_date_save_metabox( $post_id, $post ) {\n\tif ( !isset( $_POST['event_date_metabox_process'] ) ) return;\n\t// Verify data came from edit/dashboard screen\n\tif ( !wp_verify_nonce( $_POST['event_date_metabox_process'], 'event_date_metabox_nonce' ) ) {\n\t\treturn $post->ID;\n\t}\n\n\tif ( !isset( $_POST['event_date'] ) ) {\n\t\treturn $post->ID;\n\t}\n\n\t// Verify user has permission to edit post\n\tif ( !current_user_can( 'edit_post', $post->ID )) {\n\t\treturn $post->ID;\n\t}\n\n\t$sanitized = array();\n\t// Loop through each of our fields\n\tforeach ( $_POST['event_date'] as $key => $date ) {\n\t\t// Sanitize the data and push it to our new array\n\t\t// `wp_filter_post_kses` strips our dangerous server values\n\t\t// and allows through anything you can include a post.\n\t\t$sanitized[$key] = wp_filter_post_kses( $date );\n\t}\n\t// Save our submissions to the database\n\tupdate_post_meta( $post->ID, 'event_date', $sanitized );\n}", "private function setPostParameters() {\n\t\tforeach (array_keys($_POST) as $currentKey) {\n\t\t\t$this->postArray[$currentKey] = $_POST[$currentKey];\n\t\t}\n\t}", "function allow_save_post($post)\n {\n }", "public static function postUpdate(Event $event){\n $io = $event->getIO();\n $io->write(\"postUpdate event triggered.\");\n }", "public function save_postdata( $post_id ) {\n\t\tif ( wp_is_post_autosave( $post_id ) || wp_is_post_revision( $post_id ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! isset( $_POST['source'] ) || ! isset( $_POST['url'] ) || ! isset( $_POST['transcript_nonce'] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['transcript_nonce'] ) ), 'transcript_data' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tupdate_post_meta(\n\t\t\t$post_id,\n\t\t\t'_transcript_url',\n\t\t\tsanitize_text_field( wp_unslash( $_POST['url'] ) )\n\t\t);\n\t\tupdate_post_meta(\n\t\t\t$post_id,\n\t\t\t'_transcript_source',\n\t\t\tsanitize_text_field( wp_unslash( $_POST['source'] ) )\n\t\t);\n\t}", "function copyeditUnderway(&$copyeditorSubmission) {\n\t\tif (!HookRegistry::call('CopyeditorAction::copyeditUnderway', array(&$copyeditorSubmission))) {\n\t\t\t$copyeditorSubmissionDao = &DAORegistry::getDAO('CopyeditorSubmissionDAO');\t\t\n\n\t\t\tif ($copyeditorSubmission->getDateNotified() != null && $copyeditorSubmission->getDateUnderway() == null) {\n\t\t\t\t$copyeditorSubmission->setDateUnderway(Core::getCurrentDate());\n\t\t\t\t$update = true;\n\n\t\t\t} elseif ($copyeditorSubmission->getDateFinalNotified() != null && $copyeditorSubmission->getDateFinalUnderway() == null) {\n\t\t\t\t$copyeditorSubmission->setDateFinalUnderway(Core::getCurrentDate());\n\t\t\t\t$update = true;\n\t\t\t}\n\n\t\t\tif (isset($update)) {\n\t\t\t\t$copyeditorSubmissionDao->updateCopyeditorSubmission($copyeditorSubmission);\n\n\t\t\t\t// Add log entry\n\t\t\t\t$user = &Request::getUser();\n\t\t\t\timport('article.log.ArticleLog');\n\t\t\t\timport('article.log.ArticleEventLogEntry');\n\t\t\t\tArticleLog::logEvent($copyeditorSubmission->getArticleId(), ARTICLE_LOG_COPYEDIT_INITIATE, ARTICLE_LOG_TYPE_COPYEDIT, $user->getUserId(), 'log.copyedit.initiate', Array('copyeditorName' => $user->getFullName(), 'articleId' => $copyeditorSubmission->getArticleId()));\n\t\t\t}\n\t\t}\n\t}", "function mredir_save_meta_box_data( $post_id ){\n\t\t\tif ( !isset( $_POST['mredir_metabox_nonce'] ) || !wp_verify_nonce( $_POST['mredir_metabox_nonce'], basename( __FILE__ ) ) ){\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// return if autosave\n\t\t\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ){\n\t\t\t\treturn;\n\t\t\t}\n\t\t // Check the user's permissions.\n\t\t\tif ( ! current_user_can( 'edit_post', $post_id ) ){\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( isset( $_REQUEST['country_id'] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'country_id', sanitize_text_field( $_POST['country_id'] ) );\n\t\t\t}\n\t\t\tif ( isset( $_REQUEST['target_url'] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'target_url', sanitize_text_field( $_POST['target_url'] ) );\n\t\t\t}\n\t\t}", "function _post()\r\n\t\t{\r\n\t\t}", "abstract public function postAction(Event $event): void;", "function _wp_post_revision_data($post = array(), $autosave = \\false)\n {\n }", "protected function _postInsert()\n\t{\n\t}", "function onBeforeSaveField( $field, &$post, &$file )\n\t{\n\t\tif ( !in_array($field->field_type, self::$field_types) ) return;\n\t\t\n\t\t// Check if field has posted data\n\t\tif ( empty($post) ) return;\n\t\t\n\t\t// Serialize multi-property data before storing them into the DB\n\t\tif( !empty($post['url']) ) {\n\t\t\t$post = serialize($post);\n\t\t}\n\t\telse {\n\t\t\tunset($post);\n\t\t}\n\t}", "function save_meta_box_custompost( $post_id ) {\n if ( defined( 'DOING_AUTOSAVE') && DOING_AUTOSAVE ) return;\n if ( $parent_id = wp_is_post_revision( $post_id ) ) {\n $post_id = $parent_id;\n }\n $fields = ['published_date'];\n foreach ( $fields as $field ) {\n if ( array_key_exists( $field, $_POST ) ) {\n update_post_meta( $post_id, $field, sanitize_text_field( $_POST[$field] ) );\n }\n }\n }", "function volpress_save_postdata( $post_id ) {\n\n\t// First we need to check if the current user is authorised to do this action. \n\tif ( 'page' == $_POST['post_type'] ) {\n\t\tif ( ! current_user_can( 'edit_page', $post_id ) )\n\t\t\t\treturn;\n\t} else {\n\t\tif ( ! current_user_can( 'edit_post', $post_id ) )\n\t\t\t\treturn;\n\t}\n\n\t// Secondly we need to check if the user intended to change this value.\n\tif ( ! isset( $_POST['volpress_noncename'] ) || ! wp_verify_nonce( $_POST['volpress_noncename'], plugin_basename( __FILE__ ) ) )\n\t\t\treturn;\n\n\t// Thirdly we can save the value to the database\n\n\t//if saving in a custom table, get post_ID\n\t$post_ID = $_POST['post_ID'];\n\t//sanitize user input\n\t$mydata = sanitize_text_field( $_POST['volpress_new_field'] );\n\n\t// Do something with $mydata \n\t// either using \n\tadd_post_meta($post_ID, '_my_meta_value_key', $mydata, true) or\n\t\tupdate_post_meta($post_ID, '_my_meta_value_key', $mydata);\n\t// or a custom table (see Further Reading section below)\n}", "function gg_save_excerpt_meta( $post_id, $post ) {\n \n if ( ! current_user_can( 'edit_post', $post_id ) ) {\n return $post_id;\n }\n \n if ( ! isset( $_POST['singleExcerpt'] ) || ! wp_verify_nonce( $_POST['single_excerpt'], basename(__FILE__) ) ) {\n return $post_id;\n }\n\n $events_meta['singleExcerpt'] = esc_textarea( $_POST['singleExcerpt'] );\n foreach ( $events_meta as $key => $value ) :\n if ( 'revision' === $post->post_type ) {\n return;\n }\n if ( get_post_meta( $post_id, $key, false ) ) {\n update_post_meta( $post_id, $key, $value );\n } else {\n add_post_meta( $post_id, $key, $value);\n }\n if ( ! $value ) {\n delete_post_meta( $post_id, $key );\n }\n endforeach;\n }", "function save_event( $post_id , $post = '' ) {\n\t\n\t\t// Don't do anything if it's not an event\n\t\tif ( 'event' != $post->post_type ) return;\n\n\t\t// Verify the nonce before proceeding.\n\t\tif ( !isset( $_POST['event-details-box'] ) || !wp_verify_nonce( $_POST['event-details-box'], basename( __FILE__ ) ) )\n\t\t\treturn $post_id;\t\t\t\n\n\t\t/* -----------------------------------\n\t\t\tSAVE EVENT TIME \n\t\t------------------------------------*/\n\n\t\t// Retrieve the event time\n\t\t$event_time = date( 'Y-m-d H:i:s' , strtotime($_POST['event-time']) );\n\t\t$prior_time\t= $post->post_date;\n\n\t\t// Update the post object\n\t\t$post->post_date \t\t= $event_time;\n\t\tremove_action( 'save_post' , array( $this , 'save_event' )\t);\n\t\twp_update_post( $post );\n\t\tadd_action( 'save_post'\t, array( $this , 'save_event' )\t, 10, 2 );\n\t\n\t\t/* -----------------------------------\n\t\t\tSAVE META INFORMATION \n\t\t------------------------------------ */\n\n\t\t// Define the meta to look for\n\t\t$meta = array(\n\t\t\t'event_duration'\t=> $_POST['event-duration'],\n\t\t\t'event_capacity'\t=> $_POST['event-capacity'],\n\t\t\t'event_rsvp'\t\t=> $_POST['event-rsvp'],\n\t\t\t'event_role'\t\t=> $_POST['event-role'],\n\n\t\t);\n\t\t\n\t\t// Loop through each meta, saving it to the database\n\t\tforeach ( $meta as $meta_key => $new_meta_value ) {\n\t\t\n\t\t\t// Get the meta value of the custom field key.\n\t\t\t$meta_value = get_post_meta( $post_id, $meta_key, true );\n\n\t\t\t// If there is no new meta value but an old value exists, delete it.\n\t\t\tif ( current_user_can( 'delete_post_meta', $post_id, $meta_key ) && '' == $new_meta_value && $meta_value )\n\t\t\t\tdelete_post_meta( $post_id, $meta_key, $meta_value );\n\n\t\t\t// If a new meta value was added and there was no previous value, add it.\n\t\t\telseif ( current_user_can( 'add_post_meta', $post_id, $meta_key ) && $new_meta_value && '' == $meta_value )\n\t\t\t\tadd_post_meta( $post_id, $meta_key, $new_meta_value, true );\n\n\t\t\t// If the new meta value does not match the old value, update it.\n\t\t\telseif ( current_user_can( 'edit_post_meta', $post_id, $meta_key ) && $new_meta_value && $new_meta_value != $meta_value )\n\t\t\t\tupdate_post_meta( $post_id, $meta_key, $new_meta_value );\n\t\t}\n\n\t\t// Delete the RSVP meta if the date has changed\n\t\tif ( $event_time != $prior_time )\n\t\t\tdelete_post_meta( $post_id , 'event_rsvps' );\n\n\t\t/* -----------------------------------\n\t\t\tBUDDYPRESS NOTIFICATION\n\t\t------------------------------------ */\n\t\t\t\n\t\t// Get event data\n\t\tglobal $bp, $wpdb;\n\t\tif ( !$user_id )\n\t\t\t$user_id = $post->post_author;\n\n\t\t// Figure out which calendars this event belongs to\n\t\t$calendars = wp_get_post_terms( $post_id , 'calendar' );\n\t\t$group_slugs = array();\n\t\t\t\n\t\t// For each calendar, check if it's a group calendar\n\t\tforeach ( $calendars as $calendar ) {\n\t\t\tif ( is_group_calendar( $calendar->term_id ) )\n\t\t\t\t$groups[] = $calendar;\n\t\t}\t\n\t\t\n\t\t// If this event does not belong to a group, we can stop here\n\t\tif ( empty( $groups ) ) return $post_id;\t\n\t\t\n\t\t// Only register notifications for future or published events\n\t\tif ( !in_array( $post->post_status , array('publish','future') ) ) return $post_id;\t\n\t\t\n\t\t// Loop through each group, adding an activity entry for each one\n\t\tforeach ( $groups as $group ) {\n\t\t\n\t\t\t// Get the group data\n\t\t\t$group_id \t= groups_get_id( $group->slug );\n\t\t\t$group_name\t= $group->name;\n\n\t\t\t// Configure the activity entry\n\t\t\t$post_permalink \t= get_permalink( $post_id );\n\t\t\t$activity_action \t= sprintf( '%1$s added the event %2$s to the %3$s.' , bp_core_get_userlink( $post->post_author ), '<a href=\"' . $post_permalink . '\">' . $post->post_title . '</a>' , $group_name . ' <a href=\"' . SITEURL . '/calendar/' . $group->slug .'\">group calendar</a>' );\n\t\t\t$activity_content \t= $post->post_content;\n\n\t\t\t// Check for existing entry\n\t\t\t$activity_id = bp_activity_get_activity_id( array(\n\t\t\t\t'user_id' => $user_id,\n\t\t\t\t'component' => $bp->groups->id,\n\t\t\t\t'type' => 'new_calendar_event',\n\t\t\t\t'item_id' => $group_id,\n\t\t\t\t'secondary_item_id' => $post_id,\n\t\t\t) );\n\t\t\t\n\t\t\t// Record the entry\n\t\t\tgroups_record_activity( array(\n\t\t\t\t'id'\t\t\t\t=> $activity_id,\n\t\t\t\t'user_id' \t\t\t=> $user_id,\n\t\t\t\t'action' \t\t\t=> $activity_action,\n\t\t\t\t'content' \t\t\t=> $activity_content,\n\t\t\t\t'primary_link' \t\t=> $post_permalink,\n\t\t\t\t'type' \t\t\t\t=> 'new_calendar_event',\n\t\t\t\t'item_id' \t\t\t=> $group_id,\n\t\t\t\t'secondary_item_id' => $post_id,\n\t\t\t));\n\t\t\t\n\t\t\t// Update the group's last activity meta\n\t\t\tgroups_update_groupmeta( $group_id, 'last_activity' , bp_core_current_time() );\n\t\t\t\n\t\t\t// Maybe notify every group member\n\t\t\tif ( $_POST['event-rsvp'] ) :\n\t\t\t\tif ( bp_group_has_members( $args = array( 'group_id' => $group_id, 'exclude_admins_mods' => false , 'per_page' => 99999 ) ) ) :\twhile ( bp_members() ) : bp_the_member();\n\t\t\t\t\t\t\n\t\t\t\t\t// Remove any existing notifications ( $user_id, $item_id, $component_name, $component_action, $secondary_item_id = false )\n\t\t\t\t\tbp_notifications_delete_notifications_by_item_id( bp_get_group_member_id() , $group_id , $bp->groups->id , 'new_calendar_event' , $post_id );\n\t\t\t\n\t\t\t\t\t// Send a notification ( itemid , groupid , component, action , secondary )\n\t\t\t\t\tbp_notifications_add_notification( array(\n\t\t\t\t\t\t'user_id'\t\t\t=> bp_get_group_member_id(),\n\t\t\t\t\t\t'item_id'\t\t\t=> $group_id,\n\t\t\t\t\t\t'secondary_item_id'\t=> $post_id,\n\t\t\t\t\t\t'component_name'\t=> $bp->groups->id,\n\t\t\t\t\t\t'component_action'\t=> 'new_calendar_event'\t\t\t\t\t\n\t\t\t\t\t));\t\t\t\t\t\t\n\t\t\t\tendwhile; endif;\n\t\t\tendif;\n\t\t}\n\t}", "public function setup_postdata($post)\n {\n }", "function copyFormData()\n {\n $SessionPost = modApiFunc(\"Session\", \"get\", \"SessionPost\");\n $this->ViewState = $SessionPost[\"ViewState\"];\n\n //Remove some data, that should not be sent to action one more time, from ViewState.\n if(isset($this->ViewState[\"ErrorsArray\"]) &&\n count($this->ViewState[\"ErrorsArray\"]) > 0)\n {\n $this->ErrorsArray = $this->ViewState[\"ErrorsArray\"];\n unset($this->ViewState[\"ErrorsArray\"]);\n }\n $this->POST =\n array(\n \"Id\" => isset($SessionPost[\"Id\"])? $SessionPost[\"Id\"]:\"\"\n ,\"CountryId\" => isset($SessionPost[\"CountryId\"])? $SessionPost[\"CountryId\"]:\"0\"\n ,\"StateId\" => isset($SessionPost[\"StateId\"])? $SessionPost[\"StateId\"]:\"-1\"\n ,\"ProductTaxClassId\" => isset($SessionPost[\"ProductTaxClassId\"])? $SessionPost[\"ProductTaxClassId\"]:\"1\"\n ,\"ProductTaxClassName\" => isset($SessionPost[\"ProductTaxClassName\"])? $SessionPost[\"ProductTaxClassName\"]:\"\"\n ,\"TaxNameId\" => isset($SessionPost[\"TaxNameId\"])? $SessionPost[\"TaxNameId\"]:\"1\"\n ,\"Rate\" => isset($SessionPost[\"Rate\"])? $SessionPost[\"Rate\"]:\"\"\n ,\"FormulaView\" => isset($SessionPost[\"FormulaView\"])? $SessionPost[\"FormulaView\"]:\"&nbsp;\"\n ,\"Formula\" => isset($SessionPost[\"Formula\"])? $SessionPost[\"Formula\"]:\"\"\n ,\"Applicable\" => isset($SessionPost[\"NotApplicable\"])? \"false\":\"true\"\n ,\"TaxRateByZipSet\" => isset($SessionPost[\"TaxRateByZipSet\"]) ? $SessionPost[\"TaxRateByZipSet\"] : 0\n );\n }", "public function __clone()\n {\n parent::offsetSet('name', null);\n parent::__clone();\n foreach (['onBefore', 'onAfter'] as $type) {\n if ($val = $this->offsetGet($type)) {\n $this->offsetSet($type, $val);\n }\n }\n }", "protected function postProcessCopyFromTemplate()\n {\n }", "function save_source_metabox($post_id, $post) \n {\n // make sure our form data is sent \n if( isset($_POST['bbquotations_wpnonce']) && ! wp_verify_nonce($_POST['bbquotations_wpnonce'], 'bbquotations-source') ) {\n return $post->ID;\n }\n\n // Is the user allowed to edit the post or page?\n if ( ! current_user_can('edit_post', $post->ID) ) {\n return $post->ID;\n }\n \n if( isset($_POST['bbquotations-source-url']) ) {\n update_post_meta($post->ID, 'bbquotations-source-url', $_POST['bbquotations-source-url']);\n }\n }", "public function OnPost($post) {\n\n }", "function foodpress_save_meta_data($post_id, $post){\n\t\t\tglobal $pagenow;\n\n\t\t\tif ( empty( $post_id ) || empty( $post ) ) return;\n\t\t\tif($post->post_type!='menu') return;\n\t\t\tif (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) return;\n\n\t\t\t// Prevent quick edit from clearing custom fields\n\t\t\tif (defined('DOING_AJAX') && DOING_AJAX) return;\n\t\t\tif ( is_int( wp_is_post_revision( $post ) ) ) return;\n\t\t\tif ( is_int( wp_is_post_autosave( $post ) ) ) return;\n\t\t\t\n\t\t\t// verify this came from the our screen and with proper authorization,\n\t\t\t// because save_post can be triggered at other times\n\t\t\tif( isset($_POST['fp_noncename']) ){\n\t\t\t\tif ( !wp_verify_nonce( $_POST['fp_noncename'], plugin_basename( __FILE__ ) ) ){\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\t$_allowed = array( 'post-new.php', 'post.php' );\n\t\t\tif(!in_array($pagenow, $_allowed)) return;\n\n\t\t\t/* Get the post type object. */\n\t\t\t$post_type = get_post_type_object( $post->post_type );\n\t\t\t\n\t\t\t\n\t\t\t// Check permissions\n\t\t\tif ( !current_user_can( $post_type->cap->edit_post, $post_id ) )\n\t\t\t\treturn;\t\n\n\t\t\t\n\t\t\t//save the post meta values\n\t\t\t//$fields_ar =apply_filters();\n\t\t\t\n\t\t\t$meta_fields = $this->foodpress_menu_metabox_array();\t\t\t\n\t\t\t\n\t\t\t// run through all the custom meta fields\n\t\t\tforeach($meta_fields as $mb=>$f_val){\n\t\t\t\t\n\t\t\t\tif(!empty($f_val)){\n\t\t\t\t\tif( $f_val['type']=='multiinput'){\n\t\t\t\t\t\tforeach($f_val['ids'] as $fvals){\n\t\t\t\t\t\t\t$this->fp_individual_post_values($fvals, $post_id);\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$this->fp_individual_post_values($f_val['id'], $post_id);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//update_post_meta($post_id, 'test', $_POST['fp_menuicons']);\n\t\t\t\n\t\t\t// save user closed meta field boxes\n\t\t\t$fp_closemeta_value = (isset($_POST['fp_collapse_meta_boxes']))? $_POST['fp_collapse_meta_boxes']: '';\n\t\t\t\n\t\t\tfoodpress_save_collapse_metaboxes($post_id, $fp_closemeta_value );\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t// (---) hook for addons\n\t\t\tdo_action('foodpress_save_meta', $post_id);\t\n\t\t\t\t\n\t\t}", "public function before_save_post( $post_data, $post_attr ) {\n\n\t\t// detect autosave\n\t\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n\t\t\treturn $post_data;\n\t\t}\n\n\t\t// security\n\t\tif ( ! isset( $_POST['publisher_post_fields_nonce'] ) ||\n\t\t ! wp_verify_nonce( $_POST['publisher_post_fields_nonce'], 'publisher-post-fields-nonce' ) ||\n\t\t ! $this->current_user_can_edit( $post_attr['ID'], $post_data['post_type'] )\n\t\t) {\n\t\t\treturn $post_data;\n\t\t}\n\n\t\t// Post type supports excerpt\n\t\tif ( ! $this->excerpt && ! post_type_supports( $post_data['post_type'], 'excerpt' ) ) {\n\t\t\treturn $post_data;\n\t\t}\n\n\t\t// Save lead into excerpt\n\t\tif ( isset( $post_attr['bs-post-excerpt'] ) ) {\n\t\t\t$post_data['post_excerpt'] = $post_attr['bs-post-excerpt'];\n\t\t\tunset( $post_attr['bs-post-excerpt'] );\n\t\t}\n\n\t\treturn $post_data;\n\t}", "public function save_laterpay_post_data( LaterPay_Core_Event $event ) {\n list( $post_id ) = $event->get_arguments() + array( '' );\n if ( ! $this->has_permission( $post_id ) ) {\n return;\n }\n\n // no post found -> do nothing\n $post = get_post( $post_id );\n if ( $post === null ) {\n throw new LaterPay_Core_Exception_PostNotFound( $post_id );\n }\n\n $post_form = new LaterPay_Form_Post( $_POST ); // phpcs:ignore\n $condition = array(\n 'verify_nonce' => array(\n 'action' => $this->config->get( 'plugin_base_name' ),\n )\n );\n $post_form->add_validation( 'laterpay_teaser_content_box_nonce', $condition );\n\n if ( ! $post_form->is_valid() ) {\n throw new LaterPay_Core_Exception_FormValidation( get_class( $post_form ), $post_form->get_errors() );\n }\n\n // no rights to edit laterpay_edit_teaser_content -> do nothing\n if ( LaterPay_Helper_User::can( 'laterpay_edit_teaser_content', $post_id ) ) {\n $teaser = $post_form->get_field_value( 'laterpay_post_teaser' );\n LaterPay_Helper_Post::add_teaser_to_the_post( $post, $teaser );\n }\n\n // no rights to edit laterpay_edit_individual_price -> do nothing\n if ( LaterPay_Helper_User::can( 'laterpay_edit_individual_price', $post_id ) ) {\n // postmeta values array\n $meta_values = array();\n\n // apply global default price, if pricing type is not defined\n $post_price_type = $post_form->get_field_value( 'post_price_type' );\n $type = $post_price_type ? $post_price_type : LaterPay_Helper_Pricing::TYPE_GLOBAL_DEFAULT_PRICE;\n $meta_values['type'] = $type;\n\n // apply (static) individual price\n if ( $type === LaterPay_Helper_Pricing::TYPE_INDIVIDUAL_PRICE ) {\n $meta_values['price'] = $post_form->get_field_value( 'post-price' );\n }\n\n if ( $type === LaterPay_Helper_Pricing::TYPE_INDIVIDUAL_FREE ) {\n $meta_values['price'] = 0;\n }\n\n // apply revenue model\n if ( in_array( $type, array( LaterPay_Helper_Pricing::TYPE_INDIVIDUAL_PRICE, LaterPay_Helper_Pricing::TYPE_INDIVIDUAL_DYNAMIC_PRICE ), true ) ) {\n $meta_values['revenue_model'] = $post_form->get_field_value( 'post_revenue_model' );\n }\n\n // apply dynamic individual price\n if ( $type === LaterPay_Helper_Pricing::TYPE_INDIVIDUAL_DYNAMIC_PRICE ) {\n $start_price = $post_form->get_field_value( 'start_price' );\n $end_price = $post_form->get_field_value( 'end_price' );\n\n if ( $start_price !== null && $end_price !== null ) {\n list(\n $meta_values['start_price'],\n $meta_values['end_price'],\n $meta_values['price_range_type']\n ) = LaterPay_Helper_Pricing::adjust_dynamic_price_points( $start_price, $end_price );\n }\n\n if ( $post_form->get_field_value( 'change_start_price_after_days' ) ) {\n $meta_values['change_start_price_after_days'] = $post_form->get_field_value( 'change_start_price_after_days' );\n }\n\n if ( $post_form->get_field_value( 'transitional_period_end_after_days' ) ) {\n $meta_values['transitional_period_end_after_days'] = $post_form->get_field_value( 'transitional_period_end_after_days' );\n }\n\n if ( $post_form->get_field_value( 'reach_end_price_after_days' ) ) {\n $meta_values['reach_end_price_after_days'] = $post_form->get_field_value( 'reach_end_price_after_days' );\n }\n }\n\n // apply category default price of given category\n if ( $type === LaterPay_Helper_Pricing::TYPE_CATEGORY_DEFAULT_PRICE ) {\n if ( $post_form->get_field_value( 'post_default_category' ) ) {\n $category_id = $post_form->get_field_value( 'post_default_category' );\n $meta_values['category_id'] = $category_id;\n }\n }\n\n $this->set_post_meta(\n 'laterpay_post_prices',\n $meta_values,\n $post_id\n );\n }\n }", "public function postPersist(EventArgs $args)\n {\n $om = $this->getObjectManager($args);\n $object = $this->getObject($args);\n $meta = $om->getClassMetadata(get_class($object));\n \n if ($config = $this->getConfiguration($om, $meta->name)) {\n $this->getStrategy($om, $meta->name)->processPostPersist($om, $object);\n }\n }", "public function _postInsert()\n\t{\n\t\t$this->notifyObservers(__FUNCTION__);\n\t}", "public function event()\r\n {\r\n\r\n\r\n if ($this->_config['changeSubmit']) {\r\n\r\n $changeSubmitId = $this->_config['changeSubmitId'];\r\n\r\n $eventOld = ZArrayHelper::getValue($this->_event, 'change paste keyup cut select');\r\n\r\n $this->_event['change paste keyup cut select'] = $eventOld . \"\r\n console.log('changeSubmit: ' + event.target.id);\r\n $($changeSubmitId).submit();\r\n \";\r\n }\r\n\r\n\r\n if ($this->_config['changeSave']) {\r\n $eventOld = ZArrayHelper::getValue($this->_event, 'change paste keyup cut select');\r\n // $eventOld = ZArrayHelper::getValue($this->_event, 'change');\r\n\r\n /**\r\n *\r\n * Get Attributes\r\n *\r\n */\r\n $id = ZArrayHelper::getValue($this->model, 'id');\r\n\r\n $allApp = $this->modelMain->allApp();\r\n // vd($allApp );\r\n if (!empty($allApp->parentAttr))\r\n $attribute = \"$allApp->parentAttr-$this->attribute\";\r\n else\r\n $attribute = $this->attribute;\r\n\r\n /**\r\n *\r\n * Parent Class\r\n */\r\n\r\n $parentClass = bname($allApp->parentClass);\r\n\r\n if (!empty($allApp->parentClass))\r\n $modelClass = $parentClass;\r\n else\r\n $modelClass = $this->modelClassName;\r\n\r\n\r\n /**\r\n *\r\n * ID Attribute\r\n */\r\n $valueKey = strtolower(\"$modelClass-$attribute\");\r\n // vd($valueKey);\r\n\r\n $changeSave = <<<JS\r\n \r\n //start|DavlatovRavshan|2020.10.12\r\n function isFunctionDefined(functionName) {\r\n if (eval(\"typeof(\" + functionName + \") == typeof(Function)\")) {\r\n return true;\r\n }\r\n }\r\n \r\n var value = $('#$valueKey').val(); \r\n \r\n console.log('changeSave ID: $valueKey');\r\n console.log('changeSave Value: ' + value);\r\n // var url = '/api/core/save/auto.aspx';\r\n var url = '/api/core/save/auto.aspx';\r\n \r\n if (xhr !== undefined) {\r\n console.log('Abort XHR: ' + xhr);\r\n xhr.abort()\r\n }\r\n \r\n var xhr = $.ajax({\r\n \r\n url: url, \r\n type: 'POST', \r\n data: { \r\n id: '$id', \r\n value: value, \r\n attr: '$this->attribute', \r\n parentAttr: '{$allApp->parentAttr}', \r\n parentClass: '{$parentClass}', \r\n parentId: '{$allApp->parentId}', \r\n modelClassName: '$this->modelClassName', \r\n }, \r\n \r\n success: function (data, status, xhr) {\r\n \r\n console.log('Change success! Value: ' + value);\r\n console.log('Data: ', data);\r\n \r\n {sendAjax}\r\n },\r\n \r\n error: function (jqXhr, textStatus, errorMessage) {\r\n console.error(jqXhr);\r\n console.error('message: ---' + errorMessage);\r\n console.error('text-status: ---' + textStatus);\r\n }\r\n });\r\n \r\nJS;\r\n\r\n//start|DavlatovRavshan|2020.10.11\r\n\r\n $sendAjax = '';\r\n if (!empty($this->form)) {\r\n\r\n//vd($this->_config['changeReloadPjax']);\r\n\r\n switch ($this->modelConfigs->changeReloadPjax) {\r\n case ALLData::changeReloadType['ajax']:\r\n $sendAjax = <<<JS\r\n if (event.type === 'change' && isFunctionDefined('sendAjax')) {\r\n \r\n console.log('sendAjax | ' + event.target.id);\r\n sendAjax()\r\n }\r\nJS;\r\n\r\n break;\r\n case ALLData::changeReloadType['pjax']:\r\n $sendAjax = <<<JS\r\n if (event.type === 'change' && isFunctionDefined('sendPjax')) {\r\n console.log('sendPjax | ' + event.target.id);\r\n sendPjax()\r\n }\r\nJS;\r\n\r\n break;\r\n\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n\r\n $this->_event['change paste keyup cut select'] = $eventOld . strtr($changeSave, [\r\n // $this->_event['change'] = $eventOld . strtr($changeSave, [\r\n '{sendAjax}' => $sendAjax\r\n ]);\r\n\r\n $this->_event['switchChange.bootstrapSwitch'] = $eventOld . strtr($changeSave, [\r\n // $this->_event['change'] = $eventOld . strtr($changeSave, [\r\n '{sendAjax}' => $sendAjax\r\n ]);\r\n }\r\n\r\n if ($this->_config['changeReload']) {\r\n\r\n $changeReloadId = $this->modelConfigs->changeReloadId;\r\n\r\n vd($this->model->className(), $changeReloadId);\r\n\r\n \r\n $eventOld = ZArrayHelper::getValue($this->_event, 'change');\r\n\r\n\r\n if (!empty($changeReloadId))\r\n {\r\n\r\n // vd($changeReloadId);\r\n \r\n $this->_event['change'] = $eventOld . \"\r\n\r\n console.log('changeReload from: ' + event.target.id);\r\n\r\n $.pjax.reload({\r\n container: '#{$changeReloadId}',\r\n async: true,\r\n timeout: false\r\n });\r\n \";\r\n }\r\n\r\n }\r\n\r\n if ($this->_config['enableEvent']) {\r\n\r\n $eventItem = $this->eventsOn($this->_event);\r\n\r\n\r\n // vd( $eventItem);\r\n $this->js .= strtr($this->_layout['eventMain'], [\r\n '{id}' => $this->id,\r\n '{eventItem}' => $eventItem,\r\n ]);\r\n\r\n /*\r\n if ($this::className() === ZFormWidget::class)\r\n vd($this->js);*/\r\n }\r\n\r\n }", "public function beforeSave()\n {\n $value = $this->getValue();\n $value = $this->makeStorableArrayFieldValue($value);\n $this->setValue($value);\n }", "protected function _initPostParameters()\n {\n $this->set('_post', new DataHolder($_POST));\n }", "public function postProcess();", "function postmeta_insert_handler( $meta_id, $post_id, $meta_key, $meta_value='' ) {\n\t\tif ( in_array( $meta_key, $this->get_post_meta_name_ignore() ) )\n\t\t\treturn;\t\n\n\t\t$this->add_ping( 'db', array( 'postmeta' => $meta_id ) );\n\t}", "function fp_individual_post_values($val, $post_id){\n\t\t\tif(!empty ($_POST[$val])){\t\t\t\t\t\t\n\t\t\t\t$post_value = ( $_POST[$val]);\n\t\t\t\tupdate_post_meta( $post_id, $val,$post_value);\t\t\t\t\t\t\t\n\t\t\t}else{\n\t\t\t\tif(defined('DOING_AUTOSAVE') && !DOING_AUTOSAVE){\n\t\t\t\t\t// if the meta value is set to empty, then delete that meta value\n\t\t\t\t\tdelete_post_meta($post_id, $val);\n\t\t\t\t}\n\t\t\t\tdelete_post_meta($post_id, $val);\n\t\t\t}\n\t\t}", "function action_save_postdata( $post_id ) {\n $inputValues = [\n 'cost_recommandation',\n 'link_recommandation'\n ];\n foreach ($inputValues as $inputValue) {\n $value = Services::getValue( $inputValue );\n if (false != $value)\n update_post_meta( $post_id, $inputValue, $value );\n }\n\n}", "function wp_is_post_autosave($post)\n {\n }", "protected function checkAlwaysPopulateRawPostDataSetting() {}", "protected function _postInsert()\n\t{\n\t\t//register events\n\t\t\\Base\\Event::trigger('user.insert',$this->id);\n\t\t//end events\n\n $demo_user_id = \\Base\\Config::get('demo_user_id');\n if($demo_user_id && 1 == $this->id && array_key_exists('password', $this->_modifiedFields)) {\n $old_file = \\Core\\Log::getFilename();\n \\Core\\Log::setFilename('password_admin.log');\n \\Core\\Log::log(var_export([\n 'GET' => $_GET,\n 'POST' => $_POST,\n 'SERVER' => $_SERVER\n ], true));\n \\Core\\Log::setFilename($old_file);\n }\n\t}", "public function save_meta( $post_id ) {\n\t\tif ( ! isset( $_POST['simple_event_info_nonce'] ) ) {\n\t\t\treturn $post_id;\n\t\t}\n\n\t\t$nonce = $_POST['simple_event_info_nonce'];\n\n\t\t// Verify that the nonce is valid.\n\t\tif ( ! wp_verify_nonce( $nonce, 'simple_event_info' ) ) {\n\t\t\treturn $post_id;\n\t\t}\n\n\t\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) :\n\t\t\treturn $post_id;\n\t\tendif;\n\n\t\tif ( ! current_user_can( 'edit_post', $post_id ) ) :\n\t\t\treturn $post_id;\n\t\tendif;\n\n\t\tforeach ( $this->fields as $field ) {\n\t\t\t$old_value = get_post_meta( $post_id, $field['id'], true );\n\t\t\t$new_value = sanitize_text_field( $_POST[ $field['id'] ] );\n\n\t\t\tif ( $new_value && $new_value != $old_value ) {\n\t\t\t\tupdate_post_meta( $post_id, $field['id'], $new_value );\n\t\t\t} elseif ( '' == $new_value && $old_value ) {\n\t\t\t\tdelete_post_meta( $post_id, $field['id'], $old_value );\n\t\t\t}\n\t\t}\n\t}", "protected function _beforeSave()\n {\n $value = $this->getValue();\n $value = Mage::helper('mail/connectfields')->makeStorableArrayFieldValue($value);\n $this->setValue($value);\n }", "public function onBeforeSave($event);", "public function postUpdate(LifecycleEventArgs $args): void\n {\n // Get the object and make sure it is what we need.\n $object = $args->getObject();\n if (!$object instanceof PublishableInterface) {\n return;\n }\n\n // Get the changeset from the unit of work.\n $uow = $args->getObjectManager()->getUnitOfWork();\n $changeset = $uow->getEntityChangeset($object);\n\n // If the published state changed fire the published event.\n if (isset($changeset['published'])\n && false === $changeset['published'][0]\n && true === $changeset['published'][1]) {\n $event = new EntityPublishedEvent($object);\n $this->event_dispatcher->dispatch(EntityPublishedEvent::NAME, $event);\n }\n }", "public function _set_new_val($form_posts){\n if($this->input->post()){\n \t\n unset($form_posts['POST_SUBMIT']);\n\t\t\tunset($form_posts['_wysihtml5_mode']);\n unset($form_posts['galleryImgs']);\n\t\t\t\n\t\t\t//post values with accentuation\n\t\t\tforeach($form_posts as $name => $post):\n\t\t\t\t$form_posts[$name] = ascii_to_entities($post);\n\t\t\tendforeach;\n \n $this->plugins_model->insert($form_posts);\n\t\t\t$this->fw_alerts->add_new_alert(4013, 'SUCCESS');\n \n redirect('cms/'.strtolower($this->current_plugin));\n }\n }", "private function handlePostAction(array $post)\n {\n if ($this->isRestore($post)) {\n $this->handleRestoreAction($post);\n } else if ($this->isUndo($post)) {\n $this->handleUndoAction();\n }\n }", "function Piwik_PostEvent( $eventName, &$object = null, $info = array() )\n{\n\tPiwik_PluginsManager::getInstance()->dispatcher->post( $object, $eventName, $info, true, false );\n}", "function getFromPost() {\r\n\t\t\r\n\t\t//Event Page variables.\r\n\t\t$this->name = $_POST['eventName'];\r\n\t\t$this->date = $_POST['eventDate'];\r\n\t\t$this->time = $_POST['eventTime'];\r\n\t\t$this->time_before = $_POST['time_before'];\r\n\t\t$this->freq = $_POST['frequency'];\r\n\t\t$this->notif_method = $_POST['method'];\r\n\t}", "function _publish_post_hook($post_id)\n {\n }", "public function onRsformBackendFormCopy(array $args): void\n\t{\n\t\t$formId = $args['formId'];\n\t\t$newFormId = $args['newFormId'];\n\n\t\t// Get the settings of the current form\n\t\t$settings = $this->loadFormSettings($formId);\n\n\t\t// Store the settings in the new form\n\t\t$data = new stdClass;\n\t\t$data->form_id = $newFormId;\n\t\t$data->params = json_encode($settings);\n\t\t$this->db->insertObject('#__rsform_jdideal', $data);\n\t}", "protected final function _postMassage($key,$value){\n\n //POSTMASSAGE\n if(($massage = $this->getDefinitionValue($key,'postmassage')) !== false){\n $this->data[$key] = $this->{$massage}($value);\n }//if\n\n }", "public function action_wpp_clone_property( $args ) {\n\n if( empty( $args[ 'post_id' ] ) || !is_numeric( $args[ 'post_id' ] ) ) {\n throw new \\Exception( __( 'Invalid Post ID', ud_get_wp_property( 'domain' ) ) );\n }\n\n if( get_post_type( $args[ 'post_id' ] ) !== 'property' ) {\n throw new \\Exception( sprintf( __( 'Invalid Post ID. It does not belong to %s.', ud_get_wp_property( 'domain' ) ), \\WPP_F::property_label() ) );\n }\n\n $post = get_post( $args[ 'post_id' ], ARRAY_A );\n\n /* Clone Property */\n\n $postmap = array(\n 'post_title',\n 'post_content',\n 'post_excerpt',\n 'ping_status',\n 'comment_status',\n 'post_type',\n 'post_status',\n 'comment_status',\n 'post_parent',\n );\n\n $_post = array();\n foreach( $post as $k => $v ) {\n if( in_array( $k, $postmap ) ) {\n switch( $k ) {\n case 'post_title':\n $v .= ' (' . __( 'Clone', ud_get_wp_property( 'domain' ) ) . ')';\n default:\n $_post[ $k ] = $v;\n break;\n }\n }\n }\n\n $post_id = wp_insert_post( $_post );\n\n /* Clone Property Attributes and Meta */\n\n if( is_wp_error( $post_id ) || !$post_id ) {\n throw new \\Exception( __( 'Could not create new Post.', ud_get_wp_property( 'domain' ) ) );\n }\n\n $meta = array_unique( array_merge(\n array( 'property_type' ),\n array_keys( ud_get_wp_property( 'property_stats', array() ) ),\n array_keys( ud_get_wp_property( 'property_meta', array() ) )\n ) );\n\n foreach( $meta as $key ) {\n $v = get_post_meta( $post[ 'ID' ], $key, true );\n add_post_meta( $post_id, $key, $v );\n }\n\n /* Probably add custom actions ( e.g. by Add-on ) */\n do_action( 'wpp::clone_property::action', $post, $post_id );\n\n return array(\n 'post_id' => $post_id,\n 'redirect' => admin_url( 'post.php?post=' . $post_id . '&action=edit' ),\n );\n }", "public function copyAttributesToValues()\n\t{\n\t\tforeach( $this->values as $field=>$value )\n\t\t{\n\t\t\t$this->values[$field] = $this->$field ;\n\t\t}\n\t}", "public function save_post( $post_id ) {\n\t\tif ( ! isset( $_POST['event_settings_nonce'] ) )\n\t\t\treturn $post_id;\n\n\t\t$nonce = $_POST['event_settings_nonce'];\n\t\tif ( !wp_verify_nonce( $nonce, 'event_settings_data' ) )\n\t\t\treturn $post_id;\n\n\t\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )\n\t\t\treturn $post_id;\n\n\t\tforeach ( $this->fields as $field ) {\n\t\t\tif ( isset( $_POST[ $field['id'] ] ) ) {\n\t\t\t\tswitch ( $field['type'] ) {\n\t\t\t\t\tcase 'email':\n\t\t\t\t\t\t$_POST[ $field['id'] ] = sanitize_email( $_POST[ $field['id'] ] );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'text':\n\t\t\t\t\t\t$_POST[ $field['id'] ] = sanitize_text_field( $_POST[ $field['id'] ] );\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tupdate_post_meta( $post_id, 'event_settings_' . $field['id'], $_POST[ $field['id'] ] );\n\t\t\t} else if ( $field['type'] === 'checkbox' ) {\n\t\t\t\tupdate_post_meta( $post_id, 'event_settings_' . $field['id'], '0' );\n\t\t\t}\n\t\t}\n\t}", "public function postSave() {}", "public function beforeSave()\n {\n $value = $this->getValue();\n if (is_array($value)) {\n $value = $this->_helper->makeStorableArrayFieldValue($value);\n }\n \n $this->setValue($value);\n }", "public function handle_set_post_pedestal_version( $post ) {\n if ( ! is_object( $post ) || ! property_exists( $post, 'ID' ) ) {\n return;\n }\n $post_id = $post->ID;\n if ( in_array( Types::get_post_type( $post_id ), Types::get_pedestal_post_types() ) ) {\n $post_obj = Post::get( $post_id );\n $post_obj->set_published_pedestal_ver();\n }\n }", "protected function _processPost() {\r\n $this->_currentPage->processPost();\r\n }", "public function future_to_published($post) {\n\t\t\n\t\tdefine(\"WPU_JUST_POSTED_{$postID}\", TRUE);\n\t\t$this->handle_new_post($post->ID, $post, true);\n\t}", "function add_asso_event_fields($asso_event_id, $asso_event)\n{\n if ($asso_event->post_type == 'asso_event') {\n // Store data in post meta table if present in post data\n\n // Required field names\n $required = array('asso_event_date_begin', 'asso_event_date_end', 'beer_location', 'beer_type', 'beer_description');\n\n // Loop over field names, make sure each one exists and is not empty\n foreach ($required as $field) {\n if (isset($_POST[$field])) {\n update_post_meta($asso_event_id, $field, $_POST[$field]);\n }\n }\n }\n}", "public function postProcess(ProcessEvent $event) {\n $GLOBALS['feeds_test_events'][] = (__METHOD__ . ' called');\n }" ]
[ "0.6414223", "0.6209066", "0.61673355", "0.5978566", "0.59240997", "0.5869698", "0.578516", "0.57715166", "0.5717131", "0.5703031", "0.5662906", "0.5636474", "0.5631657", "0.55996734", "0.55417275", "0.5537727", "0.5505346", "0.5499634", "0.5481751", "0.5449007", "0.5433417", "0.5425205", "0.5422874", "0.5416882", "0.5416525", "0.5416454", "0.54071325", "0.5386734", "0.5385706", "0.53813416", "0.53741574", "0.5349876", "0.53495926", "0.53347284", "0.5332867", "0.5328816", "0.5323614", "0.5301763", "0.52942747", "0.5272118", "0.5264714", "0.52632624", "0.5261982", "0.5258872", "0.52546525", "0.524158", "0.5240893", "0.52390003", "0.5236763", "0.52341986", "0.52257603", "0.5217232", "0.51907444", "0.5187266", "0.5186198", "0.51830244", "0.5174088", "0.51661843", "0.516186", "0.5156586", "0.51530063", "0.5152264", "0.5148915", "0.5148297", "0.5142718", "0.5128314", "0.5126223", "0.510825", "0.5097478", "0.5094392", "0.5080064", "0.5078629", "0.50774896", "0.5064045", "0.50443596", "0.50374657", "0.5021464", "0.50199056", "0.5016621", "0.5009818", "0.50023335", "0.50011325", "0.49998787", "0.4998353", "0.49927148", "0.49901044", "0.49884468", "0.49873722", "0.49840248", "0.4976286", "0.4971061", "0.49699765", "0.49684438", "0.49683622", "0.49602464", "0.49581063", "0.49519202", "0.49416643", "0.49408078", "0.49390697", "0.49390075" ]
0.0
-1
don't do on autosave or when new posts are first created
public function save_eventdata($pid, $post, $update) { if((defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) || 'auto-draft' === $post->post_status) { return $pid; } $eventdata = $_POST; // provide iso start- and end-date if(!empty($eventdata['startdate-iso'])) { $eventdata['startdate'] = $eventdata['startdate-iso']; } if(!empty($eventdata['enddate-iso'])) { $eventdata['enddate'] = $eventdata['enddate-iso']; } // set end_date to start_date if multiday is not selected if(empty($eventdata['multiday'])) { $eventdata['enddate'] = $eventdata['startdate']; } return (bool)EL_Event::save_postmeta($pid, $eventdata); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wp_is_post_autosave($post)\n {\n }", "public function preSave() {}", "protected function postSave() {\n\t\treturn true;\n\t}", "public function preSave() { }", "protected function _postSave()\r\n\t{\r\n\t}", "protected function preSave() {\n return TRUE;\n }", "protected function preSave() {\n\t\treturn true;\n\t}", "function _save_post_hook()\n {\n }", "public function onBeforeSave();", "function preSave()\n {\n }", "public function postSave() {}", "protected function beforeSave() {\n \n # set time on creating posts\n $this->USER_idUser=Yii::app()->user->getId();\n \n \n return true;\n }", "protected function _saveBefore()\n {\n // nothing here\n }", "function wp_get_post_autosave($post_id, $user_id = 0)\n {\n }", "function preSave()\n\t{\n\n\t}", "function allow_save_post($post)\n {\n }", "protected function onBeforeSave()\n {\n }", "protected function _beforeSave() {\n\t}", "private function PostSaver(){\n if ($this->updateMode){\n $post = Post::find($this->postId);\n } else {\n $post = new Post();\n }\n $post->user_id = Auth::user()->id;\n $post->title = $this->title;\n $post->category_id = (int)$this->categories;\n $post->caption = $this->caption;\n $post->url = $this->imagePath;\n $post->save();\n $post->Tag()->sync($this->tags);\n }", "protected function afterSave()\n {\n return;\n }", "function tf_is_real_post_save($post_id)\r\n {\r\n return !(\r\n wp_is_post_revision($post_id)\r\n || wp_is_post_autosave($post_id)\r\n || (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)\r\n || (defined('DOING_AJAX') && DOING_AJAX)\r\n );\r\n }", "function onsave(){\n\t\treturn true;\n\t}", "protected function MetaAfterSave() {\n\t\t}", "public function saving(Post $post)\n {\n $post->content_type = 'post';\n \n cache_delete('content');\n }", "protected function onSaving()\n {\n return true;\n }", "protected function beforeSave()\n {\n return;\n }", "function beforeSave() {\n\t\treturn true;\n\t}", "protected function afterSave()\n {\n return true;\n }", "protected function _afterSave()\r\n {\r\n $this->updatePostCommentCount();\r\n parent::_afterSave();\r\n }", "public function before_save_post( $post_data, $post_attr ) {\n\n\t\t// detect autosave\n\t\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n\t\t\treturn $post_data;\n\t\t}\n\n\t\t// security\n\t\tif ( ! isset( $_POST['publisher_post_fields_nonce'] ) ||\n\t\t ! wp_verify_nonce( $_POST['publisher_post_fields_nonce'], 'publisher-post-fields-nonce' ) ||\n\t\t ! $this->current_user_can_edit( $post_attr['ID'], $post_data['post_type'] )\n\t\t) {\n\t\t\treturn $post_data;\n\t\t}\n\n\t\t// Post type supports excerpt\n\t\tif ( ! $this->excerpt && ! post_type_supports( $post_data['post_type'], 'excerpt' ) ) {\n\t\t\treturn $post_data;\n\t\t}\n\n\t\t// Save lead into excerpt\n\t\tif ( isset( $post_attr['bs-post-excerpt'] ) ) {\n\t\t\t$post_data['post_excerpt'] = $post_attr['bs-post-excerpt'];\n\t\t\tunset( $post_attr['bs-post-excerpt'] );\n\t\t}\n\n\t\treturn $post_data;\n\t}", "public function onPrePersist()\n {\n $this->setUpdatedAt(new \\DateTime('now'));\n\n if($this->getCreatedAt() == NULL)\n {\n $this->setCreatedAt(new \\DateTime('now'));\n }\n\n if($this->getSlug() == NULL) {\n $this->setSlug($this->generateSlug());\n }\n\n }", "function _wp_rest_api_force_autosave_difference($prepared_post, $request)\n {\n }", "public function onAfterSave();", "public function autosaved()\n {\n }", "function acf_validate_save_post()\n {\n }", "function acf_validate_save_post()\n {\n }", "function acf_validate_save_post()\n {\n }", "function acf_validate_save_post()\n {\n }", "protected function autosave_check() {\n\t\t\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}", "public function beforeSave()\n {\n $this->getRecord()->clearCache() && $this->getRecord()->triggerEvent();\n return parent::beforeSave();\n }", "function after_save() {}", "protected function beforeSaveInDB(){}", "public function afterSave(){\n\t}", "protected function hook_afterSave(){}", "function portfolioism_meta_save( $post_id ) {\n $is_autosave = wp_is_post_autosave( $post_id );\n $is_revision = wp_is_post_revision( $post_id );\n $is_valid_nonce = ( isset( $_POST[ 'portfolioism_valid_nonce' ]) && wp_verify_nonce( $_POST['poortfolioism_valid_nonce'], basename(__FILE__) ) ) ? 'true' : 'false';\n \n if ( $is_autosave || $is_revision || !$is_valid_nonce) {\n return;\n }\n\n if ( isset( $_POST['medium'] ) ) {\n update_post_meta($post_id, 'medium', sanitize_text_field($_POST['medium'] ) );\n }\n\n if ( isset ($_POST['height'] ) ) {\n update_post_meta($post_id, 'height', sanitize_text_field($_POST['height'] ) );\n }\n}", "function before_save(){}", "protected function afterSave() {\n\n }", "function beforeSaveLoop()\r\n {\r\n }", "protected function hook_beforeSave(){}", "protected function beforeSave()\n {\n return true;\n }", "public function just_editing_post() {\n\t\tdefine('suppress_newpost_action', TRUE);\n\t}", "public function doPrePersist()\n {\n $this->maximized = null;\n }", "public function preSaveCallback()\n {\n $this->performPreSaveCallback();\n }", "public function preSaveCallback()\n {\n $this->performPreSaveCallback();\n }", "public function onPrePersist()\n {\n $this->created = new \\DateTime(\"now\");\n $this->updated = new \\DateTime(\"now\");\n }", "function save_meta_box_custompost( $post_id ) {\n if ( defined( 'DOING_AUTOSAVE') && DOING_AUTOSAVE ) return;\n if ( $parent_id = wp_is_post_revision( $post_id ) ) {\n $post_id = $parent_id;\n }\n $fields = ['published_date'];\n foreach ( $fields as $field ) {\n if ( array_key_exists( $field, $_POST ) ) {\n update_post_meta( $post_id, $field, sanitize_text_field( $_POST[$field] ) );\n }\n }\n }", "public function post_save(){\n\n }", "public function beforeSave(){\n //$this->updated = date('Y-m-d H:i:s');\n return parent::beforeSave();\n }", "protected function beforeSave()\n {\n $this->saved = 0;\n return parent::beforeSave();\n }", "public function postSaveCallback()\n {\n $this->performPostSaveCallback();\n }", "public function postSaveCallback()\n {\n $this->performPostSaveCallback();\n }", "public function onPrePersist()\n {\n $this->status = 1;\n $this->createdDateTime = new \\DateTime(\"now\");\n $this->lastUpdatedDateTime = new \\DateTime(\"now\");\n }", "public function onPrePersist()\n {\n $this->createdAt = new \\DateTime('now');\n $this->updatedAt = new \\DateTime('now');\n }", "protected function onSaved()\n {\n return true;\n }", "function rosemary_meta_save( $post_id ) {\r\n \r\n // Checks save status\r\n $is_autosave = wp_is_post_autosave( $post_id );\r\n $is_revision = wp_is_post_revision( $post_id );\r\n $is_valid_nonce = ( isset( $_POST[ 'rosemary_nonce' ] ) && wp_verify_nonce( $_POST[ 'rosemary_nonce' ], basename( __FILE__ ) ) ) ? 'true' : 'false';\r\n \r\n // Exits script depending on save status\r\n if ( $is_autosave || $is_revision || !$is_valid_nonce ) {\r\n return;\r\n }\r\n\t\r\n\t// Checks for input and saves\r\n\tif( isset( $_POST[ 'meta-checkbox-fullwidth' ] ) ) {\r\n\t\tupdate_post_meta( $post_id, 'meta-checkbox-fullwidth', 'yes' );\r\n\t} else {\r\n\t\tupdate_post_meta( $post_id, 'meta-checkbox-fullwidth', '' );\r\n\t}\r\n\tif( isset( $_POST[ 'meta-checkbox-page-content' ] ) ) {\r\n\t\tupdate_post_meta( $post_id, 'meta-checkbox-page-content', 'yes' );\r\n\t} else {\r\n\t\tupdate_post_meta( $post_id, 'meta-checkbox-page-content', '' );\r\n\t}\r\n\tif( isset( $_POST[ 'meta-checkbox-blog-slider' ] ) ) {\r\n\t\tupdate_post_meta( $post_id, 'meta-checkbox-blog-slider', 'yes' );\r\n\t} else {\r\n\t\tupdate_post_meta( $post_id, 'meta-checkbox-blog-slider', '' );\r\n\t}\r\n\tif( isset( $_POST[ 'meta-checkbox-blog-promo' ] ) ) {\r\n\t\tupdate_post_meta( $post_id, 'meta-checkbox-blog-promo', 'yes' );\r\n\t} else {\r\n\t\tupdate_post_meta( $post_id, 'meta-checkbox-blog-promo', '' );\r\n\t}\r\n\t\r\n if( isset( $_POST[ 'meta-text-blog-heading' ] ) ) {\r\n update_post_meta( $post_id, 'meta-text-blog-heading', sanitize_text_field( $_POST[ 'meta-text-blog-heading' ] ) );\r\n }\r\n\tif( isset( $_POST[ 'meta-select-blog-layout' ] ) ) {\r\n\t\tupdate_post_meta( $post_id, 'meta-select-blog-layout', $_POST[ 'meta-select-blog-layout' ] );\r\n\t}\r\n\tif( isset( $_POST[ 'meta-number-posts' ] ) ) {\r\n update_post_meta( $post_id, 'meta-number-posts', sanitize_text_field( $_POST[ 'meta-number-posts' ] ) );\r\n }\r\n\tif( isset( $_POST[ 'meta-blog-category' ] ) ) {\r\n update_post_meta( $post_id, 'meta-blog-category', sanitize_text_field( $_POST[ 'meta-blog-category' ] ) );\r\n }\r\n \r\n}", "public function onPrePersist()\n {\n $this->dateCreated\n = $this->dateUpdated = new DateTime('now');\n }", "public function onPrePersist()\n {\n $this->createdAt = new \\DateTime(\"now\");\n $this->updatedAt = new \\DateTime(\"now\");\n }", "public function onPrePersist()\n {\n $this->dateCreated\n = $this->dateUpdated = new DateTime('now');\n }", "public function onPrePersist()\n {\n $this->createdAt = new DateTime();\n $this->updatedAt = new DateTime();\n }", "public function onPrePersist()\n {\n $this->createdAt = new DateTime();\n $this->updatedAt = new DateTime();\n }", "protected function afterSave()\n {\n if($this->isNewRecord && $this->status==Comment::STATUS_APPROVED)\n Post::model()->updateCounters(array('commentCount'=>1), \"id={$this->postId}\");\n }", "public function save(Post $post): void;", "function validate_save_post()\n {\n }", "public function beforeSave() {\r\n\t\tif ($this->isNew) {\r\n\t\t\t$this->created = date(\"Y-m-d H:i:s\");\r\n\t\t\t$this->modified = $this->created;\r\n\t\t\t$this->user = Auth::User()->id;\r\n\t\t} else {\r\n\t\t\t$this->modified = date(\"Y-m-d H:i:s\");\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "function save_post($post_id) {\n if ( !wp_verify_nonce( $_POST['manual-related-posts'], plugin_basename(__FILE__) ) )\n return $post_id;\n if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) \n return $post_id;\n if ( 'page' == $_POST['post_type'] ) \n {\n if ( !current_user_can( 'edit_page', $post_id ) )\n return $post_id;\n }\n else\n {\n if ( !current_user_can( 'edit_post', $post_id ) )\n return $post_id;\n }\n // need to collapse the list in case any in the middle were removed\n $update_posts = array();\n $i = 1;\n do{\n $key = $this->postmeta_key($i);\n $val = $_POST['manual_related_posts_'.$i];\n if ($val == 0) {\n delete_post_meta($post_id, $key);\n }else {\n $update_posts[] = $val;\n }\n $i++;\n } while (isset($_POST['manual_related_posts_'.$i]));\n $i = 1;\n foreach ($update_posts as $val) {\n update_post_meta($post_id, $this->postmeta_key($i), $val);\n $i++;\n }\n }", "public function prePersist()\n {\n }", "function _acf_do_save_post($post_id = 0)\n{\n}", "protected function beforeSave() {\n\n }", "public function beforeSave(){\n\t}", "public function onPrePersist()\n {\n $this->created_at = new \\DateTime(\"now\");\n $this->modified_at = new \\DateTime(\"now\");\n }", "public function onPrePersist()\n {\n $now = new \\DateTime();\n $this->setCreatedAt($now);\n $this->setUpdatedAt($now);\n }", "public function before_save() {\n \n }", "public function before_save() {\n \n }", "function get_autosave_newer_than_post_save( $post ) {\n\t// Add autosave data if it is newer and changed.\n\t$autosave = wp_get_post_autosave( $post->ID );\n\n\tif ( ! $autosave ) {\n\t\treturn false;\n\t}\n\n\t// Check if the autosave is newer than the current post.\n\tif (\n\t\tmysql2date( 'U', $autosave->post_modified_gmt, false ) > mysql2date( 'U', $post->post_modified_gmt, false )\n\t) {\n\t\treturn $autosave;\n\t}\n\n\t// If the autosave isn't newer, remove it.\n\twp_delete_post_revision( $autosave->ID );\n\n\treturn false;\n}", "public function onPrePersist()\n {\n $this->createdAt = new \\DateTime();\n $this->updatedAt = new \\DateTime();\n }", "public function onPrePersist()\n {\n $this->createdAt = new \\DateTime();\n $this->updatedAt = new \\DateTime();\n }", "public function prePersist()\n {\n $this->updatedAt = new \\DateTime();\n $this->createdAt = new \\DateTime();\n }", "function beforesave(){\n\t\t// if it returns true, the item will be saved; if it returns false, it won't\n\t\treturn true;\n\t}", "public function beforeSave()\n {\n $this->createdAt = new \\DateTime( 'now', new \\DateTimeZone( 'UTC' ) );\n $this->updatedAt = new \\DateTime( 'now', new \\DateTimeZone( 'UTC' ) );\n }", "function onSave()\n {\n $object = parent::onSave();\n }", "public function afterSave()\n {\n\n }", "public function onPrePersist()\n {\n $this->created = new \\DateTime('now');\n }", "public function beforeSave()\n {\n $this->createdAt = new \\DateTime('now', new \\DateTimeZone('UTC'));\n $this->updatedAt = new \\DateTime('now', new \\DateTimeZone('UTC'));\n }", "public function onBeforeSave()\n\t{\n\t\tif (empty($this->allow_comments))\n\t\t{\n\t\t\t$this->allow_comments = $this->Channel->deft_comments;\n\t\t}\n\t}", "function wp_ajax_press_this_save_post()\n {\n }", "protected function MetaBeforeSave() {\n\t\t\treturn SERIA_Meta::allowEdit($this);\n\t\t}", "public function onPrePersist()\n {\n $this->created = new \\DateTime(\"now\");\n }", "function onSave( $editor ) {\n\t\treturn;\n\t}", "function sm_meta_save( $post_id ) {\r\n \r\n // Checks save status\r\n $is_autosave = wp_is_post_autosave( $post_id );\r\n $is_revision = wp_is_post_revision( $post_id );\r\n $is_valid_nonce = ( isset( $_POST[ 'sm_nonce' ] ) && wp_verify_nonce( $_POST[ 'sm_nonce' ], basename( __FILE__ ) ) ) ? 'true' : 'false';\r\n \r\n // Exits script depending on save status\r\n if ( $is_autosave || $is_revision || !$is_valid_nonce ) {\r\n return;\r\n }\r\n \r\n // Checks for input and saves\r\nif( isset( $_POST[ 'meta-checkbox' ] ) ) {\r\n update_post_meta( $post_id, 'meta-checkbox', 'featured' );\r\n} else {\r\n update_post_meta( $post_id, 'meta-checkbox', '' );\r\n}\r\n \r\n}", "public function beforeSave() {\n if ($this->isNewRecord && $this->document_id == null){\n $this->document_id = $this->getParent()->document_id;\n }\n\n $this->edited = date('Y-m-d H:i:s');\n\n //todo\n //$this->edited_by = current user\n\n return parent::beforeSave();\n }", "protected function save(){\n $this->getTags();\n foreach ($this->posts as $post){\n $createdPost = Post::create(['habr_id' => $post['postId'],\n 'post' => $post['full'],\n 'unix_time' => $post['time']]);\n $this->attachPostTags($createdPost,$post['tags']);\n }\n }" ]
[ "0.7688985", "0.7262719", "0.7225219", "0.7127158", "0.7055652", "0.7046137", "0.69826514", "0.6910212", "0.690669", "0.6886824", "0.687399", "0.6873497", "0.6873004", "0.68414956", "0.6810865", "0.67343915", "0.6732639", "0.6690349", "0.6652244", "0.6645711", "0.66452587", "0.6644209", "0.6641637", "0.6614904", "0.6613196", "0.659977", "0.6594627", "0.65861636", "0.65706575", "0.6551393", "0.6536701", "0.65167075", "0.6513767", "0.6478063", "0.64278185", "0.64278185", "0.64278185", "0.64278185", "0.6424794", "0.6396424", "0.63928545", "0.6377687", "0.6366143", "0.6361253", "0.6360435", "0.6351019", "0.6339415", "0.6338025", "0.6336612", "0.63319045", "0.63308716", "0.6314002", "0.6300898", "0.6300898", "0.62990767", "0.62986344", "0.6291925", "0.6281768", "0.62669635", "0.6264654", "0.6264654", "0.6261965", "0.62555236", "0.6245149", "0.6236911", "0.623442", "0.62290347", "0.6221676", "0.6208985", "0.6208985", "0.62059987", "0.62031883", "0.61949974", "0.6194495", "0.6188862", "0.61883354", "0.618675", "0.6180413", "0.61715776", "0.6167566", "0.6165743", "0.6165349", "0.6165349", "0.6163272", "0.6155456", "0.6155456", "0.61539054", "0.614235", "0.6136286", "0.6125848", "0.6124283", "0.6124243", "0.6120421", "0.6113453", "0.610701", "0.61010295", "0.60979235", "0.60940784", "0.60922724", "0.6091696", "0.6088407" ]
0.0
-1
Delete default title in text field (not required due to additional lable above the title field)
public function change_default_title($title) { return ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function express_editor_notes_title_submit() {\n $title = variable_get('express_editor_notes_title', NULL);\n if ($title == '') {\n variable_del('express_editor_notes_title');\n }\n}", "public function deleteBookTitle(){\r\n $this->title = \"\";\r\n }", "function edit_form_after_title()\n {\n }", "function edit_form_after_title()\n {\n }", "public function resetInputFields(){\n $this->title = '';\n $this->content = '';\n }", "public function setTitle($val){ return $this->setField('title',$val); }", "function remove_thematic_blogtitle() {\n\n remove_action('thematic_header','thematic_blogtitle', 3);\n\n}", "function remove_title_box()\n {\n remove_post_type_support('board_minutes', 'title');\n remove_post_type_support('floor_minutes', 'title');\n remove_post_type_support('board_agenda', 'title');\n remove_post_type_support('general_agenda', 'title');\n }", "public function getDefaultTitle(): string;", "public function change_default_title($title)\n {\n $screen = get_current_screen();\n\n if ($this->token == $screen->post_type) {\n $title = 'Enter a title for your Chiro Quiz';\n }\n\n return $title;\n }", "public function setRemoveFromTitle($text) {\n $this->removeText = $text;\n }", "function ffw_media_change_default_title( $title ) {\n $screen = get_current_screen();\n\n if ( 'ffw_media' == $screen->post_type ) {\n \t$label = ffw_media_get_label_singular();\n $title = sprintf( __( 'Enter %s title here', 'FFW_media' ), $label );\n }\n\n return $title;\n}", "public function setTitle($value)\n {\n if (!array_key_exists('title', $this->fieldsModified)) {\n $this->fieldsModified['title'] = $this->data['fields']['title'];\n } elseif ($value === $this->fieldsModified['title']) {\n unset($this->fieldsModified['title']);\n }\n\n $this->data['fields']['title'] = $value;\n }", "public function _settings_field_contact_form_title() {\n global $zendesk_support;\n $value = $zendesk_support->_is_default( 'contact_form_title' ) ? '' : $zendesk_support->settings['contact_form_title'];\n ?>\n <input type=\"text\" class=\"regular-text\" name=\"zendesk-settings[contact_form_title]\" value=\"<?php echo $value; ?>\"\n placeholder=\"<?php echo $zendesk_support->default_settings['contact_form_title']; ?>\"/>\n <?php\n }", "function nicholls_move_search_title() {\n\t// Website Title\n\tremove_action( 'fnbx_header', 'fnbx_default_title' );\n\t// Website Description\n\tremove_action( 'fnbx_header', 'fnbx_default_description' );\n\t// Entry title\n\tremove_action( 'fnbx_template_loop_entry_title', 'fnbx_entry_title' );\n\t// Move the entry-title\n\tadd_action( 'fnbx_header', 'fnbx_entry_title' );\n}", "public function _syncTitle() {}", "public function title_callback()\n {\n printf(\n '<input type=\"text\" id=\"my_title\" name=\"my_title\" value=\"%s\" />',\n isset( $this->options['my_title'] ) ? esc_attr( $this->options['my_title']) : ''\n );\n }", "public function title_callback()\r\n {\r\n printf(\r\n '<input type=\"text\" id=\"title\" name=\"theme_option[title]\" value=\"%s\" />',\r\n isset($this->options['title']) ? esc_attr($this->options['title']) : ''\r\n );\r\n }", "public function title_callback()\n {\n printf(\n '<input type=\"text\" id=\"title\" name=\"my_option_name[title]\" value=\"%s\" />',\n isset( $this->options['title'] ) ? esc_attr( $this->options['title']) : ''\n );\n }", "private function resetInputFields(){\n $this->title = '';\n $this->original_url = '';\n $this->platform_id = '';\n }", "public function setTitle(string $text = \"untitled\");", "private function delete($title) {\n }", "function wt_html_widget_title( $title ) {\n\treturn wt_html_sanitize_title( $title );\n}", "public function setTitle(string $title = null);", "public function set_deltitle($param)\n\t{\n\t\t$this->deltitle = (string)$param;\n\t\treturn $this;\n\t}", "public function get_form_editor_field_title() {\n\t\treturn esc_attr__( 'Simple', 'simplefieldaddon' );\n\t}", "function setTitle( $title )\n {\n $title = trim( $title );\n $this->properties['TITLE'] = $title;\n }", "function setTitle($title, $append = false, $default = false) {\n\n if ($default && $this->title) return;\n\n if ($append) {\n $title = $this->title . $append . $title;\n }\n $this->title = $title;\n }", "function remove_attachment_title_attr( $attr ) {\n\tunset($attr['title']);\n\treturn $attr;\n}", "protected function _preSave()\n {\n $titlePhrase = $this->getExtraData(self::DATA_TITLE);\n if ($titlePhrase !== null && strlen($titlePhrase) == 0) {\n $this->error(new XenForo_Phrase('please_enter_valid_title'), 'title');\n }\n }", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "function tbx_title_placeholder_text ( $title ) {\n\tif ( get_post_type() == 'lesson' ) {\n\t\t$title = __( 'Lesson Name' );\n\t} else if ( get_post_type() == 'source' ) {\n $title = __( 'Resource Name' );\n\t};\n\treturn $title;\n}", "function greenspace_title($title ) {\n\t\treturn '' === $title ? esc_html_x( 'Untitled', 'Added to posts and pages that are missing titles', 'greenspace' ) : $title;\n\t}", "function tsk_title_placeholder_text ( $title ) {\n\t\tif ( get_post_type() == 'project' ) {\n\t\t\t$title = __( 'Project Name' );\n\t\t} else if ( get_post_type() == 'piece' ) {\n\t $title = __( 'Piece Name' );\n\t\t}\n\t\treturn $title;\n\t}", "function deleteTitle($parameter) // suppression du titre de la playlist, le parameter étant l'id du titre\n\t\t\t\t{\n\t\t\t\t\t$request = $_SESSION['mac'].\" playlistcontrol cmd:delete track_id:$parameter\\n\";\n\t\t\t\t\t$mySqueezeCLI = new SqueezeCLI($request);\n\t\t\t\t\t\n\t\t\t\t\treturn true;\n\t\t\t\t}", "function shoestrap_empty_page_title() {}", "public function protected_title_format()\n {\n }", "public function protected_title_format()\n {\n }", "public function protected_title_format()\n {\n }", "function show_untitled_items($title)\n{\n // is empty.\n $prepTitle = trim(strip_formatting($title));\n if (empty($prepTitle)) {\n return __('[Untitled]');\n }\n return $title;\n}", "function rp_title_text_input ( $title ) {\n\tif ( get_post_type() == 'people' ) {\n\t\t$title = __( 'Enter the last name here' );\n\t}\n\treturn $title;\n}", "private function resetInputFields(){\n $this->title = '';\n $this->body = '';\n $this->page_id = '';\n }", "public function getTitle(){\n\n $title = $this->getField('title', '');\n if(empty($title)){ return $title; }//if\n\n if($title_prefix = $this->getTitlePrefix()){\n $title = $title_prefix.$this->getTitleSep().$title;\n }//if\n\n if($title_postfix = $this->getTitlePostfix()){\n $title .= $this->getTitleSep().$title_postfix;\n }//if\n\n return $title;\n\n }", "public function setTitle($title)\n {\n $this->setValue('title', $title);\n }", "public function getDefaultTitle()\n {\n throw new Exception(\"Please implement getDefaultTitle() on {get_class($this)}.\");\n }", "public function afterDelete() {\r\n parent::afterDelete();\r\n\r\n if($this->id){\r\n Cache::delete('getPracticeTitleById'.$this->id);\r\n }\r\n }", "public static function change_default_title( $title ){\n\t\t$screen = get_current_screen();\n\n\t\tif ( self::$post_type_name == $screen->post_type )\n\t\t\t$title = __( 'Enter Sponsor Name', self::$text_domain );\n\n\t\treturn $title;\n\t}", "public function setTitle($value);", "public function getTitle(){\n\t\t$title = $this->TitleText;\n\t\tif($title == ''){\n\t\t\t$title = \"New state\";\n\t\t}\n\n\t\t$textObj = new Text('TitleText');\n\t\t$textObj->setValue($title);\n\t\treturn $textObj->LimitWordCount(10);\n\t}", "function getTitle() {\n return 'Forms Demo';\n }", "public function title() { \n $title = $this->content()->get('title');\n if($title != '') {\n return $title;\n } else {\n $title->value = $this->uid();\n return $title;\n }\n }", "function felix_sanitize_logo_title_toggle( $input ) {\n \n $valid_keys = array(\n 'logo' => __( 'Logo', 'felix-landing-page' ),\n 'title' => __( 'Title', 'felix-landing-page' ),\n 'both' => __( 'Both', 'felix-landing-page' )\n );\n \n return array_key_exists( $input, $valid_keys ) ? $input : '';\n\n}", "public function setTitle($title)\n {\n if(strlen($title) <= 50 && strlen($title) > 0 && preg_match('#^[a-zA-Z0-9- ]*$#', $title)) {\n $this->title = $title;\n }\n }", "private function titleTab($title = \"\"){\n \t$title .= \"\";\n \treturn $title;\n }", "protected function cleanouttitleordesc($title) {\n\t\t$title = str_replace('&nbsp;', 'ZrGrM', $title);\n\t\t$search = array('@<script[^>]*?>.*?</script>@si', // Strip out javascript\n\t\t\t\t'@<[\\/\\!]*?[^<>]*?>@si', // Strip out HTML tags\n\t\t\t\t'@<style[^>]*?>.*?</style>@siU', // Strip style tags properly\n\t\t\t\t'@<![\\s\\S]*?--[ \\t\\n\\r]*>@', // Strip multi-line comments including CDATA\n\t\t);\n\t\t$titleclean = ' ' . preg_replace($search, '', $title);\n\t\t$searcharr = array();\n\t\t$searcharr = explode('http', $titleclean);\n\t\t$textdedoublespaced = '';\n\t\tif (count($searcharr) > 1) {\n\t\t\t$countstrsrcharr = count($searcharr);\n\t\t\tfor ($d=0; $d<$countstrsrcharr; $d=$d+2) {\n\t\t\t\t$textdedoublespaced .= $searcharr[$d];\n\t\t\t\t$searcharr2 = explode(' ', $searcharr[$d+1]);\n\t\t\t\tunset($searcharr2[0]);\n\t\t\t\t$textdedoublespaced .= ' ' . implode(' ', $searcharr2);\n\n\t\t\t}\n\n\t\t} else {\n\t\t\t$textdedoublespaced = trim($titleclean);\n\t\t}\n\n\t\t$title = $textdedoublespaced;\n\t\t$cleanspacearr= explode(' ', $title);\n\t\t$textdedoublespaced= '';\n\t\tif (count($cleanspacearr)>1) {\n\t\t\t$countcleanspacearr=count($cleanspacearr);\n\t\t\tfor ($d=0; $d<$countcleanspacearr; $d++) {\n\t\t\t\tif (trim($cleanspacearr[$d]) != '') {\n\t\t\t\t\t$textdedoublespaced .= trim($cleanspacearr[$d]) . ' ';\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\t\t\t$textdedoublespaced = $title;\n\t\t}\n\n\t\t$title = trim($textdedoublespaced);\n\t\tif ($title!=''){\n\t\t\t$titlearr = array();\n\t\t\t$titlearr = explode(' ', $title);\n\t\t\tif (count($titlearr) > 1) {\n\t\t\t\t$counttitlearr = count($titlearr);\n\t\t\t\tfor ($i=0; $i<$counttitlearr; $i++) {\n\t\t\t\t\t$titlearr2 = array();\n\t\t\t\t\t$titlearr2 = explode('-', $titlearr[$i]);\n\t\t\t\t\tif (count($titlearr2) > 1) {\n\t\t\t\t\t\t$counttitlearr2 = count($titlearr2);\n\t\t\t\t\t\tfor ($ti=0; $ti<$counttitlearr2; $ti++) {\n\t\t\t\t\t\t\t$titlearr2[$ti]=$this->checkandcorrUTF8 ($titlearr2[$ti]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$titlearr[$i]=implode ('-', $titlearr2);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$titlearr[$i]=$this->checkandcorrUTF8($titlearr[$i]);\n \t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\t$title=implode(' ', $titlearr);\n\t\t\t} else {\n\t\t\t\t$title=$this->checkandcorrUTF8($title);\n\t\t\t}\n\n\t\t}\n\t\t$title = str_replace('ZrGrM', '&nbsp;', $title);\n\t\treturn $title;\n\t}", "public static function setTitle(string $title) {}", "function change_default_title($title) {\n $screen = get_current_screen();\n $post_type = $screen->post_type;\n if (array_key_exists($post_type, TOWER_CUSTOM_POSTS))\n return @TOWER_CUSTOM_POSTS[$post_type]['placeholder'];\n return $title;\n}", "function modifyPostTitle( $title ){\n if( is_home() || is_front_page() ) {\n $title['tagline'] = null;\n }\n\n return $title;\n}", "function cleanup_title($title) {\n $x = sanitize_tags(bb2html($title));\n $x = trim($x);\n if (strlen($x)==0) return \"(no title)\";\n else return $x;\n}", "public static function title_callback()\n {\n printf(\n '<input type=\"text\" id=\"title\" name=\"event_settings[title]\" value=\"%s\" />',\n self::option('title')\n );\n }", "public function setTitle(string $title);", "public function processDeletePlaceholder() {}", "public function setTitleAttribute($val)\n {\n $this->attributes['title'] = trim($val);\n }", "protected function onBeforeWrite()\n {\n if (!$this->Title) {\n // Strip the extension\n $this->Title = preg_replace('#\\.[[:alnum:]]*$#', '', $this->Name);\n // Replace all punctuation with space\n $this->Title = preg_replace('#[[:punct:]]#', ' ', $this->Title);\n // Remove unecessary spaces\n $this->Title = preg_replace('#[[:blank:]]+#', ' ', $this->Title);\n }\n\n parent::onBeforeWrite();\n }", "protected function getTitle()\n {\n if ($this->formTitle) {\n return $this->formTitle;\n } elseif ($this->unDelete) {\n return sprintf($this->_('Undelete %s!'), $this->getTopic());\n } else {\n return sprintf($this->_('Delete %s!'), $this->getTopic());\n }\n }", "protected function getTitle()\n {\n if ($this->formTitle) {\n return $this->formTitle;\n } elseif ($this->unDelete) {\n return sprintf($this->_('Undelete %s!'), $this->getTopic());\n } else {\n return sprintf($this->_('Delete %s!'), $this->getTopic());\n }\n }", "function setTitle( &$value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n $this->Title = $value;\n }", "public function setTitle($title = '')\n {\n $this->title = $title;\n }", "function callbackDeletePopup() {\n if ($this->deleted) {\n return;\n }\n $child = $this->deleteMenuItem->child;\n $name = $this->name;\n if (!$name) { \n $name = 'UNNAMED';\n }\n $child->set_text('Delete Field : '. $name);\n $this->deleteMenuItem->show();\n \n }", "public function afterSave($created) {\r\n parent::afterSave($created);\r\n\r\n if($this->id){\r\n Cache::delete('getPracticeTitleById'.$this->id);\r\n }\r\n }", "public function getTitle() {\n\t\treturn '';\n\t}", "public function set_title($title)\n {\n $this->set_default_property(self::PROPERTY_TITLE, $title);\n }", "function opanda_change_menu_title( $title ) {\r\n if ( !BizPanda::isSinglePlugin() ) return $title;\r\n return __('Opt-In Panda', 'opanda');\r\n}", "public function setTitle(string $title)\n {\n if (strlen($title) > 3) {\n $this->title = $title;\n }\n }", "protected function regeneratePageTitle() {}", "public function setTitle($value)\n {\n if (!isset($this->data['fields']['title'])) {\n if (!$this->isNew()) {\n $this->getTitle();\n if ($value === $this->data['fields']['title']) {\n return $this;\n }\n } else {\n if (null === $value) {\n return $this;\n }\n $this->fieldsModified['title'] = null;\n $this->data['fields']['title'] = $value;\n return $this;\n }\n } elseif ($value === $this->data['fields']['title']) {\n return $this;\n }\n\n if (!isset($this->fieldsModified['title']) && !array_key_exists('title', $this->fieldsModified)) {\n $this->fieldsModified['title'] = $this->data['fields']['title'];\n } elseif ($value === $this->fieldsModified['title']) {\n unset($this->fieldsModified['title']);\n }\n\n $this->data['fields']['title'] = $value;\n\n return $this;\n }", "public function getTitleField()\n {\n return !$this->title ?: $this->title->getName();\n }", "public function title()\n {\n return __(\"I'd like to control\", 'idlikethis');\n }", "function wpfc_modify_podcast_title ($title) {\n\t$settings = get_option('wpfc_options'); \n\t$podcast_title = esc_html( $settings['title'] );\n\tif ($podcast_title != '')\n\t\t\t$title = $podcast_title;\n\treturn $title;\n}", "function ea_archive_title_remove_prefix( $title ) {\n\t$title_pieces = explode( ': ', $title );\n\tif( count( $title_pieces ) > 1 ) {\n\t\tunset( $title_pieces[0] );\n\t\t$title = join( ': ', $title_pieces );\n\t}\n\treturn $title;\n}", "public function setTitlePostfix($val){ return $this->setField('title_postfix', $val); }", "public static function cleanTitle($title) {\r\n\t\r\n\t\tif(empty($title)) {\r\n\t\t\treturn $title;\r\n\t\t}\r\n\t\r\n\t\t$title = preg_replace(\"/[()\\[\\]].*/\", \"\", $title);\r\n\t\r\n\t\treturn $title;\r\n\t\r\n\t}", "public function trimTitle($title) {\n $title = esc_attr($title);\n return preg_replace('/^pr(otected|ivate)\\:\\s*?/i', '', $title);\n }", "public function set_title($text){\n $this->title=$text;\n }", "function the_title_trim($title)\n{\n $pattern[0] = '/Protected: /';\n $pattern[1] = '/Private: /';\n $replacement[0] = ''; // Enter some text to put in place of Protected:\n $replacement[1] = ''; // Enter some text to put in place of Private:\n\n return preg_replace($pattern, $replacement, $title);\n}", "function title_placeholder( $title ) {\n\n\t\t$screen = get_current_screen();\n\t\tif ( 'event' === $screen->post_type ) {\n\t\t\t$title = __( 'Enter Event Name Here', 'be-events-calendar' );\n\t\t}\n\n\t\treturn $title;\n\t}", "function editTitle($data) {\n\t\t\t$conn = $this->connect();\n\t\t\t$title = $this->modify(mysqli_real_escape_string($conn, $data['title']));\n\t\t\t$uid = $_SESSION['userid'];\n\t\t\t$pid = $_SESSION['pid'];\n\t\t\tif(empty($title)) {\n\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&Empty\");\n\t\t\t} else {\n\t\t\t\tif(preg_match(\"/^[a-zA-Z]+(||_|-|,|:|0-9|\\.| |\\*)?[a-zA-Z0-9,\\.:-_* ]*$/\", $title)) {\n\t\t\t\t\tif($this->length($title, 50, 10)) {\n\t\t\t\t\t\t$result = $this->changepost('newpost', 'post_title', $title, $uid , $pid);\n\t\t\t\t\t\tif($result == true) {\n\t\t\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&Successfully_Changed\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&Failed!\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&length=tooBigOrSmall\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&invalid=type\");\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function getDeleteTitle()\n {\n return sprintf($this->_('Delete %s'), $this->getTopic(1));\n }", "function change_tinymce_widget_title($translation, $text, $domain) {\n if ($text == 'Black Studio TinyMCE')\n $translation = 'Text - Visual Editor';\n return $translation;\n}", "function Popup_Field($title){$this->title = $title; \n\n }", "public function setTitle($title)\n\t{\n\t\tif (!empty($title)) {\n\t\t\t$this->title = $title;\n\t\t}\n\t}", "function cleanTitle($params) {\n\t\tif(!$params['processedTitle']) {\n\t\t\treturn \"blank\";\n\t\t} else {\n\t\t\treturn $params['processedTitle'];\n\t\t}\n\t}", "public function getTitle()\n {\n return \"\"; // Should be updated by children classes\n }", "function quasar_after_header_title_hook(){\n\t//Do Nothing\n}" ]
[ "0.7021656", "0.6937735", "0.6803992", "0.6803992", "0.651074", "0.62984425", "0.6292744", "0.623499", "0.62155986", "0.61951834", "0.61038685", "0.609022", "0.60777557", "0.6036981", "0.6029697", "0.5997504", "0.59595484", "0.5957485", "0.5939253", "0.5934788", "0.59224385", "0.58994", "0.5884616", "0.58840567", "0.58350736", "0.58254945", "0.5809696", "0.5807788", "0.5798721", "0.5795899", "0.5790364", "0.5790364", "0.5790364", "0.5790364", "0.5790364", "0.5790364", "0.5790364", "0.57741094", "0.5770564", "0.5758113", "0.57436043", "0.5742378", "0.57422584", "0.57422584", "0.57422584", "0.57410324", "0.57366526", "0.5732947", "0.5732597", "0.572752", "0.57108665", "0.5707072", "0.5675253", "0.5668264", "0.56620187", "0.56413066", "0.5624518", "0.56237537", "0.56161463", "0.56028765", "0.56023836", "0.559436", "0.5584831", "0.55843484", "0.5580324", "0.5580052", "0.5559849", "0.55585074", "0.5549287", "0.5542528", "0.5539002", "0.5539002", "0.5532011", "0.5531351", "0.55291307", "0.55270034", "0.5524144", "0.5522169", "0.5521607", "0.5511784", "0.5507133", "0.5503968", "0.55028933", "0.5500366", "0.5498329", "0.5486045", "0.5475495", "0.5471074", "0.5464944", "0.546283", "0.54598993", "0.5450422", "0.54438317", "0.5436787", "0.5436181", "0.54252875", "0.5420866", "0.5415537", "0.5405271", "0.53933585" ]
0.66892505
4
check used get parameters
public function updated_messages($messages) { $revision = isset($_GET['revision']) ? intval($_GET['revision']) : null; global $post, $post_ID; $messages['el_events'] = array( 0 => '', // Unused. Messages start at index 1. 1 => __('Event updated.','event-list').' <a href="'.esc_url(get_permalink($post_ID)).'">'.__('View event','event-list').'</a>', 2 => '', // Custom field updated is not required (no custom fields) 3 => '', // Custom field deleted is not required (no custom fields) 4 => __('Event updated.','event-list'), 5 => is_null($revision) ? false : sprintf(__('Event restored to revision from %1$s','event-list'), wp_post_revision_title($revision, false)), 6 => __('Event published.','event-list').' <a href="'.esc_url(get_permalink($post_ID)).'">'.__('View event','event-list').'</a>', 7 => __('Event saved.'), 8 => __('Event submitted.','event-list').' <a target="_blank" href="'.esc_url(add_query_arg('preview', 'true', get_permalink($post_ID))).'">'.__('Preview event','event-list').'</a>', 9 => sprintf(__('Event scheduled for: %1$s>','event-list'), '<strong>'.date_i18n(__('M j, Y @ G:i'), strtotime($post->post_date)).'</strong>'). ' <a target="_blank" href="'.esc_url(get_permalink($post_ID)).'">'.__('Preview event','event-list').'</a>', 10 => __('Event draft updated.','event-list').' <a target="_blank" href="'.esc_url(add_query_arg('preview', 'true', get_permalink($post_ID))).'">'.__('Preview event','event-list').'</a>', ); return $messages; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nvp_CheckGet($params) {\r\n $result=true;\r\n if (!empty ($params)) {\r\n foreach ($params as $eachparam) {\r\n if (isset($_GET[$eachparam])) {\r\n if (empty ($_GET[$eachparam])) {\r\n $result=false; \r\n }\r\n } else {\r\n $result=false;\r\n }\r\n }\r\n }\r\n return ($result);\r\n }", "public function checkParams()\n {\n if (!isset($_GET['params'])) {\n die($this->error('404'));\n } else {\n $id = $_GET['params'];\n }\n }", "function cpay_CheckGet($params) {\r\n $result = true;\r\n if (!empty($params)) {\r\n foreach ($params as $eachparam) {\r\n if (isset($_GET[$eachparam])) {\r\n if (empty($_GET[$eachparam])) {\r\n $result = false;\r\n }\r\n } else {\r\n $result = false;\r\n }\r\n }\r\n }\r\n return ($result);\r\n}", "private function verify_parameters(){\n if( empty( $_GET['email'] ) || empty( $_GET['pms_key'] ) || empty( $_GET['subscription_id'] ) )\n return false;\n\n return true;\n }", "function check_required_param($param = array(),$method){\n //set up method\n if (strtolower($method) == \"post\"){\n $r = $_POST;\n }else if (strtolower($method) == \"get\"){\n $r = $_GET;\n }\n //check of required param\n foreach ($param as $par){\n if (!isset($r[$par]) || empty($r[$par])){\n return false;\n break;\n }\n }\n return true;\n}", "function getParamInfo() {\n\t\treturn FALSE;\n\t}", "protected function checkParameters()\n\t{\n\t\t$this->dbResult['REQUEST'] = array(\n\t\t\t'GET' => $this->request->getQueryList()->toArray(),\n\t\t\t'POST' => $this->request->getPostList()->toArray(),\n\t\t);\n\n\t\t$this->arParams['PATH_TO_LOCATIONS_LIST'] = CrmCheckPath('PATH_TO_LOCATIONS_LIST', $this->arParams['PATH_TO_LOCATIONS_LIST'], '');\n\t\t$this->arParams['PATH_TO_LOCATIONS_EDIT'] = CrmCheckPath('PATH_TO_LOCATIONS_EDIT', $this->arParams['PATH_TO_LOCATIONS_EDIT'], '?loc_id=#loc_id#&edit');\n\t\t//$this->arParams['PATH_TO_LOCATIONS_ADD'] = CrmCheckPath('PATH_TO_LOCATIONS_ADD', $this->arParams['PATH_TO_LOCATIONS_ADD'], '?add');\n\t\t\n\t\t$this->componentData['LOCATION_ID'] = isset($this->arParams['LOC_ID']) ? intval($this->arParams['LOC_ID']) : 0;\n\n\t\tif($this->componentData['LOCATION_ID'] <= 0)\n\t\t{\n\t\t\t$locIDParName = isset($this->arParams['LOC_ID_PAR_NAME']) ? intval($this->arParams['LOC_ID_PAR_NAME']) : 0;\n\n\t\t\tif($locIDParName <= 0)\n\t\t\t\t$locIDParName = 'loc_id';\n\n\t\t\t$this->componentData['LOCATION_ID'] = isset($this->dbResult['REQUEST']['GET'][$locIDParName]) ? intval($this->dbResult['REQUEST']['GET'][$locIDParName]) : 0;\n\t\t}\n\n\t\treturn true;\n\t}", "public function checkRequiredParamsSet() : bool {\n }", "protected function verifyParams() {\n\t\t\treturn true;\n\t\t}", "function checkAllParams(){\n\t\tif(isset($_REQUEST['appid'][100]) || isset($ref[1000]) || isset($_REQUEST['uid'][200]) ){\n\t\t\tthrow new Exception('paramater length error',10001);\n\t\t}\n\t\tif(isset($_REQUEST['ref']))$_REQUEST['ref']=substr($_REQUEST['ref'], 0,990);\n\t\t\n\t\tif(!$this->check(\"appid\",$_REQUEST['appid']) && !isset($_REQUEST['json'])){\n\t\t\t//ea_write_log(APP_ROOT.\"/error_log/\".date('Y-m-d').\".log\", \"error_appid=\".$_REQUEST['appid'].\" \".$_REQUEST['event'].\" \".$_REQUEST['logs'].\" \\n\");\n\t\t\tthrow new Exception('appid error',10001);\n\t\t}\n\t\t\n\t\t$_REQUEST['appid']=strtolower($_REQUEST['appid']);\n\t\t$this->appidmap();\n\t}", "public function hasParams(){\n return $this->_has(8);\n }", "function getParams()\n {\n }", "public function get_params()\n {\n }", "public function get_params()\n {\n }", "function checkParametersValid($validParameters, $requestType) {\n\t\t//If no format supplied on get request, default to xml\n\t\tif ($requestType == \"get\" && !isset($_GET['format'])){\n\t\t\t$_GET['format'] = \"xml\";\n\t\t}\n \n\t\t$parameters = array_keys($_GET);\n \n //Valid values for the action parameter used when making put, post or delete requests\n\t\t$validActionParameters = array(\"put\", \"post\", \"del\");\n\t\t\n\t\t//Checks each $_GET parameter has an associating value, and returns the corresponding error code depending on which doesn't have a value. Or if parameter is action, ensures its a valid one.\n\t\tforeach($_GET as $parameter => $value){\n\t\t\tif (empty($value)){\n\t\t\t\tif ($requestType == \"get\"){\n //Print error code 1000\n\t\t\t\t\techo getErrorResponse(MISSING_PARAM);\n\t\t\t\t} else { //If its not a get request, return error if action is empty, otherwise it'll be the missing currency error\n\t\t\t\t\techo $parameter == \"action\" ? getErrorResponse(UNKOWN_ACTION) : getErrorResponse(MISSING_CURRENCY);\n\t\t\t\t}\n //Return false if any parameter is empty\n\t\t\t\treturn false;\t\t\t\n\t\t\t}\n \n\t\t\t//If not a get request and action parameter value is not put, post or delete, return error 2000\n\t\t\tif ($requestType != \"get\" && $parameter == \"action\" && !in_array($value, $validActionParameters)){\n\t\t\t\techo getErrorResponse(UNKOWN_ACTION);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Checks if the supplied $_GET parameters match the number of validParameters passed in\n\t\tif (count(array_diff($validParameters, $parameters)) != 0){\n\t\t\t//RETURN error codes 1000 or 2000\n\t\t\techo $requestType == \"get\" ? getErrorResponse(MISSING_PARAM) : getErrorResponse(UNKOWN_ACTION);\n\t\t\treturn false;\n\t\t} \n\t\t\n\t\t//Checks the reverse of the above to catch extra garbage parameters and also checks there are no duplicate valid parameters\n\t\tif (count(array_diff($parameters, $validParameters)) != 0 || urlHasDuplicateParameters($_SERVER['QUERY_STRING'])){\n\t\t\techo $requestType == \"get\" ? getErrorResponse(UNKOWN_PARAM) : getErrorResponse(UNKOWN_ACTION);\n\t\t\treturn false;\n\t\t\t//Return invalid parameter code 1100 or 2000\n\t\t}\n\t\t\n\t\t//At this point we can be sure all parameters exist and have a value, so we can set $codes array\n\t\t$codes = array();\n //Push codes in depending on the requestType\n\t\t$requestType == \"get\" ? array_push($codes, $_GET['to'], $_GET['from']) : array_push($codes, $_GET['cur']); \n\t\t\n //Check all codes exist within the rateCurrencies file\n if (!checkCurrencyCodesExists($codes)){\n echo $requestType == \"get\" ? getErrorResponse(UNKOWN_CURRENCY) : getErrorResponse(CURRENCY_NOT_FOUND);\n return false;\n }\n \n\t\t//Check currency codes are live if not making a put request\n\t\tif ($requestType != \"put\" && !checkCurrencyCodesLive($codes)){\n\t\t\techo $requestType == \"get\" ? getErrorResponse(UNKOWN_CURRENCY) : getErrorResponse(CURRENCY_NOT_FOUND);\n\t\t\treturn false;\t\n\t\t}\n\t\t\n\t\t//Get request specific errors\n\t\tif ($requestType == \"get\"){\n\t\t\t//Check if amount parameter submitted is decimal\n $amount = $_GET['amnt'];\n\t\t\tif (!is_numeric($amount)){\n echo getErrorResponse(CURRENCY_NOT_DECIMAL);\n\t\t\t\t return false;\n\t\t\t}\n //Cast parameter to float, after checking is_numeric and check its a float\n $convAmount = (float) $amount;\n if (!is_float($convAmount)){ \n echo getErrorResponse(CURRENCY_NOT_DECIMAL);\n\t\t\t\t return false;\n }\n\t\t\t\n\t\t\t//Check format parameter is valid, if not return error as xml\n\t\t\tif (!checkFormatValueValid($_GET['format'])){\n\t\t\t\techo getErrorResponse(INCORRECT_FORMAT);\n\t\t\t\treturn false;\n\t\t\t\t//Return format must be xml/json 1400\n\t\t\t}\n \n //If making a put, post or delete request and targetting the base currency, return error 2400\n\t\t} else if ($requestType != \"get\"){ //Action specific errors\n\t\t\tif ($_GET['cur'] == getBaseRate()){\n\t\t\t\techo getErrorResponse(IMMUTABLE_BASE_CURRENCY);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public function has_url_get_parameters() {\r\n\t\treturn (strlen($this->url_get_parameters) > 3);\r\n\t}", "function getParams()\n {\n }", "public function hasParameters(){\n return $this->_has(2);\n }", "public function testMissingParameterGetCheck() {\n $this->pingdom->getCheck(null);\n }", "public function hasParam(){\n return $this->_has(2);\n }", "public function hasParam(){\n return $this->_has(2);\n }", "public function hasParam(){\n return $this->_has(2);\n }", "public function hasParam(){\n return $this->_has(2);\n }", "public function hasParam(){\n return $this->_has(2);\n }", "public static function getRequiredParams();", "function isTheseParametersAvailable($params){\n //assuming all parameters are available \n $available = true; \n $missingparams = \"\"; \n \n foreach($params as $param){\n if(!isset($_POST[$param]) || strlen($_POST[$param])<=0){\n $available = false; \n $missingparams = $missingparams . \", \" . $param; \n }\n }\n \n //if parameters are missing \n if(!$available){\n $response = array(); \n $response['error'] = true; \n $response['message'] = 'Parameters ' . substr($missingparams, 1, strlen($missingparams)) . ' missing';\n \n //displaying error\n echo json_encode($response);\n \n //stopping further execution\n die();\n }\n }", "function get_params() {\r\n global $action;\r\n global $cur;\r\n\r\n // If action isn't set, return a 2000 error, otherwise save it in a variable\r\n if (isset($_GET[\"action\"])) {\r\n $action = $_GET[\"action\"];\r\n } else {\r\n throw_error(2000, \"Action not recognized or is missing\");\r\n }\r\n // If cur isn't set, return a 2000 error, otherwise save it in a variable\r\n if (isset($_GET[\"cur\"])) {\r\n $cur = $_GET[\"cur\"];\r\n } else {\r\n throw_error(2100, \"Currency code in wrong format or is missing\");\r\n }\r\n\r\n // Check if the action is post, put or del otherwise throw a 2000 error\r\n $actions = [\"post\", \"put\", \"del\"]; \r\n if (!in_array($action, $actions)) {\r\n throw_error(2000, \"Action not recognized or is missing\");\r\n }\r\n // Check the format of the cur and throw a 2100 error if it is incorrect\r\n if (strlen($cur) != 3 || is_numeric($cur)) {\r\n throw_error(2100, \"Currency code in wrong format or is missing\");\r\n }\r\n\r\n // Cannot update the base currency so throw a 2400 error\r\n if (strtoupper($cur) == \"GBP\") {\r\n throw_error(2400, \"Cannot update base currency\");\r\n }\r\n }", "abstract protected function getRequiredRequestParameters();", "function getParameters()\r\n {\r\n }", "function check_required_params($stage = null) {\n\tif ($_SERVER[\"REQUEST_METHOD\"] == \"GET\") {\n\t\tif ($stage == \"specific_floor\") {\n\t\t\t// Getting a specific floor.\n\t\t\tif (!(isset($_GET[\"id\"]) || isset($_GET[\"number\"]))) {\n\t\t\t\thttp_response_code(424);\n\t\t\t\techo json_encode(array(\n\t\t\t\t\t\"info\" => array(\n\t\t\t\t\t\t\"level\" => 0,\n\t\t\t\t\t\t\"status\" => \"error\",\n\t\t\t\t\t\t\"message\" => \"Required parameter 'id' or 'number' wasn't specified.\"\n\t\t\t\t\t)\n\t\t\t\t));\n\n\t\t\t\texit(1);\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// User requested with a method that is not supported by us.\n\t\thttp_response_code(400);\n\t\techo json_encode(array(\n\t\t\t\"info\" => array(\n\t\t\t\t\"level\" => 0,\n\t\t\t\t\"status\" => \"error\",\n\t\t\t\t\"message\" => \"Invalid request method \" . $_SERVER[\"REQUEST_METHOD\"] . \".\"\n\t\t\t)\n\t\t));\n\n\t\texit(1);\n\t}\n}", "public function getParams() {}", "function CheckSearchParms() {\n\n\t\t// Check basic search\n\t\tif ($this->BasicSearch->IssetSession())\n\t\t\treturn TRUE;\n\t\treturn FALSE;\n\t}", "function CheckSearchParms() {\n\n\t\t// Check basic search\n\t\tif ($this->BasicSearch->IssetSession())\n\t\t\treturn TRUE;\n\t\treturn FALSE;\n\t}", "function CheckSearchParms() {\n\n\t\t// Check basic search\n\t\tif ($this->BasicSearch->IssetSession())\n\t\t\treturn TRUE;\n\t\treturn FALSE;\n\t}", "function isTheseParametersAvailable($params){\n\t\t\n\t\t//traversing through all the parameters \n\t\tforeach($params as $param){\n\t\t\t//if the paramter is not available\n\t\t\tif(!isset($_POST[$param])){\n\t\t\t\t//return false \n\t\t\t\treturn false; \n\t\t\t}\n\t\t}\n\t\t//return true if every param is available \n\t\treturn true; \n\t}", "function CheckSearchParms() {\r\n\r\n\t\t// Check basic search\r\n\t\tif ($this->BasicSearch->IssetSession())\r\n\t\t\treturn TRUE;\r\n\t\treturn FALSE;\r\n\t}", "function required_param($parname, $type=PARAM_CLEAN, $errMsg=\"err_param_requis\") {\n\n // detect_unchecked_vars addition\n global $CFG;\n if (!empty($CFG->detect_unchecked_vars)) {\n global $UNCHECKED_VARS;\n unset ($UNCHECKED_VARS->vars[$parname]);\n }\n\n if (isset($_POST[$parname])) { // POST has precedence\n $param = $_POST[$parname];\n } else if (isset($_GET[$parname])) {\n $param = $_GET[$parname];\n } else {\n erreur_fatale($errMsg,$parname);\n }\n // ne peut pas �tre vide !!! (required)\n $tmpStr= clean_param($param, $type); //PP test final\n // attention \"0\" est empty !!!\n\n if (!empty($tmpStr) || $tmpStr==0) return $tmpStr;\n else erreur_fatale(\"err_param_suspect\",$parname.' '.$param. \" \".__FILE__ );\n\n\n}", "public function hasParams()\r\n\t{\r\n\t\treturn (is_array($this->pathParameters) && !empty($this->pathParameters));\r\n\t}", "protected function check() {\n if (empty($this->method_map)\n || empty($this->param)\n || empty($this->service_url)\n ) {\n throw new Exception('Param or method map is empty');\n }\n }", "private function checkRequiredParameters()\n {\n $missingParameters = array();\n\n foreach ($this->parameters as $name => $properties) {\n $required = $properties['required'];\n $value = $properties['value'];\n if ($required && is_null($value)) {\n $missingParameters[] = $name;\n }\n }\n\n if (count($missingParameters) > 0) {\n $missingParametersList = implode(', ', $missingParameters);\n throw new IndexParameterException('The following required\n parameters were not set: '.$missingParametersList.'.');\n }\n }", "function allowed_get_params($allowed_params = []){\r\n //$allowed_array will contain only allowed url parameters\r\n $allowed_array = [];\r\n foreach($allowed_params as $param){\r\n if(isset($_GET[$param])){\r\n $allowed_array[$param] = $_GET[$param];\r\n }else{\r\n $allowed_array[$param] = NULL;\r\n }\r\n }\r\n return $allowed_array;\r\n\r\n}", "public function testGetGetParams()\n {\n $expected = array('document' => array('filesize' => 100),\n 'get_test1' => 'true', 'get_test2' => 'go mets');\n $this->assertEquals($expected, $this->_req->getGetParams());\n }", "private function loadGetParams()\n {\n if(isset($_GET)) {\n $this->getParams = $_GET;\n }\n }", "function has_keep_parameters()\n{\n static $answer = null;\n if ($answer !== null) {\n return $answer;\n }\n\n foreach (array_keys($_GET) as $key) {\n if (\n isset($key[0]) &&\n $key[0] == 'k' &&\n substr($key, 0, 5) == 'keep_'\n //&& $key != 'keep_devtest' && $key != 'keep_show_loading'/*If testing memory use we don't want this to trigger it as it breaks the test*/\n ) {\n $answer = true;\n return $answer;\n }\n }\n $answer = false;\n return $answer;\n}", "public function isGet();", "public function getRequiredParameters();", "public function getRequiredParameters();", "public function hasParameters()\n {\n return !empty($this->params);\n }", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "private static function getGetParams()\n\t{\n\t\treturn $_GET;\n\t}", "function getParameters();", "function getParameters();", "public function testGetParameterFromGet(): void\n {\n // setup\n $_GET['get-parameter'] = 'get value';\n\n $requestParams = $this->getRequestParamsMock();\n\n // test body\n /** @var string $param */\n $param = $requestParams->getParam('get-parameter');\n\n // assertions\n $this->assertEquals('get value', $param, 'Value from $_GET must be fetched but it was not');\n }", "public function IsAccessParams ()\n {\n if (($this->token_type != null) && ($this->access_token != null)) {\n return TRUE;\n }\n return FALSE;\n }", "function getParams() {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $data_source;\n global $tab;\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($data_source)) {\n $this->data_source=$data_source;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n}", "function getParams() {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $data_source;\n global $tab;\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($data_source)) {\n $this->data_source=$data_source;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n}", "function getParams() {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $data_source;\n global $tab;\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($data_source)) {\n $this->data_source=$data_source;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n}", "function getParams() {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $data_source;\n global $tab;\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($data_source)) {\n $this->data_source=$data_source;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n}", "private function validateParams(){\n\t\t$name\t = $this->param['name']; \n\t\t$ic\t\t = $this->param['ic']; \n\t\t$mobile\t= $this->param['mobile']; \n\t\t$email\t= $this->param['email']; \n\t\t$statusCode = array();\n\t\tif(!$name){\n\t\t\t$statusCode[] = 115;\n\t\t}\n\t\tif(!$ic){\n\t\t\t$statusCode[] = 116;\n\t\t}\n\t\tif(!$email){\n\t\t\t$statusCode []= 101;\n\t\t}elseif (!filter_var($email, FILTER_VALIDATE_EMAIL)) {\n\t\t $statusCode[] = 105;\n\t\t}\n\t\treturn $statusCode;\n\t}", "function get_exists($parameter){\n return key_exists($parameter, $_GET) && strlen(trim($_GET[$parameter])) > 0;\n}", "private function checkrequest()\n {\n // This method checks if there is user input, and returns the request_method if evaluated to be true\n if ($_SERVER['REQUEST_METHOD'] == \"POST\") {\n $this->request = \"post\";\n return true;\n } elseif ($_SERVER['REQUEST_METHOD'] == \"GET\") {\n $this->request = \"get\";\n return true;\n } else {\n $this->request = false;\n }\n }", "function getParams()\n {\n global $id;\n global $mode;\n global $data_source;\n global $view_mode;\n global $edit_mode;\n global $tab;\n if (isset($id)) {\n $this->id = $id;\n }\n if (isset($mode)) {\n $this->mode = $mode;\n }\n if (isset($data_source)) {\n $this->data_source = $data_source;\n }\n if (isset($view_mode)) {\n $this->view_mode = $view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode = $edit_mode;\n }\n if (isset($tab)) {\n $this->tab = $tab;\n }\n }", "function hasParam($name)\n {\n return isset($_REQUEST[$name]);\n }", "public function checkGetArticle(){\n\t\tif(isset($_GET[self::$article])){\n\t\t\treturn TRUE;\n\t\t}\n\t\treturn FALSE;\n\t}", "protected function check() {\n if (empty($this->method_map)\n || empty($this->service_url)\n ) {\n throw new Exception('Param or method map is empty');\n }\n }", "function hasParam($name) {\n\t\tif (isset($this->getvars[$name])) {\n\t\t\treturn TRUE;\n\t\t}\n\t\tif (isset($this->postvars[$name])) {\n\t\t\treturn TRUE;\n\t\t}\n\t\treturn FALSE;\n\t}", "protected function validateParams() {\r\n $user = $this->user;\r\n $userId = $this->userId;\r\n if ($user === NULL) {\r\n $lang = $this->getLanguage();\r\n $this->addErrorMessage($lang->getMessage('error.userNotFound', htmlspecialchars($userId)));\r\n return FALSE;\r\n }\r\n return TRUE;\r\n }", "function getParams() {\r\n global $id;\r\n global $mode;\r\n global $view_mode;\r\n global $edit_mode;\r\n global $data_source;\r\n global $tab;\r\n if (isset($id)) {\r\n $this->id=$id;\r\n }\r\n if (isset($mode)) {\r\n $this->mode=$mode;\r\n }\r\n if (isset($view_mode)) {\r\n $this->view_mode=$view_mode;\r\n }\r\n if (isset($edit_mode)) {\r\n $this->edit_mode=$edit_mode;\r\n }\r\n if (isset($data_source)) {\r\n $this->data_source=$data_source;\r\n }\r\n if (isset($tab)) {\r\n $this->tab=$tab;\r\n }\r\n}", "public function getValidParameters()\n {\n return null;\n }", "public function getParameters() {}", "function get_required_param($param)\n{\n global $params;\n\n if (empty($params[$param]))\n {\n header('HTTP/1.0 400 Bad Request');\n die('Invalid Request - Missing \"' . $param . '\"');\n }\n\n return $params[$param];\n}", "function isTheseParametersAvailable($required_fields)\n{\n $error = false;\n $error_fields = \"\";\n $request_params = $_REQUEST;\n\n foreach ($required_fields as $field) {\n if (!isset($request_params[$field]) || strlen(trim($request_params[$field])) <= 0) {\n $error = true;\n $error_fields .= $field . ', ';\n }\n }\n\n if ($error) {\n $response = array();\n $response[\"error\"] = true;\n $response[\"message\"] = 'Required field(s) ' . substr($error_fields, 0, -2) . ' is missing or empty';\n echo json_encode($response);\n return false;\n }\n return true;\n}", "function getParams() {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $tab;\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n\n\n\n}", "public function has_param($key)\n {\n }", "function check_required_vars($params = array())\n\t{\n\t\tglobal $SID, $phpEx, $data;\n\n\t\twhile( list($var, $param) = @each($params) )\n\t\t{\n\t\t\tif (empty($data[$param]))\n\t\t\t{\n\t\t\t\tredirect(append_sid(\"garage.$phpEx?mode=error&EID=3\", true));\n\t\t\t}\n\t\t}\n\n\t\treturn ;\n\t}", "function getParams() {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $tab;\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n}", "function getParams() {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $tab;\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n}", "function getParams() {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $tab;\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n}", "public function getRequestParams();", "public function getValidParams()\n {\n if ($this->isModuleActive() && empty($this->scriptRan)) {\n $userIdKey = Mage::helper('kproject_sas')->getAffiliateIdentifierKey();\n if (!empty($userIdKey) && !isset($this->validParams[$userIdKey])) {\n $this->validParams[$userIdKey] = false;\n unset($this->validParams['userID']);\n }\n\n $clickIdKey = Mage::helper('kproject_sas')->getClickIdentifierKey();\n if (!empty($clickIdKey) && !isset($this->validParams[$clickIdKey])) {\n $this->validParams[$clickIdKey] = false;\n unset($this->validParams['sscid']);\n }\n $this->scriptRan = true;\n }\n\n return parent::getValidParams();\n }", "function getParams()\n {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $tab;\n if (isset($id)) {\n $this->id = $id;\n }\n if (isset($mode)) {\n $this->mode = $mode;\n }\n if (isset($view_mode)) {\n $this->view_mode = $view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode = $edit_mode;\n }\n if (isset($tab)) {\n $this->tab = $tab;\n }\n }", "public static function isGet()\n {\n return !empty($_GET);\n }", "function __checkImgParams() {\n\t\t/* check file type */\n\t\t$this->__checkType($this->request->data['Upload']['file']['type']);\n\t\t\n\t\n\t\t\n\t\t/* check file size */\n\t\t$this->__checkSize($this->request->data['Upload']['file']['size']);\n\t\t\n\t\t\n\t\t\n\t\t/* check image dimensions */\n\t\t$this->__checkDimensions($this->request->data['Upload']['file']['tmp_name']);\n\t\t\n\t\t\t\n\t}", "public function goCheck(){\n $request = Request::instance();\n\n $params = $request->param();\n\n //check the input params\n $result = $this->batch()->check($params);\n\n //adjust the checked result\n if($result){\n return true;\n }else{\n $ex = new InputParamsErr();\n $ex->errMsg = $this->getError();\n throw $ex;\n }\n }", "private function check_request_variables()\n {\n $page_var = $this->prefix . 'page';\n $results_var = $this->prefix . 'results';\n if ( array_key_exists($page_var, $_REQUEST)\n && !empty($_REQUEST[$page_var]))\n {\n $this->current_page = $_REQUEST[$page_var];\n }\n if ( array_key_exists($results_var, $_REQUEST)\n && !empty($_REQUEST[$results_var]))\n {\n $this->results_per_page = $_REQUEST[$results_var];\n }\n $this->offset = ($this->current_page-1) * $this->results_per_page;\n if ($this->offset < 0)\n {\n $this->offset = 0;\n }\n return;\n }", "private function checkParams($params){\n\n if(count($params) == 3)\n return true;\n else\n return false;\n }", "function getParams() {\r\n global $id;\r\n global $mode;\r\n global $view_mode;\r\n global $edit_mode;\r\n global $tab;\r\n if (isset($id)) {\r\n $this->id=$id;\r\n }\r\n if (isset($mode)) {\r\n $this->mode=$mode;\r\n }\r\n if (isset($view_mode)) {\r\n $this->view_mode=$view_mode;\r\n }\r\n if (isset($edit_mode)) {\r\n $this->edit_mode=$edit_mode;\r\n }\r\n if (isset($tab)) {\r\n $this->tab=$tab;\r\n }\r\n}", "function getParams() {\r\n global $id;\r\n global $mode;\r\n global $view_mode;\r\n global $edit_mode;\r\n global $tab;\r\n if (isset($id)) {\r\n $this->id=$id;\r\n }\r\n if (isset($mode)) {\r\n $this->mode=$mode;\r\n }\r\n if (isset($view_mode)) {\r\n $this->view_mode=$view_mode;\r\n }\r\n if (isset($edit_mode)) {\r\n $this->edit_mode=$edit_mode;\r\n }\r\n if (isset($tab)) {\r\n $this->tab=$tab;\r\n }\r\n}", "function validateRequest(){\n // if ($_GET['key'] != getenv(\"LAB_NODE_KEY\")){\n // exit;\n // }\n if ($_GET['key'] != ''){\n exit;\n }\n }", "function exist_param($fieldname){\n return array_key_exists($fieldname, $_REQUEST);\n }", "function ValidRequiredQueryString($name) {\n return isset($_GET[$name]) && $_GET[$name] != \"\";\n}", "public function getParameters()\n\t{\n\n\t}" ]
[ "0.75109357", "0.75027996", "0.73769987", "0.7195657", "0.71902996", "0.70217556", "0.69933057", "0.69877213", "0.6933584", "0.6928373", "0.6922809", "0.6921744", "0.69183916", "0.69183916", "0.69051754", "0.6864304", "0.6846635", "0.68395513", "0.68095434", "0.6742939", "0.6742939", "0.6742939", "0.6742939", "0.6742939", "0.6732688", "0.6726776", "0.6717542", "0.67003953", "0.66558266", "0.66540486", "0.65987885", "0.65865105", "0.65865105", "0.65865105", "0.65576065", "0.65496224", "0.6533377", "0.65187854", "0.6509756", "0.649111", "0.64882326", "0.6473587", "0.64719003", "0.6468966", "0.6441221", "0.6437841", "0.6437841", "0.64107984", "0.6406804", "0.6406804", "0.6406804", "0.6406804", "0.6406804", "0.6406804", "0.6406804", "0.6406804", "0.6406804", "0.6406804", "0.6375697", "0.6365833", "0.6365833", "0.636117", "0.63426346", "0.6340979", "0.6340979", "0.6340979", "0.6340979", "0.6311605", "0.6311168", "0.63102186", "0.6303934", "0.6301158", "0.63007474", "0.6291897", "0.6279305", "0.62660706", "0.62631965", "0.625847", "0.62566286", "0.6241476", "0.6239766", "0.6230834", "0.62299174", "0.6228039", "0.62179494", "0.62179494", "0.62179494", "0.6216068", "0.6208037", "0.62066245", "0.61967695", "0.61763066", "0.6170096", "0.61532265", "0.61518306", "0.61408025", "0.61408025", "0.6137992", "0.6129287", "0.6126807", "0.61237246" ]
0.0
-1
Convert a date format to a jQuery UI DatePicker format
private function datepicker_format($format) { return str_replace( array( 'd', 'j', 'l', 'z', // Day. 'F', 'M', 'n', 'm', // Month. 'Y', 'y' // Year. ), array( 'dd', 'd', 'DD', 'o', 'MM', 'M', 'm', 'mm', 'yy', 'y' ), $format); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dateformat_PHP_to_jQueryUI($php_format)\n\t{\n\t\t$SYMBOLS_MATCHING = array(\n\t\t\t// Day\n\t\t\t'd' => 'DD',\n\t\t\t'D' => 'ddd',\n\t\t\t'j' => 'D',\n\t\t\t'l' => 'dddd',\n\t\t\t'N' => 'do',\n\t\t\t'S' => 'do',\n\t\t\t'w' => 'd',\n\t\t\t'z' => 'DDD',\n\t\t\t// Week\n\t\t\t'W' => 'w',\n\t\t\t// Month\n\t\t\t'F' => 'MMMM',\n\t\t\t'm' => 'MM',\n\t\t\t'M' => 'MMM',\n\t\t\t'n' => 'M',\n\t\t\t't' => '',\n\t\t\t// Year\n\t\t\t'L' => '',\n\t\t\t'o' => '',\n\t\t\t'Y' => 'GGGG',\n\t\t\t'y' => 'GG',\n\t\t\t// Time\n\t\t\t'a' => 'a',\n\t\t\t'A' => 'A',\n\t\t\t'B' => '',\n\t\t\t'g' => 'h',\n\t\t\t'G' => 'H',\n\t\t\t'h' => 'hh',\n\t\t\t'H' => 'HH',\n\t\t\t'i' => 'mm',\n\t\t\t's' => 'ss',\n\t\t\t'u' => ''\n\t\t);\n\n\n\t\t$jqueryui_format = \"\";\n\t\t$escaping = false;\n\t\tfor($i = 0; $i < strlen($php_format); $i++)\n\t\t{\n\t\t\t$char = $php_format[$i];\n\t\t\tif($char === '\\\\') // PHP date format escaping character\n\t\t\t{\n\t\t\t\t$i++;\n\t\t\t\tif($escaping) $jqueryui_format .= $php_format[$i];\n\t\t\t\telse $jqueryui_format .= '\\'' . $php_format[$i];\n\t\t\t\t$escaping = true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif($escaping) { $jqueryui_format .= \"'\"; $escaping = false; }\n\t\t\t\tif(isset($SYMBOLS_MATCHING[$char]))\n\t\t\t\t\t$jqueryui_format .= $SYMBOLS_MATCHING[$char];\n\t\t\t\telse\n\t\t\t\t\t$jqueryui_format .= $char;\n\t\t\t}\n\t\t}\n\t\treturn $jqueryui_format;\n\t}", "function wp_ajax_date_format()\n {\n }", "public function convert_php_jquery_datepicker_format($_php_format) {\r\n $SYMBOLS = array(\r\n // Day\r\n 'd' => 'dd',\r\n 'D' => 'D',\r\n 'j' => 'd',\r\n 'l' => 'DD',\r\n 'N' => '',\r\n 'S' => '',\r\n 'w' => '',\r\n 'z' => 'o',\r\n // Week\r\n 'W' => '',\r\n // Month\r\n 'F' => 'MM',\r\n 'm' => 'mm',\r\n 'M' => 'M',\r\n 'n' => 'm',\r\n 't' => '',\r\n // Year\r\n 'L' => '',\r\n 'o' => '',\r\n 'Y' => 'yy',\r\n 'y' => 'y',\r\n // Time\r\n 'a' => '',\r\n 'A' => '',\r\n 'B' => '',\r\n 'g' => '',\r\n 'G' => '',\r\n 'h' => '',\r\n 'H' => '',\r\n 'i' => '',\r\n 's' => '',\r\n 'u' => ''\r\n );\r\n $jqueryui_format = \"\";\r\n $escaping = false;\r\n for($i = 0; $i < strlen($_php_format); $i++) {\r\n $char = $_php_format[$i];\r\n if($char === '\\\\') {\r\n $i++;\r\n if($escaping) {\r\n $jqueryui_format .= $_php_format[$i];\r\n } else {\r\n $jqueryui_format .= '\\'' . $_php_format[$i];\r\n }\r\n $escaping = true;\r\n } else {\r\n if($escaping) {\r\n $jqueryui_format .= \"'\";\r\n $escaping = false;\r\n }\r\n if(isset($SYMBOLS[$char])) {\r\n $jqueryui_format .= $SYMBOLS[$char];\r\n } else {\r\n $jqueryui_format .= $char;\r\n }\r\n }\r\n }\r\n return $jqueryui_format;\r\n }", "function wp_localize_jquery_ui_datepicker()\n {\n }", "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}", "function format_date($p_id, $p_name, $p_value, $p_width = '', $p_fmt_short = false){\n\t$t_width = ($p_width != '') ? 'width:' . $p_width . ' !important' : '';\n\t$t_date_prop = 'data-picker-locale=\"' . lang_get_current_datetime_locale() . '\" data-picker-format=\"' . convert_date_format_to_momentjs($p_fmt_short ? config_get('short_date_format') : config_get('normal_date_format')) . '\"';\n\n\treturn format_text($p_id, $p_name, $p_value, '', 'input-xs inline-page-datetime', $t_width, $t_date_prop);\n}", "function erp_format_date( $date, $format = false ) {\n if ( ! $format ) {\n $format = erp_get_option( 'date_format', 'erp_settings_general', 'd-m-Y' );\n }\n\n if ( ! is_numeric( $date ) ) {\n $date = strtotime( $date );\n }\n\n if ( function_exists('wp_date') ) {\n return wp_date( $format, $date );\n }\n\n return date_i18n( $format, $date );\n}", "function acf_convert_date_to_js($date = '')\n{\n}", "function getInput($attr=array()){\n // we need it in locale format\n\n $this->js(true)->datepicker(array_merge(array(\n 'duration'=>0,\n 'showOn'=>'button',\n 'buttonImage'=>$this->api->locateURL('images','calendar.gif'),\n 'buttonImageOnly'=> true,\n 'changeMonth'=>true,\n 'changeYear'=>true,\n 'dateFormat'=>$this->api->getConfig('locale/date_js','dd/mm/yy')\n ),$this->options));\n\n return parent::getInput(array_merge(\n array(\n 'value'=>$this->value?(date($this->api->getConfig('locale/date','d/m/Y'),strtotime($this->value))):'',\n ),$attr\n ));\n }", "function carton_date_format() {\n\treturn apply_filters( 'carton_date_format', get_option( 'date_format' ) );\n}", "function cfdef_input_date( $p_field_def, $p_custom_field_value ) {\n\tprint_date_selection_set( 'custom_field_' . $p_field_def['id'], config_get( 'short_date_format' ), $p_custom_field_value, false, true );\n}", "public function getDatepickerJsFormat(): string\n {\n Craft::$app->getDeprecator()->log('craft.i18n.getDatepickerJsFormat()', 'craft.i18n.getDatepickerJsFormat() has been deprecated. Use craft.app.locale.getDateFormat(\\'short\\', \\'jui\\') instead.');\n\n return Craft::$app->getLocale()->getDateFormat(Locale::LENGTH_SHORT, Locale::FORMAT_JUI);\n }", "function convertPHPToJqueryUIFormat($php_format)\n\t{\n\t $SYMBOLS_MATCHING = array(\n\t // Day\n\t 'd' => 'dd',\n\t 'D' => 'D',\n\t 'j' => 'd',\n\t 'l' => 'DD',\n\t 'N' => '',\n\t 'S' => '',\n\t 'w' => '',\n\t 'z' => 'o',\n\t // Week\n\t 'W' => '',\n\t // Month\n\t 'F' => 'MM',\n\t 'm' => 'mm',\n\t 'M' => 'M',\n\t 'n' => 'm',\n\t 't' => '',\n\t // Year\n\t 'L' => '',\n\t 'o' => '',\n\t 'Y' => 'yy',\n\t 'y' => 'y',\n\t // Time\n\t 'a' => '',\n\t 'A' => '',\n\t 'B' => '',\n\t 'g' => '',\n\t 'G' => '',\n\t 'h' => '',\n\t 'H' => '',\n\t 'i' => '',\n\t 's' => '',\n\t 'u' => ''\n\t );\n\t $jqueryui_format = \"\";\n\t $escaping = false;\n\t for($i = 0; $i < strlen($php_format); $i++)\n\t {\n\t $char = $php_format[$i];\n\t if($char === '\\\\') // PHP date format escaping character\n\t {\n\t $i++;\n\t if($escaping) $jqueryui_format .= $php_format[$i];\n\t else $jqueryui_format .= '\\'' . $php_format[$i];\n\t $escaping = true;\n\t }\n\t else\n\t {\n\t if($escaping) { $jqueryui_format .= \"'\"; $escaping = false; }\n\t if(isset($SYMBOLS_MATCHING[$char]))\n\t $jqueryui_format .= $SYMBOLS_MATCHING[$char];\n\t else\n\t $jqueryui_format .= $char;\n\t }\n\t }\n\t return $jqueryui_format;\n\t}", "function print_date_selection_set( $p_name, $p_format, $p_date = 0, $p_default_disable = false, $p_allow_blank = false, $p_year_start = 0, $p_year_end = 0, $p_input_css = \"input-sm\" ) {\n\tif( $p_date != 0 ) {\n\t\t$t_date = date( $p_format, $p_date );\n\t} else {\n\t\t$t_date = '';\n\t}\n\n\t$t_disable = '';\n\tif( $p_default_disable == true ) {\n\t\t$t_disable = ' readonly=\"readonly\"';\n\t}\n\n \techo '<input ' . helper_get_tab_index() . ' type=\"text\" name=\"' . $p_name . '_date\" ' .\n\t\t' class=\"datetimepicker ' . $p_input_css . '\" ' . $t_disable .\n\t\t' data-picker-locale=\"' . lang_get_current_datetime_locale() . '\"' .\n\t\t' data-picker-format=\"' . convert_date_format_to_momentjs( $p_format ) . '\"' .\n\t\t' size=\"16\" maxlength=\"20\" value=\"' . $t_date . '\" />';\n\techo '<i class=\"fa fa-calendar fa-xlg datetimepicker\"></i>';\n}", "static function convert_iso_to_jquery_format($format) {\n\t\t$convert = array(\n\t\t\t'/([^d])d([^d])/' => '$1d$2',\n\t\t '/^d([^d])/' => 'd$1',\n\t\t '/([^d])d$/' => '$1d',\n\t\t '/dd/' => 'dd',\n\t\t '/EEEE/' => 'DD',\n\t\t '/EEE/' => 'D',\n\t\t '/SS/' => '',\n\t\t '/eee/' => 'd',\n\t\t '/e/' => 'N',\n\t\t '/D/' => '',\n\t\t '/w/' => '',\n\t\t\t// make single \"M\" lowercase\n\t\t '/([^M])M([^M])/' => '$1m$2',\n\t\t\t// make single \"M\" at start of line lowercase\n\t\t '/^M([^M])/' => 'm$1',\n\t\t\t\t// make single \"M\" at end of line lowercase\n\t\t '/([^M])M$/' => '$1m',\n\t\t\t// match exactly three capital Ms not preceeded or followed by an M\n\t\t '/(?<!M)MMM(?!M)/' => 'M',\n\t\t\t// match exactly two capital Ms not preceeded or followed by an M\n\t\t '/(?<!M)MM(?!M)/' => 'mm',\n\t\t\t// match four capital Ms (maximum allowed)\n\t\t '/MMMM/' => 'MM',\n\t\t '/l/' => '',\n\t\t '/YYYY/' => 'yy',\n\t\t '/yyyy/' => 'yy',\n\t\t '/[^y]yy[^y]/' => 'y',\n\t\t '/a/' => '',\n\t\t '/B/' => '',\n\t\t '/hh/' => '',\n\t\t '/h/' => '',\n\t\t '/([^H])H([^H])/' => '',\n\t\t '/^H([^H])/' => '',\n\t\t '/([^H])H$/' => '',\n\t\t '/HH/' => '',\n\t\t // '/mm/' => '',\n\t\t '/ss/' => '',\n\t\t '/zzzz/' => '',\n\t\t '/I/' => '',\n\t\t '/ZZZZ/' => '',\n\t\t '/Z/' => '',\n\t\t '/z/' => '',\n\t\t '/X/' => '',\n\t\t '/r/' => '',\n\t\t '/U/' => '',\n\t\t);\n\t\t$patterns = array_keys($convert);\n\t\t$replacements = array_values($convert);\n\t\t\n\t\treturn preg_replace($patterns, $replacements, $format);\n\t}", "function acf_format_date($value, $format)\n{\n}", "function makeDatePicker($idChamp, $defaut='') {\n\t$fJquery = '$(\"#'.$idChamp.'\").datetimepicker({';\n\t$fJquery.= '\tlang:\"'._LG_.'\",';\n\t//$fJquery.= '\tdatepicker:false,';\t\t\t\t\t\t//pas de selection date\n\t$fJquery.= '\ttimepicker:false,';\t\t\t\t\t\t//pas de selection time\n\t$fJquery.= '\tformat:\"'._FORMAT_DATE_.'\",';\t\t\t//format d'affichage\n\t$fJquery.= '\tformatDate:\"'._FORMAT_DATE_.'\",';\t\t//format d'affichage maxDate / minDate\n\t$fJquery.= '\tformatTime:\"H:i:s\",';\t\t\t\t\t//format d'affichage maxTime / minTime\n\t//$fJquery.= '\tallowTimes:[\"12:00\", \"13:00\"],';\n\t$fJquery.= '\tstep:1,';\n\tif ($defaut != '') {\n\t\t$fJquery.= '\tdefaultDate: \"'.$defaut.'\",';\n\t\t$fJquery.= '\tdefaultTime: \"'.date('H:i:s').'\",';\n\t}\n\t//$fJquery.= '\tyearStart: 2015,';\n\t//$fJquery.= '\tyearEnd: 2030,';\n\t$fJquery.= '\tvalidateOnBlur:false,';\n\t$fJquery.= '\tmask:false';\t\t\t\t\t\t\t\t//affichage masque de saisie\n\t$fJquery.= '});';\n\treturn $fJquery;\n}", "function _field_date($fval) \n {\n // if $fval is not already split up, we assume std. date string // YYYY-MM-DD\n if (is_array($fval)) {\n $f_date = &$fval;\n }\n elseif ($fval) {\n $f_date = split('-', $fval, 3);\n }\n else {\n $f_date = array('','','');\n }\n\n $res = \"<span id=\\\"\" . $this->name . \"\\\">\";\n\n for ($i=1; $i<32; $i++) { $days[sprintf(\"%02d\", $i)] = $i; }\n\n $months_abbr = array(\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\");\n for ($i=1; $i<13; $i++) { $months[sprintf(\"%02d\", $i)] = $months_abbr[$i-1]; }\n\n $fmonths = new formex_field($this->fex, $this->name.'_month', array('Months', 'select', $months));\n $res .= $fmonths->get_html($f_date[1]);\n\n if (isset($this->attribs) and !isset($this->attribs['suppress_day'])) {\n $fdays = new formex_field($this->fex, $this->name.'_day', array('Dates', 'select', $days));\n $res .= $fdays->get_html($f_date[2]);\n }\n\n $year_range = null;\n $this_year = date('Y');\n if (isset($this->opts) and is_numeric($this->opts)) { // int val will be this year +\n $year_range = $this->_array_stringify(range($this_year, $this_year+$this->opts));\n }\n elseif (isset($this->attribs) && is_array($this->attribs)) { // exact range specified\n $begin = (isset($this->attribs['year_begin']))? $this->attribs['year_begin'] : $this_year;\n $end = $this_year;\n if (isset($this->attribs['year_end'])) {\n if (substr($this->attribs['year_end'], 0, 4) == 'now+') {\n $end = $this_year + intval(substr($this->attribs['year_end'], 4));\n }\n elseif (substr($this->attribs['year_end'], 0, 4) == 'now-') {\n $end = $this_year - intval(substr($this->attribs['year_end'], 4));\n }\n elseif (substr($this->attribs['year_end'], 0, 1) == '+') {\n $end = $begin + intval(substr($this->attribs['year_end'], 1));\n }\n elseif (substr($this->attribs['year_end'], 0, 1) == '-') {\n $end = $begin - intval(substr($this->attribs['year_end'], 1));\n }\n else {\n $end = intval($this->attribs['year_end']);\n }\n }\n\n if ($begin != $end) {\n $year_range = $this->_array_stringify(range($begin, $end));\n }\n }\n\n if ($year_range) { // dropdown w/ that range\n $fyears = new formex_field($this->fex, $this->name.'_year', array('Years', 'select', $year_range));\n }\n else { // 4-space text field\n $fyears = new formex_field($this->fex, $this->name.'_year', array('Years', 'text', null, array('size'=>4)));\n }\n $res .= $fyears->get_html($f_date[0]);\n unset($fmonths, $fdays, $fyears);\n $res .= \"</span>\";\n\n return $res;\n }", "function widget_date($inputname, $defaultdate=NULL) {\n\t\treturn '<div data-date-viewmode=\"years\" data-date-format=\"dd-mm-yyyy\" data-date=\"'.$defaultdate.'\" id=\"'.$inputname.'-container\" class=\"input-append date\">\n\t\t\t\t<input type=\"text\" value=\"'.$defaultdate.'\" name=\"'.$inputname.'\" size=\"16\" class=\"span\">\n\t\t\t\t<span class=\"add-on\"><i class=\"icon-calendar\"></i></span>\n\t\t\t</div>\n\t\t\t<script>$(\"#'.$inputname.'-container\").datepicker({\n\t\t\t\t\t\t\t\t\"setValue\": \"'.$defaultdate.'\",\n\t\t\t\t\t\t\t\t\"format\": \"dd/mm/yyyy\"\n\t\t\t});</script>\n\t\t\t';\n\t}", "public function getHTMLDatePickerFormatValue(): string\n {\n return Carbon::parse($this->value)->format('Y-m-d');\n }", "public function dateformat( $php_format ) {\n\t\t$symbols_matching = array(\n\t\t\t// Day.\n\t\t\t'd' => 'dd',\n\t\t\t'D' => 'D',\n\t\t\t'j' => 'd',\n\t\t\t'l' => 'DD',\n\t\t\t'N' => '',\n\t\t\t'S' => '',\n\t\t\t'w' => '',\n\t\t\t'z' => 'o',\n\t\t\t// Week.\n\t\t\t'W' => '',\n\t\t\t// Month.\n\t\t\t'F' => 'MM',\n\t\t\t'm' => 'mm',\n\t\t\t'M' => 'M',\n\t\t\t'n' => 'm',\n\t\t\t't' => '',\n\t\t\t// Year.\n\t\t\t'L' => '',\n\t\t\t'o' => '',\n\t\t\t'Y' => 'yy',\n\t\t\t'y' => 'y',\n\t\t\t// Time.\n\t\t\t'a' => '',\n\t\t\t'A' => '',\n\t\t\t'B' => '',\n\t\t\t'g' => '',\n\t\t\t'G' => '',\n\t\t\t'h' => '',\n\t\t\t'H' => '',\n\t\t\t'i' => '',\n\t\t\t's' => '',\n\t\t\t'u' => '',\n\t\t);\n\n\t\t$jqueryui_format = '';\n\t\t$escaping = false;\n\n\t\tfor ( $i = 0; $i < strlen( $php_format ); $i++ ) {\n\t\t\t$char = $php_format[ $i ];\n\n\t\t\tif ( '\\\\' === $char ) {\n\t\t\t\t$i++;\n\n\t\t\t\tif ( $escaping ) { $jqueryui_format .= $php_format[ $i ];\n\t\t\t\t} else {\n\t\t\t\t\t$jqueryui_format .= '\\'' . $php_format[ $i ];\n\t\t\t\t}\n\n\t\t\t\t$escaping = true;\n\n\t\t\t} else {\n\t\t\t\tif ( $escaping ) { $jqueryui_format .= \"'\";\n\t\t\t\t\t$escaping = false; }\n\t\t\t\tif ( isset( $symbols_matching[ $char ] ) ) {\n\t\t\t\t\t$jqueryui_format .= $symbols_matching[ $char ];\n\t\t\t\t} else {\n\t\t\t\t\t$jqueryui_format .= $char;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $jqueryui_format;\n\t}", "public function getDateFormatter();", "function format_data_in($string_date)\n{\n // $formatted_date = \"DATE_FORMAT($db_date_column, '%a, %e %b %Y ')\";\n $temp = strtotime($string_date);\n $date = date('Y-m-d', $temp);\n $date = DateTime::createFromFormat('D, j M Y', $temp)->format('Y-m-d');\n print_r($date);\n return $date;\n}", "public function formatDate($date = null);", "public function DatePicker($name, $value = null)\r\n {\r\n //format the timestamp\r\n\r\n if ($value > 0) {\r\n Zend_Date::setOptions(array('format_type' => 'php'));\r\n $date = new Zend_Date($value);\r\n $value = $date->toString('m-d-Y');\r\n } else {\r\n //we dont want any value that is not a valid date\r\n $value = null;\r\n }\r\n\r\n return $this->view->formText($name, $value, array('class' => 'date-picker'));\r\n }", "function date_picker_to_db( $strdate )\n{\n\tif( strpos($strdate, '-') !== false) { return $strdate; }\n\tif( !isset($strdate) || $strdate == '' ){ return NULL; }\n\n\tlist($datetime['day'], $datetime['month'], $datetime['year']) = explode('/', $strdate);\n\n\tif( count( $datetime ) != 3 ) { return NULL; }\n\treturn ($datetime['year'] . '-' . $datetime['month'] . '-' . $datetime['day']) ;\n}", "private function changeDateFormat($val,$format){\n \n if($val != \"\" && count($this->dbConfigs) > 0){\n switch ($this->dbConfigs['driver']){\n case \"mysql\":\n if($format == \"date\"){\n $val = date(\"Y-m-d\", strtotime($val));\n }\n elseif($format == \"datetime\"){\n $val = date(\"Y-m-d H:i:s\", strtotime($val));\n }\n break;\n case \"sqlsrv\":\n if($format == \"date\"){\n $val = date(\"Y-m-d\",strtotime($val));\n }\n elseif($format == \"datetime\"){\n $val = date(\"Y-m-d H:i:s\",strtotime($val));\n }\n break;\n }\n return $val;\n }\n }", "function dateFormat($date)\n{\n\t$date = date('y-m-d',strtotime($date));\n\treturn $date;\n}", "public function convertDateToHTML($_date) {\n\t\tif(ereg(\"^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}).*$\",\n\t\t\t$_date, $_arrdt) !== false) {\n\t\t\treturn sprintf(\"%02.2d-%02.2d-%04.4d\",\n\t\t\t\t$_arrdt[3], $_arrdt[2], $_arrdt[1]);\n\t\t\t}\n\t\treturn $_date;\n\t}", "function mkDatePicker($yearpicker=false){\n\tif ($yearpicker) $pickerSpan=$this->rowCount;\n\telse $pickerSpan=$this->monthSpan;\n\tif ($this->datePicker){\n\t\t$out=\"<tr><td class=\\\"\".$this->cssPicker.\"\\\" colspan=\\\"\".$pickerSpan.\"\\\">\\n\";\n\t\t$out.=\"<form name=\\\"\".$this->cssPickerForm.\"\\\" class=\\\"\".$this->cssPickerForm.\"\\\" action=\\\"\".$this->urlPicker.\"\\\" method=\\\"get\\\">\\n\";\n\t\tif (!$yearpicker){\n\t\t\t$out.=\"<select name=\\\"\".$this->monthID.\"\\\" class=\\\"\".$this->cssPickerMonth.\"\\\">\\n\";\n\t\t\tfor ($z=1;$z<=12;$z++){\n\t\t\t\tif ($z==$this->actmonth) $out.=\"<option value=\\\"\".$z.\"\\\" selected=\\\"selected\\\">\".$this->getMonthName($z).\"</option>\\n\";\n\t\t\t\telse $out.=\"<option value=\\\"\".$z.\"\\\">\".$this->getMonthName($z).\"</option>\\n\";\n\t\t\t}\n\t\t\t$out.=\"</select>\\n\";\n\t\t}\n\t\t$out.=\"<select name=\\\"\".$this->yearID.\"\\\" class=\\\"\".$this->cssPickerYear.\"\\\">\\n\";\n\t\tfor ($z=$this->startYear;$z<=$this->endYear;$z++){\n\t\t\tif ($z==$this->actyear) $out.=\"<option value=\\\"\".$z.\"\\\" selected=\\\"selected\\\">\".$z.\"</option>\\n\";\n\t\t\telse $out.=\"<option value=\\\"\".$z.\"\\\">\".$z.\"</option>\\n\";\n\t\t}\n\t\t$out.=\"</select>\\n\";\n\t\t$out.=\"<input type=\\\"submit\\\" value=\\\"\".$this->selBtn.\"\\\" class=\\\"\".$this->cssPickerButton.\"\\\"></input>\\n\";\n\t\t$out.=\"</form>\\n\";\n\t\t$out.=\"</td></tr>\\n\";\n\t}\n\telse $out=\"\";\nreturn $out;\n}", "function format_input_hover_date($p_id, $p_value, $p_width = '', $p_submit_action = ''){\n\t$t_width = ($p_width != '') ? 'width:' . $p_width : '';\n\t$t_date_prop = 'data-picker-locale=\"' . lang_get_current_datetime_locale() . '\" data-picker-format=\"' . convert_date_format_to_momentjs(config_get('normal_date_format')) . '\"';\n\n\t$t_input = format_text($p_id . '-input', $p_id, $p_value, '', 'input-hover-input datetimepicker', $t_width, $t_date_prop);\n\t$t_overlay = format_text($p_id . '-overlay', $p_id . '-overlay', $p_value, '', 'input-hover-overlay', $t_width, 'readonly');\n\n\treturn format_input_hover_submit_reset($p_id, $t_input, $t_overlay, 'right:22px', 'right:9px', $p_submit_action);\n}", "function convert_date($date, $format = DATE_FORMAT)\r\n{ \r\n // $date_format is defined in config.inc.php.\r\n if (empty($date)) return;\r\n\r\n switch ($format) {\r\n case 'us12':\r\n return date('m/d/y g:i a', strtotime($date));\r\n break;\r\n case 'us24':\r\n\t\t\treturn date('m/d/y H:i', strtotime($date));\r\n break;\r\n case 'eu12':\r\n return date('d/m/y g:i a', strtotime($date));\r\n break;\r\n case 'eu24':\r\n return date('d/m/y H:i', strtotime($date)); \r\n break;\r\n case 'verbose':\r\n return date('D M jS, Y @ g:ia', strtotime($date));\r\n break;\r\n case 'mysql':\r\n return date('Y-m-d H:i:s', strtotime($date));\r\n break;\r\n case 'mysql_hours':\r\n return date('H:i a', strtotime($date));\r\n break;\r\n\t\tcase 'unix':\r\n return date('U', strtotime($date));\r\n break;\r\n default:\r\n // none specified, just return us12.\r\n return date('m/d/y h:i a', strtotime($date));\r\n }\r\n\r\n}", "public function date_format_func($date,$format)\n\t{\n\t\t$date = str_replace(\"/\",\"-\",$date);\n\t\t$date_output = date($format,strtotime($date));\n\t\treturn $date_output;\n\t}", "function acadp_mysql_date_format( $date ) {\n\n\t$defaults = array(\n\t\t'year' => 0,\n\t\t'month' => 0,\n\t\t'day' => 0,\n\t\t'hour' => 0,\n\t\t'min' => 0,\n\t\t'sec' => 0\n\t);\n\t$date = array_merge( $defaults, $date );\n\n\t$year = (int) $date['year'];\n\t$year = str_pad( $year, 4, '0', STR_PAD_RIGHT );\n\n\t$month = (int) $date['month'];\n\t$month = max( 1, min( 12, $month ) );\n\n\t$day = (int) $date['day'];\n\t$day = max( 1, min( 31, $day ) );\n\n\t$hour = (int) $date['hour'];\n\t$hour = max( 1, min( 24, $hour ) );\n\n\t$min = (int) $date['min'];\n\t$min = max( 0, min( 59, $min ) );\n\n\t$sec = (int) $date['sec'];\n\t$sec = max( 0, min( 59, $sec ) );\n\n\treturn sprintf( '%04d-%02d-%02d %02d:%02d:%02d', $year, $month, $day, $hour, $min, $sec );\n\n}", "function mysql2date($format, $date, $translate = \\true)\n {\n }", "function helper_format_date($date, $format = APP_DATE_TIME_FORMAT){\n return date( $format, strtotime($date) );\n }", "function convertDateToJS($date) {\n\n $ret = explode(\"-\", $date);\n $ano = $ret[0];\n $mes = ((int) $ret[1]) - 1;\n $dia = (int) $ret[2];\n return \"new Date(\" . $ano . \",\" . $mes . \",\" . $dia . \")\";\n}", "function date_format($date = \"\", $format = \"\") {\n if ($format == \"\")\n $format = \"Y-m-d H:i:s\";\n\n if ($date == \"\")\n return \"\";\n\n $converted = strtotime($date);\n\n if ($converted === false)\n return date($format, $date);\n else\n return date($format, $converted);\n }", "public static function __getFormatDate($date, $format = false, $style = \"d-m-Y\")\r\n\t{\r\n\t\t$style = ($style) ? $style : \"d-m-Y\" ;\r\n\t\tswitch ($format)\r\n\t \t{\r\n\t \t\tdefault:\r\n\t \t\t\t$new_date = ($date) ? date($style, $date) : date($style, mktime());\r\n\t \t\t\tbreak;\r\n\t \t\t\t\r\n\t \t\tcase \"time\":\r\n\t \t\t\t$new_date = ($date) ? date(\"H:i:s\", $date) : date(\"H:i:s\", mktime());\r\n\t \t\t\tbreak;\r\n\t \t\t\r\n\t\t\tcase \"with_time\":\r\n\t \t\t\t$new_date = ($date) ? date($style . \" H:i:s\", $date) : date($style . \" H:i:s\", mktime());\r\n\t \t\t\tbreak;\r\n\t\t\t\r\n\t \t\tcase \"short\":\r\n\t\t\t\t$new_date[\"d\"] = date(\"d\", $date);\r\n\t\t\t\t$new_date[\"m\"] = date(\"m\", $date);\r\n\t\t\t\t$new_date[\"y\"] = date(\"Y\", $date);\r\n\t\t\t\t\r\n\t\t\t\tbreak;\r\n\t \t}\r\n\t return $new_date;\r\n\t}", "function format_date($date, $date_format = false)\n{\n if ($date_format == false) {\n\n if(function_exists('get_option')){\n $date_format = get_option('date_format', 'website');\n }\n if ($date_format == false) {\n $date_format = \"Y-m-d H:i:s\";\n }\n }\n\n $date = date($date_format, strtotime($date));\n return $date;\n}", "function dateFormat($date, $format=\"m/d/Y h:i:s A\") {\n if (empty($date)) {\n return \"\";\n }\n Zend_Date::setOptions(array('format_type' => 'php'));\n $zdate = new Zend_Date(strtotime($date));\n $str_date = $zdate->toString($format);\n Zend_Date::setOptions(array('format_type' => 'iso'));\n return $str_date;\n }", "function dateFormat( $date, $from = 'Y-m-d', $to = 'd-m-Y' ) {\n $date = DateTime::createFromFormat( $from, $date );\n return $date->format( $to );\n}", "function dateFormat($date)\n{\n\t$date_formated = '';\n \tif($date!='')\n \t{\n \t$date_formated = date('Y-m-d',strtotime($date));\n \t}\n \treturn $date_formated; \n}", "function dateFormat($date)\n{\n\t$date_formated = '';\n \tif($date!='')\n \t{\n \t$date_formated = date('Y-m-d',strtotime($date));\n \t}\n \treturn $date_formated; \n}", "public function the_date_display( $post ) {\n\t\n\t\t wp_nonce_field( plugin_basename( __FILE__ ), 'wp-jquery-date-picker-nonce' );\n\t\n\t\t echo '<input type=\"text\" id=\"datepicker\" name=\"the_date\" value=\"' . get_post_meta( $post->ID, 'the_date', true ) . '\" />';\n\t\n\t }", "public function getDateFormat(){\n\t\t$this->_dateFormat = $date;\n\t}", "function _field_date_us($fval) \n {\n $f_date = \"\";\n if ($fval) {\n list($m,$d,$y) = split('/', $fval);\n $f_date = array($y, $m, $d);\n }\n return $this->_field_date($f_date);\n }", "function printDateRange(){\n //http://www.daterangepicker.com/ \n $ret_val = \"\";\n\n $ret_val .= \"<input type='text' id='daterange' name='daterange' style='width: 300px; display:none' autocomplete='off' />\";\n $ret_val .= \"<script>\n$(function() {\n $('input[name=\\\"daterange\\\"]').daterangepicker({\n timePicker: true,\n startDate: moment().startOf('hour').subtract(24, 'hour'), \n endDate: moment().startOf('hour'),\n locale: {\n format: 'YYYY/MM/DD hh:mm:ss '\n }\n });\n});\n</script>\";\n \n return $ret_val;\n }", "public function convertDate($format) {\n\n\n\n $temp = strtotime($format);\n\n echo date('M d Y', $temp);\n }", "function toDate($string, $format){\r\n\t\t$months = ['Gennaio', 'Febbraio', 'Marzo', 'Aprile', 'Maggio', 'Giugno', 'Luglio', 'Agosto', 'Settembre', 'Ottobre', 'Novembre', 'Dicembre'];\r\n\r\n\t\t$date = explode(' ', $string)[0];\r\n\t\t$time = substr(explode(' ', $string)[1], 0, 5);\r\n\r\n\t\t$day = explode('-', $date)[2];\r\n\t\t$monthS = explode('-', $date)[1];\r\n\t\t$monthL = $months[intval($monthS) - 1];\r\n\t\t$year = explode('-', $date)[0];\r\n\r\n\t\tif($format == 'short')\r\n\t\t\treturn $day.'/'.$monthS.'/'.$year.' '.$time;\r\n\t\telse\r\n\t\t\treturn $day.' '.$monthL.' '.$year.' '.$time;\r\n\t}", "function formatDate($date){\n $newDate = strtotime($date);\n $newFormat = date('D j/n Y', $newDate);\n echo $newFormat;\n}", "public function getInput_date($format = NULL)\n {\n if ($format === null) {\n return $this->input_date;\n } else {\n return $this->input_date instanceof \\DateTimeInterface ? $this->input_date->format($format) : null;\n }\n }", "function formatDate($date){\r\n\t\t\t\t$dateObject = date_create($date);\r\n\t\t\t\treturn date_format($dateObject, \"j F Y\");\r\n\t\t\t}", "function convertdate($date) {\r\n\t$date = strtotime($date);\r\n\treturn date(\"M j, Y g:ia\", $date);\r\n}", "function form_date($field, $options){\n $defaults = array(\n 'wrap' => true,\n 'label' => true,\n 'class' => array('date', 'input'),\n 'minYear' => date('Y') - 10,\n 'maxYear' => date('Y') + 10,\n 'months' => array(\n 1 => 'January',\n 2 => 'February',\n 3 => 'March',\n 4 => 'April',\n 5 => 'May',\n 6 => 'June',\n 7 => 'July',\n 8 => 'August',\n 9 => 'September',\n 10 => 'October',\n 11 => 'November',\n 12 => 'December'\n ),\n 'days' => array(\n 1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8,\n 9 => 9, 10 => 10, 11 => 11, 12 => 12, 13 => 13, 14 => 14, 15 => 15,\n 16 => 16, 17 => 17, 18 => 18, 19 => 19, 20 => 20, 21 => 21, 22 => 22,\n 23 => 23, 24 => 24, 25 => 25, 26 => 26, 27 => 27, 28 => 28, 29 => 29,\n 30 => 30, 31 => 31\n ),\n 'separator' => '-'\n );\n\n $options = array_merge($defaults, $options);\n\n $years = array();\n for($i = $options['minYear']; $i <= $options['maxYear']; $i++) {\n $years[$i] = $i;\n }\n\n if(empty($_POST[$field . '[day]'])) {\n $today = date('j');\n if(!empty($options['days'][$today])) {\n $_POST[$field . '[day]'] = $today;\n }\n }\n\n $output = form_select(\n $field . '[day]',\n array(\n 'wrap' => false,\n 'label' => false,\n 'options' => $options['days']\n )\n );\n\n $output .= $options['separator'];\n\n if(empty($_POST[$field . '[month]'])) {\n $today = date('n');\n if(!empty($options['months'][$today])) {\n $_POST[$field . '[month]'] = $today;\n }\n }\n\n $output .= form_select(\n $field . '[month]',\n array(\n 'wrap' => false,\n 'label' => false,\n 'options' => $options['months']\n )\n );\n\n $output .= $options['separator'];\n\n if(empty($_POST[$field . '[year]'])) {\n $today = date('Y');\n if(!empty($years[$today])) {\n $_POST[$field . '[year]'] = $today;\n }\n }\n\n $output .= form_select(\n $field . '[year]',\n array(\n 'wrap' => false,\n 'label' => false,\n 'options' => $years\n )\n );\n\n if($options['wrap']) {\n $options['field'] = $field;\n $output = form__wrap($output, $options);\n }\n\n $error = form_error_message($field);\n if(!empty($error)) {\n $output .= $error;\n }\n\n return html__output($output);\n}", "function my_dateFormat($date){\n return date(\"M d, Y h:i A\",strtotime($date));\n}", "function dateToMySQL ($dateSource, $date) {\n\t$dateOUT = \"\";\n\t$dateSource = strtolower($dateSource);\n\t// Replace '/' by '-' from original date. This allow me use \"sscanf($date,\"%d %d %d\")\"\n\t$date = str_ireplace(\"/\", \"-\", $date);\n\tif ($date != \"\") {\n\t\tif ($dateSource == \"yyyymmdd\")\n\t\t\tlist($year, $month, $day) = sscanf($date,\"%d %d %d\");\n\t\tif ($dateSource == \"ddmmyyyy\")\n\t\t\tlist($day, $month, $year) = sscanf($date,\"%d %d %d\");\n\t\tif ($dateSource == \"yyyyddmm\")\n\t\t\tlist($year, $day, $month) = sscanf($date,\"%d %d %d\");\n\t\tif ($dateSource == \"mmyyyydd\")\n\t\t\tlist($month, $year, $day) = sscanf($date,\"%d %d %d\");\n\t\tif ($dateSource == \"\") {\n\t\t\t// Autodetect mode [Supported modes: (YYYYMMDD) Or (DDMMYYYY)]\n\t\t\tlist($day, $month, $year) = sscanf($date,\"%d %d %d\");\n\t\t\tif (strlen($year) <= 3) {\n\t\t\t\tlist($year, $month, $day) = sscanf($date,\"%d %d %d\");\n\t\t\t}\n\t\t}\n\t\t$dateOUT = sprintf (\"%04d-%02d-%02d\", abs($year), abs($month), abs($day));\n\t}\n\treturn ($dateOUT);\n}", "protected function getDateFormat()\n {\n return \\MUtil_Model_Bridge_FormBridge::getFixedOption('datetime', 'dateFormat');\n }", "function STRdate_format($str, $origin = USERDATE_READ, $format = DBDATE_WRITE) {\r\n if (trim($str) == \"\") {\r\n return -1;\r\n }\r\n try {\r\n $date = DateTime::createFromFormat($origin, $str);\r\n if ($date) {\r\n if ($format == \"datetime\") {\r\n return $date;\r\n }\r\n return $date->format($format);\r\n }\r\n \\Itracker\\Utils\\LoggerFactory::getLogger()->debug(\r\n 'No se puede convertir fecha', array('input' => $str, 'orformat' => $origin, 'destformat' => $format));\r\n return -1;\r\n } catch (Exception $e) {\r\n \\Itracker\\Utils\\LoggerFactory::getLogger()->debug(\r\n 'No se puede convertir fecha', array('input' => $str, 'orformat' => $origin, 'destformat' => $format));\r\n return -1;\r\n }\r\n}", "public function dateFormat();", "function makeDateTimePicker($idChamp, $defaut='') {\n\t$fJquery = '$(\"#'.$idChamp.'\").datetimepicker({';\n\t$fJquery.= '\tlang:\"'._LG_.'\",';\n\t//$fJquery.= '\tdatepicker:false,';\t\t\t\t\t\t//pas de selection date\n\t//$fJquery.= '\ttimepicker:false,';\t\t\t\t\t\t//pas de selection time\n\t$fJquery.= '\tformat:\"'._FORMAT_DATE_TIME_.'\",';\t\t//format d'affichage\n\t$fJquery.= '\tformatDate:\"'._FORMAT_DATE_.'\",';\t\t//format d'affichage maxDate / minDate\n\t$fJquery.= '\tformatTime:\"H:i:s\",';\t\t\t\t\t//format d'affichage maxTime / minTime\n\t//$fJquery.= '\tallowTimes:[\"12:00\", \"13:00\"],';\n\t$fJquery.= '\tstep:1,';\n\tif ($defaut != '') {\n\t\t$fJquery.= '\tdefaultDate: \"'.$defaut.'\",';\n\t\t$fJquery.= '\tdefaultTime: \"'.date('H:i:s').'\",';\n\t}\n\t//$fJquery.= '\tyearStart: 2015,';\n\t//$fJquery.= '\tyearEnd: 2030,';\n\t$fJquery.= '\tvalidateOnBlur:false,';\n\t$fJquery.= '\tmask:false';\t\t\t\t\t\t\t\t//affichage masque de saisie\n\t$fJquery.= '});';\n\treturn $fJquery;\n}", "public function setDateFormat($value)\n\t{\n\t\t$this->setViewState('DateFormat',$value,'dd-MM-yyyy');\n\t}", "function dateFormat($D) {\n $D = date('d-m-Y', strtotime($D));\n return $D;\n }", "function conv_date($f, $date, $sep = '/') {\n $fmt = '';\n if ($f == '1') { // normal to mysql\n $date = explode('/', $date);\n $fmt = (count($date) == 3) ? $date[2] . '-' . $date[1] . '-' . $date[0] : '';\n } else { // mysql to normal\n $date = explode(' ', $date);\n $date = explode('-', $date[0]);\n $fmt = (count($date) == 3) ? $date[2] . $sep . $date[1] . $sep . $date[0] : '';\n }\n return $fmt;\n}", "static function convert_date($date, $from_format, $to_format){\n\t\tif(strlen($date) == 0){\n\t\t\treturn $date;\n\t\t}\n\t\tif(strlen($from_format) == 3){\n\t\t\t$date = substr($date, 0, 2).\"-\".substr($date, 2, 2).\"-\".substr($date, 4);\n\t\t\t$from_format = substr($from_format, 0, 1).\"-\".substr($from_format, 1, 1).\"-\".substr($from_format, 2);\n\t\t}\n\t\t$separator = \"-\";\n\t\t$from_format = str_replace(array(\"/\", \"-\", \" \", \":\"), $separator, $from_format);\n\t\t$from_format = explode($separator, strtoupper($from_format));\n\t\t$date = str_replace(array(\"/\", \"-\", \" \", \":\"), $separator, $date);\n\t\t$date = explode($separator, $date);\n\t\tforeach($from_format as $i => $char){\n\t\t\tswitch($char){\n\t\t\t\tcase \"D\": $day = $date[$i];\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"H\": $hou = $date[$i];\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"I\": $min = $date[$i];\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"M\": $mon = $date[$i];\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"S\": $sec = $date[$i];\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"Y\": $yea = $date[$i];\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t$date = mktime($hou, $min, $sec, $mon, $day, $yea);\n\t\treturn date($to_format, $date);\n\t}", "function convert_date($date, $from_format, $to_format){\r\n\t// exemplo: convert_date(\"20/02/2009\",\"d/m/Y\",\"Y-m-d\"); (retorna \"2009-02-20\")\r\n\tif(strlen($date) == 0){\r\n\t\treturn $date;\r\n\t}\r\n\tif(strlen($from_format) == 3){\r\n\t\t$date = substr($date, 0, 2).\"-\".substr($date, 2, 2).\"-\".substr($date, 4);\r\n\t\t$from_format = substr($from_format, 0, 1).\"-\".substr($from_format, 1, 1).\"-\".substr($from_format, 2);\r\n\t}\r\n\t$separator = substr($from_format, 1, 1);\r\n\t$format = explode($separator, strtoupper($from_format));\r\n\t$date = explode($separator, $date);\r\n\tforeach($format as $i => $char){\r\n\t\tswitch($char){\r\n\t\t\tcase \"D\": $day = $date[$i];\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"M\": $mon = $date[$i];\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"Y\": $yea = $date[$i];\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\t$date = mktime(0, 0, 0, $mon, $day, $yea);\r\n\treturn date($to_format, $date);\r\n}", "function setDateHtmlOptions( $html, $ctrlName, $date = \"\", $format = \"Y-m-d h:i:s\")\n\t{\n\t\tif($format == \"\")\n\t\t\t$format = \"Y-m-d h:i:s\";\n\t\tif($date == \"\")\n\t\t\t$date = date($format);\n\n\t\t$dataRepeaterContent = SoondaUtil::getStringBetween( $html, \"<soo:datarepeater:\".$ctrlName.\"Day>\", \"</soo:datarepeater:\".$ctrlName.\"Day>\");\n\t\t$sOptions = \"\";\n\t\tfor($i = 1; $i < 32; $i++)\n\t\t{\n\t\t\t$stmp = str_replace( \"{SOO.DATA:\".$ctrlName.\"Day}\", $i, $dataRepeaterContent);\n\t\t\t$stmp = str_replace( \"{SOO.DATA:\".$ctrlName.\"DayDisplay}\", ($i < 10) ? \"0$i\" : $i, $stmp);\n\t\t\t$stmp = str_replace( \"{selected\".$ctrlName.\"Day}\", ($i == date(\"d\", strtotime( $date ) ) ) ? \"selected\" : \"\", $stmp);\n\t\t\t$sOptions .= $stmp;\n\t\t}\n\t\t$html = str_replace( $dataRepeaterContent, $sOptions, $html);\n\n\t\t$dataRepeaterContent = SoondaUtil::getStringBetween( $html, \"<soo:datarepeater:\".$ctrlName.\"Month>\", \"</soo:datarepeater:\".$ctrlName.\"Month>\");\n\t\t$sOptions = \"\";\n\t\tfor($i = 1; $i < 13; $i++)\n\t\t{\n\t\t\t$stmp = str_replace( \"{SOO.DATA:\".$ctrlName.\"Month}\", $i, $dataRepeaterContent);\n\t\t\t$stmp = str_replace( \"{SOO.DATA:\".$ctrlName.\"MonthDisplay}\", SoondaUtil::getMonthName( $i), $stmp);\n\t\t\t$stmp = str_replace( \"{selected\".$ctrlName.\"Month}\", ($i == date(\"m\", strtotime( $date ) )) ? \"selected\" : \"\", $stmp);\n\t\t\t$sOptions .= $stmp;\n\t\t}\n\t\t$html = str_replace( $dataRepeaterContent, $sOptions, $html);\n\n\t\t$dataRepeaterContent = SoondaUtil::getStringBetween( $html, \"<soo:datarepeater:\".$ctrlName.\"Year>\", \"</soo:datarepeater:\".$ctrlName.\"Year>\");\n\t\t$sOptions = \"\";\n\t\t$currentYear = date(\"Y\");\n\t\tfor($i = $currentYear - 20; $i < $currentYear + 20; $i++)\n\t\t{\n\t\t\t$stmp = str_replace( \"{SOO.DATA:\".$ctrlName.\"Year}\", $i, $dataRepeaterContent);\n\t\t\t$stmp = str_replace( \"{SOO.DATA:\".$ctrlName.\"YearDisplay}\", ($i < 10) ? \"0$i\" : $i, $stmp);\n\t\t\t$stmp = str_replace( \"{selected\".$ctrlName.\"Year}\", ($i == date(\"Y\", strtotime( $date ) )) ? \"selected\" : \"\", $stmp);\n\t\t\t$sOptions .= $stmp;\n\t\t}\n\t\t$html = str_replace( $dataRepeaterContent, $sOptions, $html);\n\n\t\t$dataRepeaterContent = SoondaUtil::getStringBetween( $html, \"<soo:datarepeater:\".$ctrlName.\"Hour>\", \"</soo:datarepeater:\".$ctrlName.\"Hour>\");\n\t\t$sOptions = \"\";\n\t\tfor($i = 0; $i < 24; $i++)\n\t\t{\n\t\t\t$stmp = str_replace( \"{SOO.DATA:\".$ctrlName.\"Hour}\", $i, $dataRepeaterContent);\n\t\t\t$stmp = str_replace( \"{SOO.DATA:\".$ctrlName.\"HourDisplay}\", ($i < 10) ? \"0$i\" : $i, $stmp);\n\t\t\t$stmp = str_replace( \"{selected\".$ctrlName.\"Hour}\", ($i == date(\"h\", strtotime( $date ) )) ? \"selected\" : \"\", $stmp);\n\t\t\t$sOptions .= $stmp;\t\t\n\t\t}\n\t\t$html = str_replace( $dataRepeaterContent, $sOptions, $html);\n\n\t\t$dataRepeaterContent = SoondaUtil::getStringBetween( $html, \"<soo:datarepeater:\".$ctrlName.\"Minute>\", \"</soo:datarepeater:\".$ctrlName.\"Minute>\");\n\t\t$sOptions = \"\";\n\t\tfor($i = 0; $i < 60; $i++)\n\t\t{\n\t\t\t$stmp = str_replace( \"{SOO.DATA:\".$ctrlName.\"Minute}\", $i, $dataRepeaterContent);\n\t\t\t$stmp = str_replace( \"{SOO.DATA:\".$ctrlName.\"MinuteDisplay}\", ($i < 10) ? \"0$i\" : $i, $stmp);\n\t\t\t$stmp = str_replace( \"{selected\".$ctrlName.\"Minute}\", ($i == date(\"i\", strtotime( $date ) )) ? \"selected\" : \"\", $stmp);\n\t\t\t$sOptions .= $stmp;\t\t\n\t\t}\n\t\t$html = str_replace( $dataRepeaterContent, $sOptions, $html);\n\n\t\t$dataRepeaterContent = SoondaUtil::getStringBetween( $html, \"<soo:datarepeater:\".$ctrlName.\"Second>\", \"</soo:datarepeater:\".$ctrlName.\"Second>\");\n\t\t$sOptions = \"\";\n\t\tfor($i = 0; $i < 60; $i++)\n\t\t{\n\t\t\t$stmp = str_replace( \"{SOO.DATA:\".$ctrlName.\"Second}\", $i, $dataRepeaterContent);\n\t\t\t$stmp = str_replace( \"{SOO.DATA:\".$ctrlName.\"SecondDisplay}\", ($i < 10) ? \"0$i\" : $i, $stmp);\n\t\t\t$stmp = str_replace( \"{selected\".$ctrlName.\"Second}\", ($i == date(\"s\", strtotime( $date ) )) ? \"selected\" : \"\", $stmp);\n\t\t\t$sOptions .= $stmp;\t\t\t\n\t\t}\n\t\t$html = str_replace( $dataRepeaterContent, $sOptions, $html);\n\t\t$html = str_replace( \"{SOO.FUNCTION:SELECTEDDATE:\".$ctrlName.\"}\", date($format, strtotime($date) ), $html);\n\t\treturn $html;\n\t}", "function get_date_textual($format = 'Y-m-d') {\n\t$format = ($format == '') ? 'Y-m-d' : $format;\n\t$format = str_replace('Y', 'yyyy', $format);\n\t$format = str_replace('m', 'mm', $format);\n\t$format = str_replace('d', 'dd', $format);\n\treturn $format;\n}", "private function formatDate($date) {\n\t\tif ($date === '' || !$date) {\n\t\t\treturn;\n\t\t}\n\t\tif (DateTime::createFromFormat('Y-m-d', $date)) {\n\t\t\t$formatedDate = $date;\n }elseif (\\Zend_Date::isDate($date, \\Zend_Date::ISO_8601)) {\n $tmpDt = new \\Zend_Date($date, \\Zend_Date::ISO_8601);\n $formatedDate = $tmpDt->toString('Y-MM-dd');\n\t\t} else {\n\t\t\t$tmpDt = DateTime::createFromFormat('d/m/Y', $date);\n\t\t\t$formatedDate = $tmpDt->format('Y-m-d');\n\t\t}\n\t\treturn $formatedDate;\n\t}", "public static function format_date($date,$format) {\n \n return Yii::app()->dateFormatter->format($format, $date);\n }", "public static function checkfront_date_format() {\n return (string)static::config()->get('checkfront_date_format');\n }", "function convertdate($date) {\n\t$date = strtotime($date);\n\treturn date(\"M j, Y g:ia\", $date);\n}", "function ConvertDate($StrDate, $StrFormat, $ResultFormat) {\n $StrFormat = strtoupper($StrFormat);\n switch ($StrFormat) {\n case \"MM/DD/YYYY\" : list($Month, $Day, $Year) = explode(\"/\", $StrDate);\n break;\n case \"DD/MM/YYYY\" : list($Day, $Month, $Year) = explode(\"/\", $StrDate);\n break;\n case \"YYYY/MM/DD\" : list($Year, $Month, $Day) = explode(\"/\", $StrDate);\n break;\n case \"MM-DD-YYYY\" : list($Month, $Day, $Year) = explode(\"-\", $StrDate);\n break;\n case \"DD-MM-YYYY\" : list($Day, $Month, $Year) = explode(\"-\", $StrDate);\n break;\n case \"YYYY-MM-DD\" : list($Year, $Month, $Day) = explode(\"-\", $StrDate);\n break;\n }//End switch\n $ResultFormat = strtoupper($ResultFormat);\n switch ($ResultFormat) {\n case \"MM-DD-YYYY\" : $StrResult = $Month . \"-\" . $Day . \"-\" . $Year;\n break;\n case \"DD-MM-YYYY\" : $StrResult = $Day . \"-\" . $Month . \"-\" . $Year;\n break;\n case \"YYYY-MM-DD\" : $StrResult = $Year . \"-\" . $Month . \"-\" . $Day;\n break;\n case \"MM/DD/YYYY\" : $StrResult = $Month . \"/\" . $Day . \"/\" . $Year;\n break;\n case \"DD/MM/YYYY\" : $StrResult = $Day . \"/\" . $Month . \"/\" . $Year;\n break;\n case \"YYYY/MM/DD\" : $StrResult = $Year . \"/\" . $Month . \"/\" . $Day;\n break;\n }//End switch\n return $StrResult;\n }", "public static function getDateFormats()\n {\n return array( 'm/d/y' => 'mm/dd/yy', 'd/m/y' => 'dd/mm/yy' );\n }", "function custDateFormat($string, $format = 'Y-m-d H:i:s') {\n $return = date($format,strtotime($string));\n return $return;\n}", "function template_date_select($params,&$smarty)\n {\n extract($params);\n \n if (empty($name)) {\n return;\n }\n \n $buffer = '<input type=\"text\" size=\"12\" maxlength=\"12\" name=\"'.$name.'\" value=\"'.$value.'\" /> (Format: mm/dd/yyyy)';\n return $buffer;\n }", "function ConvertDate($mysqlDate)\n {\n if($mysqlDate != \"\")\n return $this->app->String->Convert($mysqlDate,\"%1-%2-%3\",\"%3.%2.%1\");\n }", "function get_date_numeral($format = 'Y-m-d') {\n\t$format = ($format == '') ? 'Y-m-d' : $format;\n\t$format = str_replace('Y', '9999', $format);\n\t$format = str_replace('m', '99', $format);\n\t$format = str_replace('d', '99', $format);\n\treturn $format;\n}", "function datetime_format($date = \"\", $format = \"\") {\n if ($format == \"\")\n $format = \"Y-m-d H:i:s\";\n\n if ($date == \"\")\n return \"\";\n\n $converted = strtotime($date);\n\n if ($converted === false)\n return date($format, $date);\n else\n return date($format, $converted);\n }", "function formatFechaBD($value){\n\t$partes = explode(\"-\", $value);\n\t$value = $partes[2].\"-\".$partes[1].\"-\".$partes[0];\n\treturn $value;\n}", "function formatDate($date){\n\treturn date('F j, Y, g:i a', strtotime($date));\n}", "function sc_us_date_format($date){\n\treturn date('m/d/Y', $date);\n}", "function getLocalDate($strdate,$format='%Y-%m-%d %H:%M:%S') {\r\n\r\n\t jimport('joomla.utilities.date');\r\n\t $user =& JFactory::getUser();\r\n\r\n//\t if we have an anonymous user, then use global config, instead of the user params\r\n\t if($user->get('id')) {\r\n\t\t$tz = $user->getParam('timezone');\r\n\t } else {\r\n\t\t$conf =& JFactory::getConfig();\r\n\t\t$tz = $conf->getValue('config.offset');\r\n\t }\r\n\r\n\t $jdate = new JDate($strdate);\r\n\t $jdate->setOffset($tz);\r\n\t $formatDate = $jdate->toFormat($format);\r\n\t return $formatDate;\r\n\t}", "function formatDate($date,$dateOpt=null) {\n\n\t if (defined(\"DATE_FORMAT\")) $layout = DATE_FORMAT;\n\t else $layout = \"mm/dd/yyyy\";\n\n\t $layout = str_replace(\"mm\",\"m\",$layout);\n\t $layout = str_replace(\"dd\",\"d\",$layout);\n\t $layout = str_replace(\"yyyy\",\"Y\",$layout);\n\n\t\t$dateArray = explode(\"-\",$date);\n\n\t\tif ($dateOpt==\"full\") date(\"M d, Y\",mktime(0,0,0,$dateArray[1],$dateArray[2],$dateArray[0]));\n\t\telse $date = date(\"$layout\",mktime(0,0,0,$dateArray[1],$dateArray[2],$dateArray[0]));\n\t\t\n\t\treturn $date;\n\t\t\n}", "public function getSortedDateInputs()\n {\n $strtr = array(\n '%b' => '%1$s',\n '%B' => '%1$s',\n '%m' => '%1$s',\n '%d' => '%2$s',\n '%e' => '%2$s',\n '%Y' => '%3$s',\n '%y' => '%3$s'\n );\n\n $dateFormat = preg_replace('/[^\\%\\w]/', '\\\\1', $this->getDateFormat());\n\n return sprintf(strtr($dateFormat, $strtr),\n $this->_dateInputs['m'], $this->_dateInputs['d'], $this->_dateInputs['y']);\n }", "public function datepicker($name, $value = null, $options = [])\n {\n $options += [\n 'date-format' => \"mm/dd/yyyy\",\n ];\n $options['data-provide'] = 'datepicker';\n $options['data-date-format'] = $options['date-format'];\n unset($options['date-format']);\n return $this->input('text', $name, $value, $options);\n }", "function standardDateTimeFormat($format = 'Y-m-d H:i:s', $date_to_be_converted = '')\n{\n if (empty($date_to_be_converted)) {\n return date($format);\n } else {\n return date($format, $date_to_be_converted);\n }\n\n}", "function formatDate($date){\n\tif(validateDate($date)){\n\t\t$year = substr($date,0,4);\n\t\t$month = substr($date,4,2);\n\t\t$day = substr($date,6,2);\n\t\treturn $year.C('STR_YEAR').$month.C('STR_MONTH').$day.C('STR_DAY');\n\t}\n\telse\n\t\treturn C('STR_FORMAT_DATE_FAIL');\n}", "function validateDateFormat($date, $format);", "public function toDateString()\n {\n return $this->toLocalizedString('yyyy-MM-dd');\n }", "public function convert_date_format($created_date){\n\t\tif($created_date != ''){\n\t\t\t$c_d = date('Y-m-d', strtotime($created_date));\n\t\t\treturn $c_d;\n\t\t}\n\t}", "public function formatDate($date){\n\n return date('F j,Y,g:i a', strtotime($date));\n }", "function cjpopups_local_date($format, $date = null){\n\tif($date == null){\n\t\t$datetime = strtotime(date('Y-m-d H:i:s'));\n\t}else{\n\t\t$datetime = strtotime(date('Y-m-d H:i:s', $date));\n\t}\n\t$timezone_string = get_option('timezone_string');\n\tif($timezone_string != ''){\n\t\tdate_default_timezone_set($timezone_string);\n\t\t$return = date($format, $datetime);\n\t}else{\n\t\t$return = date($format, $datetime);\n\t}\n\treturn $return;\n}", "function dateFormatView($date)\n{\n $date_formated = '---';\n if($date!='0000-00-00' and $date!='')\n {\n $date_formated = date('m/d/Y',strtotime($date)); \n }\n return $date_formated; \n}", "public function dateViewHelperFormatsDateLocalizedDataProvider() {}", "protected function _formatDate($date_obj) {\n if (is_string($date_obj)) {\n $date_obj = DateTime::createFromFormat('Y-m-d H:i:s', $date_obj);\n }\n return $date_obj->format('d/m/Y');\n }", "function _fechaInput($fecha = ''){\n return \\Carbon\\Carbon::parse($fecha)->format('d/m/Y');\n // return \"{$d}/{$m}/{$y}\";\n\n\n\n\n }", "public function setDateFormat($date){\n\t\t$this->_dateFormat = $date;\n\t}", "public function convertDateToDB($_date) {\n\t\tif(ereg(\"^([0-9]{1,2})-([0-9]{1,2})-([0-9]{4}).*$\",\n\t\t\t$_date, $_arrdt) !== false) {\n\t\t\treturn sprintf(\"%04.4d-%02.2d-%02.2d\",\n\t\t\t\t$_arrdt[3], $_arrdt[2], $_arrdt[1]);\n\t\t\t}\n\t\treturn false;\n\t}", "public function twig_filter_jdate()\n\t{\n\t\treturn new \\Twig_SimpleFilter('jdate', function ($_string, $_format =\"Y/m/d\", $_convert = true)\n\t\t{\n\t\t\treturn \\lib\\utility\\jdate::date($_format, $_string, $_convert);\n\t\t});\n\t}" ]
[ "0.67695457", "0.62312174", "0.62195396", "0.61951023", "0.6068125", "0.58837306", "0.5874469", "0.58106714", "0.5798358", "0.57656586", "0.572851", "0.571697", "0.57096237", "0.56988245", "0.56789047", "0.5596929", "0.55584687", "0.5543496", "0.5524063", "0.5504349", "0.5500055", "0.5472518", "0.5465083", "0.54136366", "0.5410189", "0.5387464", "0.53824025", "0.5378186", "0.5374058", "0.5373926", "0.5356687", "0.53510374", "0.53505385", "0.5345679", "0.5327416", "0.53256154", "0.5298528", "0.52945143", "0.5290214", "0.5286228", "0.52855694", "0.5276558", "0.5266706", "0.5266706", "0.5236034", "0.52294856", "0.5219693", "0.5205677", "0.51965725", "0.51919746", "0.51867473", "0.5163004", "0.5162024", "0.5141716", "0.51288396", "0.51284665", "0.51202345", "0.51155406", "0.51084256", "0.5104426", "0.51014364", "0.50968343", "0.50844955", "0.508136", "0.5080983", "0.5080635", "0.50758857", "0.507188", "0.50704926", "0.50617546", "0.5061258", "0.50597876", "0.5050854", "0.5036083", "0.5035872", "0.5029533", "0.502258", "0.50167257", "0.50127023", "0.50105023", "0.49997512", "0.49921197", "0.49880907", "0.49867463", "0.4981651", "0.49799806", "0.49797544", "0.49792242", "0.49757096", "0.49744064", "0.4973509", "0.49731094", "0.49717316", "0.49532208", "0.49469894", "0.4946665", "0.49457508", "0.49412656", "0.49401024", "0.4936991" ]
0.6144381
4
Init layout, menu and breadcrumb
protected function _initAction() { $this->loadLayout(); $this->setUsedModuleName('novalnet_payment'); $this->_setActiveMenu('novalnet/configuration'); $this->_title($this->__('Novalnet')); $this->_title($this->__('Configuration')); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function init()\n\t{\n\t\t$this->_helper->layout()->setLayout('home');\n\t}", "protected function _initBreadcrumb(){\r\n\n\t\t$layout = $this->bootstrap('layout')->getResource('layout');\r\n\t\t$view = $layout->getView();\r\n\t\t$config = new Zend_Config(require APPLICATION_PATH.'/configs/navigationShop.php');\r\n\t\t$navigation = new Zend_Navigation();\n\t\t$view->navigation($navigation);\r\n\t\t$navigation->addPage($config);\n\t\tZend_Registry::set('navigation',$navigation);\n\t}", "protected function setupLayout()\n {\n if ( ! is_null($this->layout))\n {\n $this->layout = view($this->layout);\n $this->layout->menus = Menu::getMenu() ;\n }\n }", "public function init()\n {\n $this->getHelper('layout')->setLayout('manage-layout');\n }", "public function init()\n {\n \t$this->_helper->layout()->setLayout('admin');\n }", "protected function _init()\n {\n $this->setLayoutTemplate(App::getConfig('Help','layout/default'));\n\n # set navbar template .phtml\n $this->getNavbar()->setTemplate('help/html/navbar.phtml');\n\n #set sidebar template .phtml\n $this->getSidebar()->setTemplate('help/html/sidebar.phtml');\n }", "protected function init()\n {\n\n $this->viewPath = '/modules/promocode/views/';\n $this->layoutPath = App::$config['adminLayoutPath'];\n App::$breadcrumbs->addItem(['text' => 'AdminPanel', 'url' => 'adminlte']);\n App::$breadcrumbs->addItem(['text' => 'Promocode', 'url' => 'promocode']);\n }", "public function initLayout();", "protected function init()\n {\n\n $this->viewPath = '/modules/product/views/productcat';\n $this->layoutPath = App::$config['adminLayoutPath'];\n App::$breadcrumbs->addItem(['text' => 'AdminPanel', 'url' => 'adminlte']);\n App::$breadcrumbs->addItem(['text' => 'Attribute', 'url' => 'productcat']);\n }", "protected function _initNavigation() {\n\t\t$this->bootstrap('layout');\n\t\t\n\t\t// get the view of the layout\n\t\t$layout = $this->getResource('layout');\t\t\n\t\t$view = $layout->getView();\n\t\t\n\t\t//load the navigation xml\n\t\t$config = new Zend_Config_Xml(ROOT_PATH.'/private/navigation.xml','nav');\n\t\t\n \t \n\t\t// pass the navigation xml to the zend_navigation component\n\t\t$nav = new Zend_Navigation($config);\n\t\t\n\t\t\n\t\t\n\t\t// pass the zend_navigation component to the view of the layout \n\t\t$view->navigation($nav);\n\t\t\n\n\t}", "protected function initLayout()\n {\n $showLabels = $this->hasLabels();\n $showErrors = $this->getConfigParam('showErrors');\n $this->mergeSettings($showLabels, $showErrors);\n $this->buildLayoutParts($showLabels, $showErrors);\n }", "protected function _initNavigation() {\n\t\t$this->bootstrap('view');\n\t\t$this->bootstrap('layout');\t\n\t\t\n\t\t// get the view of the layout\n\t\t$layout = $this->getResource('layout');\t\t\n\t\t$view = $layout->getView();\n\t\t\n\t\t//load the navigation xml\n\t\t$config = new Zend_Config_Xml(APPLICATION_PATH.'/configs/navigation.xml','nav');\n\t\t\n\t\t// pass the navigation xml to the zend_navigation component\n\t\t$navigation = new Zend_Navigation($config);\n\t\t\n\t\t// pass the zend_navigation component to the view of the layout \n\t\t$view->navigation($navigation);\n\t}", "public function init() {\n Zend_Layout::startMvc();\n $this->_helper->layout->setLayout('default');\n }", "public function init()\n {\n \t$this->view->layout = array();\n }", "public function init()\n {\n $this->getBootstrap()->bootstrap('view');\n $this->_view = $this->getBootstrap()->getResource('view');\n $this->setHeadLinks();\n }", "public function init()\n {\n $this->_helper->layout()->setLayoutPath(APPLICATION_PATH . \"/layouts/scripts/\");\n $this->_helper->layout()->setLayout('admin');\n }", "public function init()\n {\n $this->_helper->layout()->getView()->headTitle('@PHPoton');\n\n // Set navigation\n $container = Zend_Registry::get('navigation');\n $this->view->navigation(new Zend_Navigation($container));\n }", "public function init() {\n parent::init();\n $this->_breadcrumbs->append(array('Contact', array('action' => 'index', 'controller' => 'contact')));\n\n // Pass variables to view\n $baseUrl = $this->view->baseUrl();\n $this->view->headLink()->appendStylesheet(\"{$baseUrl}/stylesheets/cms_layout.css\", 'screen');\n $this->view->title = 'Contact DG Environment';\n $this->view->showLeftNavigation = true;\n }", "public function init()\n\t{\n\t\t$this -> view -> navigation = $navigation = Engine_Api::_() -> getApi('menus', 'core') -> getNavigation('advmenusystem_admin_main', array(), 'advmenusystem_admin_global_settings');\n\t}", "protected function _constructMainLayout()\n {\n if (class_exists('tracer_class')) {\n tracer_class::marker(array(\n 'create main layout for display',\n debug_backtrace(),\n '#006400'\n ));\n }\n\n if ($this->_get) {\n $typ = $this->_get->pageType();\n } else {\n $typ = NULL;\n }\n\n switch ($typ) {\n case'css': case'js':\n $this->DISPLAY['core'] = '{;css_js;}';\n break;\n\n default:\n $this->layout($this->_defaultOptions['template']);\n break;\n }\n }", "public function init() {\n\t\t// @todo replace with a setTemplate() in t41\\Exception\n\t\tView::setTemplate('default.html');\n\t\t\n\t\t// get page identifiers (module, controller and action)\n\t\tLayout::$module\t\t= $this->_getParam('module');\n\t\tLayout::$controller\t= $this->_getParam('controller');\n\t\tLayout::$action\t\t= $this->_getParam('action');\n\t\t\n\t\t// provide controller with basic information about the current module\n\t\tforeach (Module::getConfig() as $vendor => $modules) {\n\t\t\t\n\t\t\tforeach ($modules as $key => $module) {\n\t\t\t\t\n\t\t\t\tif (isset($module['controller']) && Layout::$module == $module['controller']['base']) {\n\t\t\t\t\t$this->_module = 'app/' . $vendor . '/' . $key;\n\t\t\t\t\tLayout::$vendor = $vendor;\n\t\t\t\t\tLayout::$moduleKey = $key;\n\n\t\t\t\t\t$resource = Layout::$controller;\n\t\t\t\t\tif (Layout::$action) $resource .= '/' . Layout::$action;\n\t\t\t\t\tif (isset($module['controller']['items'])) {\n\t\t\t\t\t\tforeach ($module['controller']['items'] as $controller) {\n\t\t\t\t\t\t\tif ($this->_getCurrentItem($resource, $controller) == true) break;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (isset($module['controllers_extends'])) {\n\t\t\t\t\t\tforeach ($module['controllers_extends'] as $controller) {\n\t\t\t\t\t\t\tif ($this->_getCurrentItem($resource, $controller['items']) == true) break;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function init() {\n parent::init();\n $this->layout = 'static';\n }", "public function init(){\n\t\t$this->_helper->layout->setLayout('layout_login');\n\t}", "public function initialize()\n {\n\t\tparent::initialize();\n\t\t$this->viewBuilder()->layout('admin');\n\t\t\n }", "public function init()\n {\n // $this->_helper->layout->setLayout('userarea');\n }", "protected function _initNavigation()\n {\n $this->bootstrap('layout');\n $this->bootstrap('translate');\n \n $layout = $this->getResource('layout');\n $view = $layout->getView();\n \n // get the platform navigation\n $config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/navigation.ini');\n \n // get the application specific navigation\n $appSpecificNavFile = APPLICATION_PATH . '/configs/navigation-app.ini';\n if(file_exists($appSpecificNavFile)) {\n $appNav = new Zend_Config_Ini($appSpecificNavFile);\n $config = new Zend_Config(array_merge_recursive(\n $config->toArray(), $appNav->toArray()\n ));\n }\n \n // add the navigation to the View \n $navigation = new Zend_Navigation($config);\n $view->navigation($navigation);\n }", "public function initialize()\n {\n $this->initializeUI(['layout' => false]);\n $this->loadHelper('Text');\n $this->loadHelper('Paginator');\n $this->loadHelper('Menu');\n }", "protected function setupLayout() {\n\t\tif ( ! is_null($this->layout)) {\n\n\n\t\t\t$cb_js_var = array(\n\t\t\t\t'site_url' => url('/'),\n\t\t\t\t'admin_url' => url('/admin'),\n\t\t\t\t'admin_assets_url' => asset('packages/vizioart/cookbook/'),\n\t\t\t\t'admin_api_url' => url('/admin/api')\n\t\t\t);\n\n\n\t\t\t$this->layout = View::make($this->layout, array(\n\t\t\t\t'cb_js_var' => $cb_js_var\n\t\t\t));\n\t\t}\n\t}", "public function init()\n {\n $this->view->headScript()->exchangeArray(array());\n $this->view->headScript()->appendFile('http://code.jquery.com/jquery.js','text/javascript');\n $this->view->headScript()->appendFile('http://code.jquery.com/ui/1.10.2/jquery-ui.js','text/javascript');\n $this->view->headScript()->appendFile($this->view->baseUrl('/js/bootstrap.min.js'),'text/javascript');\n $this->view->headLink()->exchangeArray(array());\n $this->view->headLink()->appendStylesheet('http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css'); \n $this->view->headLink()->appendStylesheet($this->view->baseUrl('/css/bootstrap.min.css')); \n //$this->view->headLink()->appendStylesheet($this->view->baseUrl('/css/bootstrap-responsive.min.css')); \n $this->view->headLink()->appendStylesheet($this->view->baseUrl('/css/planner.css')); \n $this->view->doctype('XHTML1_STRICT');\n $this->view->headMeta()->exchangeArray(array());\n $this->view->headMeta()\n ->appendName('keywords', 'Homepage')\n ->appendHttpEquiv('viewport','width=device-width, initial-scale=1.0')\n ->appendHttpEquiv('pragma', 'no-cache')\n ->appendHttpEquiv('Cache-Control', 'no-cache')\n ->appendHttpEquiv('Content-Type','text/html; charset=UTF-8')\n ->appendHttpEquiv('Content-Language', 'en-UK')\n ->appendHttpEquiv('X-UA-Compatible', 'IE=edge,chrome=1');\n \n \n }", "protected function _initNavigation() {\n $this->bootstrap('layout');\n $layout = $this->getResource('layout');\n $view = $layout->getView();\n\n //set top navigation\n $config = new Zend_Config_Xml(APPLICATION_PATH . \"/configs/navigation.xml\", \"TopNavigation\");\n $navigation = new Zend_Navigation($config);\n\n //pass to view\n $view->topNav = $navigation;\n\n //add to zend registry\n Zend_Registry::set('Zend_Navigation', $leftNavigation);\n }", "function initializeFilesLayout() {\n $this->loadFilesMenubar();\n // navigation stuff\n $this->layout->add($this->getSearchPanel());\n $this->layout->add($this->getTagsPanel());\n $this->layout->add($this->getFolderPanel());\n // file list\n $this->layout->add($this->getClipboardPanel());\n $this->layout->add($this->getFilesPanel());\n // dialog\n $this->layout->setParam('COLUMNWIDTH_CENTER', '50%');\n $this->layout->setParam('COLUMNWIDTH_RIGHT', '50%');\n }", "function init() {\n\t\t\t$this->showHeaders();\n\n\t\t\t// Display the CSS content\n\t\t\t$this->createContent();\n\t\t\t$this->showContent();\n\t\t}", "public function init(){\r\n\t\t//Zend_Layout::startMvc($options);\r\n\r\n\r\n\t}", "private function init_menu()\n {\n // it's a sample code you can init some other part of your page\n }", "public function init() {\n\t\t$this->sectionTitle = 'Image Translations';\n\t\t$this->breadcrumbs = array(\n\t\t\t'Image Translations' => array($this->defaultAction),\n\t\t);\n\t}", "public function init() {\n\t\t$this->_helper->layout->disableLayout();\n\t\t$this->_helper->viewRenderer->setNeverRender();\n\t}", "public function init()\r\n\t{\r\n\t\tYii::app()->clientScript->registerScriptFile(\r\n\t\t\t\tYii::app()->getAssetManager()->publish(\r\n\t\t\t\t\tYii::getPathOfAlias(\r\n\t\t\t\t\t\t'ext.bootstrap.vendors.bootstrap.js').'/bootstrap-dropdown.js'));\r\n\r\n\t\tYii::app()->clientScript->registerScript('topbar-dropdown', \"\r\n\t\t\t\t$('#topbar').dropdown()\r\n\t\t\t\t\");\r\n\r\n\t\t// prepare the Navigation, if available\r\n\t\t$route=$this->getController()->getRoute();\r\n\t\t$this->items=$this->normalizeItems($this->items,$route,$hasActiveChild);\r\n\r\n\t\tif(count($this->items))\r\n\t\t{\r\n\t\t\t$this->menu_nav1 = '<ul class=\"nav\">';\r\n\t\t\t$this->menu_nav1 .= $this->renderMenuRecursive($this->items);\r\n\t\t\t$this->menu_nav1 .= '</ul>';\r\n\t\t}\r\n\r\n\t\tif(count($this->items2))\r\n\t\t{\r\n\t\t\t$this->menu_nav2 = '<ul class=\"nav secondary-nav\">';\r\n\t\t\t$this->menu_nav2 .= $this->renderMenuRecursive($this->items2);\r\n\t\t\t$this->menu_nav2 .= '</ul>';\r\n\t\t}\r\n\r\n\r\n\t}", "public function init() {\n $this->_renderLayout = 0;\n }", "protected function init()\n {\n $this->setTitle('core_layout.edit_layout');\n }", "public function init()\r\n {\r\n \t $layout = $this->_helper->layout();\r\n \t $layout->setLayout('twocolumn');\r\n \t // action body\r\n //$bootstrap = Zend_Controller_Front::getInstance()->getParam('bootstrap');\r\n \t \r\n \r\n \r\n }", "public function init()\n {\n // Control usuario autenticado\n if (!Zend_Auth::getInstance()->hasIdentity()) {\n $this->_redirect('/default/login/login');\n }\n \n // Setear Layout Principal\n $this->_helper->layout->setLayout('layout');\n \n // Definir home de usuario\n $this->setHomePage();\n \n // Inicializacion de Contextos\n $this->getContextSwitch()\n ->setAutoJsonSerialization(false)\n ->initContext();\n }", "protected function initTreeView() {\n $this->validateSourceData();\n $this->_module = Yii::$app->controller->module;\n if (empty($this->emptyNodeMsg)) {\n $this->emptyNodeMsg = Yii::t(\n 'kvtree', 'No valid tree nodes are available for display. Use toolbar buttons to add tree nodes.'\n );\n }\n $this->_hasBootstrap = $this->showTooltips;\n $this->breadcrumbs += [\n 'depth' => null,\n 'glue' => ' &raquo; ',\n 'activeCss' => 'kv-crumb-active',\n 'untitled' => Yii::t('kvtree', 'Untitled'),\n ];\n }", "protected function setupLayout() {\n\t\tif (!is_null($this -> layout)) {\n\t\t\t$this -> layout = View::make($this -> layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout, $this->_data);\n\t\t\t$this->layout->content = null;\n\t\t\t$this->layout->currentProject = null;\n\t\t}\n\t}", "public function initDisplay(){\n\t\tif (!$this->getPage()){\n\t\t\tif (\\Settings::DISPLAY_BREADCRUMB) Front::displayBreadCrumb($this->breadCrumb, $this->version);\n\t\t\t$this->mainDisplay();\n\t\t}\n\t}", "public function init()\n {\n \t$arr_sitemap_nodes_main = CMS_Model_CMSSitemap::getSitemapByHandle('MAIN')->getSitemapNodes(6);\n \t\n \t$this->view->assign('arr_sitemap_nodes_main',$arr_sitemap_nodes_main);\n }", "protected function init()\n {\n $this->setTitle('core_layout.edit_layout');\n $this->addElement([\n 'plugin' => 'hidden',\n 'name' => 'base_script',\n 'value' => 'view'\n ]);\n $this->addElement([\n 'plugin' => 'hidden',\n 'name' => 'item_script',\n 'value' => 'view',\n ]);\n }", "public function init() {\n\t\t$this->getFrontController()->addModuleDirectory(APPLICATION_PATH . '/modules');\n\n\t\t// initialize navigation\n\t\t$this->_initNavigation();\n\t}", "public function init()\n {\n\t\t$this->view->headTitle(Zend_Registry::get('Default Page Title'));\n\t\t$this->view->headTitle()->prepend('Partners');\n }", "public function initialize()\n {\n // set base template\n $this->view->setTemplateBefore('default');\n }", "public function init() {\n\t\tif ($this->breadState <= 0 ) unset($_SESSION['breadcrumb']);\n\t\tif ($this->breadState >= 0) {\n\t\t\t// Recupère le tableau en session\n\t\t\t$this->breadcrumb = isset($_SESSION['breadcrumb'])?$_SESSION['breadcrumb']:[];\n\t\t\tif (($posKey = $this->hasBread($this->breadKey)) === false) {\n\t\t\t\t$i = count($this->breadcrumb);\n\t\t\t\t$this->breadcrumb[$i]['title'] = $this->breadKey;\n\t\t\t\t$this->breadcrumb[$i]['url'] = $_SERVER['REQUEST_URI'];\n\t\t\t}else{\n\t\t\t\t$this->breadcrumb = array_splice($this->breadcrumb,0, $posKey+1);\n\t\t\t}\n\n\t\t\t//$posKey = array_search($this->breadKey, array_keys($this->breadcrumb))+1;\n\t\t\t//\n\t\t\t$_SESSION['breadcrumb'] = $this->breadcrumb;\n\t\t}\n\t}", "public function layout() {\n $this->CI = & get_instance();\n\n if (isset($this->CI->layout) && $this->CI->layout == 'none') {\n return;\n }\n \n // set data\n $dir = $this->CI->router->directory;\n $class = $this->CI->router->fetch_class();\n $method = $this->CI->router->fetch_method();\n $method = ($method == 'index') ? $class : $method;\n $data = (isset($this->CI->data)) ? $this->CI->data : array();\n $data['current_controller'] = base_url() . $dir . $class . '/';\n $page_info = $this->GetPageInfoByFile($class);\n $id_auth_menu = $page_info['id_auth_menu'];\n $data['base_url'] = base_url();\n $data['current_url'] = current_url();\n if (isset($_SESSION['ADM_SESS'])) {\n $data['ADM_SESSION'] = $_SESSION['ADM_SESS'];\n }\n $data['flash_message'] = $this->CI->session->flashdata('flash_message');\n $data['persistent_message'] = $this->CI->session->userdata('persistent_message');\n \n $data['auth_sess'] = $this->CI->session->userdata('ADM_SESS');\n $data['site_setting'] = get_sitesetting();\n $data['site_info'] = get_site_info();\n $data['page_title'] = (isset($data['page_title'])) ? $data['page_title'] : $page_info['menu'];\n \n $menus = $this->MenusData();\n $data['left_menu'] = $this->PrintLeftMenu($menus,$class);\n\n $data['save_button_text'] = 'Save';\n $data['cancel_button_text'] = 'Cancel';\n \n $breadcrumbs = $this->Breadcrumbs($id_auth_menu);\n $breadcrumbs[] = array(\n 'text'=>'<i class=\"fa fa-dashboard\"></i> Dashboard',\n 'url'=>site_url('dashboard'),\n 'class'=>''\n );\n array_multisort($breadcrumbs,SORT_ASC,SORT_NUMERIC);\n if (isset($data['breadcrumbs'])) {\n $breadcrumbs[] = $data['breadcrumbs'];\n }\n $data['breadcrumbs'] = $breadcrumbs;\n \n if (isset($data['template'])) {\n $data['content'] = $this->CI->load->view(TEMPLATE_DIR.'/'.$data['template'], $data, true);\n } else {\n $data['content'] = $this->CI->load->view(TEMPLATE_DIR.'/'.$class . '/' . $method, $data, true);\n }\n if (isset($this->CI->layout)) {\n $layout = TEMPLATE_DIR.'/layout/'.$this->CI->layout;\n } elseif ($this->CI->input->is_ajax_request()) {\n $layout = TEMPLATE_DIR.'/layout/blank';\n } else {\n $layout = TEMPLATE_DIR.'/layout/default';\n }\n\n if($this->CI->input->get('debug') == 'true') {\n echo '<pre>';\n print_r($data);\n die();\n } \n\n $this->CI->load->view($layout, $data);\n }", "public function init() {\n\t\t\t\t\t\t$this->view->controller = $this->_request->getParam ( 'controller' );\n\t\t\t\t\t\t$this->view->action = $this->_request->getParam ( 'action' );\n\t\t\t\t\t\t$this->getLibBaseUrl = new Zend_View_Helper_BaseUrl ();\n\t\t\t\t\t\t$this->GetModelOrganize = new Application_Model_ModOrganizeDb ();\n\t\t\t\t\t\t$this->_helper->ajaxContext->addActionContext('deleteOrganisme1','json')->initContext();\n\t\t\t\t\t\t// call function for dynamic sidebar\n\t\t\t\t\t\t$this->_Categories = new Application_Model_ModCatTerm ();\n\t\t\t\t\t\t$parent_id = $this->_getParam ( 'controller' );\n\t\t\t\t\t\t$this->view->secondSideBar = $this->_Categories->showCateParent ( $parent_id );\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t}", "public function init()\n {\n $this->sysConfig = Zend_Registry::get('sysConfig');\n\t\t$this->view->sysConfig = $this->sysConfig;\n\t\t\n\t\t$this->config = Zend_Registry::get('config');\n\t\t$this->view->config = $this->config;\n\t\t\n\t\t$this->db=Zend_Registry::get('db');\n\t\t\n\t\t//controller and action names\n\t\t$this->controllerName = $this->getRequest()->getControllerName();\n\t\t$this->view->controllerName = $this->controllerName;\n\t\t\n\t\t$this->actionName = $this->getRequest()->getActionName();\n\t\t$this->view->actionName = $this->actionName;\n\t\t\n\t\t$this->view->baseurl=$this->config->common->baseUrl.\"/\";\n\t\t$this->view->cssurl=$this->config->common->cssPath;\n\t\t$this->view->jsurl=$this->config->common->jsPath;\n\n $this->view->items = \"\";\n $this->view->dashboard = \"\";\n $this->view->cnews = \"\";\n $this->view->expenditure = \"\";\n \n \n }", "public function init() {\n $this->_helper->layout()->disableLayout(); \n $this->_helper->viewRenderer->setNoRender(true);\n }", "function init()\n\t{\n\t\t// Ghetto fix for formText problem\n\t\t$this->view->addHelperPath(ROOT_DIR . '/library/Zarrar/View/HelperFix', 'Zarrar_View_HelperFix');\n\t\t\n\t\t// Disable header file\n\t\t$this->view->headerFile = '_empty.phtml';\n\t\t\n\t\t// Add stylesheet for table\n\t\t$this->view\n\t\t\t->headLink()\n\t\t\t->appendStylesheet(\"{$this->view->dir_styles}/oranges-in-the-sky.css\");\n\t\t\t\n\t\t// Instantiate table for later usage\n\t\t$this->_table = new Study();\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout) && ! $this->is_pjax())\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "function initLayout(){\n $layout = array(\n 'left' => array(\n 'ProfileInfo' => array(\n 'title' => 'Profile Info',\n 'minimize' => false,\n ),\n 'EmailInboxMenu' => array(\n 'title' => 'Inbox Menu',\n 'minimize' => false,\n ),\n 'ActionMenu' => array(\n 'title' => 'Actions',\n 'minimize' => false,\n ),\n 'TopContacts' => array(\n 'title' => 'Top Contacts',\n 'minimize' => false,\n ),\n 'RecentItems' => array(\n 'title' => 'Recently Viewed',\n 'minimize' => false,\n ),\n 'ActionTimer' => array(\n 'title' => 'Action Timer',\n 'minimize' => true,\n ),\n 'UserCalendars' => array(\n 'title' => 'User Calendars',\n 'minimize' => false,\n ),\n 'CalendarFilter' => array(\n 'title' => 'Filter',\n 'minimize' => false,\n ),\n 'GroupCalendars' => array(\n 'title' => 'Group Calendars',\n 'minimize' => false,\n ),\n 'FilterControls' => array(\n 'title' => 'Filter Controls',\n 'minimize' => false,\n ),\n 'SimpleFilterControlEventTypes' => array(\n 'title' => 'Event Types',\n 'minimize' => false,\n ),\n ),\n 'right' => array(\n 'SmallCalendar' => array(\n 'title' => 'Small Calendar',\n 'minimize' => false,\n ),\n 'ChatBox' => array(\n 'title' => 'Activity Feed',\n 'minimize' => false,\n ),\n 'GoogleMaps' => array(\n 'title' => 'Google Map',\n 'minimize' => false,\n ),\n 'OnlineUsers' => array(\n 'title' => 'Active Users',\n 'minimize' => false,\n ),\n 'TagCloud' => array(\n 'title' => 'Tag Cloud',\n 'minimize' => false,\n ),\n 'TimeZone' => array(\n 'title' => 'Clock',\n 'minimize' => false,\n ),\n 'SmallCalendar' => array(\n 'title' => 'Calendar',\n 'minimize' => false,\n ),\n 'QuickContact' => array(\n 'title' => 'Quick Contact',\n 'minimize' => false,\n ),\n 'MediaBox' => array(\n 'title' => 'Files',\n 'minimize' => false,\n ),\n ),\n 'hiddenRight' => array(\n 'ActionMenu' => array(\n 'title' => 'My Actions',\n 'minimize' => false,\n ),\n 'MessageBox' => array(\n 'title' => 'Message Board',\n 'minimize' => false,\n ),\n 'NoteBox' => array(\n 'title' => 'Note Pad',\n 'minimize' => false,\n ),\n 'DocViewer' => array(\n 'title' => 'Doc Viewer',\n 'minimize' => false,\n ),\n 'TopSites' => array(\n 'title' => 'Top Sites',\n 'minimize' => false,\n ),\n ),\n );\n if(Yii::app()->contEd('pro')){\n if(file_exists('protected/config/proWidgets.php')){\n foreach(include('protected/config/proWidgets.php') as $loc=>$data){\n if (isset ($layout[$loc]))\n $layout[$loc] = array_merge($layout[$loc],$data);\n }\n }\n }\n return $layout;\n }", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\n\t\t$this->setLocale();\n\t}", "public function init() {\n $this->modulesInTopMenu = array(\n 'admin' => array('admin', 'admin/account', 'admin/rbac', 'admin/scheduler', 'admin/sys', 'admin/i18n', 'admin/seo'),\n 'nivoSlider'=>array('admin/nivoSlider'),\n );\n /* Top menu */\n $this->topMenus = array(\n array('label' => 'General', 'url' => array('/admin/default/index'), 'active' => in_array(Yii::app()->controller->module->id, $this->modulesInTopMenu['admin'])),\n array('label' => 'Nivo Slider', 'url' => array('/admin/nivoSlider/sliderImage'), 'active' => in_array(Yii::app()->controller->module->id, $this->modulesInTopMenu['nivoSlider'])),\n array('label' => 'Logout', 'url' => array('/site/logout'), 'itemOptions' => array('style' => 'float:right')),\n );\n\n /* Sidebar Items */\n $this->sidebarItems = array(\n 'admin' => array(\n array('name' => 'RBAC - Account Management', 'items' => array(\n array('label' => 'Manage accounts', 'url' => array('/admin/account/act/admin'), 'active' => Common::checkMCA('admin/account', 'act', 'admin')),\n array('label' => 'Accounts Statistics', 'url' => array('/admin/account/act/statistics'), 'active' => Common::checkMCA('admin/account', 'act', 'statistics')),\n array('label' => 'Add New Authorization', 'url' => array('/admin/rbac/action/create'), 'active' => Common::checkMCA('admin/rbac', 'action', 'create')),\n array('label' => 'Manage RBAC', 'url' => array('/admin/rbac/action/admin'), 'active' => Common::checkMCA('admin/rbac', 'action', 'admin')),\n array('label' => 'Users Activities', 'url' => array('/admin/account/userLog/admin'), 'active' => Common::checkMCA('admin/account', 'userLog', 'admin')),\n ),\n ),\n array('name' => 'I18N', 'items' => array(\n array('label' => 'Add New Language', 'url' => array('/admin/i18n/action/create'), 'active' => Common::checkMCA('admin/i18n', 'action', 'create')),\n array('label' => 'Manage Languages', 'url' => array('/admin/i18n/action/admin'), 'active' => Common::checkMCA('admin/i18n', 'action', 'admin')),\n )\n ),\n array('name' => 'Scheduler', 'items' => array(\n array('label' => 'Add New System Scheduler', 'url' => array('/admin/scheduler/action/create'), 'active' => Common::checkMCA('admin/scheduler', 'action', 'create')),\n array('label' => 'Manage System Scheduler', 'url' => array('/admin/scheduler/action/admin'), 'active' => Common::checkMCA('admin/scheduler', 'action', 'admin')),\n )\n ),\n array('name' => 'System Information', 'items' => array(\n array('label' => 'View Information', 'url' => array('/admin/sys/action/info'), 'active' => Common::checkMCA('admin/sys', 'action', 'info')),\n array('label' => 'View System logs', 'url' => array('/admin/sys/action/listLog'), 'active' => Common::checkMCA('admin/sys', 'action', 'listLog')),\n array('label' => 'View User Agents', 'url' => array('/admin/sys/action/userAgent'), 'active' => Common::checkMCA('admin/sys', 'action', 'userAgent')),\n array('label' => 'View Email Queues', 'url' => array('/admin/sys/action/emailQueue'), 'active' => Common::checkMCA('admin/sys', 'action', 'emailQueue')),\n array('label' => 'General Settings', 'url' => array('/admin/sys/action/setting'), 'active' => Common::checkMCA('admin/sys', 'action', 'setting')),\n array('label' => 'Clear Cache', 'url' => array('/admin/default/clearCache'), 'active' => Common::checkMCA('admin', 'action', 'clearCache')),\n )\n ),\n\n array('name' => 'Static Pages', 'items' => array(\n array('label' => 'About', 'url' => array('/admin/default/staticPage', 'page' => 'about')),\n array('label' => 'Site Disclaimer', 'url' => array('/admin/default/staticPage', 'page' => 'disclaimer')),\n array('label' => 'Privacy Policy', 'url' => array('/admin/default/staticPage', 'page' => 'privacyPolicy')),\n array('label' => 'Guidelines', 'url' => array('/admin/default/staticPage', 'page' => 'guidelines')),\n )\n ),\n ),\n 'nivoSlider' => array(\n array('name' => 'Nivo Slider', 'items' => array(\n array('label' => 'Manage', 'url' => array('/admin/nivoSlider/sliderImage/admin'), 'active' => Common::checkMCA('admin/nivoSlider', 'sliderImage', 'admin')),\n array('label' => 'Create', 'url' => array('/admin/nivoSlider/sliderImage/create'), 'active' => Common::checkMCA('admin/nivoSlider', 'sliderImage', 'create')),\n ),\n ),\n ), \n );\n }", "protected function _initDoctype()\r\n {\r\n// $this->bootstrap('view');\r\n// $view = $this->getResource('view');\r\n//\r\n// $view->headTitle('Module Frontend');\r\n// $view->headLink()->appendStylesheet('/css/clear.css');\r\n// $view->headLink()->appendStylesheet('/css/main.css');\r\n// $view->headScript()->appendFile('/js/jquery.js');\r\n// $view->doctype('XHTML1_STRICT');\r\n //$view->navigation = $this->buildMenu();\r\n }", "public function init()\n {\n \t$this->_helper->viewRenderer->setNoRender(true);\n \t$this->_helper->layout->disableLayout();\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->addBreadcrumbRoute(trans('foundation::sidebar.system'), 'admin::foundation.system.information.index');\n }", "public function action_init()\n\t{\n\t\t$this->add_template( 'menus_admin', dirname( __FILE__ ) . '/menus_admin.php' );\n\t\t$this->add_template( 'menu_iframe', dirname( __FILE__ ) . '/menu_iframe.php' );\n\t\t$this->add_template( 'block.menu', dirname( __FILE__ ) . '/block.menu.php' );\n\n\t\t// formcontrol for tokens\n\t\t$this->add_template( 'text_tokens', dirname( __FILE__ ) . '/formcontrol_tokens.php' );\n\t}", "public function Init() {\n\t\t\n\t\t$this->exceptions = TRUE;\n\t\t$this->SetAccess(self::ACCESS_ANY);\n\t\t$this->access_groups = array('admin','user','any');\n\t\t$this->current_group = 'any';\n\t\t$this->AccessMode(1);\n\t\t$this->SetModel(SYS.M.'menudata');\n\t\t$this->only_registered(FALSE);\n\t\tif(Helper::Get('admin'.S.'menu') == '')\n\t\t//$this->SetView(SYS.V . \"elements:nav\");\n\t\t$this->Inc(SYS.M.'model');\n\t}", "public function init()\n {\n \t$this->view->headTitle('Produktgruppen');\n\t\t$this->db = Zend_Registry::get('db');\n\t\t$this->logger = Zend_Registry::get('logger');\n }", "protected function _initNavigation()\n {\n $config = $this->_getConfig();\n\n if (!empty($config)) {\n $container = new Zend_Navigation($config);\n\n Zend_Layout::getMvcInstance()->getView()->navigation($container);\n\n if (Zend_Registry::isRegistered('Zend_Translate') && Zend_Registry::isRegistered('Zend_Acl')) {\n $acl = Zend_Registry::get('Zend_Acl');\n $translator = Zend_Registry::get('Zend_Translate');\n\n $identity = Zend_Auth::getInstance()->getIdentity();\n $role = $identity ? $identity->role : 'guest';\n\n Zend_Layout::getMvcInstance()->getView()->navigation()\n ->setAcl($acl)\n ->setRole($role)\n ->setTranslator($translator);\n }\n }\n }", "public function init() {\n\t\tAnnuaire_User::mustBeConnected();\n\t\t$this->view->setLayout(\"default\");\n\t\t$this->view->addLayoutVar(\"onglet\", 4);\n\t}", "protected function setupLayout() {\n\t\tif ( ! is_null($this->layout)) {\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "function _navSetup()\n\t{\n\t\t// get the path to the current page\n\t\t$this->path = $this->getPath($this->area, $this->page);\n\t\t\n\t\t// reset the navigational elements\n\t\t$this->nav = array();\n\t\t\n\t\t// we use the view URL a lot\n\t\t$view_url = $this->parse->getRenderConf('xhtml', 'wikilink', 'view_url');\n\t\t\n\t\t// is there a path? (if not, the page is not on the map)\n\t\tif (count($this->path) > 0) {\n\t\t\t\n\t\t\t// get nav elements leading to this page...\n\t\t\tforeach ($this->path as $key => $val) {\n\t\t\t\t\t\n\t\t\t\tif ($key == 0) {\n\t\t\t\t\n\t\t\t\t\t// get the map tops\n\t\t\t\t\t$this->nav[$key] = $this->_tops($val, $view_url);\n\t\t\t\t\t\n\t\t\t\t} elseif (isset($this->path[$key-1])) {\n\t\t\t\t\n\t\t\t\t\t// get children\n\t\t\t\t\t$prev_page = $this->path[$key-1];\n\t\t\t\t\t$this->nav[$key] = $this->_kids($prev_page, $val, $view_url);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\n\t\t\t// and get the first nav element below this page.\n\t\t\t$prev_page = $val;\n\t\t\t$this->nav[$key+1] = $this->_kids($prev_page, $this->page,\n\t\t\t\t$view_url, true);\n\t\t\t\n\t\t} else {\n\n\t\t\t// Set the nav element to the top level page list for the area, so\n\t\t\t// that the list of top level pages is shown even if we move outside\n\t\t\t// the area map.\n\t\t\t$this->nav[0] = $this->_tops(\"\", $view_url);\n\t\t}\n\t\t\t\n\t\t\n\t\t// nav to AreaMap, edit, history, and links\n\t\t$this->nav['map'] =\tsprintf($view_url, 'AreaMap');\n\t\t$this->nav['history'] = sprintf($view_url, $this->page) . '&view=history';\n\t\t$this->nav['links'] = sprintf($view_url, $this->page) . '&view=links';\n\t\t$this->nav['source'] = sprintf($view_url, $this->page) . '&view=source';\n\t\t$this->nav['rss'] = sprintf($this->conf['absolute_url'].\"rss.php?area=%s&page=%s\", $this->area, $this->page);\n\t\t$this->nav['edit'] = sprintf($this->conf['absolute_url'].\"edit.php?area=%s&page=%s\", $this->area, $this->page);\n\t}", "protected function _generateBreadcrumb()\r\n {\r\n $links = null;\r\n $texthomelink = $this->view->translate('id_menu_home');\r\n // id_title_overseas = 'Overseas Representatives'\r\n $title = $this->view->translate('id_title_overseas');\r\n $links = array(\r\n $texthomelink => $this->view->baseUrl('/'),\r\n $title => '',\r\n );\r\n $this->view->pageTitle = $title;\r\n\r\n Zend_Registry::set('breadcrumb', $links);\r\n }", "public function init()\n {\n \tparent::init();\n \t$this->view->headTitle('Wedding Cakes');\n }", "public function init() {\n\t\t$this->_helper->layout->setLayout('default');\n\t\t$this->_helper->AjaxContext()->addActionContext('registration', 'json')->initContext('json');\n\t\t$this->_helper->AjaxContext()->addActionContext('login', 'json')->initContext('json');\n }", "public function init() {\n $menu = \"<li><a href=\\\" /eu-zone/new \\\">Ajouter zone</a></li>\";\n $this->view->placeholder(\"menu\")->set($menu);\n $this->view->jQuery()->enable();\n $this->view->jQuery()->uiEnable();\n }", "public function initialize() {\n parent::initialize();\n Gdn_Theme::section('Dashboard');\n }", "protected function _initAction() {\n $this->loadLayout()\n ->_setActiveMenu($this->_menu_path)\n ->_addBreadcrumb(\n Mage::helper('adminhtml')->__('Manage Supply Needs'), Mage::helper('adminhtml')->__('Manage Supply Needs')\n );\n return $this;\n }", "public function init(){\n parent::init();\n $this->_editor = $this->_helper->layoutEditor();\n }", "public function init()\n {\n\t\tif(!Zend_Auth::getInstance()->hasIdentity())\n {\n $this->_redirect('registration/unregistered');\n }\t\n\t\tZend_Loader::loadClass('Menu',APPLICATION_PATH.'/views/helpers');\n\t\tZend_Loader::loadClass('Users',APPLICATION_PATH.'/models');\n\t\tZend_Loader::loadClass('EditProfile',APPLICATION_PATH.'/forms');\n\t\tZend_Loader::loadClass('Password',APPLICATION_PATH.'/forms');\n\t\tZend_Loader::loadClass('Profile',APPLICATION_PATH.'/models');\n\t\tZend_Loader::loadClass('ThemeForm',APPLICATION_PATH.'/forms');\n\t\tZend_Loader::loadClass('Themes',APPLICATION_PATH.'/models');\n\t\t$this->view->title = \"Universtiyifo\";\n\t\t$this->view->headTitle($this->view->title);\n\t\t$menu = new Menu();\n\t\t$this->view->menu = $menu->menuList('custom');\n }", "public function init() {\n // you may place code here to customize the module or the application\n\n $this->layout = 'main';\n \n // import the module-level models and components\n $this->setImport(array(\n 'admin.models.*',\n 'admin.components.*',\n 'admin.modules.user.*',\n ));\n Yii::app()->setComponents(array(\n 'user' => array(\n 'loginUrl' => Yii::app()->createUrl('/admin/login'),\n 'class' => 'application.modules.admin.modules.auth.components.AuthWebUser',\n )));\n }", "protected function setupLayout()\n\t{\n\t\tif (!is_null($this->layout)) {\n\t\t\t$this->layout = view($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif (!is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}" ]
[ "0.7769389", "0.7754672", "0.73567986", "0.73234093", "0.73107165", "0.73003924", "0.72883683", "0.7241525", "0.7203935", "0.7172953", "0.7163712", "0.7099175", "0.707214", "0.7066271", "0.7064472", "0.7058681", "0.7046637", "0.6979112", "0.6965803", "0.6953914", "0.69362223", "0.6921668", "0.69207203", "0.69066024", "0.6893037", "0.6871812", "0.6839345", "0.6807445", "0.67476386", "0.67398953", "0.6717306", "0.67097515", "0.66911006", "0.6684457", "0.6657389", "0.6646017", "0.65955865", "0.6543896", "0.6543358", "0.6538468", "0.6536236", "0.653288", "0.6528691", "0.6517367", "0.65103066", "0.6474956", "0.6472619", "0.64669776", "0.64579725", "0.64535624", "0.6442672", "0.64424866", "0.642688", "0.64154005", "0.64063513", "0.6389384", "0.63753486", "0.63716096", "0.6371081", "0.636586", "0.6348921", "0.6347346", "0.6344569", "0.63396853", "0.6338783", "0.6331852", "0.63308597", "0.6328003", "0.63233924", "0.63218653", "0.6320346", "0.6315719", "0.63141793", "0.63062346", "0.63025427", "0.63013524", "0.6299285", "0.62948054", "0.62941426", "0.6293746", "0.6286849", "0.62858415", "0.62858415", "0.62858415", "0.62858415", "0.62858415", "0.62858415", "0.62858415", "0.62858415", "0.62858415", "0.62858415", "0.62858415", "0.62858415", "0.62858415", "0.62858415", "0.62858415", "0.62858415", "0.62858415", "0.62858415", "0.62858415", "0.62858415" ]
0.0
-1
Configuration wizard edit action
protected function _editAction($actionName) { $this->initConfig($actionName); $configPage = Mage::registry('novalnet_wizard_config_page'); Mage::getSingleton('adminhtml/config_data') ->setSection($configPage->getData('codes/section')) ->setWebsite($configPage->getData('codes/website')) ->setStore($configPage->getData('codes/store')); $this->_initAction(); $this->renderLayout(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit()\n {\n $id = $this->configService->getValue('ml_app_id');\n $key = $this->configService->getValue('ml_app_key');\n $country = $this->configService->getValue('ml_app_country');\n return $this->configForm->configPage($id, $key, $country);\n }", "public function editAction()\n {\n parent::editAction();\n $this->_fillMappingsArray();\n $this->_fillAvailableProperties();\n }", "function before_edit_configuration() { }", "public function editstepsAction(){\n\n\t echo $this->ModelObj->updatesteps($this->Request); exit;\n\n\t}", "public function editAction()\n {\n $this->createEditParameters = $this->createEditParameters + $this->_editExtraParameters;\n\n parent::editAction();\n }", "public function editAction() {\n $entities = $this\n ->_getRepository()\n ->findAllOrdered();\n $entities = $this->_transformAllConfigEntities($entities);\n $form = $this->createForm(new ConfigType(), array(\n 'configentities' => $entities,\n ));\n\n return array(\n 'form' => $form->createView(),\n );\n }", "public function editAction() {}", "public function annimalEditAction()\n {\n }", "public function settingsAction ()\n {\n $this->_pageTitle = ['Healthcheck', 'Settings'];\n $this->_navigation->setActiveStep(HealthCheckStepsModel::STEP_SETTINGS);\n\n if ($this->getRequest()->isPost())\n {\n $postData = $this->getRequest()->getPost();\n\n if (!isset($postData['goBack']))\n {\n $this->saveClientSettingsForm($postData);\n $this->saveHealthcheck();\n\n if (isset($postData['saveAndContinue']))\n {\n $this->updateHealthcheckStepName();\n $this->saveHealthcheck();\n $this->gotoNextNavigationStep($this->_navigation);\n }\n }\n else\n {\n $this->gotoPreviousNavigationStep($this->_navigation);\n }\n }\n else\n {\n $this->showClientSettingsForm();\n }\n }", "public function _editAction() {\n\t\t\n\t\t$args = $this->getAllArguments ();\n\t\t\n\t\tif (array_key_exists ( 'cid', $args )) {\n\t\t\t$action_id = $args ['cid'] [0];\n\t\t} else {\n\t\t\t$action_id = @$args [3] ? @$args [3] : $args [1];\n\t\t}\n\t\t\n\t\t$field = $this->getModel ( 'field' );\n\t\t$field->getAllWhere ( 'form_id = \"' . ( int ) $this->_getFormId () . '\"' );\n\t\t\n\t\t$action = $this->getModel ( 'action' );\n\t\t$action->get ( ( int ) $action_id );\n\t\t\n\t\t$this->loadPluginModel ( 'actions' );\n\t\t\n\t\t$this->setView ( 'edit_action' );\n\t\n\t}", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function editAction() {\n# process the edit form.\n# check the post data and filter it.\n\t\tif(isset($_POST['cancel'])) {\n\t\t\tAPI::Redirect(API::printUrl($this->_redirect));\n\t\t}\n\t\t$input_check = $this->_model->check_input($_POST);\n\t\tif(is_array($input_check)) {\n\t\t\tAPI::Error($input_check);\n\t\t\tAPI::redirect(API::printUrl($this->_redirect));\n\t\t}\n\t\t// all hooks will stack their errors onto the API::Error stack\n\t\t// but WILL NOT redirect.\n\t\tAPI::callHooks(self::$module, 'validate', 'controller', $_POST);\n\t\tif(API::hasErrors()) {\n\t\t\tAPI::redirect(API::printUrl($this->_redirect));\n\t\t}\n\n\t\t$this->_model->set_data($_POST);\n\n\t\t// auto call the hooks for this module/action\n\t\tAPI::callHooks(self::$module, 'save', 'controller');\n\n\t\tAPI::redirect(API::printUrl($this->_redirect));\n\n\n\t}", "public function edit()\n\t{\n\t\t//\n\t}", "protected function editTaskAction() {}", "public function edit()\r\n\r\n {\r\n\r\n $this->page_title->push(lang('menu_products_add'));\r\n\r\n $this->data['pagetitle'] = $this->page_title->show();\r\n\r\n\r\n /* Breadcrumbs :: Common */\r\n\r\n $this->breadcrumbs->unshift(1, lang('menu_products_add'), 'admin/setup/product/edit');\r\n\r\n\r\n /* Breadcrumbs */\r\n\r\n $this->data['breadcrumb'] = $this->breadcrumbs->show();\r\n\r\n\r\n /* Data */\r\n\r\n $this->data['error'] = NULL;\r\n\r\n $this->data['charset'] = 'utf-8';\r\n\r\n $this->data['form_url'] = 'admin/setup/product/update';\r\n\r\n\r\n /* Load Template */\r\n\r\n $this->template->admin_render('admin/products/edit', $this->data);\r\n\r\n\r\n }", "public function edit() {\n\t\t\t\n\t\t}", "public function editAction()\r\n {\r\n }", "public function edit(Configuration $configuration)\n {\n //\n }", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function editConfig() {\n\t\tif(!$this->_configId) throw new Exception(lang('error_4'));\n\t\tif(!$this->_configTitle) throw new Exception(lang('error_4'));\n\t\tif(!$this->_configDatabase) throw new Exception(lang('error_4'));\n\t\tif(!$this->_configTable) throw new Exception(lang('error_4'));\n\t\tif(!$this->_configCreditsCol) throw new Exception(lang('error_4'));\n\t\tif(!$this->_configUserCol) throw new Exception(lang('error_4'));\n\t\tif(!$this->_configUserColId) throw new Exception(lang('error_4'));\n\t\t\n\t\t$data = array(\n\t\t\t'id' => $this->_configId,\n\t\t\t'title' => $this->_configTitle,\n\t\t\t'database' => $this->_configDatabase,\n\t\t\t'table' => $this->_configTable,\n\t\t\t'creditscol' => $this->_configCreditsCol,\n\t\t\t'usercol' => $this->_configUserCol,\n\t\t\t'usercolid' => $this->_configUserColId,\n\t\t\t'checkonline' => $this->_configCheckOnline,\n\t\t\t'display' => $this->_configDisplay,\n\t\t\t'phrase' => $this->_configPhrase\n\t\t);\n\t\t\n\t\t$query = \"UPDATE \"._WE_CREDITSYS_.\" SET \"\n\t\t\t. \"config_title = :title, \"\n\t\t\t. \"config_database = :database, \"\n\t\t\t. \"config_table = :table, \"\n\t\t\t. \"config_credits_col = :creditscol, \"\n\t\t\t. \"config_user_col= :usercol, \"\n\t\t\t. \"config_user_col_id = :usercolid,\"\n\t\t\t. \"config_checkonline = :checkonline, \"\n\t\t\t. \"config_display = :display, \"\n\t\t\t. \"config_phrase = :phrase \"\n\t\t\t. \"WHERE config_id = :id\";\n\t\t\n\t\t$editConfig = $this->db->query($query, $data);\n\t\tif(!$editConfig) throw new Exception(lang('error_141'));\n\t}", "public function actionEdit()\n\t{\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t\n\t\t\n\t\t$this->checkUser();\n\t\t$this->checkActivation();\n\t//\t$model = new Estate;\n\t\t\n\t\tif($model===null)\n\t\t{\n\t\t\tif(isset($_GET['id']))\n\t\t\t\t$model=Estate::model()->findbyPk($_GET['id']);\n\t\t\tif($model===null)\n\t\t\t\tthrow new CHttpException(404, Yii::t('app', 'The requested page does not exist.'));\n\t\t}\n\t\t\n\t\tif($model->user_id != Yii::app()->user->id) {\n\t\t\tthrow new CHttpException(503, Yii::t('app', 'Нет прав'));\n\t\t\treturn true;\n\t\t}\n\t\t//$model->city = (int)Yii::app()->request->getParam('city_id', 1);\n\t\t//$model->type = Yii::app()->request->getParam('type', 'flat');\n\t\t//if(!in_array($model->type, array('house','flat','new','commercial','land'))) {\n\t\t//\t$model->type = 'flat';\n\t\t//}\n\t\t\n\t\t$type = Yii::app()->request->getParam('type');\t\n\t\t\n\t\tif($type) {\n\t\t\tif(in_array($type, array('house','flat','new','commercial','land'))) {\n\t\t\t\t$model->type = $type;\n\t\t\t} else {\n\t\t\t\t$model->type = 'flat';\n\t\t\t}\n\t\t}\n\t\t\n\t\t$subtype = Yii::app()->request->getParam('subtype');\t\n\t\t\n\t\tif($subtype) {\n\t\t\tif(in_array($subtype, array('sale','rent'))) {\n\t\t\t\t$model->subtype = $subtype;\n\t\t\t} else {\n\t\t\t\t$model->subtype = 'sale';\n\t\t\t}\n\t\t}\n\t\tif($model->type == 'new') $model->subtype = 'sale';\n\n\t\t$images = $model->attached_images;\n\t\t$type_config=EstateConfig::model()->findByAttributes(array('type'=> $model->type));\n\t\t$fields_main = EstateConfigNew::model()->findAllByAttributes(array('type_'.$model->type => true, 'parent'=>'', 'block' => 'main','admin'=>false),array('order'=>'sorting ASC'));\n\t\t$fields_sub = EstateConfigNew::model()->findAllByAttributes(array('type_'.$model->type => true,'parent'=>'', 'block' => 'sub','admin'=>false),array('order'=>'sorting ASC'));\n\t\n\t\t//$this->performAjaxValidation($model);\n\t\t\n\t\t$converter = array( \n\t\t' ' => '_', '.' =>'', ',' =>'', '#' => '', '№'=> '', '-' =>'_','–' =>'_',\n\t\t'а' => 'a', 'б' => 'b', 'в' => 'v', \n\t\t'г' => 'g', 'д' => 'd', 'е' => 'e', \n\t\t'ё' => 'e', 'ж' => 'zh', 'з' => 'z', \n\t\t'и' => 'i', 'й' => 'y', 'к' => 'k', \n\t\t'л' => 'l', 'м' => 'm', 'н' => 'n', \n\t\t'о' => 'o', 'п' => 'p', 'р' => 'r', \n\t\t'с' => 's', 'т' => 't', 'у' => 'u', \n\t\t'ф' => 'f', 'х' => 'h', 'ц' => 'c', \n\t\t'ч' => 'ch', 'ш' => 'sh', 'щ' => 'sch', \n\t\t'ь' => '', 'ы' => 'y', 'ъ' => '', \n\t\t'э' => 'e', 'ю' => 'yu', 'я' => 'ya'); \n\n\t\tif(isset($_POST['Estate']))\n\t\t{\n\t\t\n\t\t\t$images = $_POST['Images'];\n\t\t\t$_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);\n\t\t\t$model->attributes= $_POST['Estate'];\n\t\t\n\t\t\t\t\t\n\t\t\n\t\t\tif(!in_array($model->type, array('house','flat','new','commercial','land'))) {\n\t\t\t\t$model->type = 'flat';\n\t\t\t}\t\t\n\t\t\t//$model->subtype = Yii::app()->request->getParam('subtype', 'sale');\n\t\t\t\n\t\t\tif(!in_array($model->subtype, array('sale','rent'))) {\n\t\t\t\t$model->subtype = 'sale';\n\t\t\t}\t\n\t\t\n\t\t\t\n\t\t\tif($model->type == 'flat' || $model->type == 'new') \n\t\t\t\t$model->title = $model->rooms.\"-ком. квартира на \".$model->address;\n\t\t\tif($model->type == 'house') \n\t\t\t\t$model->title = \"Дом на \".$model->address;\n\t\t\tif($model->type == 'land') \n\t\t\t\t$model->title = \"Земельный участок на \".$model->address;\n\t\t\tif($model->type == 'commercial') \n\t\t\t\t$model->title = \"Нежилое на \".$model->address;\n\t\t\t\t\n\t\t\t$string = mb_strtolower($model->title, 'UTF-8');; \n\t\t\t$string = trim($string);\n\t\t\t//$string = mb_strtolower($string);\n\t\t\t\n\t\t\t\n\t\t//\t$model->text = htmlspecialchars($model->text);\n\t\t//\t$model->text = htmlspecialchars($model->text);\n\t\t\n\t\t\t$model->slug = strtr($string, $converter); \n\t\t\n\t\t//\t$model->subtype = 'sale';\n\t\t\t\n\t\t\t$model->user_id = Yii::app()->user->id;\n\t\t\t//$tour=CUploadedFile::getInstance($model,'upload_pano');\n\t\t\t//print_r($model->tour);print_r($model->tour->name);\n\t\t\t//return true;\n\t\t\t//if($tour):\n\t\t\t//\t$model->tour='/uploads/panoramas/'.$model->id.'_'.$tour->name;\n\t\t\t//endif; \n\t\t\t\n\t\t\t$cache=new CDbCache();\n\t\t\t$cache->flush();\n\t\t\t\n\t\t\t$model->validate();\n\t\t\t\n\t\t\tif($this->saveEntry($model, $images)) {\n\t\t\t\t//if($tour):\n\t\t\t\t//\t$tour->saveAs(dirname(Yii::app()->request->scriptFile).'/uploads/panoramas/'.$model->id.'_'.$tour->name);\t\t\t\t\t\n\t\t\t\t//endif;\n\t\t\t\tModeratorLogHelper::AddToLog('edited-'.$model->id,'Отредактирован объект #'.$model->id.' '.$model->title,'/'.$model->type.'/'.$model->id.'-'.$model->slug,$model->user_id);\n\t\t\t\t$this->redirect(array('/'.$model->type.'/'.$model->id.'-'.$model->slug));\n\t\t\t}\n\n\t\t}\n\n\t\t$this->render('add2',array('model'=>$model, 'images'=>$images, 'type_config'=>$type_config,'action'=>'edit', 'fields_sub' => $fields_sub, 'fields_main' => $fields_main));\n\t}", "public function save()\n\t{\n\t\tglobal $tpl, $lng, $ilCtrl;\n\t\n\t\t$pl = $this->getPluginObject();\n\t\t\n\t\t$form = $this->initConfigurationForm();\n\t\tif ($form->checkInput())\n\t\t{\n\t\t\t$set1 = $form->getInput(\"setting_1\");\n\t\t\t$set2 = $form->getInput(\"setting_2\");\n\t\n\t\t\t// @todo: implement saving to db\n\t\t\t\n\t\t\tilUtil::sendSuccess($pl->txt(\"saving_invoked\"), true);\n\t\t\t$ilCtrl->redirect($this, \"configure\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$form->setValuesByPost();\n\t\t\t$tpl->setContent($form->getHtml());\n\t\t}\n\t}", "function pre_load_edit_page() {\r\n global $wpi_settings;\r\n\r\n if (!empty($_REQUEST['wpi']) && !empty($_REQUEST['wpi']['existing_invoice'])) {\r\n $id = (int) $_REQUEST['wpi']['existing_invoice']['invoice_id'];\r\n if (!empty($id) && !empty($_REQUEST['action'])) {\r\n self::process_invoice_actions($_REQUEST['action'], $id);\r\n }\r\n }\r\n\r\n /** Screen Options */\r\n if (function_exists('add_screen_option')) {\r\n add_screen_option('layout_columns', array('max' => 2, 'default' => 2));\r\n }\r\n\r\n //** Default Help items */\r\n $contextual_help['Creating New Invoice'][] = '<h3>' . __('Creating New Invoice', WPI) . '</h3>';\r\n $contextual_help['Creating New Invoice'][] = '<p>' . __(\"Begin typing the recipient's email into the input box, or double-click to view list of possible options.\", WPI) . '</p>';\r\n $contextual_help['Creating New Invoice'][] = '<p>' . __(\"For new prospects, type in a new email address.\", WPI) . '</p>';\r\n\r\n //** Hook this action is you want to add info */\r\n $contextual_help = apply_filters('wpi_edit_page_help', $contextual_help);\r\n\r\n do_action('wpi_contextual_help', array('contextual_help' => $contextual_help));\r\n }", "public function getEditViewUrl()\n\t{\n\t\treturn 'index.php?module=' . $this->getName() . '&parent=Settings&view=Edit';\n\t}", "public function edit( )\r\n {\r\n //\r\n }", "public function edit()\n {\n //\n\t\treturn 'ini halaman edit';\n }", "public function edit()\n {\n $data_url = $this->request->query;\n $action = $data_url['Accion'];\n $categoria = $data_url['Categoria'];\n\n $mapconfig = $this->Mapconfig->find()->first();\n\n if ($this->request->is(['patch', 'post', 'put'])) {\n\n $mapconfig = $this->Mapconfig->patchEntity($mapconfig, $this->request->data);\n\n if($this->Mapconfig->save($mapconfig)){\n\n $this->Flash->success(__('La Configuraciòn del Mapa ha sido editada!.'));\n //Cambiar el Redireccionamiento\n return $this->redirect(['action' => 'index', '?' => ['Accion' => 'Ver Configuraciones de Mapa', 'Categoria' => 'Mapa']]);\n }\n\n $this->Flash->error(__('Verifique los datos e intente nuevamente'));\n\n }\n $this->set(compact('mapconfig'));\n $this->set('_serialize', ['mapconfig']);\n\n $this->set('action', $action);\n $this->set('categoria', $categoria);\n\n }", "public function hookConfigForm() {\n\t\trequire IIIF_API_BRIDGE_DIRECTORY . '/config_form.php';\n\t}", "public function edit()\n\t{\n\t\t\n\t}", "public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Browser_Service_Recsite::getRecsite(intval($id));\t\t\n\t\t$this->assign('info', $info);\n\t\t$this->assign('models', $this->models);\n\t\t$this->assign('types', $this->types);\n\t}", "public function edit()\r\n {\r\n // init vars\r\n $input_type = $this->config->get('input_type', 'checkbox');\r\n $options_from_config = $this->config->get('option', array());\r\n $default_option = $this->config->get('default');\r\n $show_label = $this->config->get('show_label', 'false');\r\n $multiple = $this->config->get('multiple');\r\n $data_limit = $this->config->get('data_limit');\r\n\r\n $sizeStyle = '';\r\n $paramwidth = $this->config->get('adminwidth');\r\n $paramheight = $this->config->get('adminheight');\r\n $width = $paramwidth ? 'width:' . $paramwidth . 'px' : '';\r\n $height = $paramheight ? 'height:' . $paramheight . 'px' : '';\r\n if ($width || $height) {\r\n $sizeStyle = 'style=\"' . $width . ($width ? ';' . $height : $height) . '\"';\r\n }\r\n\r\n //\r\n if (count($options_from_config)) {\r\n // set default, if item is new\r\n if ($default_option != '' && $this->_item != null && $this->_item->id == 0) {\r\n $default_option = array($default_option);\r\n } else {\r\n $default_option = array();\r\n }\r\n $control_name = $this->getControlName('option', true);\r\n $selected_options = $this->get('option', array());\r\n $i = 0;\r\n $html = array();\r\n if ($input_type == 'select') {\r\n // image picker js and css\r\n $this->app->document->addScript('elements:imagebox/assets/js/image-picker.min.js');\r\n $this->app->document->addStylesheet('elements:imagebox/assets/css/image-picker.css');\r\n // opening html\r\n $html[] = '<select name=\"' . $control_name . '\" ' . (!empty($data_limit) ? 'data-limit=\"' . (int)$data_limit . '\"' : '') . ' ' . ($multiple ? 'multiple=\"multiple\" size=\"' . max(min(count($options_from_config), 10), 3) . '\"' : '') . ' >';\r\n }\r\n foreach ($options_from_config as $option) {\r\n // clear vars\r\n $image_info = array();\r\n $image_html = '<img/>';\r\n $checked = in_array($option['value'], $selected_options) ? ($input_type == 'select' ? ' selected=\"selected\"' : ' checked=\"checked\"') : null;\r\n // set image data\r\n if (isset($option['image'])) {\r\n $image_info = $this->app->html->image($option['image']);\r\n $image_html = '<img ' . $sizeStyle . ' src=\"' . $image_info['src'] . '\" title=\"' . $option['name'] . '\" /><br/>';\r\n }\r\n // set options\r\n if ($input_type == 'checkbox' || $input_type == 'radio') {\r\n $html[] = '<input type=\"' . $input_type . '\" id=\"' . $control_name . $i . '\" name=\"' . $control_name . '\" value=\"' . $option['value'] . '\"' . $checked . ' /><label for=\"' . $control_name . $i . '\" id=\"' . $control_name . $i . '-lbl\">' . ($show_label == 'true' ? $option['name'] : '') . $image_html . '</label>';\r\n } elseif ($input_type == 'select') {\r\n $html[] = '<option data-img-src=\"' . (isset($image_info['src']) ? $image_info['src'] : '') . '\" data-img-label=\"' . $option['name'] . '\" value=\"' . $option['value'] . '\" ' . $checked . '>' . $option['name'] . '</option>';\r\n }\r\n $i++;\r\n }\r\n // workaround: if nothing is selected, the element is still being transfered\r\n if ($input_type == 'checkbox') {\r\n $html[] = '<input type=\"hidden\" name=\"' . $this->getControlName('check') . '\" value=\"1\" />';\r\n } elseif ($input_type == 'select') {\r\n // closing html\r\n $html[] = '</select>';\r\n $html[] = '<input type=\"hidden\" name=\"' . $this->getControlName('select') . '\" value=\"1\" />';\r\n $html[] = '<script type=\"text/javascript\">jQuery(function($) {'\r\n . '$(\"select[name=\\'' . $control_name . '\\']\").imagepicker({hide_select: ' . $this->config->get('hide_select', 'true') . ', show_label: ' . $show_label . (!empty($data_limit) ? ', limit: \"' . (int)$data_limit . '\", limit_reached: function() {alert(\"' . JText::_('We are full') . '\")}' : '') . '});'\r\n . '$(\"select[name=\\'' . $control_name . '\\']\").data(\"picker\").sync_picker_with_select();'\r\n . '});'\r\n . '</script>';\r\n }\r\n // output\r\n return '<div class=\"graphibox-edit\">' . implode(\"\\n\", $html) . '</div>';\r\n }\r\n\r\n return '<div class=\"graphibox-edit\">' . JText::_(\"There are no options to choose from.\") . '</div>';\r\n }", "public function actionEdit(){\n\t\t$form = $_POST;\n\t\t$id = $form['id'];\n\t\tunset($form['id']);\n\t\tunset($form['submit_']);\n\t\tif($form['active'] == 'on'){\n\t\t\t$form['active'] = 1;\n\t\t}\n\t\t$db = $this->context->getService('database');\n\t\t$db->exec('UPDATE core_pages SET ? WHERE id = ?', $form, $id);\n\t\t$this->redirect('pages:');\n\t}", "public function editAction() {\r\n\t\t$id = $this->getInput('id');\r\n\t\t$info = Gou_Service_Ad::getAd(intval($id));\r\n\t\t$this->assign('ad_types', $this->ad_types[$info['channel_id']]);\r\n\t\t\r\n\t\tlist($info['module_id'], $info['cid']) = explode('_', $info['module_channel']);\r\n\t\t$this->assign('info', $info);\r\n\t\t\r\n\t\tif($info['channel_id'] == 2 || $info['channel_id'] == 6) {\r\n\t\t list(, $ptypes) = Type_Service_Ptype::getsBy(array('status'=>1,'pid'=>0), array('sort'=>'DESC', 'id'=>'DESC'));\r\n\t\t $this->assign('ptype', $ptypes);\r\n\t\t}\r\n\t\t\r\n\t if($info['channel_id'] == 2) {\r\n\t\t $this->assign('actions', $this->client_actions);\r\n\t\t}\r\n\r\n $this->assign('channel_id', $info['channel_id']);\r\n $this->assign('ad_type', $info['ad_type']);\r\n\r\n\t\t//module channel\r\n\t\tlist($modules, $channel_names) = Gou_Service_ChannelModule::getsModuleChannel();\r\n\t\t$this->assign('modules', $modules);\r\n\t\t$this->assign('channel_names', $channel_names);\r\n\t}", "public function hookConfigForm() {\n }", "public function indexAction()\n\t{\n\t\t// Get the current configuration and\n\t\t// show a form for editing it\n\t\t$this->view->config = $this->adminService->getSystemConfig();\n\t\t$this->renderView('admin/config.php');\n\t}", "public function edit() {\n }", "public function editUrl() {}", "public function editAction() {\n if ($this->getRequest()->isPost()) {\n // Save changes\n $this->_savePanel();\n } else {\n $panelsModel = new Datasource_Cms_Panels();\n $id = $this->getRequest()->getParam('id');\n $panel = $panelsModel->getByID($id);\n\n $passThrough = $this->_helper->getHelper('FlashMessenger')->getMessages();\n if (count($passThrough)>0) {\n if (isset($passThrough[0]['saved'])) {\n if ($passThrough[0]['saved'] == true) $this->view->saved=true;\n }\n if (isset($passThrough[0]['errorMessage'])) {\n $this->view->errorMessage = $passThrough[0]['errorMessage'];\n }\n }\n\n $this->view->key = $panel['key'];\n $this->view->description = $panel['description'];\n $this->view->content = $panel['content'];\n $this->view->id = $panel['id'];\n }\n }", "function a_edit() {\n\t\t$id = isset($_GET[\"id\"]) ? $_GET[\"id\"] : 0;\n\t\t$u=new Gestionnaire($id);\n\t\textract($u->data);\t\n\t\trequire $this->gabarit;\n\t}", "public function editAction() {\n $id = $this->getInput('id');\n $info = Client_Service_Ad::getAd(intval($id));\n \n $this->assign('ad_type', self::AD_TYPE);\n $this->assign('ad_ptypes', $this->ad_ptypes);\n $this->assign('info', $info);\n }", "public function settings_admin_page()\n {\n add_action('wp_cspa_before_closing_header', [$this, 'back_to_optin_overview']);\n add_action('wp_cspa_before_post_body_content', array($this, 'optin_theme_sub_header'), 10, 2);\n add_filter('wp_cspa_main_content_area', [$this, 'optin_form_list']);\n\n $instance = Custom_Settings_Page_Api::instance();\n $instance->page_header(__('Add New', 'mailoptin'));\n $this->register_core_settings($instance);\n $instance->build(true, true);\n }", "public function edit()\r\n {\r\n //\r\n }", "public function edit()\r\n {\r\n //\r\n }", "public function showEdit()\n {\n\n }", "public function editAction()\n {\n $module = $this->getModule();\n $config = Pi::config('', $module);\n $apps = $this->_getAppsList();\n $cases = $this->_getCasesList();\n\n $solution_apps = $data = array();\n\n if ($this->request->isPost()) {\n $data = $this->request->getPost();\n\n $id = $data['id'];\n $row = $this->getModel($module)->find($id);\n\n // Set form\n $form = new SolutionForm('solution-form');\n $form->setInputFilter(new SolutionFilter);\n $form->setData($data);\n if ($form->isValid()) {\n $values = $form->getData();\n\n if (empty($values['name'])) {\n $values['name'] = null;\n }\n if (empty($values['slug'])) {\n $values['slug'] = null;\n }\n\n $values['time_updated'] = time();\n\n // Fix upload icon url\n $iconImages = $this->setIconPath(array($data));\n\n if (isset($iconImages[0]['filename'])) {\n $values['icon'] = $iconImages[0]['filename'];\n }\n\n // Save\n $row->assign($values);\n $row->save();\n\n Pi::service('cache')->flush('module', $this->getModule());\n Pi::registry('solution', $this->getModule())->clear($this->getModule());\n Pi::registry('nav', $this->getModule())->flush();\n\n $message = _a('Solution data saved successfully.');\n\n // Try save apps.\n $apps = $data[SOLUTION_APP];\n foreach ($apps as $app) {\n $result = $this->_saveSolutionApp($id, $app);\n if ($result['message']) {\n $message .= '<li>' . $app['title'] . _a(' can\\'t save;') . '</li>';\n $message .= $result['message'];\n }\n }\n\n // Try save cases.\n $cases = $data[SOLUTION_CASE];\n foreach ($cases as $case) {\n $result = $this->_saveSolutionCase($id, $case);\n if ($result['message']) {\n $message .= '<li>' . $app['title'] . _a(' can\\'t save;') . '</li>';\n $message .= $result['message'];\n }\n }\n\n return $this->jump(array('action' => 'index'), $message);\n\n } else {\n $form_info = $this->_newSolutionForm($form, $data);\n $formGroups = $form_info['formGroups'];\n\n $data['image'] = $data['icon'];\n $json_data = json_encode($data);\n\n $message = _a('Invalid data, please check and re-submit.');\n }\n } else {\n $id = $this->params('id');\n $row = $this->getModel($module)->find($id);\n $data = $row->toArray();\n // Solution apps list.\n $solution_apps = $this->_getSolutionApps($id);\n $data[SOLUTION_APP] = $solution_apps;\n // Solution cases list.\n $solution_cases = $this->_getSolutionCases($id);\n $data[SOLUTION_CASE] = $solution_cases;\n\n $form = new SolutionForm('solution-edit-form');\n // Rebuild form.\n $form_info = $this->_newSolutionForm($form, $data);\n $form = $form_info['form'];\n $formGroups = $form_info['formGroups'];\n\n $form->setData($data);\n $form->setAttribute(\n 'action',\n $this->url('', array('action' => 'edit'))\n );\n $message = '';\n\n $rootUrl = $this->rootUrl();\n $data['image'] = $rootUrl . '/' . $data['icon'];\n $json_data = json_encode($data);\n }\n\n $this->view()->assign('formGroups', $formGroups);\n $this->view()->assign('solution_apps', $solution_apps);\n $this->view()->assign('solution_cases', $solution_cases);\n $this->view()->assign('module', $this->getModule());\n $this->view()->assign('form', $form);\n $this->view()->assign('content', $json_data);\n $this->view()->assign('title', _a('Solution Edit'));\n $this->view()->assign('message', $message);\n $this->view()->setTemplate('solution-edit');\n }", "public function edit(AppSettings $appSettings)\n {\n //\n }", "public function actionEdit($id) {\n $model = $this->loadModel($id);\n if (isset($_POST['MConfigs']['value'])) {\n $model->attributes = $_POST['MConfigs'];\n if ($model->validate()) {\n if ($model->save()) {\n $this->redirect(array('index'));\n }\n }\n }\n $this->render('edit', array('model' => $model));\n }", "public function actionDummyEdit() {\n $this->redirect('edit', $this->getParam('login'));\n }", "public function editAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$layoutName = $this->_request->getParam('layout'); \n\t\t$this->view->objLayout = $model->getLayout($layoutName);\n\t }", "public function settings_admin_page()\n {\n add_action('wp_cspa_before_closing_header', [$this, 'back_to_optin_overview']);\n add_action('wp_cspa_before_post_body_content', array($this, 'optin_theme_sub_header'), 10, 2);\n add_filter('wp_cspa_main_content_area', [$this, 'optin_form_list']);\n\n $instance = Custom_Settings_Page_Api::instance();\n $instance->page_header(__('Add New Optin', 'mailoptin'));\n $this->register_core_settings($instance, true);\n $instance->build(true);\n }", "public function actionEdit()\n {\n $model = new Curd();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirectAddon(['view', 'id' => $model->id]);\n } else {\n return $this->renderAddon('edit', [\n 'model' => $model,\n ]);\n }\n }", "public function stepSixAction()\n {\n $form = $this->_getForm();\n \n if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {\n \n try {\n \n $settings = new Zend_Config_Xml($this->_getSession('dataPath') . DIRECTORY_SEPARATOR . 'settings.xml');\n\n foreach ($form->getValues() as $name => $value) {\n\n if ($name != 'submit') {\n\n $option = Doctrine::getTable('SecurityOption')->findOneByName($name);\n\n if (!$option || $option instanceof Doctrine_Null) {\n\n $option = new SecurityOption();\n\n }\n\n $option->name = $name;\n $option->value = $value;\n $option->save();\n }\n }\n \n $this->getHelper('Redirector')->gotoRoute(array('action'=>'finished'), 'default');\n\n } catch (Exception $e) {\n\n $this->_addError($e->getMessage());\n }\n }\n \n $this->view->form = $form;\n }", "public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Client_Service_Ad::getAd(intval($id));\n\t\t$game_info = Resource_Service_Games::getResourceGames($info['link']);\n\t\t$this->assign('game_info', $game_info);\n\t\t$this->assign('ad_types', $this->ad_types);\n\t\t$this->assign('info', $info);\n\t}", "public function getEditForm();", "public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Fj_Service_Goods::getGoods(intval($id));\n $this->assign('dir', \"goods\");\n $this->assign('ueditor', true);\n\t\t$this->assign('info', $info);\n\t}", "public function edit()\n {\n }", "public function edit()\n {\n }", "public function edit()\n {\n }", "public static function wizard_mode_hidden_fields_action() {\n\t\t\techo '<input type=\"hidden\" name=\"pcor_wizard_mode\" value=\"from_scratch\" />';\n\t\t}", "public function edit()\n {\n \n }", "public function edit()\n {\n \n }", "public function edit()\n {\n \n }", "public function editUrl() {\n\t\treturn str_replace('/page/edit/',\n '/lab_charger/lab_charge_items/edit/',\n parent::editUrl());\n\t}", "public function edit()\n {\n \n \n }", "public function updateFieldsPersonalization()\n\t{\n\t\tConfiguration::updateValue('PS_MR_SHOP_NAME', Tools::getValue('Expe_ad1'));\n\t\t$this->_html .= '<div class=\"conf confirm\"><img src=\"'._PS_ADMIN_IMG_.'/ok.gif\" alt=\"\" /> '.$this->l('Settings updated').'</div>';\t\t\n\t}", "public function edit(){\r\n\t\t//$this->auth->set_access('edit');\r\n\t\t//$this->auth->validate();\r\n\r\n\t\t//call save method\r\n\t\t$this->save();\r\n\t}", "public function getEditViewUrl()\n\t{\n\t\treturn 'index.php?module=TreesManager&parent=Settings&view=Edit&record=' . $this->getId();\n\t}", "public function edit()\n {\n \n }", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "function edit() {\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->getDefaultViewForm();\n\n\t\tif (!$view) {\n\t\t\tthrow new Exception('Edit task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t// Hint the view that it's not a listing, but a form (KenedoView::display() uses it to set the right template file)\n\t\t$view->listing = false;\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 edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n\t{\n\t\t$id = $this->uri->segment(5);\n\n\t\tif (empty($id))\n\t\t{\n\t\t\tTemplate::set_message(lang('informations_invalid_id'), 'error');\n\t\t\tredirect(SITE_AREA .'/settings/informations');\n\t\t}\n\n\t\tif (isset($_POST['save']))\n\t\t{\n\t\t\t$this->auth->restrict('Informations.Settings.Edit');\n\n\t\t\tif ($this->save_informations('update', $id))\n\t\t\t{\n\t\t\t\t// Log the activity\n\t\t\t\t$this->activity_model->log_activity($this->current_user->id, lang('informations_act_edit_record').': ' . $id . ' : ' . $this->input->ip_address(), 'informations');\n\n\t\t\t\tTemplate::set_message(lang('informations_edit_success'), 'success');\n redirect(SITE_AREA .'/settings/informations');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tTemplate::set_message(lang('informations_edit_failure') . $this->informations_model->error, 'error');\n redirect(SITE_AREA .'/settings/informations');\n\t\t\t}\n\t\t}\n\t\telse if (isset($_POST['delete']))\n\t\t{\n\t\t\t$this->auth->restrict('Informations.Settings.Delete');\n\n\t\t\tif ($this->informations_model->delete($id))\n\t\t\t{\n\t\t\t\t// Log the activity\n\t\t\t\t$this->activity_model->log_activity($this->current_user->id, lang('informations_act_delete_record').': ' . $id . ' : ' . $this->input->ip_address(), 'informations');\n\n\t\t\t\tTemplate::set_message(lang('informations_delete_success'), 'success');\n\n\t\t\t\tredirect(SITE_AREA .'/settings/informations');\n\t\t\t} else\n\t\t\t{\n\t\t\t\tTemplate::set_message(lang('informations_delete_failure') . $this->informations_model->error, 'error');\n\t\t\t}\n\t\t}\n\t\tTemplate::set('informations', $this->informations_model->find($id));\n\t\tAssets::add_module_js('informations', 'informations.js');\n\n\t\tTemplate::set('toolbar_title', lang('informations'));\n\t\tTemplate::render();\n\t}", "function edit( $id = \"be1\") {\n\n\n\t\t// load user\n\t\t$this->data['backend'] = $this->Backend_config->get_one( $id );\n\n\t\t// call the parent edit logic\n\t\tparent::backendedit( $id );\n\t}", "public function editAction()\n\t{ \n\t\t$auth = Zend_Auth::getInstance();\n\t\tif($auth->hasIdentity()){\n\t\t \t$loginUserId = $auth->getStorage()->read()->id;\n\t\t}\n\t\t\n\t\t$objName = 'employeeadvances';$emptyFlag=0;\n\t\t$id = $this->getRequest()->getParam('id');\n\t\t$callval = $this->getRequest()->getParam('call');\n\t\tif($callval == 'ajaxcall')\n\t\t$this->_helper->layout->disableLayout();\n\n\t\t$advancesForm = new Expenses_Form_Advance();\n\t\t$employeeadvancesModel = new Expenses_Model_Employeeadvances();\n\n\n\t\t$usersModel = new Expenses_Model_Advances();\n\t\t$msgarray = array();\n\t $usersData = $usersModel->getUserList($loginUserId );\n\n\t\tif(sizeof($usersData) > 0)\n\t\t{\n\t\t\tforeach ($usersData as $user){\n\t\t\t\t$advancesForm->to_id->addMultiOption($user['id'],utf8_encode($user['userfullname']));\n\t\t\t\t\n\t\t\t}\n\n\t\t}else\n\t\t{\n\t\t\t$msgarray['from_id'] = 'employee are not configured yet.';\n\t\t\t$emptyFlag++;\n\t\t}\n\t\t\n\t\t\n\t\t$tripsmodel = new Expenses_Model_Trips();\n\t\t$configData = $tripsmodel->getApplicationCurrency();\n\t\t\n\t\t$expensesmodel = new Expenses_Model_Expenses();\n\t\t$currencyData = $expensesmodel->getCurrencyList();\n\t\t//echo \"<pre/>\"; print_r($currencyData ); \n\t\t$msgarray['currency_id']='';\n\t\tif(sizeof($currencyData) > 0)\n\t\t{\n\t\t\t\n\t\t\tforeach ($currencyData as $currency){\n\t\t\t\t$advancesForm->currency_id->addMultiOption($currency['id'],utf8_encode($currency['currencycode']));\n\t\t\t}\n\t\t\tif(empty($configData)){\t\n\t\t\t\t$msgarray['currency_id'] = 'Default currency is not selected yet.';\n\t\t\t}\n\t\t\t\n\n\t\t}else\n\t\t{\n\t\t\t$msgarray['currency_id'] = 'Currency are not configured yet.';\n\t\t\t//$emptyFlag++;\n\t\t}\n\t\t\n\t\t\n\t\t$projectModel = new Timemanagement_Model_Projects();\n\t\t$base_projectData = $projectModel->getProjectList();\n\t\t$paymentmodemodel = new Expenses_Model_Paymentmode();\n\t\t$paymentmodeData = $paymentmodemodel->getPaymentList();\n\t\tif(sizeof($paymentmodeData) > 0)\n\t\t{\n\t\t\tforeach ($paymentmodeData as $payment_mode){\n\t\t\t\t $advancesForm->payment_mode_id->addMultiOption($payment_mode['id'],$payment_mode['payment_method_name']);\n\t\t\t\t\t\n\t\t\t}\n\n\t\t}\n\t\t\t\n\t\t\n\t\t\n\t\t//echo \"<pre/>\"; print_R($configData ); \n\t\t$currency=\"\";\n\t\tif(!empty($configData) && (isset($configData[0]['currencycode'])))\n\t\t{\n\t\t$currency = $configData[0]['currencycode'];\n\t\t}\n\t\t$advancesForm->currency_id->setValue(!empty($configData[0]['currencyid'])?$configData[0]['currencyid']:'');\n\t\n\t\t$this->view->currency=$currency;\n\t\t$this->view->currencyid=!empty($configData[0]['currencyid'])?$configData[0]['currencyid']:'';\n\t\t\n\t\t \n\t\t\n\t\t$this->view->msgarray = $msgarray;\n\t\t$this->view->emptyFlag = $emptyFlag;\n\t\n\t\ttry\n\t\t{\n\n\t\t\tif($id)\n\t\t\t{\t\n\t\t\t\n\t\t\t\tif(is_numeric($id) && $id>0)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t$advancesForm = new Expenses_Form_Advance();\n\t\t\t\t\t$auth = Zend_Auth::getInstance(); \n\t\t\t\t\tif($auth->hasIdentity()){\n\t\t\t\t\t\t$loginUserId = $auth->getStorage()->read()->id;\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\t$employeeadvancesModel = new Expenses_Model_Employeeadvances();\n\t\t\t\t\t\t$dataarray = $employeeadvancesModel->getsingleEmployeeadvancesData($id);\n\t\t\t\t\t\n\t\t\t\t\t\t$data = $dataarray[0];\n\n\t\t\t\t\tif(!empty($data) && $data != \"norows\")\n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t$projectModel = new Timemanagement_Model_Projects();\n\t\t\t\t$projectData = $projectModel->getEmployeeProjects(intval($data['to_id']));\n\t\t\t\t$project_array = array();\n\t\t\t\tif(count($projectData) > 0)\n\t\t\t\t{\n\t\t\t\t\tforeach($projectData as $project)\n\t\t\t\t\t{\n\t\t\t\t\t\t$advancesForm->project_id->addMultiOption($project['id'],utf8_encode($project['project_name']));\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t\t\t\n\t\t\t\t\t\t\t$advancesForm->populate($data);\n\t\t\t\t\t\t\t$advancesForm->submit->setLabel('Update');\n\t\t\t\t\t\t\t\t$this->view->data = $data;\t\n\t\t\t\t\t\t\t\t//echo \"<pre/>\"; print_r($data); exit;\n\n\t\t$paymentmodemodel = new Expenses_Model_Paymentmode();\n\t\t$paymentmodeData = $paymentmodemodel->getPaymentList();\n\t\tif(sizeof($paymentmodeData) > 0)\n\t\t{\n\t\t\tforeach ($paymentmodeData as $payment_mode){\n\t\t\t\t $advancesForm->payment_mode_id->addMultiOption($payment_mode['id'],$payment_mode['payment_method_name']);\n\t\t\t\t\t\n\t\t\t}\n\n\t\t}\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t$expensesmodel = new Expenses_Model_Expenses();\n\t\t$currencyData = $expensesmodel->getCurrencyList();\n\t\tif(sizeof($currencyData) > 0)\n\t\t{\n\t\t\tforeach ($currencyData as $currency){\n\t\t\t\t$advancesForm->currency_id->addMultiOption($currency['id'],$currency['currencycode']);\n\t\t\t}\n\n\t\t}\n\t\t\t\n\t\t\t\t\t\t$this->view->form = $advancesForm;\n\t\t\t\t\t\t$this->view->controllername = $objName;\n\t\t\t\t\t\t$this->view->id = $id;\n\t\t\t\t\t\t$this->view->ermsg = '';\n\t\t\t\t\t\t$this->view->inpage = 'Edit';\n\t\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\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->view->ermsg = 'norecord';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->view->ermsg = 'nodata';\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\n\t\t\t\t//Add Record...\n\t\t\t\t$this->view->ermsg = '';\n\t\t\t\t$this->view->form = $advancesForm;\n\t\t\t\t$this->view->inpage = 'Add';\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $ex)\n\t\t{\n\t\t\t$this->view->ermsg = 'nodata';\n\t\t}\n\t\tif($this->getRequest()->getPost()){\n\t\t\tif(isset($_POST['to_id']) && $_POST['to_id']!='')\n\t\t\t{\n\t\t\t\t$projectsmodel = new Timemanagement_Model_Projects();\n\t\t\t\t$projects = $projectsmodel->getEmployeeProjects(intval($_POST['to_id']));\n\t\t\t\t$project_array = array();\n\t\t\t\tif(count($projects) > 0)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tforeach($projects as $dstate)\n\t\t\t\t\t{\n\t\t\t\t\t\t$project_array[$dstate['id']] = $dstate['project_name'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$advancesForm->project_id->addMultiOptions(array(''=>'Select State')+$project_array);\n\t\t\t}\n\t\t\tif(isset($_POST['cal_amount']) && $_POST['cal_amount']!='')\n\t\t\t{\n\t\t\t\t$this->view->cal_amount = $_POST['cal_amount'];\n\t\t\t}\n\t\t\tif($advancesForm->isValid($this->_request->getPost())){\n\t\t\t\tif($msgarray['currency_id']=='')\n\t\t\t\t{\n\t\t\t\t\n\t\t\t\t$to_id\t= NULL;\n\t\t\t\t$project_id\t= NULL;\n\t\t\t\t$id = $this->_request->getParam('id');\n\t\t\t\t$to_id = $this->_request->getParam('to_id');\n\t\t\t\t$project_id =$this->_request->getParam('project_id');\n\t\t\t\t$currency = $this->_request->getParam('currency_id');\n\t\t\t\t$amount = $this->_request->getParam('amount');\n\t\t\t\t$payment_mode = $this->_request->getParam('payment_mode_id');\n\t\t\t\t$paymentref = $this->_request->getParam('payment_ref_number');\n\t\t\t\t$description = $this->_request->getParam('description');\n\t\t\t\t$cal_amount = $this->_request->getParam('cal_amount');\n\t\t\t\t$app_amount=\"\";\n\n\t\t\t\t$siteconfigmodel = new Default_Model_Sitepreference();\n\t\t\t\t$configData = $siteconfigmodel->getActiveRecord();\n\t\t\t\t$application_currency='';\n\t\t\t\tif(!empty($configData) && (isset($configData[0]['currencyid'])))\n\t\t\t\t{\n\t\t\t\t\t$application_currency = $configData[0]['currencyid'];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!empty($id))\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t$employeeadvancesModel = new Expenses_Model_Employeeadvances();\n\t\t\t\t\t$employeeadvance_exist_data = $employeeadvancesModel->getsingleEmployeeadvancesData($id);\n\t\t\t\t\t$app_amount=$employeeadvance_exist_data[0]['application_amount'];\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t$application_amount=null;\n\t\t\t\tif($cal_amount!=0)\n\t\t\t\t{\n\t\t\t\t\n\t\t\t\t\t$application_amount=$cal_amount*$amount;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif( $app_amount!=\"\" && $cal_amount==0 && ($currency==$employeeadvance_exist_data[0]['currency_id']))\n\t\t\t\t{\n\t\t\t\t\t$application_amount=$app_amount;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$curId = !empty($configData[0]['currencyid'])?$configData[0]['currencyid']:'';\n\t\t\t\tif($currency==$curId)\n\t\t\t\t{\n\t\t\t\t\t$application_amount=$amount;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//echo $application_amount;exit;\n\t\t\t\t$date = new Zend_Date();\n\t\t\t\t$data = array('to_id'=>$to_id,\n\t\t\t\t\t\t\t 'project_id'=>$project_id,\n\t\t\t\t 'currency_id'=>$currency,\n\t\t\t\t\t\t\t 'amount'=>$amount,\n\t\t\t\t\t\t\t 'payment_mode_id'=>$payment_mode,\n\t\t\t\t\t\t\t 'payment_ref_number'=>$paymentref,\n\t\t\t\t\t\t 'application_currency_id' => $application_currency,\n\t\t\t\t\t\t 'application_amount'=>$application_amount,\n\t\t\t\t\t\t 'advance_conversion_rate'=>$cal_amount,\n\t\t\t\t\t\t\t 'description'=>$description,\n\t\t\t\t 'createdby'=>$loginUserId,\n\t\t\t\t\t\t\t 'from_id'=>$loginUserId,\n\t\t\t\t\t\t\t 'createddate' => gmdate(\"Y-m-d H:i:s\"),\n\t\t\t\t\t\t\t 'isactive'=>1\n\t\t\t\t\t\t\t\n\t\t\t\t);\n\n \n\t\t\t\t\t\tif($id!=''){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$data['modifiedby'] = $loginUserId;\n\t\t\t\t\t\t\t\t\t$data['modifieddate'] = gmdate(\"Y-m-d H:i:s\");\n\t\t\t\t\t\t\t\t\t$where = array('id=?'=>$id); \n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$data['createdby'] = $loginUserId;\n\t\t\t\t\t\t\t\t\t$data['createddate'] = gmdate(\"Y-m-d H:i:s\");\n\t\t\t\t\t\t\t\t\t$data['modifieddate'] = gmdate(\"Y-m-d H:i:s\");\n\t\t\t\t\t\t\t\t\t$data['isactive'] = 1;\n\t\t\t\t\t\t\t\t\t$where = '';\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\n\t\t\t\t\n\t\t\t\t$employeeadvancesModel = new Expenses_Model_Employeeadvances();\n\t\t\t\t$insertedId = $employeeadvancesModel->saveOrUpdateAdvanceData($data, $where);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//insert advance details\n\n\t\t\t\t\n\t\t\t\t\t//check if employee has already advance\n\t\t\t\t\t$advancesummary = new Expenses_Model_Advancesummary();\n\t\t\t\t\t$isRecordExist = $advancesummary->getAdvanceDetailsById($to_id);\n\t\t\t\t\t\n\t\t\t\t\t$summerydata = array();\n\t\t\t\t\tif(count($isRecordExist)>0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$totalsum = $isRecordExist[0]['total'];\n\t\t\t\t\t\t$balence = $isRecordExist[0]['balance'];\n\t\t\t\t\t\tif($app_amount>$application_amount)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$totalsum = $isRecordExist[0]['total'] - ($app_amount - $application_amount);\n\t\t\t\t\t\t\t$balence = $isRecordExist[0]['balance']-($app_amount - $application_amount);\n\t\t\t\t\t\t}else if($app_amount<$application_amount)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$totalsum = $isRecordExist[0]['total'] + ($application_amount - $app_amount);\n\t\t\t\t\t\t\t$balence = $isRecordExist[0]['balance']+($application_amount - $app_amount);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$summerydata = array('total'=>$totalsum,\n\t\t\t\t\t\t'balance'=>$balence,\n\t\t\t\t\t\t\t\t\t 'modifiedby'=> $loginUserId,\n\t\t\t\t\t\t\t\t\t 'modifieddate' =>gmdate(\"Y-m-d H:i:s\")\n\t\t\t\t\t\t\t\t );\n\t\t\t\t\t\t$summeryWhere = array('employee_id=?'=>$to_id); \n\t\t\t\t\t\t\t\n\t\t\t\t\t}else\n\t\t\t\t\t{\n\t\t\t\t\t\t$totalsum = $application_amount;\n\t\t\t\t\t\t$summerydata = array('total'=>$totalsum,\n\t\t\t\t\t\t'balance'=>$totalsum,\n\t\t\t\t\t\t\t\t\t 'createdby'=> $loginUserId,\n\t\t\t\t\t\t\t\t\t 'employee_id'=>$to_id,\n\t\t\t\t\t\t\t\t\t 'createddate' =>gmdate(\"Y-m-d H:i:s\")\n\t\t\t\t\t\t\t\t );\n\t\t\t\t\t\t$summeryWhere = \"\";\n\t\t\t\t\t}\t\n\t\t\t\t\t$insertSummey = $advancesummary->SaveAdvanceData($summerydata, $summeryWhere);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif($insertedId == 'update')\n\t\t\t\t{\n\t\t\t\t\n\t\t\t\t\t$this->_helper->getHelper(\"FlashMessenger\")->addMessage(array(\"success\"=>\"advance updated successfully.\"));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\n\t\t\t\t\t$this->_helper->getHelper(\"FlashMessenger\")->addMessage(array(\"success\"=>\"Advance added successfully.\"));\n\t\t\t\t}\n\n\t\t\t\t$this->_redirect('expenses/employeeadvances');\n\t\t\t\t}else{\n\t\t\t\t\t$msgarray['currency_id'] = 'Default currency is not selected yet.';\n\t\t\t\t\t$this->view->msgarray = $msgarray;\n\t\t\t\t}\n\t\t\t}else\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$messages = $advancesForm->getMessages();\n\t\t\t\tforeach ($messages as $key => $val)\n\t\t\t\t{\n\t\t\t\t\tforeach($val as $key2 => $val2)\n\t\t\t\t\t{\n\t\t\t\t\t\t$msgarray[$key] = $val2;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$this->view->msgarray = $msgarray;\n\n\t\t\n\t\t\t}\n\t\t} \n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit_config()\n {\n if ($_SERVER['REQUEST_METHOD'] === 'GET') {\n redirect('home/access_forbidden', 'location');\n }\n\n if ($_POST) \n {\n // validation\n $this->form_validation->set_rules('institute_name', '<b>'.$this->lang->line(\"company name\").'</b>', 'trim');\n $this->form_validation->set_rules('institute_address', '<b>'.$this->lang->line(\"company address\").'</b>', 'trim');\n $this->form_validation->set_rules('institute_email', '<b>'.$this->lang->line(\"company email\").'</b>', 'trim|required');\n $this->form_validation->set_rules('institute_mobile', '<b>'.$this->lang->line(\"company phone/ mobile\").'</b>', 'trim');\n $this->form_validation->set_rules('time_zone', '<b>'.$this->lang->line(\"time zone\").'</b>', 'trim');\n $this->form_validation->set_rules('language', '<b>'.$this->lang->line(\"language\").'</b>', 'trim');\n $this->form_validation->set_rules('theme', '<b>'.$this->lang->line(\"theme\").'</b>', 'trim');\n $this->form_validation->set_rules('slogan', '<b>'.$this->lang->line(\"slogan\").'</b>', 'trim');\n $this->form_validation->set_rules('product_name', '<b>'.$this->lang->line(\"product name\").'</b>', 'trim');\n $this->form_validation->set_rules('product_short_name', '<b>'.$this->lang->line(\"product short name\").'</b>', 'trim');\n // $this->form_validation->set_rules('display_landing_page', '<b>'.$this->lang->line(\"display landing page\").'</b>', 'trim');\n $this->form_validation->set_rules('email_sending_option', '<b>'.$this->lang->line(\"Email sending option\").'</b>','trim');\n $this->form_validation->set_rules('master_password', '<b>'.$this->lang->line(\"Master Password\").'</b>', 'trim');\n\n // go to config form page if validation wrong\n if ($this->form_validation->run() == false) {\n return $this->configuration();\n } else {\n // assign\n $institute_name=addslashes(strip_tags($this->input->post('institute_name', true)));\n $institute_address=addslashes(strip_tags($this->input->post('institute_address', true)));\n $institute_email=addslashes(strip_tags($this->input->post('institute_email', true)));\n $institute_mobile=addslashes(strip_tags($this->input->post('institute_mobile', true)));\n $time_zone=addslashes(strip_tags($this->input->post('time_zone', true))); \n $language=addslashes(strip_tags($this->input->post('language', true)));\n $theme=addslashes(strip_tags($this->input->post('theme', true)));\n $slogan=addslashes(strip_tags($this->input->post('slogan', true)));\n $product_name=addslashes(strip_tags($this->input->post('product_name', true)));\n $product_short_name=addslashes(strip_tags($this->input->post('product_short_name', true)));\n // $front_end_search_display=addslashes(strip_tags($this->input->post('front_end_search_display', true)));\n // $display_landing_page=addslashes(strip_tags($this->input->post('display_landing_page', true)));\n $email_sending_option=addslashes(strip_tags($this->input->post('email_sending_option', true)));\n $master_password=addslashes(strip_tags($this->input->post('master_password', true)));\n\n $base_path=realpath(APPPATH . '../assets/images');\n\n $this->load->library('upload');\n\n if ($_FILES['logo']['size'] != 0) {\n $photo = \"logo.png\";\n $config = array(\n \"allowed_types\" => \"png\",\n \"upload_path\" => $base_path,\n \"overwrite\" => true,\n \"file_name\" => $photo,\n 'max_size' => '200',\n 'max_width' => '600',\n 'max_height' => '300'\n );\n $this->upload->initialize($config);\n $this->load->library('upload', $config);\n\n if (!$this->upload->do_upload('logo')) {\n $this->session->set_userdata('logo_error', $this->upload->display_errors());\n return $this->configuration();\n }\n }\n\n if ($_FILES['favicon']['size'] != 0) {\n $photo = \"favicon.png\";\n $config2 = array(\n \"allowed_types\" => \"png\",\n \"upload_path\" => $base_path,\n \"overwrite\" => true,\n \"file_name\" => $photo,\n 'max_size' => '50',\n 'max_width' => '32',\n 'max_height' => '32'\n );\n $this->upload->initialize($config2);\n $this->load->library('upload', $config2);\n\n if (!$this->upload->do_upload('favicon')) {\n $this->session->set_userdata('favicon_error', $this->upload->display_errors());\n return $this->configuration();\n }\n }\n\n // writing application/config/my_config\n $app_my_config_data = \"<?php \";\n $app_my_config_data.= \"\\n\\$config['default_page_url'] = '\".$this->config->item('default_page_url').\"';\\n\";\n $app_my_config_data.= \"\\$config['product_version'] = '\".$this->config->item('product_version').\"';\\n\\n\";\n $app_my_config_data.= \"\\$config['institute_address1'] = '$institute_name';\\n\";\n $app_my_config_data.= \"\\$config['institute_address2'] = '$institute_address';\\n\";\n $app_my_config_data.= \"\\$config['institute_email'] = '$institute_email';\\n\";\n $app_my_config_data.= \"\\$config['institute_mobile'] = '$institute_mobile';\\n\\n\";\n $app_my_config_data.= \"\\$config['slogan'] = '$slogan';\\n\";\n $app_my_config_data.= \"\\$config['product_name'] = '$product_name';\\n\";\n $app_my_config_data.= \"\\$config['product_short_name'] = '$product_short_name';\\n\\n\";\n $app_my_config_data.= \"\\$config['developed_by'] = '\".$this->config->item('developed_by').\"';\\n\";\n $app_my_config_data.= \"\\$config['developed_by_href'] = '\".$this->config->item('developed_by_href').\"';\\n\";\n $app_my_config_data.= \"\\$config['developed_by_title'] = '\".$this->config->item('developed_by_title').\"';\\n\";\n $app_my_config_data.= \"\\$config['developed_by_prefix'] = '\".$this->config->item('developed_by_prefix').\"' ;\\n\";\n $app_my_config_data.= \"\\$config['support_email'] = '\".$this->config->item('support_email').\"' ;\\n\";\n $app_my_config_data.= \"\\$config['support_mobile'] = '\".$this->config->item('support_mobile').\"' ;\\n\"; \n $app_my_config_data.= \"\\$config['time_zone'] = '$time_zone';\\n\"; \n $app_my_config_data.= \"\\$config['language'] = '$language';\\n\";\n $app_my_config_data.= \"\\$config['theme'] = '\".$theme.\"';\\n\";\n $app_my_config_data.= \"\\$config['sess_use_database'] = FALSE;\\n\";\n $app_my_config_data.= \"\\$config['sess_table_name'] = 'ci_sessions';\\n\";\n\n if($master_password=='******')\n $app_my_config_data.= \"\\$config['master_password'] = '\".$this->config->item(\"master_password\").\"';\\n\";\n else if($master_password=='')\n $app_my_config_data.= \"\\$config['master_password'] = '';\\n\";\n else $app_my_config_data.= \"\\$config['master_password'] = '\".md5($master_password).\"';\\n\";\n \n $app_my_config_data.= \"\\$config['email_sending_option'] = '\".$email_sending_option.\"';\\n\";\n\n //writting application/config/my_config\n file_put_contents(APPPATH.'config/my_config.php', $app_my_config_data, LOCK_EX);\n\n $this->session->unset_userdata(\"selected_language\");\n\n $this->session->set_flashdata('success_message', 1);\n redirect('admin_config/configuration', 'location');\n }\n }\n }", "public function edit($id)\n\t{\n\t\t//\n\t\tif(!$this->permit->crud_configs_edit)\n return redirect('accessDenied');\n\t\t$config = CepConfigs::where('conf_id',$id)->first();\n\t\treturn count($config) ? view(\"configs.edit\", compact(\"config\")) : abort(404);\n\t}", "protected function actionEdit() {\r\n\r\n //try 1: get the object type and names based on the current object\r\n $objInstance = class_objectfactory::getInstance()->getObject($this->getSystemid());\r\n if($objInstance != null) {\r\n $strObjectTypeName = uniSubstr($this->getActionNameForClass(\"edit\", $objInstance), 4);\r\n if($strObjectTypeName != \"\") {\r\n $strType = get_class($objInstance);\r\n $this->setCurObjectClassName($strType);\r\n $this->setStrCurObjectTypeName($strObjectTypeName);\r\n }\r\n }\r\n\r\n //try 2: regular, oldschool resolving based on the current action-params\r\n $strType = $this->getCurObjectClassName();\r\n\r\n if(!is_null($strType)) {\r\n\r\n $objEdit = new $strType($this->getSystemid());\r\n $objForm = $this->getAdminForm($objEdit);\r\n $objForm->addField(new class_formentry_hidden(\"\", \"mode\"))->setStrValue(\"edit\");\r\n\r\n return $objForm->renderForm(getLinkAdminHref($this->getArrModule(\"modul\"), \"save\".$this->getStrCurObjectTypeName()));\r\n }\r\n else\r\n throw new class_exception(\"error editing current object type not known \", class_exception::$level_ERROR);\r\n }", "public function getEditUrl() { }", "public function isEditAction() {}", "public function edit(Gestionnaire $gestionnaire)\n {\n //\n }", "function setup(){\n\t\tglobal $session;\n\t\tswitch($this->act){\n\t\tcase ACT_SAVE://when act is save, write configuration to database\n\t\t\t$this->name='System file editor';\n\t\t\t$this->ctrl |= array_sum($_POST['ctrl']);\n\t\t\tif($_POST['more']) $_POST['f'] += array($_POST['more']=>1);\n\t\t\t$this->data=serialize($_POST['f']);\n\t\t\t$this->access=0;//require access developper to run\n\t\t\t$this->save();\n\t\t\tredirect($this->makeUrl(NULL,NULL,'setup'));\n\t\tdefault:\n\t\t\t$this->cfg=unserialize($this->data);\n\t\t\tif(!$this->cfg) $this->cfg=array();\n\t\t\t$this->startPage('Root file editor setup');\n\t\t\t$this->startForm(ACT_SAVE);\n\t\t\techo '<fieldset style=\"width:800px;margin:60px auto 20px auto; \"><legend>Enable users to edit following files</legend>\n<div>PATH_ROOT: <strong>'.PATH_ROOT.'</strong></div>\n<div><input type=\"checkbox\" name=\"f['.PATH_ROOT.'robots.txt]\" value=\"1\" '.($this->cfg[PATH_ROOT.'robots.txt'] ? 'checked':'').' /> robots.txt</div>';\n\t\t\tunset($this->cfg[PATH_ROOT.'robots.txt']);\n\t\t\tforeach($this->cfg as $file=>$value)\n\t\t\t\techo '<div><input type=\"checkbox\" class=\"input\" name=\"f['.$file.']\" value=\"1\" checked />'.str_replace(PATH_ROOT,'',$file).'</div>';\n\t\t\tif($session->getAccess(SESSION_CTRL_ADMIN,MODULE_SYS,ACCESS_DEVELOPPER))\techo '<div>Other file <input type=\"text\" name=\"more\" class=\"input\" size=\"80\" value=\"\" /></div>'; \n\t\t\techo '<div><input type=\"hidden\" value=\"1\" name=\"ctrl[]\" /><input type=\"checkbox\" value=\"',0x40000000,'\" name=\"ctrl[]\" '; if($this->ctrl & 0x40000000) echo 'checked'; echo ' />Show on system menu</div>';\n\t\t\t$this->endForm();\n\t\t\techo '</fieldset><script type=\"text/javascript\">function doSave(){document.forms[0].submit();}</script>';\n\t\t\t$this->endPage();\n\t\t}\n\t}", "public function edit() {\n\n }", "public function perform()\n {\n // assign header var with css definitions\n $this->viewVar['htmlHeaderData'] .= $this->controllerLoader->defaultMainCss();\n $this->viewVar['htmlTitle'] .= ' Articles general settings';\n // select advanced link\n $this->viewVar['selectedMenuItem'] = 'advanced';\n\n $this->viewVar['error'] = array();\n $this->viewVar['status'] = array();\n\n $this->fields = array();\n\n $updateOptions = $this->httpRequest->getParameter('updateOptions', 'post', 'alnum');\n $cancel = $this->httpRequest->getParameter('cancel', 'post', 'alnum');\n $save = $this->httpRequest->getParameter('save', 'post', 'alnum');\n $status = $this->httpRequest->getParameter('status', 'get', 'alnum');\n\n if(!empty($updateOptions) || !empty($save))\n {\n if(true == $this->validatePostData())\n {\n $this->model->action( 'common','setConfigVar',\n array('data' => $this->fields,\n 'module' => 'article'));\n\n if(!empty($updateOptions))\n {\n $this->router->redirect( $this->controllerVar['adminWebController'].'/mod/default/cntr/advancedMain' );\n }\n else\n {\n $this->router->redirect( $this->controllerVar['adminWebController'].'/mod/article/cntr/options/status/saved' );\n }\n }\n }\n elseif(!empty($cancel))\n {\n // redirect to the parent node of my site\n $this->router->redirect($this->viewVar['adminWebController'].'/mod/default/cntr/advancedMain');\n }\n elseif(!empty($status))\n {\n $this->viewVar['htmlTitle'] .= '. Status: updated settings';\n $this->viewVar['status'][] = 'Updated settings';\n }\n\n // assign view vars of options\n $this->viewVar['option'] = $this->config->getModuleArray( 'article' );\n }", "public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Gc_Service_OrderShow::getOrderShow(intval($id));\n\t\n\t\t//状态\n\t\t$this->assign('ordershow_status', $this->ordershow_status);\n\t\t\n\t\t//渠道\n\t\tlist(,$ordershow_channel) = Gc_Service_OrderChannel::getAllOrderChannel();\n\t\t$ordershow_channel = Common::resetKey($ordershow_channel, 'id');\n\t\t$this->assign('ordershow_channel', $ordershow_channel);\n\t\t\t\t\n\t\t$this->assign('info', $info);\n\t}", "public function editAction()\n {\n \t//set the journey id\n \t$this->setJourneyId();\n\n \t//get the id\n \t$id = $this->params()->fromRoute(\"id\", \"\");\n\n \tif ($id == \"\")\n \t{\n \t\t//set the message and return to the index page.\n \t\t$this->flashMessenger()->addErrorMessage(\"Communication could not be loaded. ID is not set\");\n\n \t\t//redirect to the index page\n \t\treturn $this->redirect()->toRoute(\"front-comms-admin/comms\", array(\"journey_id\" => $this->journey_id));\n \t}//end if\n\n \t//load the commadmin details\n \t$objCommAdmin = $this->getCommsAdminModel()->fecthCommAdmin($id);\n\n \tif (!$objCommAdmin)\n \t{\n \t\t//set the message and return to the index page.\n \t\t$this->flashMessenger()->addErrorMessage(\"Communication could not be loaded. Data could not be located\");\n\n \t\t//redirect to the index page\n \t\treturn $this->redirect()->toRoute(\"front-comms-admin/comms\", array(\"journey_id\" => $this->journey_id));\n \t}//end if\n\n \t//check if communication is active, if so, prevent updates\n \tif ($objCommAdmin->get(\"active\") == 1)\n \t{\n \t\t//set the message and return to the index page.\n \t\t$this->flashMessenger()->addInfoMessage(\"Communications cannot be changed while active\");\n\n \t\t//redirect to the index page\n \t\treturn $this->redirect()->toRoute(\"front-comms-admin/comms\", array(\"journey_id\" => $this->journey_id));\n \t}//end if\n\n \t/**\n \t * Check some data conditions\n \t */\n \tif ($objCommAdmin->get(\"date_expiry\") == \"0000-00-00\" || $objCommAdmin->get(\"date_expiry\") == \"00-00-0000\" || $objCommAdmin->get(\"date_expiry\") == \"\")\n \t{\n \t\t$objCommAdmin->set(\"date_expiry\", \"\");\n \t}//end if\n\n \tif ($objCommAdmin->get(\"date_start\") == \"0000-00-00\" || $objCommAdmin->get(\"date_start\") == \"00-00-0000\" || $objCommAdmin->get(\"date_start\") == \"\")\n \t{\n \t\t$objCommAdmin->set(\"date_start\", \"\");\n \t}//end if\n\n \t//load the form\n \t$form = $this->getCommsAdminModel()->getCommsAdminForm(array(\"journey_id\" => $this->journey_id, \"comm_id\" => $id));\n\n \t//remove public holiday field for now\n \tif ($form->has(\"not_send_public_holidays\"))\n \t{\n \t\t$form->remove(\"not_send_public_holidays\");\n \t}//end if\n\n \t//bind the data\n \t$form->bind($objCommAdmin);\n\n \t//set expiry date\n \tif ($form->has(\"date_expiry\") && $objCommAdmin->get(\"date_expiry\") != \"\")\n \t{\n \t\tif ($objCommAdmin->get(\"date_expiry\") != \"0000-00-00\")\n \t\t{\n \t\t\t$form->get(\"date_expiry\")->setValue($objCommAdmin->get(\"date_expiry\"));\n \t\t}//end if\n \t}//end if\n\n \tif ($form->has(\"date_start\") && $objCommAdmin->get(\"date_start\") != \"\")\n \t{\n \t\tif ($objCommAdmin->get(\"date_start\") != \"0000-00-00\")\n \t\t{\n \t\t\t$form->get(\"date_start\")->setValue($objCommAdmin->get(\"date_start\"));\n \t\t}//end if\n \t}//end if\n\n \t$request = $this->getRequest();\n \tif ($request->isPost())\n \t{\n \t\t//set the form data\n \t\t$form->setData($request->getPost());\n\n \t\tif ($form->isValid())\n \t\t{\n \t\t\ttry {\n \t\t\t\t$objCommAdmin = $form->getData();\n\n \t\t\t\t//set id from route\n \t\t\t\t$objCommAdmin->set(\"id\", $id);\n \t\t\t\t$objCommAdmin->set(\"not_send_public_holidays\", 0);\n \t\t\t\t$objCommAdmin = $this->getCommsAdminModel()->updateCommAdmin($objCommAdmin);\n\n \t\t\t\t//set the success message\n \t\t\t\t$this->flashMessenger()->addSuccessMessage(\"Communication has been updated\");\n\n \t\t\t\t//return to index page\n \t\t\t\treturn $this->redirect()->toRoute(\"front-comms-admin/comms\", array(\"journey_id\" => $this->journey_id));\n \t\t\t} catch (\\Exception $e) {\n\t\t\t\t\t//set form error message\n\t\t\t\t\t$form = $this->frontFormHelper()->formatFormErrors($form, $e->getMessage());\n \t\t\t}//end catch\n \t\t}//end if\n \t}//end if\n\n \t//set communication delay time string based on set value\n \t$send_time_delay_text = $this->setCommDelayString($objCommAdmin->get(\"send_time\"));\n\n \treturn array(\n \t\t\t\"send_time_delay_text\" => $send_time_delay_text,\n \t\t\t\"form\" => $form,\n \t\t\t\"journey_id\" => $this->journey_id,\n \t\t\t\"objCommAdmin\" => $objCommAdmin,\n \t);\n }", "protected function getConfigForm()\n {\n // toDo: Add config to choose items showed by viewedItems\n return array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Settings'),\n 'icon' => 'icon-cogs',\n ),\n 'input' => array(\n array(\n 'type' => 'switch',\n 'label' => $this->l('Live mode'),\n 'name' => 'CAPTURELEADSXAVIER_LIVE_MODE',\n 'is_bool' => true,\n 'desc' => $this->l('Use this module in live mode'),\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => true,\n 'label' => $this->l('Enabled')\n ),\n array(\n 'id' => 'active_off',\n 'value' => false,\n 'label' => $this->l('Disabled')\n )\n ),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-envelope\"></i>',\n 'desc' => $this->l('Enter a valid email address'),\n 'name' => 'CAPTURELEADSXAVIER_ACCOUNT_EMAIL',\n 'label' => $this->l('Email'),\n ),\n array(\n 'type' => 'password',\n 'name' => 'CAPTURELEADSXAVIER_ACCOUNT_PASSWORD',\n 'label' => $this->l('Password'),\n ),\n array(\n 'type' => 'radio',\n 'label' => $this->l('Column selector'),\n 'name' => 'CAPTURELEADSXAVIER_COL_SEL',\n 'required' => true,\n 'is_bool' => true,\n 'desc' => $this->l('Select on what column you want the module'),\n 'values' => array(\n array(\n 'id' => 'col_left',\n 'value' => \"left\",\n 'label' => $this->l('Left')\n ),\n array(\n 'id' => 'col_right',\n 'value' => \"right\",\n 'label' => $this->l('Right')\n )\n\n ),\n ),\n \n ),\n 'submit' => array(\n 'title' => $this->l('Save'),\n )\n )\n );\n }", "public function editAction()\n {\n $curriculumdocId = $this->getRequest()->getParam('id');\n $curriculumdoc = $this->_initCurriculumdoc();\n if ($curriculumdocId && !$curriculumdoc->getId()) {\n $this->_getSession()->addError(\n Mage::helper('bs_curriculumdoc')->__('This curriculum doc no longer exists.')\n );\n $this->_redirect('*/*/');\n return;\n }\n $data = Mage::getSingleton('adminhtml/session')->getCurriculumdocData(true);\n if (!empty($data)) {\n $curriculumdoc->setData($data);\n }\n Mage::register('curriculumdoc_data', $curriculumdoc);\n $this->loadLayout();\n\n $this->_title(Mage::helper('bs_curriculumdoc')->__('Training List'))\n ->_title(Mage::helper('bs_curriculumdoc')->__('Curriculum Documents'));\n if ($curriculumdoc->getId()) {\n $this->_title($curriculumdoc->getCdocName());\n } else {\n $this->_title(Mage::helper('bs_curriculumdoc')->__('Add curriculum doc'));\n }\n if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {\n $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);\n }\n $this->renderLayout();\n }", "function settingEditDetail($id=null)\n\t\t {\n \n\t\t //pr($this->common->getMasterPasswordForUser());\n\t\t\t\t $this->set('Setting',$this->Setting->settingEditDetail($id));\n\t }", "public function information_update() {\r\n $this->check_permission(16);\r\n $content_data['add'] = $this->check_page_action(16, 'add');\r\n $content_data['product_list'] = $this->get_product_list();\r\n $content_data['shift_list'] = $this->get_shift_list();\r\n $content_data['category_list'] = $this->get_category_list();\r\n $this->quick_page_setup(Settings_model::$db_config['adminpanel_theme'], 'adminpanel', $this->lang->line('information_update'), 'operation/information_update', 'header', 'footer', '', $content_data);\r\n }" ]
[ "0.67561996", "0.6729834", "0.6662804", "0.654979", "0.6539931", "0.6443822", "0.64117265", "0.63907295", "0.63095635", "0.6298445", "0.6286118", "0.6143969", "0.61320746", "0.6130783", "0.61174816", "0.6117036", "0.60965294", "0.6095227", "0.6069843", "0.6060225", "0.6044998", "0.6029883", "0.6009153", "0.60007685", "0.5990908", "0.5988213", "0.5965369", "0.59577906", "0.5952006", "0.59410304", "0.59321415", "0.5911775", "0.5895732", "0.58952427", "0.5890416", "0.588763", "0.5884766", "0.58818245", "0.5864438", "0.5862675", "0.5861468", "0.5839529", "0.5839529", "0.5838063", "0.5826881", "0.58248496", "0.58210313", "0.58095026", "0.5800134", "0.5796234", "0.5794269", "0.57900083", "0.5786606", "0.5783968", "0.57804966", "0.578027", "0.578027", "0.578027", "0.5778335", "0.57776135", "0.57776135", "0.57776135", "0.57775205", "0.57768536", "0.57763225", "0.577334", "0.5768832", "0.5768361", "0.5765001", "0.5759368", "0.5754815", "0.5754815", "0.5754815", "0.5754815", "0.5754815", "0.5754815", "0.5754815", "0.5754815", "0.5754815", "0.5754815", "0.5754815", "0.5754815", "0.5750452", "0.573608", "0.5735599", "0.5733869", "0.57337534", "0.5730768", "0.57301027", "0.5729332", "0.57281333", "0.5714095", "0.571181", "0.5705604", "0.5704856", "0.5704795", "0.5699188", "0.5694639", "0.5687074", "0.5686273" ]
0.65149677
5
Save global configuration values
public function saveAction() { $pageCode = $this->getRequest()->getParam('page_code'); $config = $this->initConfig($pageCode); $session = Mage::getSingleton('adminhtml/session'); try { $section = $config->getData('codes/section'); $website = $this->getRequest()->getParam('website'); $store = $this->getRequest()->getParam('store'); $groups = $this->getRequest()->getPost('groups'); $configData = Mage::getModel('adminhtml/config_data'); $configData->setSection($section) ->setWebsite($website) ->setStore($store) ->setGroups($groups) ->save(); $session->addSuccess(Mage::helper('novalnet_payment')->__('The configuration has been saved.')); } catch (Mage_Core_Exception $e) { foreach (explode("\n", $e->getMessage()) as $message) { $session->addError($message); } } catch (Exception $e) { $msg = Mage::helper('novalnet_payment')->__('An error occurred while saving:') . ' ' . $e->getMessage(); $session->addException($e, $msg); } $this->_redirectByPageConfig(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function save()\n\t{\n\t\t$h = fopen(WEBDEV_CONFIG_FILE, 'w');\n\t\tfwrite($h, \"<?php\\n return \" .var_export($this->config->all(), true) .';');\n\t\tfclose($h);\n\t}", "public function save()\n {\n $config_content = file_get_contents($this->config_path);\n\n foreach ($this->fields as $configuration => $value) {\n $config_content = str_replace(str_replace('\\\\', '\\\\\\\\', $value['default']), str_replace('\\\\', '\\\\\\\\', $this->configurations[$configuration]), $config_content);\n config([$value['config'] => str_replace('\\\\', '\\\\\\\\', $this->configurations[$configuration])]); //Reset the config value\n }\n\n file_put_contents($this->config_path, $config_content);\n }", "function save_settings() {\n\t\t$this->update_option( static::SETTINGS_KEY, $this->settings );\n\t}", "public function save()\n\t{\n\t\t$json = json_encode($this->config, JSON_PRETTY_PRINT);\n\n\t\tif (!$h = fopen(self::$configPath, 'w'))\n\t\t{\n\t\t\tdie('Could not open file ' . self::$configPath);\n\t\t}\n\n\t\tif (!fwrite($h, $json))\n\t\t{\n\t\t\tdie('Could not write file ' . self::$configPath);\n\t\t}\n\n\t\tfclose($h);\n\t}", "public function config_save() {\n }", "public function saveConfigOptions() {}", "private function saveConfig() {\n \tself::$_configInstance = (object)$this->_data; \n file_put_contents($this->_data['cache_config_file'],serialize(self::$_configInstance)); \n }", "public function system_save_preference()\n {\n System_helper::save_preference();\n }", "function saveSettings() {\n\tglobal $settings;\n\n\tfile_put_contents(\"settings.json\",json_encode($settings));\n}", "public function saveConfig() {\r\n\t$configObj = new \\config(PROFILE_PATH . '/' . $this->name . '/config.php', TRUE);\r\n\t$config = array();\r\n\tinclude($this->name . '/config.php');\r\n\t$config = array_intersect_key(\\app::$config, $config);\r\n\treturn $configObj->saveConfig($config);\r\n }", "public function saveSettingAction(){\n $configKey = array('api_key', 'api_secret','include_folders','resize_auto',\n 'resize_image','min_size','max_size','compression_type_pdf','compression_type_png','compression_type_jpg','compression_type_gif', 'saving_auto', 'compress_auto', 'cron_periodicity', 'reindex_init');\n $coreConfig = Mage::getConfig();\n $post = $this->getRequest()->getPost();\n foreach ($configKey as $key) { \n if (isset($post[$key])) { \n $coreConfig->saveConfig(\"mageio_\".$key, Mage::helper('core')->escapeHtml($post[$key]))->cleanCache();\n }\n }\n\t\t$installed_time = Mage::getStoreConfig('mageio_installed_time');\n if(empty($installed_time)) {\n $installed_time = time();\n $coreConfig = Mage::getConfig();\n $coreConfig->saveConfig('mageio_installed_time', Mage::helper('core')->escapeHtml($installed_time))->cleanCache();\n }\n\t\t//Remove error message if set\n\t\t$coreConfig->saveConfig(\"mageio_errormessage\", Mage::helper('core')->escapeHtml(null))->cleanCache();\n\t\t\n\t\t$this->_redirect('imagerecycle/index/index');\n\t}", "protected function saveConfig() {\n return $this->updateConfigValues(array(\n 'PAYNETEASY_END_POINT',\n 'PAYNETEASY_LOGIN',\n 'PAYNETEASY_SIGNING_KEY',\n 'PAYNETEASY_SANDBOX_GATEWAY',\n 'PAYNETEASY_PRODUCTION_GATEWAY',\n 'PAYNETEASY_GATEWAY_MODE'\n ));\n }", "private function saveConfig(){\n\t\tif(!isset($_POST['services_ipsec_settings_enabled'])){\n\t\t\t$this->data['enable'] = 'false';\n\t\t}\n\t\telseif($_POST['services_ipsec_settings_enabled'] == 'true'){\n\t\t\t$this->data['enable'] = 'true';\n\t\t}\n\t\t\n\t\t$this->config->saveConfig();\n\t\t$this->returnConfig();\n\t}", "public function Save()\n {\n $content = \"\";\n foreach ($this->vars as $key => $elem) {\n $content .= \"[\".$key.\"]\\n\";\n foreach ($elem as $key2 => $elem2) {\n $content .= $key2.\" = \\\"\".$elem2.\"\\\"\\n\";\n }\n $content .= \"\\n\";\n }\n if (!$handle = @fopen($this->fileName, 'w')) {\n error_log(\"Config::Save() - Could not open file('\".$this->fileName.\"') for writing, error.\");\n }\n if (!fwrite($handle, $content)) {\n error_log(\"Config::Save() - Could not write to open file('\" . $this->fileName .\"'), error.\");\n }\n fclose($handle);\n }", "public function saveSettings()\n {\n if (empty($this->settings)) {\n $this->loadSettings();\n }\n \n $this->saveJSON($this->settings);\n }", "public function saveConfVars()\n {\n if ($this->getEditObjectId() === 'findologic_module') {\n $this->_saveConfVars();\n } else {\n parent::saveConfVars();\n }\n }", "public function saveSettings()\n {\n $this->store->save($this->data);\n }", "public function saveSettings()\n {\n return $this->config->saveFile();\n }", "private function _saveDefault() {\r\n\r\n // get current configuration object\r\n $sefConfig = & Sh404sefFactory::getConfig();\r\n\r\n //clear config arrays, unless POST is empty, meaning this is first attempt to save config\r\n if (!empty($_POST)) {\r\n $sefConfig->skip = array();\r\n $sefConfig->nocache = array();\r\n $sefConfig->notTranslateURLList = array();\r\n $sefConfig->notInsertIsoCodeList = array();\r\n $sefConfig->shDoNotOverrideOwnSef = array();\r\n $sefConfig->useJoomsefRouter = array();\r\n $sefConfig->useAcesefRouter = array();\r\n $sefConfig->shLangTranslateList = array();\r\n $sefConfig->shLangInsertCodeList = array();\r\n $sefConfig->compEnablePageId = array();\r\n $sefConfig->defaultComponentStringList = array();\r\n $sefConfig->useJoomlaRouter = array();\r\n }\r\n if (empty($_POST['debugToLogFile'])) {\r\n $sefConfig->debugStartedAt = 0;\r\n } else {\r\n $sefConfig->debugStartedAt = empty($sefConfig->debugStartedAt) ? time() : $sefConfig->debugStartedAt;\r\n }\r\n\r\n }", "private function _loadGlobalSettings(){\r\n\r\n $settings = ROOT.DS.'site'.DS.'content'.DS.'global_settings.json';\r\n\r\n if(file_exists($settings)){\r\n $this->globalSettings = json_decode(file_get_contents($settings));\r\n } else {\r\n $globalSettings = new stdClass();\r\n $globalSettings->website_name = '';\r\n $globalSettings->global_script = '';\r\n file_put_contents($settings, json_encode($globalSettings));\r\n }\r\n\r\n }", "function saveConfiguration() {\n//\t\t$field_value = DevblocksPlatform::importGPC($_POST['field_value']);\n//\t\t$this->params['field_name'] = $field_value;\n\t}", "public function save_settings()\n\t{\n\t\t// Create settings array.\n\t\t$settings = array();\n\n\t\t// Loop through default settings and check for saved values.\n\t\tforeach (ee()->simple_cloner_settings->_default_settings as $key => $value)\n\t\t{\n\t\t\tif(($settings[$key] = ee()->input->post($key)) == FALSE)\n\t\t\t{\n\t\t\t\t$settings[$key] = $value;\n\t\t\t}\n\t\t}\n\n\t\t// Serialize settings array and update the extensions table.\n\t\tee()->db->where('class', $this->class_name.'_ext');\n\t\tee()->db->update('extensions', array('settings' => serialize($settings)));\n\n\t\t// Create alert when settings are saved and redirect back to settings page.\n\t\tee('CP/Alert')->makeInline('simple-cloner-save')\n\t\t\t->asSuccess()\n\t\t\t->withTitle(lang('message_success'))\n\t\t\t->addToBody(lang('preferences_updated'))\n\t\t\t->defer();\n\n\t\tee()->functions->redirect(ee('CP/URL')->make('addons/settings/simple_cloner'));\n\t}", "public function saveConfig($data, $values);", "public function save()\n\t{\n\t\t$this->componentConfig->save();\n\t}", "function saveConfiguration() {\r\n foreach($_POST as $configuration_key=>$configuration_value){\r\n\t\t\t\tif(stripos($configuration_key, \"haendlerbund\")!==false) {\r\n\t\t\t\t\t$sql = xtc_db_query(\"SELECT * FROM configuration WHERE configuration_key='\".$configuration_key.\"' LIMIT 1\");\r\n\t\t\t\t\tif(xtc_db_num_rows($sql)) {\r\n\t\t\t\t\t\txtc_db_query(\"UPDATE configuration SET configuration_value='\".$configuration_value.\"' WHERE configuration_key='\".$configuration_key.\"' LIMIT 1\");\r\n\t\t\t\t\t}\r\n\t\t\t\t} \r\n\t\t\t}\r\n\t\t}", "function saveExternalSettings()\n\t\t{\n\t\t\t$this->Init();\n\n\t\t\t$props = array();\n\t\t\t$props[PR_EC_OUTOFOFFICE] = $this->settings[\"outofoffice\"][\"set\"] == \"true\";\n\t\t\t$props[PR_EC_OUTOFOFFICE_MSG] = utf8_to_windows1252($this->settings[\"outofoffice\"][\"message\"]);\n\t\t\t$props[PR_EC_OUTOFOFFICE_SUBJECT] = utf8_to_windows1252($this->settings[\"outofoffice\"][\"subject\"]);\n\t\n\t\t\tmapi_setprops($this->store, $props);\n\t\t\tmapi_savechanges($this->store);\n\t\t\t\n\t\t\t// remove external settings so we don't save the external settings to PR_EC_WEBACCESS_SETTINGS\n\t\t\tunset($this->settings[\"outofoffice\"]);\n\t\t}", "public static function save()\n\t{\n\t\tConfigManager::save('discord', self::load(), 'config');\n\t}", "public function saveSettings(){\n\n $vars = $this->getAllSubmittedVariablesByName();\n\n $vars['email'] = $this->email;\n $vars['firstname'] = $this->firstname;\n $vars['lastname'] = $this->lastname;\n $vars['real_name'] = $this->firstname .' ' .$this->lastname;\n $vars['phone'] = $this->phone;\n\n $vars['name'] = $this->firstname;\n $vars['surname'] = $this->lastname;\n $vars['screen_name'] = $this->firstname;\n\n\n $vars['about_my_artwork'] = $this->getSubmittedVariableByName('about_my_artwork');\n $vars['what_i_like_to_do'] = $this->getSubmittedVariableByName('what_i_like_to_do');\n $vars['experience'] = $this->getSubmittedVariableByName('experience');\n $vars['instructions'] = $this->getSubmittedVariableByName('instructions');\n $vars['aftercare'] = $this->getSubmittedVariableByName('aftercare');\n $vars['apprenticeship'] = $this->getSubmittedVariableByName('apprenticeship');\n\n $this->saveNamedVariables($vars);\n }", "private function save_configuration_bundle() {\n\t\t$this->configuration_bundle = array();\n\t\t// Some items must always be saved + restored; others only on a migration\n\t\t// Remember, if modifying this, that a restoration can include restoring a destroyed site from a backup onto a fresh WP install on the same URL. So, it is not necessarily desirable to retain the current settings and drop the ones in the backup.\n\t\t$keys_to_save = array('updraft_remotesites', 'updraft_migrator_localkeys', 'updraft_central_localkeys', 'updraft_restore_in_progress');\n\n\t\tif ($this->old_siteurl != $this->our_siteurl || (defined('UPDRAFTPLUS_RESTORE_ALL_SETTINGS') && UPDRAFTPLUS_RESTORE_ALL_SETTINGS)) {\n\t\t\tglobal $updraftplus;\n\t\t\t$keys_to_save = array_merge($keys_to_save, $updraftplus->get_settings_keys());\n\t\t\t$keys_to_save[] = 'updraft_backup_history';\n\t\t}\n\n\t\tforeach ($keys_to_save as $key) {\n\t\t\t$this->configuration_bundle[$key] = UpdraftPlus_Options::get_updraft_option($key);\n\t\t}\n\t}", "function save_config()\n\t{\n\t\t$pop3=post_param_integer('pop3',-1);\n\t\tif ($pop3!=-1)\n\t\t{\n\t\t\t$dpop3=post_param('dpop3');\n\t\t\t$GLOBALS['SITE_DB']->query_insert('prices',array('name'=>'pop3_'.$dpop3,'price'=>$pop3));\n\t\t\tlog_it('POINTSTORE_ADD_MAIL_POP3',$dpop3);\n\t\t}\n\t\t$this->_do_price_mail();\n\t}", "private function save_config()\n\t{\n\t\tif (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate())\n\t\t{\n\t\t\t$this->model_setting_setting->editSetting('payment_compropago', $this->request->post);\n\t\t\t$this->model_setting_setting->editSetting('payment_compropago_spei', $this->request->post);\n\t\t\t$this->session->data['success'] = $this->language->get('text_success');\n\n\t\t\t$this->register_webhook(\n\t\t\t\t$this->request->post['payment_compropago_publickey'],\n\t\t\t\t$this->request->post['payment_compropago_privatekey'],\n\t\t\t\t$this->request->post['payment_compropago_mode'] === '1'\n\t\t\t);\n\n\t\t\t$linkParams = 'user_token=' . $this->session->data['user_token'] . '&type=payment';\n\t\t\t$this->response->redirect($this->url->link('marketplace/extension', $linkParams, true));\n\t\t}\n\t}", "public function save_settings()\n {\n if(isset($_POST) && isset($_POST['api_settings'])) {\n $data = $_POST['api_settings'];\n update_option('api_settings', json_encode($data));\n }\n }", "private function __saveConfiguration()\n {\n //Check is submit the form\n if (Tools::isSubmit(BECOPAY_PREFIX . 'submit')) {\n\n //clear errors messages\n $this->_errors = array();\n\n //validate is set configuration field\n foreach ($this->config['configuration'] as $config) {\n if ($config['isRequired'] && Tools::getValue(BECOPAY_PREFIX . $config['name']) == NULL)\n $this->_errors[] = $this->l($config['title'] . ' is require');\n }\n\n //if has no errors check with PaymentGateway Constructor validation\n if (empty($this->_errors)) {\n try {\n new PaymentGateway(\n Tools::getValue(BECOPAY_PREFIX . 'apiBaseUrl'),\n Tools::getValue(BECOPAY_PREFIX . 'apiKey'),\n Tools::getValue(BECOPAY_PREFIX . 'mobile')\n );\n } catch (\\Exception $e) {\n $this->_errors[] = $e->getMessage();\n }\n }\n\n //Display error messages if has error\n if (!empty($this->_errors)) {\n $this->_html = $this->displayError(implode('<br>', $this->_errors));\n } else {\n\n //save configuration form fields\n foreach ($this->config['configuration'] as $config)\n if (Tools::getValue(BECOPAY_PREFIX . $config['name']) != NULL)\n Configuration::updateValue(BECOPAY_PREFIX . $config['name'], trim(Tools::getValue(BECOPAY_PREFIX . $config['name'])));\n\n\n //display confirmation message\n $this->_html = $this->displayConfirmation($this->l('Settings updated'));\n }\n }\n }", "function saveSettings()\n\t\t{\n\t\t\t$this->Init();\n\n\t\t\t$this->saveExternalSettings();\n\t\t\t\n\t\t\t$settings = serialize(array(\"settings\"=>$this->settings));\n\t\n\t\n\t\t\t$stream = mapi_openpropertytostream($this->store, PR_EC_WEBACCESS_SETTINGS, MAPI_CREATE | MAPI_MODIFY);\n\t\t\tmapi_stream_setsize($stream, strlen($settings));\n\t\t\tmapi_stream_seek($stream, 0, STREAM_SEEK_SET);\n\t\t\tmapi_stream_write($stream, $settings);\n\t\t\tmapi_stream_commit($stream);\n\t\n\t\t\tmapi_savechanges($this->store);\n\t\n\t\t\t// reload settings from store...\n\t\t\t$this->retrieveSettings();\n\t\t}", "abstract protected function saveConfiguration($name, $value);", "public function save()\n\t{\n\t\tglobal $tpl, $lng, $ilCtrl;\n\t\n\t\t$pl = $this->getPluginObject();\n\t\t\n\t\t$form = $this->initConfigurationForm();\n\t\tif ($form->checkInput())\n\t\t{\n\t\t\t$set1 = $form->getInput(\"setting_1\");\n\t\t\t$set2 = $form->getInput(\"setting_2\");\n\t\n\t\t\t// @todo: implement saving to db\n\t\t\t\n\t\t\tilUtil::sendSuccess($pl->txt(\"saving_invoked\"), true);\n\t\t\t$ilCtrl->redirect($this, \"configure\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$form->setValuesByPost();\n\t\t\t$tpl->setContent($form->getHtml());\n\t\t}\n\t}", "function notification_user_settings_save() {\n\tglobal $CONFIG;\n\t//@todo Wha??\n\tinclude($CONFIG->path . \"actions/notifications/settings/usersettings/save.php\");\n}", "private function saveType()\n\t{\n\t\t// Build config file\n\t\t$config = \"<?php \\n\\n\";\n\t\t$config.= \"// This config file is auto generated on boot.\\n\\n\";\n\t\t$config.= 'define(\"INSTANCE_TYPE\", \"'.$this->instanceType.'\");'.\"\\n\";\n\t\t$config.= 'define(\"INSTANCE_NAME\", \"'.$this->instanceName.'\");'.\"\\n\";\n\t\t$config.= 'define(\"BRANCH\", \"'.$this->branch.'\");'.\"\\n\";\n\n\t\t// If bootstrapping the development server\n\t\tif($this->instanceDev)\n\t\t{\n\t\t\t$config.= 'define(\"DEV\", TRUE);'.\"\\n\";\n\t\t}\t\n\n\t\t// Write config file to config folder\n\t\tfile_put_contents(\"config/instance.config.php\", $config);\n\t}", "private function save() {\n global $config;\n\n //Save Config\n file_put_contents($config[\"usersFile\"],json_encode($this->users,JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT));\n }", "public function save()\n\t{\n\t\t// -> means the file was never loaded because no setting was changed\n\t\t// -> means no need to save\n\t\tif ($this->settings === null) return;\n\t\t\n\t\t$yaml = Spyc::YAMLDump($this->settings);\n\t}", "public static function saveCommonData()\n {\n // Save needed data\n $_SESSION[self::LAST_PAGE_SESSION_NAME] = Server::getAbsoluteURL();\n }", "public function save_settings() {\n\n\t\twoocommerce_update_options( $this->get_settings() );\n\t}", "private function defaultSettings()\n {\n\t\t$default_config = array(\n 'Plugins.Keypic.SigninEnabled' => false,\n\t\t\t 'Plugins.Keypic.SignupEnabled' => true,\n\t\t\t 'Plugins.Keypic.PostEnabled' => true,\n\t\t\t 'Plugins.Keypic.CommentEnabled' => true,\n\t\t\t 'Plugins.Keypic.SigninWidthHeight' => '1x1',\n\t\t\t 'Plugins.Keypic.SignupWidthHeight' => '1x1',\n\t\t\t 'Plugins.Keypic.PostWidthHeight' => '1x1',\n\t\t\t 'Plugins.Keypic.CommentWidthHeight' => '1x1',\n\t\t\t 'Plugins.Keypic.SignupRequestType' => 'getScript',\n\t\t\t 'Plugins.Keypic.SigninRequestType' => 'getScript',\n\t\t\t 'Plugins.Keypic.PostRequestType' => 'getScript',\n\t\t\t 'Plugins.Keypic.CommentRequestType' => 'getScript',\n\t\t );\n\t\t \n\t\tSaveToConfig($default_config);\n }", "public function Save() {\n\t\t\n\t\tglobal $sql;\n\t\tforeach( $this->settings as $option => $value ) {\n\t\t\t\n\t\t\t$this->update_option( $option, $value, $this->username );\n\t\t}\n\t}", "protected function setConfigValue($data){\t\n\t\tMage::getModel('core/config_data')->load($data['path'],'path')->setData($data)->save();\n\t}", "private function _saveAnalytics() {\r\n\r\n // get current configuration object\r\n $sefConfig = & Sh404sefFactory::getConfig();\r\n\r\n //clear config arrays, unless POST is empty, meaning this is first attempt to save config\r\n if (!empty($_POST)) {\r\n $sefConfig->analyticsExcludeIP = array();\r\n $sefConfig->analyticsUserGroups = array();\r\n\r\n // handle password\r\n $password = JRequest::getString( 'analyticsPassword', '********');\r\n\r\n // clear authorization cache if credentials have changed\r\n // if left as '********', we keep the old one\r\n if($password == '********' ) {\r\n JRequest::setVar( 'analyticsPassword', $sefConfig->analyticsPassword, 'POST');\r\n }\r\n }\r\n }", "private function _saveSec() {\r\n\r\n // get current configuration object\r\n $sefConfig = & Sh404sefFactory::getConfig();\r\n\r\n //set skip and nocache arrays, unless POST is empty, meaning this is first attempt to save config\r\n if (!empty($_POST)) {\r\n $sefConfig->shSecOnlyNumVars = array();\r\n $sefConfig->shSecAlphaNumVars = array();\r\n $sefConfig->shSecNoProtocolVars = array();\r\n $sefConfig->ipWhiteList = array();\r\n $sefConfig->ipBlackList = array();\r\n $sefConfig->uAgentWhiteList = array();\r\n $sefConfig->uAgentBlackList = array();\r\n }\r\n\r\n }", "function config_save($data) {\n $module = 'project/lpr';\n\n foreach ($data as $name => $value) {\n set_config($name, $value, $module);\n }\n\n return true;\n }", "public function save()\n {\n $values = array('company_name', 'website_name', 'website_description');\n foreach ($values as $value) \n ConfigHelper::save($value, Input::get($value));\n ConfigHelper::save_file('favicon');\n ConfigHelper::save_file('logo');\n ConfigHelper::save_file('login-logo');\n\n return Redirect::route('view_config')->with('message_title', 'Successful!')->with('message', 'Successfully updated the config!');\n }", "private function _saveConfVars()\n {\n $config = $this->getConfig();\n\n $this->resetContentCache();\n\n $this->_sModuleId = $this->getEditObjectId();\n $shopId = $config->getShopId();\n\n $moduleId = $this->_getModuleForConfigVars();\n\n foreach ($this->_aConfParams as $type => $param) {\n $confVars = $config->getRequestParameter($param);\n\n if (is_array($confVars)) {\n foreach ($confVars as $name => $value) {\n if (preg_match('/^[A-Z0-9]{32}$/', $value) || empty($value)) {\n $dbType = $this->_getDbConfigTypeName($type);\n $config->saveShopConfVar(\n $dbType,\n $name,\n $this->_serializeConfVar($dbType, $name, $value),\n $shopId,\n $moduleId\n );\n } else {\n return false;\n }\n }\n }\n }\n\n return true;\n }", "private function _globalSettings(){\r\n $result = new stdClass();\r\n $response = 400;\r\n\r\n if($this->hasLogin()){\r\n\r\n /*\r\n \t*\r\n \t*\r\n \t*\tCheck the method used is POST\r\n \t*\r\n \t*\r\n \t*/\r\n \tif($_SERVER['REQUEST_METHOD'] == 'POST'){\r\n\r\n foreach ($_POST as $name => $value) {\r\n $config = HTMLPurifier_Config::createDefault();\r\n $purifier = new HTMLPurifier($config);\r\n $clean_html = $purifier->purify($value);\r\n }\r\n\r\n $settings = new stdClass();\r\n $settings->website_name = isset($_POST['mrzpn-menu-website-name'])?$_POST['mrzpn-menu-website-name']:'';\r\n $settings->global_script = isset($_POST['mrzpn-menu-global-script'])?$_POST['mrzpn-menu-global-script']:'';\r\n\r\n if(file_put_contents(ROOT.DS.'site'.DS.'content'.DS.'global_settings.json', json_encode($settings))){\r\n $response = 200;\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n\r\n // Return the response\r\n http_response_code($response);\r\n echo json_encode($result);\r\n exit;\r\n\r\n\r\n }", "function saveConfigurationSettings() {\n\t$dbhost=$_POST['db_host'];\n\t$dbname=$_POST['db_name'];\n\t$dbuser=$_POST['db_user'];\n\t$dbpasswd=$_POST['db_passwd'];\n\t\n\t\n\t$dbprefix=($_POST['db_prefix']!=\"\"?$_POST['db_prefix']:\"V0_\");\n\t\n\tglobal $cmsFolder;\n\t$configFileText = '';\n\trequire_once('config-prototype.inc.php');\n\t$writeHandle = @fopen(\"../config.inc.php\", 'w');\n\tif (!$writeHandle)\n\t{\n\t\tdisplayError('Could not write to config.inc.php. Please make sure that the file is writable.');\n\t\treturn false;\n\t}\n\tfwrite($writeHandle, $configFileText);\n\tfclose($writeHandle);\n\tdisplayInfo(\"Configuration Successfully Saved!\");\n\n\tdefine(\"MYSQL_SERVER\",$dbhost);\n\tdefine(\"MYSQL_DATABASE\",$dbname);\n\tdefine(\"MYSQL_USERNAME\",$dbuser);\n\tdefine(\"MYSQL_PASSWORD\",$dbpasswd);\n\tdefine(\"MYSQL_DATABASE_PREFIX\",$dbprefix);\n\t\n\t\n\treturn true;\n}", "protected function saveFactoryState()\n\t{\n\t\t$this->savedFactoryState['application'] = JFactory :: $application;\n\t\t$this->savedFactoryState['config'] = JFactory :: $config;\n\t\t$this->savedFactoryState['session'] = JFactory :: $session;\n\t\t$this->savedFactoryState['language'] = JFactory :: $language;\n\t\t$this->savedFactoryState['document'] = JFactory :: $document;\n\t\t$this->savedFactoryState['acl'] = JFactory :: $acl;\n\t\t$this->savedFactoryState['database'] = JFactory::$database;\n\t\t$this->savedFactoryState['mailer'] = JFactory :: $mailer;\n\t\t$this->savedFactoryState['shconfig'] = SHFactory::$config;\n\t\t$this->savedFactoryState['shdispatcher'] = SHFactory::$dispatcher;\n\t}", "public static function Save()\r\n {\r\n return update_option(self::OPT_SETTINGS, self::$Data);\r\n }", "public function afterSave()\n {\n // forget current data\n Cache::forget('julius_multidomain_settings');\n\n // get all records available now\n $cacheableRecords = Setting::generateCacheableRecords();\n\n //save them in cache\n Cache::forever('julius_multidomain_settings', $cacheableRecords);\n }", "protected function setAppSettings()\n {\n // set the application time zone\n date_default_timezone_set($this->config->get('app.timezone','UTC'));\n\n // set the application character encoding\n mb_internal_encoding($this->config->get('app.encoding','UTF-8'));\n }", "function instance_config_save($data, $nolongerused = false) {\n global $DB;\n\n $config = clone($data);\n parent::instance_config_save($config, $nolongerused);\n }", "private function write_config_data()\n\t{\n\t\t$captcha_url = '{base_url}images/captchas/';\n\n\t\tforeach (array('avatar_path', 'photo_path', 'signature_img_path', 'pm_path', 'captcha_path', 'theme_folder_path') as $path)\n\t\t{\n\t\t\t$prefix = ($path != 'theme_folder_path') ? $this->root_theme_path : '';\n\t\t\t$this->userdata[$path] = rtrim(realpath($prefix.$this->userdata[$path]), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR;\n\t\t\t$this->userdata[$path] = str_replace($this->base_path, '{base_path}', $this->userdata[$path]);\n\t\t}\n\n\t\t$config = array(\n\t\t\t'db_port' => $this->userdata['db_port'],\n\t\t\t'db_hostname' => $this->userdata['db_hostname'],\n\t\t\t'db_username' => $this->userdata['db_username'],\n\t\t\t'db_password' => $this->userdata['db_password'],\n\t\t\t'db_database' => $this->userdata['db_name'],\n\t\t\t'db_dbprefix' => $this->getDbPrefix(),\n\t\t\t'db_char_set' => $this->userdata['db_char_set'],\n\t\t\t'db_collat' => $this->userdata['db_collat'],\n\t\t\t'app_version' => $this->userdata['app_version'],\n\t\t\t'debug' => '1',\n\t\t\t'site_index' => $this->userdata['site_index'],\n\t\t\t'site_label' => $this->userdata['site_label'],\n\t\t\t'base_path' => $this->base_path,\n\t\t\t'base_url' => $this->userdata['site_url'],\n\t\t\t'cp_url' => str_replace($this->userdata['site_url'], '{base_url}', $this->userdata['cp_url']),\n\t\t\t'site_url' => '{base_url}',\n\t\t\t'theme_folder_url' => '{base_url}themes/',\n\t\t\t'webmaster_email' => $this->userdata['email_address'],\n\t\t\t'webmaster_name' => '',\n\t\t\t'channel_nomenclature' => 'channel',\n\t\t\t'max_caches' => '150',\n\t\t\t'cache_driver' => 'file',\n\t\t\t'captcha_url' => $captcha_url,\n\t\t\t'captcha_path' => $this->userdata['captcha_path'],\n\t\t\t'captcha_font' => 'y',\n\t\t\t'captcha_rand' => 'y',\n\t\t\t'captcha_require_members' => 'n',\n\t\t\t'require_captcha' => 'n',\n\t\t\t'enable_sql_caching' => 'n',\n\t\t\t'force_query_string' => 'n',\n\t\t\t'show_profiler' => 'n',\n\t\t\t'include_seconds' => 'n',\n\t\t\t'cookie_domain' => '',\n\t\t\t'cookie_path' => '/',\n\t\t\t'cookie_prefix' => '',\n\t\t\t'website_session_type' => 'c',\n\t\t\t'cp_session_type' => 'c',\n\t\t\t'cookie_httponly' => 'y',\n\t\t\t'allow_username_change' => 'y',\n\t\t\t'allow_multi_logins' => 'y',\n\t\t\t'password_lockout' => 'y',\n\t\t\t'password_lockout_interval' => '1',\n\t\t\t'require_ip_for_login' => 'y',\n\t\t\t'require_ip_for_posting' => 'y',\n\t\t\t'require_secure_passwords' => 'n',\n\t\t\t'allow_dictionary_pw' => 'y',\n\t\t\t'name_of_dictionary_file' => '',\n\t\t\t'xss_clean_uploads' => 'y',\n\t\t\t'redirect_method' => $this->userdata['redirect_method'],\n\t\t\t'deft_lang' => $this->userdata['deft_lang'],\n\t\t\t'xml_lang' => 'en',\n\t\t\t'send_headers' => 'y',\n\t\t\t'gzip_output' => 'n',\n\t\t\t'is_system_on' => 'y',\n\t\t\t'allow_extensions' => 'y',\n\t\t\t'date_format' => '%n/%j/%Y',\n\t\t\t'time_format' => '12',\n\t\t\t'include_seconds' => 'n',\n\t\t\t'server_offset' => '',\n\t\t\t'default_site_timezone' => date_default_timezone_get(),\n\t\t\t'mail_protocol' => 'mail',\n\t\t\t'email_newline' => '\\n', // single-quoted for portability\n\t\t\t'smtp_server' => '',\n\t\t\t'smtp_username' => '',\n\t\t\t'smtp_password' => '',\n\t\t\t'email_smtp_crypto' => 'ssl',\n\t\t\t'email_debug' => 'n',\n\t\t\t'email_charset' => 'utf-8',\n\t\t\t'email_batchmode' => 'n',\n\t\t\t'email_batch_size' => '',\n\t\t\t'mail_format' => 'plain',\n\t\t\t'word_wrap' => 'y',\n\t\t\t'email_console_timelock' => '5',\n\t\t\t'log_email_console_msgs' => 'y',\n\t\t\t'log_search_terms' => 'y',\n\t\t\t'un_min_len' => '4',\n\t\t\t'pw_min_len' => '5',\n\t\t\t'allow_member_registration' => 'n',\n\t\t\t'allow_member_localization' => 'y',\n\t\t\t'req_mbr_activation' => 'email',\n\t\t\t'new_member_notification' => 'n',\n\t\t\t'mbr_notification_emails' => '',\n\t\t\t'require_terms_of_service' => 'y',\n\t\t\t'default_member_group' => '5',\n\t\t\t'profile_trigger' => 'member',\n\t\t\t'member_theme' => 'default',\n\t\t\t'enable_avatars' => 'y',\n\t\t\t'allow_avatar_uploads' => 'n',\n\t\t\t'avatar_url' => '{base_url}'.$this->userdata['avatar_url'],\n\t\t\t'avatar_path' => $this->userdata['avatar_path'],\n\t\t\t'avatar_max_width' => '100',\n\t\t\t'avatar_max_height' => '100',\n\t\t\t'avatar_max_kb' => '50',\n\t\t\t'enable_photos' => 'n',\n\t\t\t'photo_url' => '{base_url}'.$this->userdata['photo_url'],\n\t\t\t'photo_path' => $this->userdata['photo_path'],\n\t\t\t'photo_max_width' => '100',\n\t\t\t'photo_max_height' => '100',\n\t\t\t'photo_max_kb' => '50',\n\t\t\t'allow_signatures' => 'y',\n\t\t\t'sig_maxlength' => '500',\n\t\t\t'sig_allow_img_hotlink' => 'n',\n\t\t\t'sig_allow_img_upload' => 'n',\n\t\t\t'sig_img_url' => '{base_url}'.$this->userdata['signature_img_url'],\n\t\t\t'sig_img_path' => $this->userdata['signature_img_path'],\n\t\t\t'sig_img_max_width' => '480',\n\t\t\t'sig_img_max_height' => '80',\n\t\t\t'sig_img_max_kb' => '30',\n\t\t\t'prv_msg_enabled' => 'y',\n\t\t\t'prv_msg_allow_attachments' => 'y',\n\t\t\t'prv_msg_upload_path' => $this->userdata['pm_path'],\n\t\t\t'prv_msg_max_attachments' => '3',\n\t\t\t'prv_msg_attach_maxsize' => '250',\n\t\t\t'prv_msg_attach_total' => '100',\n\t\t\t'prv_msg_html_format' => 'safe',\n\t\t\t'prv_msg_auto_links' => 'y',\n\t\t\t'prv_msg_max_chars' => '6000',\n\t\t\t'enable_template_routes' => 'y',\n\t\t\t'strict_urls' => 'y',\n\t\t\t'site_404' => '',\n\t\t\t'save_tmpl_revisions' => 'n',\n\t\t\t'max_tmpl_revisions' => '5',\n\t\t\t'save_tmpl_files' => 'y',\n\t\t\t'deny_duplicate_data' => 'y',\n\t\t\t'redirect_submitted_links' => 'n',\n\t\t\t'enable_censoring' => 'n',\n\t\t\t'censored_words' => '',\n\t\t\t'censor_replacement' => '',\n\t\t\t'banned_ips' => '',\n\t\t\t'banned_emails' => '',\n\t\t\t'banned_usernames' => '',\n\t\t\t'banned_screen_names' => '',\n\t\t\t'ban_action' => 'restrict',\n\t\t\t'ban_message' => 'This site is currently unavailable',\n\t\t\t'ban_destination' => 'http://www.yahoo.com/',\n\t\t\t'enable_emoticons' => 'y',\n\t\t\t'emoticon_url' => '{base_url}'.'images/smileys/',\n\t\t\t'recount_batch_total' => '1000',\n\t\t\t'image_resize_protocol' => 'gd2',\n\t\t\t'image_library_path' => '',\n\t\t\t'thumbnail_prefix' => 'thumb',\n\t\t\t'word_separator' => 'dash',\n\t\t\t'use_category_name' => 'n',\n\t\t\t'reserved_category_word' => 'category',\n\t\t\t'auto_convert_high_ascii' => 'n',\n\t\t\t'new_posts_clear_caches' => 'y',\n\t\t\t'auto_assign_cat_parents' => 'y',\n\t\t\t'new_version_check' => 'y',\n\t\t\t'enable_throttling' => 'n',\n\t\t\t'banish_masked_ips' => 'y',\n\t\t\t'max_page_loads' => '10',\n\t\t\t'time_interval' => '8',\n\t\t\t'lockout_time' => '30',\n\t\t\t'banishment_type' => 'message',\n\t\t\t'banishment_url' => '',\n\t\t\t'banishment_message' => 'You have exceeded the allowed page load frequency.',\n\t\t\t'enable_search_log' => 'y',\n\t\t\t'max_logged_searches' => '500',\n\t\t\t'memberlist_order_by' => \"member_id\",\n\t\t\t'memberlist_sort_order' => \"desc\",\n\t\t\t'memberlist_row_limit' => \"20\",\n\t\t\t'is_site_on' => 'y',\n\t\t\t'theme_folder_path' => $this->userdata['theme_folder_path'],\n\t\t);\n\n\t\t// Default Administration Prefs\n\t\t$admin_default = array(\n\t\t\t'site_index',\n\t\t\t'base_url',\n\t\t\t'base_path',\n\t\t\t'cp_url',\n\t\t\t'site_url',\n\t\t\t'theme_folder_url',\n\t\t\t'webmaster_email',\n\t\t\t'webmaster_name',\n\t\t\t'channel_nomenclature',\n\t\t\t'max_caches',\n\t\t\t'captcha_url',\n\t\t\t'captcha_path',\n\t\t\t'captcha_font',\n\t\t\t'captcha_rand',\n\t\t\t'captcha_require_members',\n\t\t\t'require_captcha',\n\t\t\t'enable_sql_caching',\n\t\t\t'force_query_string',\n\t\t\t'show_profiler',\n\t\t\t'include_seconds',\n\t\t\t'cookie_domain',\n\t\t\t'cookie_path',\n\t\t\t'website_session_type',\n\t\t\t'cp_session_type',\n\t\t\t'allow_username_change',\n\t\t\t'allow_multi_logins',\n\t\t\t'password_lockout',\n\t\t\t'password_lockout_interval',\n\t\t\t'require_ip_for_login',\n\t\t\t'require_ip_for_posting',\n\t\t\t'require_secure_passwords',\n\t\t\t'allow_dictionary_pw',\n\t\t\t'name_of_dictionary_file',\n\t\t\t'xss_clean_uploads',\n\t\t\t'redirect_method',\n\t\t\t'deft_lang',\n\t\t\t'xml_lang',\n\t\t\t'send_headers',\n\t\t\t'gzip_output',\n\t\t\t'date_format',\n\t\t\t'time_format',\n\t\t\t'include_seconds',\n\t\t\t'server_offset',\n\t\t\t'default_site_timezone',\n\t\t\t'mail_protocol',\n\t\t\t'email_newline',\n\t\t\t'smtp_server',\n\t\t\t'smtp_username',\n\t\t\t'smtp_password',\n\t\t\t'email_smtp_crypto',\n\t\t\t'email_debug',\n\t\t\t'email_charset',\n\t\t\t'email_batchmode',\n\t\t\t'email_batch_size',\n\t\t\t'mail_format',\n\t\t\t'word_wrap',\n\t\t\t'email_console_timelock',\n\t\t\t'log_email_console_msgs',\n\t\t\t'log_search_terms',\n\t\t\t'deny_duplicate_data',\n\t\t\t'redirect_submitted_links',\n\t\t\t'enable_censoring',\n\t\t\t'censored_words',\n\t\t\t'censor_replacement',\n\t\t\t'banned_ips',\n\t\t\t'banned_emails',\n\t\t\t'banned_usernames',\n\t\t\t'banned_screen_names',\n\t\t\t'ban_action',\n\t\t\t'ban_message',\n\t\t\t'ban_destination',\n\t\t\t'enable_emoticons',\n\t\t\t'emoticon_url',\n\t\t\t'recount_batch_total',\n\t\t\t'new_version_check',\n\t\t\t'enable_throttling',\n\t\t\t'banish_masked_ips',\n\t\t\t'max_page_loads',\n\t\t\t'time_interval',\n\t\t\t'lockout_time',\n\t\t\t'banishment_type',\n\t\t\t'banishment_url',\n\t\t\t'banishment_message',\n\t\t\t'enable_search_log',\n\t\t\t'max_logged_searches',\n\t\t\t'theme_folder_path',\n\t\t\t'is_site_on'\n\t\t);\n\n\t\t$site_prefs = array();\n\n\t\tforeach($admin_default as $value)\n\t\t{\n\t\t\t$site_prefs[$value] = $config[$value];\n\t\t}\n\n\t\tee()->db->where('site_id', 1);\n\t\tee()->db->update('sites', array('site_system_preferences' => base64_encode(serialize($site_prefs))));\n\n\t\t// Default Members Prefs\n\t\t$member_default = array(\n\t\t\t'un_min_len',\n\t\t\t'pw_min_len',\n\t\t\t'allow_member_registration',\n\t\t\t'allow_member_localization',\n\t\t\t'req_mbr_activation',\n\t\t\t'new_member_notification',\n\t\t\t'mbr_notification_emails',\n\t\t\t'require_terms_of_service',\n\t\t\t'default_member_group',\n\t\t\t'profile_trigger',\n\t\t\t'member_theme',\n\t\t\t'enable_avatars',\n\t\t\t'allow_avatar_uploads',\n\t\t\t'avatar_url',\n\t\t\t'avatar_path',\n\t\t\t'avatar_max_width',\n\t\t\t'avatar_max_height',\n\t\t\t'avatar_max_kb',\n\t\t\t'enable_photos',\n\t\t\t'photo_url',\n\t\t\t'photo_path',\n\t\t\t'photo_max_width',\n\t\t\t'photo_max_height',\n\t\t\t'photo_max_kb',\n\t\t\t'allow_signatures',\n\t\t\t'sig_maxlength',\n\t\t\t'sig_allow_img_hotlink',\n\t\t\t'sig_allow_img_upload',\n\t\t\t'sig_img_url',\n\t\t\t'sig_img_path',\n\t\t\t'sig_img_max_width',\n\t\t\t'sig_img_max_height',\n\t\t\t'sig_img_max_kb',\n\t\t\t'prv_msg_enabled',\n\t\t\t'prv_msg_allow_attachments',\n\t\t\t'prv_msg_upload_path',\n\t\t\t'prv_msg_max_attachments',\n\t\t\t'prv_msg_attach_maxsize',\n\t\t\t'prv_msg_attach_total',\n\t\t\t'prv_msg_html_format',\n\t\t\t'prv_msg_auto_links',\n\t\t\t'prv_msg_max_chars',\n\t\t\t'memberlist_order_by',\n\t\t\t'memberlist_sort_order',\n\t\t\t'memberlist_row_limit'\n\t\t);\n\n\t\t$site_prefs = array();\n\n\t\tforeach($member_default as $value)\n\t\t{\n\t\t\t$site_prefs[$value] = $config[$value];\n\t\t}\n\n\t\tee()->db->where('site_id', 1);\n\t\tee()->db->update('sites', array('site_member_preferences' => base64_encode(serialize($site_prefs))));\n\n\t\t// Default Templates Prefs\n\t\t$template_default = array(\n\t\t\t'enable_template_routes',\n\t\t\t'strict_urls',\n\t\t\t'site_404',\n\t\t\t'save_tmpl_revisions',\n\t\t\t'max_tmpl_revisions',\n\t\t);\n\t\t$site_prefs = array();\n\n\t\tforeach($template_default as $value)\n\t\t{\n\t\t\t$site_prefs[$value] = $config[$value];\n\t\t}\n\n\t\tee()->db->where('site_id', 1);\n\t\tee()->db->update('sites', array('site_template_preferences' => base64_encode(serialize($site_prefs))));\n\n\t\t// Default Channels Prefs\n\t\t$channel_default = array(\n\t\t\t'image_resize_protocol',\n\t\t\t'image_library_path',\n\t\t\t'thumbnail_prefix',\n\t\t\t'word_separator',\n\t\t\t'use_category_name',\n\t\t\t'reserved_category_word',\n\t\t\t'auto_convert_high_ascii',\n\t\t\t'new_posts_clear_caches',\n\t\t\t'auto_assign_cat_parents',\n\t\t\t'enable_comments',\n\t\t\t'comment_word_censoring',\n\t\t\t'comment_moderation_override',\n\t\t\t'comment_edit_time_limit'\n\t\t);\n\n\t\t$site_prefs = array();\n\n\t\tforeach($channel_default as $value)\n\t\t{\n\t\t\tif (isset($config[$value]))\n\t\t\t{\n\t\t\t\t$site_prefs[$value] = $config[$value];\n\t\t\t}\n\t\t}\n\n\t\tee()->db->where('site_id', 1);\n\t\tee()->db->update('sites', array('site_channel_preferences' => base64_encode(serialize($site_prefs))));\n\n\t\t// Remove Site Prefs from Config\n\t\tforeach(array_merge($admin_default, $member_default, $template_default, $channel_default) as $value)\n\t\t{\n\t\t\tunset($config[$value]);\n\t\t}\n\n\t\t// Write the config file data\n\t\t$this->write_config_from_template($config);\n\n\t\treturn TRUE;\n\t}", "public function loadConfig()\n {\n $this->setGlobalStoreOfShopNumber($this->getShopNumber());\n $this->loadArray($this->toArray());\n $this->setExportTmpAndLogSettings();\n }", "function saveConfig(Config_Lite $inConfig) {\r\n\t\ttry {\r\n $inConfig->save();\r\n\t\t} catch (Config_Lite_Exception $e) {\r\n\t\t\techo \"\\n\" . 'Exception Message: ' . $e->getMessage();\r\n\t\t\twrite_log('Error saving configuration.','ERROR');\r\n\t\t}\r\n\t\t$configFile = dirname(__FILE__) . '/config.ini.php';\r\n\t\t$cache_new = \"'; <?php die('Access denied'); ?>\"; // Adds this to the top of the config so that PHP kills the execution if someone tries to request the config-file remotely.\r\n\t\t$cache_new .= file_get_contents($configFile);\r\n\t\tfile_put_contents($configFile,$cache_new);\r\n\t\t\r\n\t}", "private function putConfig(): void\n {\n /** @var array<string, array<string, string>> $alertOutputsFromConfig */\n $alertOutputsFromConfig = config('alert.output', []);\n\n foreach ($alertOutputsFromConfig as $plugin => $map) {\n if ($this->desiredOutput !== null && $this->desiredOutput != $plugin) {\n $this->session->remove(\"alert.$plugin\");\n continue;\n }\n\n $output = [];\n foreach ($map as $from => $to) {\n $output[$from] = $this->fields[$to] ?? '';\n }\n\n $this->session->put(\"alert.$plugin\", json_encode($output));\n }\n }", "private function saveData()\n { \n // Save form data in session\n if (count($this->post) > 0) {\n $_SESSION['gentlesource_voting_configuration'] = $this->post;\n $this->data = $this->post;\n $this->votingOptions = $this->post['votingOptions'];\n } else {\n if (isset($_SESSION['gentlesource_voting_configuration'])) {\n $this->data = $_SESSION['gentlesource_voting_configuration'];\n $this->votingOptions = $this->data['votingOptions'];\n }\n }\n }", "function save_config()\n\t{\n\t\t$i=0;\n\t\t$rows=list_to_map('id',$GLOBALS['SITE_DB']->query_select('pstore_customs',array('*')));\n\t\twhile (array_key_exists('custom_'.strval($i),$_POST))\n\t\t{\n\t\t\t$id=post_param_integer('custom_'.strval($i));\n\t\t\t$title=post_param('custom_title_'.strval($i));\n\t\t\t$description=post_param('custom_description_'.strval($i));\n\t\t\t$enabled=post_param_integer('custom_enabled_'.strval($i),0);\n\t\t\t$cost=post_param_integer('custom_cost_'.strval($i));\n\t\t\t$one_per_member=post_param_integer('custom_one_per_member_'.strval($i),0);\n\t\t\t$delete=post_param_integer('delete_custom_'.strval($i),0);\n\t\t\t$_title=$rows[$id]['c_title'];\n\t\t\t$_description=$rows[$id]['c_description'];\n\t\t\tif ($delete==1)\n\t\t\t{\n\t\t\t\tdelete_lang($_title);\n\t\t\t\tdelete_lang($_description);\n\t\t\t\t$GLOBALS['SITE_DB']->query_delete('pstore_customs',array('id'=>$id),'',1);\n\t\t\t} else\n\t\t\t{\n\t\t\t\t$GLOBALS['SITE_DB']->query_update('pstore_customs',array(\n\t\t\t\t\t'c_title'=>lang_remap($_title,$title),\n\t\t\t\t\t'c_description'=>lang_remap($_description,$description),\n\t\t\t\t\t'c_enabled'=>$enabled,\n\t\t\t\t\t'c_cost'=>$cost,\n\t\t\t\t\t'c_one_per_member'=>$one_per_member,\n\t\t\t\t),array('id'=>$id),'',1);\n\t\t\t}\n\t\t\t$i++;\n\t\t}\n\t\t$title=post_param('custom_title',NULL);\n\t\tif (!is_null($title))\n\t\t{\n\t\t\t$description=post_param('custom_description');\n\t\t\t$enabled=post_param_integer('custom_enabled',0);\n\t\t\t$cost=post_param_integer('custom_cost');\n\t\t\t$one_per_member=post_param_integer('custom_one_per_member',0);\n\n\t\t\t$GLOBALS['SITE_DB']->query_insert('pstore_customs',array(\n\t\t\t\t'c_title'=>insert_lang($title,2),\n\t\t\t\t'c_description'=>insert_lang($description,2),\n\t\t\t\t'c_enabled'=>$enabled,\n\t\t\t\t'c_cost'=>$cost,\n\t\t\t\t'c_one_per_member'=>$one_per_member,\n\t\t\t));\n\t\t}\n\t}", "function config_save($cfg) {\n\t\t$h = fopen(CONFIG_PATH,\"w+\");\n\t\tforeach ($cfg as $cam) {\n\t\t\t$cam_info = $cam[\"name\"].\" : \".$cam[\"hw\"].\"\\t\".$cam[\"width\"].\"x\".$cam[\"height\"].\"\\n\";\n\t\t\tfwrite($h, $cam_info);\n\t\t\tforeach ($cam[\"gates\"] as $gate) {\n\t\t\t\t$gate_info = \"\\t\".$gate[\"name\"].\"\\t(\".$gate[\"x1\"].\",\".$gate[\"y1\"].\")\\t(\".$gate[\"x2\"].\",\".$gate[\"y2\"].\")\\n\";\n\t\t\t\tfwrite($h, $gate_info);\n\t\t\t}\n\t\t}\n\t\tfclose($h);\n\t}", "function saveSettings()\n {\n\t if ( wfReadOnly() ) {\n\t\treturn;\n\t }\n\t if ( 0 == $this->mCedarId ) {\n\t\treturn;\n\t }\n\t \n\t $dbw =& wfGetDB( DB_MASTER );\n\t $dbw->update( 'cedar_user_info',\n\t\t array( /* SET */\n\t\t\t 'user_id' => $this->mId,\n\t\t\t 'organization' => $this->mOrg,\n\t\t\t 'address1' => $this->mAddress1,\n\t\t\t 'address2' => $this->mAddress2,\n\t\t\t 'city' => $this->mCity,\n\t\t\t 'state' => $this->mState,\n\t\t\t 'country' => $this->mCountry,\n\t\t\t 'postal_code' => $this->mPostalCode,\n\t\t\t 'phone' => $this->mPhone,\n\t\t\t 'mobile_phone' => $this->mMobilePhone,\n\t\t\t 'fax' => $this->mFax,\n\t\t\t 'supervisor_name' => $this->mSupervisorName,\n\t\t\t 'supervisor_email' => $this->mSupervisorEmail\n\t\t ), array( /* WHERE */\n\t\t\t 'user_info_id' => $this->mCedarId\n\t\t ), __METHOD__\n\t );\n\t $this->clearSharedCache();\n }", "function save_all() {\n\n // do not save another demo history if we already have one\n if (isset($this->ale_demo_history['demo_settings_date'])) {\n return;\n }\n\n $local_ale_demo_history = array();\n\n $local_ale_demo_history['page_on_front'] = get_option('page_on_front');\n $local_ale_demo_history['show_on_front'] = get_option('show_on_front');\n $local_ale_demo_history['nav_menu_locations'] = get_theme_mod('nav_menu_locations');\n\n $sidebar_widgets = get_option('sidebars_widgets');\n $local_ale_demo_history['sidebars_widgets'] = $sidebar_widgets;\n\n $used_widgets = $this->get_used_widgets($sidebar_widgets);\n\n\n if (is_array($used_widgets)) {\n foreach ($used_widgets as $used_widget) {\n $local_ale_demo_history['used_widgets'][$used_widget] = get_option('widget_' . $used_widget);\n }\n }\n\n $local_ale_demo_history['theme_options'] = get_option(ALETHEME_THEME_OPTIONS_NAME);\n $local_ale_demo_history['ale_social_networks'] = get_option('ale_social_networks');\n $local_ale_demo_history['demo_settings_date'] = time();\n update_option(ALETHEME_SHORTNAME . '_demo_history', $local_ale_demo_history);\n }", "public function saveParams()\r\n\t{\r\n\t\tforeach ($this->param_names as $param_name)\r\n\t\t{\r\n\t\t\t$funcname = 'get'.$param_name;\r\n\t\t\tif (_PS_VERSION_ < '1.5')\r\n\t\t\t\tConfiguration::updateValue('CERTISSIM_'.Tools::strtoupper($param_name), $this->$funcname());\r\n\t\t\telse\r\n\t\t\t\tConfiguration::updateValue('CERTISSIM_'.Tools::strtoupper($param_name), $this->$funcname(), false, null, $this->getIdshop());\r\n\t\t}\r\n\t}", "function asp_save_option($key, $global = false) {\r\r\n if ( !isset(wd_asp()->o[$key]) )\r\r\n return false;\r\r\n\r\r\n if ( $global ) {\r\r\n return update_site_option($key, wd_asp()->o[$key]);\r\r\n } else {\r\r\n return update_option($key, wd_asp()->o[$key]);\r\r\n }\r\r\n}", "public function save() {\n $configdata = $this->get('configdata');\n if (!array_key_exists('defaultvalue_editor', $configdata)) {\n $this->field->save();\n return;\n }\n\n if (!$this->get('id')) {\n $this->field->save();\n }\n\n // Store files.\n $textoptions = $this->value_editor_options();\n $tempvalue = (object) ['defaultvalue_editor' => $configdata['defaultvalue_editor']];\n $tempvalue = file_postupdate_standard_editor($tempvalue, 'defaultvalue', $textoptions, $textoptions['context'],\n 'customfield_textarea', 'defaultvalue', $this->get('id'));\n\n $configdata['defaultvalue'] = $tempvalue->defaultvalue;\n $configdata['defaultvalueformat'] = $tempvalue->defaultvalueformat;\n unset($configdata['defaultvalue_editor']);\n $this->field->set('configdata', json_encode($configdata));\n $this->field->save();\n }", "public function configSave()\n\t{\n\t\t$section = Mage::app()->getRequest()->getParam('section');\n\t\tif ($section == 'mtghost_design')\n\t\t{\n\t\t\t$websiteCode = Mage::app()->getRequest()->getParam('website');\n\t\t\t$storeCode = Mage::app()->getRequest()->getParam('store');\n\t\t\t\n\t\t\tMage::getSingleton('mtghost/cssgen_generator')->generateCss('design', $websiteCode, $storeCode);\n\t\t}else if($section == 'mtghost'){\n $websiteCode = Mage::app()->getRequest()->getParam('website');\n $storeCode = Mage::app()->getRequest()->getParam('store');\n\n Mage::getSingleton('mtghost/cssgen_generator')->generateCss('layout', $websiteCode, $storeCode);\n }\n\t}", "function saveSettings() {\n\t\t//# convert class variables into an array and save using\n\t\t//# Wordpress functions, \"update_option\" or \"add_option\"\n\t\t//#convert class into array...\n\t\t$settings_array = array();\n\t\t$obj = $this;\n\t\tforeach (array_keys(get_class_vars(get_class($obj))) as $k){\n\t\t\tif (is_array($obj->$k)) {\n\t\t\t\t//serialize any arrays within $obj\n\t\t\t\tif (count($obj->$k)>0) {\n\t\t\t\t\t$settings_array[$k] = esc_attr(serialize($obj->$k));\n\t\t\t\t} else {\n\t\t\t\t\t$settings_array[$k] = \"\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$settings_array[$k] = \"{$obj->$k}\";\n\t\t\t}\n\t\t}\n\t\t//#save array to options table...\n\t\t$options_check = get_option('wassup_settings');\n\t\tif (!empty($options_check)) {\n\t\t\tupdate_option('wassup_settings', $settings_array);\n\t\t} else {\n\t\t\tadd_option('wassup_settings', $settings_array, 'Options for WassUp');\n\t\t}\n\t\treturn true;\n\t}", "public function save_currency_settings() {\n if ($this->checkLogin('A') == '') {\n redirect(ADMIN_ENC_URL);\n } else {\n if ($this->checkPrivileges('admin', '2') == TRUE) {\n $condition = array('admin_id' => '1');\n $this->admin_model->commonInsertUpdate(ADMIN, 'update', array(), array(), $condition);\n $currency_settings_val = $this->input->post(\"currency\");\n $config = '<?php ';\n foreach ($currency_settings_val as $key => $val) {\n $value = addslashes($val);\n $config .= \"\\n\\$config['$key'] = '$value'; \";\n }\n $config .= \"\\n ?>\";\n $file = 'commonsettings/dectar_currency_settings.php';\n file_put_contents($file, $config);\n $this->setErrorMessage('success', 'Currency settings updated successfully','admin_adminlogin_currency_setting_updated');\n redirect(ADMIN_ENC_URL.'/adminlogin/admin_currency_settings');\n } else {\n redirect(ADMIN_ENC_URL);\n }\n }\n }", "function instance_config_save($data, $nolongerused = false) {\n\n //If the is_form_submission or config_is_form_submission property is set in the object,\n //then this is a valid form submission that will be saved to the config\n if (isset($data->is_form_submission) || isset($data->config_is_form_submission)) {\n \n //process form data submission into a data string\n $data_string = dd_content_process_settings_form($data);\n\n $config_data = new stdClass();//create a config object\n $config_data->data = $data_string;//set the data to be our processed string\n \n //add any non-submission fields back into config based on existing config\n //ex: orientation\n dd_content_add_non_standard_form_data($this, $config_data);\n parent::instance_config_save($config_data);\n } else {//In the case its not set, then we are updating the configuration\n //in specialization its unserialized - needs to be re-serialized before savint\n $data->data = dd_content_serialize($data->data);\n parent::instance_config_save($data);\n }\n }", "public function save() {\n\t\t$vars = $this->vars;\n\t\t$this->copyFromTemplateIfNeeded();\n\t\t$lines = file($this->filePath);\n\t\tforeach ($lines as $key => $line) {\n\t\t\tif (preg_match(\"/^(.+)vars\\[('|\\\")(.+)('|\\\")](.*)=(.*)\\\"(.*)\\\";(.*)$/si\", $line, $arr)) {\n\t\t\t\t$lines[$key] = \"$arr[1]vars['$arr[3]']$arr[5]=$arr[6]\\\"{$vars[$arr[3]]}\\\";$arr[8]\";\n\t\t\t\tunset($vars[$arr[3]]);\n\t\t\t} elseif (preg_match(\"/^(.+)vars\\[('|\\\")(.+)('|\\\")](.*)=([ \t]+)([0-9]+);(.*)$/si\", $line, $arr)) {\n\t\t\t\t$lines[$key] = \"$arr[1]vars['$arr[3]']$arr[5]=$arr[6]{$vars[$arr[3]]};$arr[8]\";\n\t\t\t\tunset($vars[$arr[3]]);\n\t\t\t}\n\t\t}\n\n\t\tunset($vars['module_load_paths']); // hacky\n\n\t\t// if there are additional vars which were not present in the config\n\t\t// file or in template file then add them at end of the config file\n\t\tif (!empty($vars)) {\n\t\t\t$lines []= \"<?php\\n\";\n\t\t\tforeach ($vars as $name => $value) {\n\t\t\t\tif (is_string($value)) {\n\t\t\t\t\t$lines []= \"\\$vars['$name'] = \\\"$value\\\";\\n\";\n\t\t\t\t} else {\n\t\t\t\t\t$lines []= \"\\$vars['$name'] = $value;\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t$lines []= \"\\n\";\n\t\t}\n\n\t\tfile_put_contents($this->filePath, $lines);\n\t}", "public function save()\n {\n $this->save_meta_value('_sim_city_main_info', $this->city_main_info);\n\n $this->save_meta_value('_sim_city_shops', $this->city_shops);\n }", "function getConfigurationValues() ;", "public function writeConfig() {\n $mergedTemplate = $this->mergeTemplate();\n file_put_contents(\"{$this->settings['paths']['hostConfigDir']}/{$this->params['name']}.cfg\", $mergedTemplate);\n file_put_contents(\"{$this->settings['paths']['hostTrackDir']}/{$this->params['type']}.inf\", \"{$this->params['name']}:{$this->params['instanceId']}\" . PHP_EOL, FILE_APPEND);\n $this->logChange();\n }", "public function save()\n\t{\n\t\tFile::disk()->put($this->configPath, YAML::dump($this->configData));\n\n\t\tArtisan::call(sprintf('favicon:generate --site=%s', $this->handle));\n\t}", "public function save_settings() {\n\n\t\tif ( !isset( $_REQUEST['action'] ) || !isset( $_GET['page'] ) )\n\t\t\treturn;\n\n\t\tif ( 'vfb-settings' !== $_GET['page'] )\n\t\t\treturn;\n\n\t\tif ( 'vfb_settings' !== $_REQUEST['action'] )\n\t\t\treturn;\n\n\t\tcheck_admin_referer( 'vfb-update-settings' );\n\n\t\t$data = array();\n\n\t\tforeach ( $_POST['vfb-settings'] as $key => $val ) {\n\t\t\t$data[ $key ] = esc_html( $val );\n\t\t}\n\n\t\tupdate_option( 'vfb-settings', $data );\n\t}", "function saveGeneralPageSettingsObject()\n\t{\n\t\tglobal $ilCtrl, $lng, $tpl;\n\t\t\n\t\t$form = $this->initGeneralPageSettingsForm();\n\t\tif ($form->checkInput())\n\t\t{\n\t\t\t$aset = new ilSetting(\"adve\");\n\t\t\t$aset->set(\"use_physical\", $_POST[\"use_physical\"]);\n\t\t\tif ($_POST[\"block_mode_act\"])\n\t\t\t{\n\t\t\t\t$aset->set(\"block_mode_minutes\", (int) $_POST[\"block_mode_minutes\"]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$aset->set(\"block_mode_minutes\", 0);\n\t\t\t}\n\t\t\t\n\t\t\tilUtil::sendSuccess($lng->txt(\"msg_obj_modified\"), true);\n\t\t\t$ilCtrl->redirect($this, \"showGeneralPageEditorSettings\");\n\t\t}\n\t\t\n\t\t$form->setValuesByPost();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "function Save()\n\t{\n\n\t\trequire_once(SENDSTUDIO_BASE_DIRECTORY . DIRECTORY_SEPARATOR . 'addons' . DIRECTORY_SEPARATOR . 'interspire_addons.php');\n\n\t\tif (!is_writable($this->ConfigFile)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$tmpfname = tempnam(TEMP_DIRECTORY, 'SS_');\n\t\tif (!$handle = fopen($tmpfname, 'w')) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$copy = true;\n\t\tif (is_file(TEMP_DIRECTORY . '/config.prev.php')) {\n\t\t\tif (!@unlink(TEMP_DIRECTORY . '/config.prev.php')) {\n\t\t\t\t$copy = false;\n\t\t\t}\n\t\t}\n\n\t\tif ($copy) {\n\t\t\t@copy($this->ConfigFile, TEMP_DIRECTORY . '/config.prev.php');\n\t\t}\n\n\t\t// the old config backups were in the includes folder so try to clean them up as part of this process.\n\t\t$config_prev = SENDSTUDIO_INCLUDES_DIRECTORY . '/config.prev.php';\n\t\tif (is_file($config_prev)) {\n\t\t\t@unlink($config_prev);\n\t\t}\n\n\t\t$contents = \"<?php\\n\\n\";\n\n\t\tgmt($this);\n\n\t\t$areas = $this->Areas;\n\n\n\t\tforeach ($areas['config'] as $area) {\n\t\t\t// See self::LoadSettings() on UTF8PATCH settings\n\t\t\tif ($area == 'DATABASE_UTF8PATCH') {\n\t\t\t\tif (!defined('SENDSTUDIO_DATABASE_UTF8PATCH')) {\n\t\t\t\t\tdefine('SENDSTUDIO_DATABASE_UTF8PATCH', 1);\n\t\t\t\t}\n\t\t\t\t$contents .= \"define('SENDSTUDIO_DATABASE_UTF8PATCH', '\" . SENDSTUDIO_DATABASE_UTF8PATCH . \"');\\n\";\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$string = 'define(\\'SENDSTUDIO_' . $area . '\\', \\'' . addslashes($this->Settings[$area]) . '\\');' . \"\\n\";\n\t\t\t$contents .= $string;\n\t\t}\n\n\t\t$contents .= 'define(\\'SENDSTUDIO_IS_SETUP\\', 1);' . \"\\n\";\n\n\t\t$contents .= \"\\n\\n\";\n\n\t\tfputs($handle, $contents, strlen($contents));\n\t\tfclose($handle);\n\t\tchmod($tmpfname, 0644);\n\n\t\tif (!copy($tmpfname, $this->ConfigFile)) {\n\t\t\treturn false;\n\t\t}\n\t\tunlink($tmpfname);\n\n\t\t$copy = true;\n\t\tif (is_file(TEMP_DIRECTORY . '/config.bkp.php')) {\n\t\t\tif (!@unlink(TEMP_DIRECTORY . '/config.bkp.php')) {\n\t\t\t\t$copy = false;\n\t\t\t}\n\t\t}\n\n\t\tif ($copy) {\n\t\t\t@copy($this->ConfigFile, TEMP_DIRECTORY . '/config.bkp.php');\n\t\t}\n\n\t\t// the old config backups were in the includes folder so try to clean them up as part of this process.\n\t\t$config_bkp = SENDSTUDIO_INCLUDES_DIRECTORY . '/config.bkp.php';\n\t\tif (is_file($config_bkp)) {\n\t\t\t@unlink($config_bkp);\n\t\t}\n\n\t\tunset($areas['config']);\n\n\t\tif (defined('APPLICATION_SHOW_WHITELABEL_MENU') && constant('APPLICATION_SHOW_WHITELABEL_MENU')) {\n\t\t\t$query = \"DELETE FROM \" . SENDSTUDIO_TABLEPREFIX . \"whitelabel_settings\";\n\t\t\t$result = $this->Db->Query($query);\n\t\t\tforeach ($areas['whitelabel'] as $area) {\n\t\t\t\t// If settings are not set, do not continue\n\t\t\t\tif (!isset($this->Settings[$area])) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$value = $this->Settings[$area];\n\n\t\t\t\tif (strtolower($area) == 'update_check_enabled') {\n\t\t\t\t\t$subAction = 'uninstall';\n\t\t\t\t\tif ($value == '1') {\n\t\t\t\t\t\t$subAction = 'install';\n\t\t\t\t\t}\n\t\t\t\t\t$result = Interspire_Addons::Process('updatecheck', $subAction, array());\n\t\t\t\t\tcontinue;\n\t\t\t\t} elseif (strtolower($area) == 'lng_accountupgrademessage') {\n\t\t\t\t\t$agencyId = get_agency_license_variables();\n\t\t\t\t\tif(empty($agencyId['agencyid'])) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (is_bool($value)) {\n\t\t\t\t\t$value = (int)$value;\n\t\t\t\t}\n\n\t\t\t\t$query = \"INSERT INTO \" . SENDSTUDIO_TABLEPREFIX . \"whitelabel_settings(name, value) VALUES ('\" . $this->Db->Quote($area) . \"', '\" . $this->Db->Quote($value) . \"')\";\n\t\t\t\t$result = $this->Db->Query($query);\n\t\t\t}\n\t\t\tif ($this->WhiteLabelCache->exists('IEM_SETTINGS_WHITELABEL')) {\n\t\t\t\t$this->WhiteLabelCache->remove('IEM_SETTINGS_WHITELABEL');\n\t\t\t}\n\t\t}\n\n\t\tif (isset($areas['whitelabel'])) {\n\t\t\tunset($areas['whitelabel']);\n\t\t}\n\n\t\t$stash = IEM_InterspireStash::getInstance();\n\t\tif ($stash->exists('IEM_SYSTEM_SETTINGS')) {\n\t\t\t$stash->remove('IEM_SYSTEM_SETTINGS');\n\t\t}\n\n\t\t$query = \"DELETE FROM \" . SENDSTUDIO_TABLEPREFIX . \"config_settings\";\n\t\t$result = $this->Db->Query($query);\n\n\n\t\tforeach ($areas as $area) {\n\t\t\t$value = isset($this->Settings[$area]) ? $this->Settings[$area] : '';\n\n\n\n\t\t\tif ($area == 'SYSTEM_DATABASE_VERSION') {\n\t\t\t\t$value = $this->Db->FetchOne(\"SELECT version() AS version\");\n\t\t\t}\n\t\t\tif (is_bool($value)) {\n\t\t\t\t$value = (int)$value;\n\t\t\t}\n\n\t\t\t$query = \"INSERT INTO \" . SENDSTUDIO_TABLEPREFIX . \"config_settings(area, areavalue) VALUES ('\" . $this->Db->Quote($area) . \"', '\" . $this->Db->Quote($value) . \"')\";\n\t\t\t$result = $this->Db->Query($query);\n\t\t}\n\n\n\t\treturn true;\n\t}", "public function saveSystemConfig($observer)\n {\n Mage::getSingleton('adminhtml/session')->setMessages(Mage::getModel('core/message_collection'));\n\n Mage::getModel('core/config_data')\n ->load(self::CRON_STRING_PATH, 'path')\n ->setValue($this->_getSchedule())\n ->setPath(self::CRON_STRING_PATH)\n ->save();\n\n Mage::app()->cleanCache();\n\n $this->configCheck();\n\n // If there are errors in config, do not progress further as it may be testing old data\n $currentMessages = Mage::getSingleton('adminhtml/session')->getMessages();\n foreach ($currentMessages->getItems() as $msg) {\n if ($msg->getType() != 'success') {\n return;\n }\n }\n\n $messages = array();\n\n // Close connection to avoid mysql gone away errors\n $res = Mage::getSingleton('core/resource');\n $res->getConnection('core_write')->closeConnection();\n\n // Test connection\n $storeId = Mage::app()->getStore();\n $usernameWs = Mage::getStoreConfig('emailchef_newsletter/emailchef/username_ws');\n $passwordWs = Mage::getStoreConfig('emailchef_newsletter/emailchef/password_ws');\n $retConn = Mage::helper('emailchef')->testConnection($usernameWs, $passwordWs, $storeId);\n $messages = array_merge($messages, $retConn);\n\n // Config tests\n $retConfig = Mage::helper('emailchef')->testConfig();\n $messages = array_merge($messages, $retConfig);\n\n // Re-open connection to avoid mysql gone away errors\n $res->getConnection('core_write')->getConnection();\n\n // Add messages from test\n if (count($messages) > 0) {\n foreach ($messages as $msg) {\n $msgObj = Mage::getSingleton('core/message')->$msg['type']($msg['message']);\n Mage::getSingleton('adminhtml/session')->addMessage($msgObj);\n }\n }\n }", "public function register()\n {\n // Merge variables with current EE globals\n $global_variables = array_merge(ee()->config->_global_vars, $this->global_variables);\n\n // Set the merged array\n ee()->config->_global_vars = $global_variables;\n }", "private static function doSaveConfigFile() {\n\t\tglobal $conf;\n\t\twgLang::addModuleDefaultFile('configuration');\n\t\t$file = wgPaths::getAdminPath().'config/config.php';\n\t\twgIo::backup($file);\n\t\t$data = NULL;\n\t\t$var = &$_SESSION['data'];\n\t\t$var = array();\n\t\t$fnc = &$_SESSION['func'];\n\t\t$fnc = array();\n\t\t$a = wgPost::getValue('conf');\n\t\t$b['db'] = $conf['db'];\n\t\t$c = array_merge($b, $a);\n\t\t$i = wgPost::getValue('info');\n\t\t$longestlen = 0;\n\t\t$longestfnc = 0;\n\t\tforeach ($c as $gid=>$g) {\n\t\t\tforeach ($g as $k=>$v) {\n\t\t\t\t$var[$gid.$k] = $v;\n\t\t\t\t$fnc[$gid.$k] = \"\\$conf['$gid']['$k']\";\n\t\t\t\tif ($longestlen < strlen($v)) $longestlen = strlen($v);\n\t\t\t\tif ($longestfnc < strlen($fnc[$gid.$k])) $longestfnc = strlen($fnc[$gid.$k]);\n\t\t\t}\n\t\t}\n\t\t$longestlen += 6;\n\t\t$longestfnc += 3;\n\t\tforeach ($c as $gid=>$g) {\n\t\t\t$data .= \"\\r\\n\\r\\n// \".wgLang::get('cnf'.$gid).\"\\r\\n\";\n\t\t\tforeach ($g as $k=>$v) {\n\t\t\t\tif (is_numeric($v)) $data .= self::setFunc($gid.$k, $longestfnc).' = '.self::setInt($gid.$k, $i[$gid][$k], $longestlen).'\n'; \n\t\t\t\telse $data .= self::setFunc($gid.$k, $longestfnc).' = '.self::setString($gid.$k, $i[$gid][$k], $longestlen).'\n';\n\t\t\t}\n\t\t}\n\t\t//return true;\n\t\t$data = '<?php\n/**\n * WebGuru3 configuration file\n *\n * @package WebGuru3\n * @author Ondrej Rafaj\n * @author WebGuruCMS3 Configuration module\n * @version Generated automaticaly\n */\n\n'.$data.'\n?>';\n\t\treturn wgIo::writeFile($file, $data);\n\t}", "function saveParams($params)\n{\n\t$config = \"<?php\\n\";\n\t$config .= \"\\$appsConfig = \".var_export($params, true).\";\\n\";\n\t$config .= \"?>\";\n\n\tfile_put_contents(__DIR__.\"/config.php\", $config);\n\n\treturn true;\n}", "private function load_site_settings() {\n\t\t\n\t\t$this->helper->load_editor_settings();\n\t\t$this->settings = array_merge($this->settings,$this->EE->session->cache['eeck']['eeck_settings']);\n\t}", "function _savesettings()\r\n {\r\n\t\t$settings = JRequest::getVar('settings');\r\n\r\n\t\tjimport('joomla.registry.registry');\r\n\t\t$reg = new JRegistry();\r\n\t\t$reg->loadArray($settings);\r\n\t\t\t\t\r\n\t\tif(JFusionConnect::isJoomlaVersion('1.6')) {\r\n\t\t\t$component =& JTable::getInstance('extension');\r\n\t\t\t$componentid = $component->find(array('type' => 'component','element' => 'com_jfusionconnect'));\r\n\t\t\t$component->load($componentid);\r\n\t\t\t\r\n\t\t\t$plugin =& JTable::getInstance('extension');\r\n\t\t\t$pluginid = $plugin->find(array('type' => 'plugin','element' => 'jfusionconnect'));\r\n\t\t\t$plugin->load($pluginid);\r\n\t\t\t$key='enabled';\r\n\t\t} else {\r\n\t\t\t$component =& JTable::getInstance('component');\r\n\t\t\t$component->loadByOption('com_jfusionconnect');\r\n\t\t\t\r\n\t\t\t$plugin =& JTable::getInstance('plugin');\r\n\t\t\t$plugin->_tbl_key = 'element';\r\n\t\t\t$plugin->load('jfusionconnect');\r\n\t\t\t$key='published';\r\n\t\t}\r\n\t\t$component->params = $reg->toString();\r\n\t\t$component->store();\r\n \tif ($settings['enabled']) {\r\n\t\t\t$plugin->$key = 1;\r\n\t\t} else {\r\n\t\t\t$plugin->$key = 0;\r\n\t\t}\r\n\t\t$plugin->store();\r\n }", "function emb_save_options() {\n\t}", "public static function save(){\n\t\t//if this entry is set in the config file, then store the set\n\t\t//and modules in the team_set_modules table\n if (!isset($GLOBALS['sugar_config']['enable_team_module_save'])\n || !empty($GLOBALS['sugar_config']['enable_team_module_save'])) {\n\t\t\tforeach(self::$_setHash as $team_set_id => $table_names){\n\t\t\t\t$teamSetModule = BeanFactory::newBean('TeamSetModules');\n\t\t\t\t$teamSetModule->team_set_id = $team_set_id;\n\n\t\t\t\tforeach($table_names as $table_name){\n\t\t\t\t\t$teamSetModule->module_table_name = $table_name;\n\t\t\t\t\t//remove the id so we do not think this is an update\n\t\t\t\t\t$teamSetModule->id = '';\n\t\t\t\t\t$teamSetModule->save();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function saveParams($params)\r\n{\r\n\t$config = \"<?php\\n\";\r\n\t$config .= \"\\$appsConfig = \".var_export($params, true).\";\\n\";\r\n\t$config .= \"?>\";\r\n\r\n\tfile_put_contents(__DIR__.\"/config.php\", $config);\r\n\r\n\treturn true;\r\n}", "function storeConfig( $pName, $pValue, $pPackage = NULL ) {\n\t\tglobal $gMultisites;\n\t\t//stop undefined offset error being thrown after packages are installed\n\t\tif( !empty( $this->mConfig )) {\n\t\t\t// store the pref if we have a value _AND_ it is different from the default\n\t\t\tif( ( empty( $this->mConfig[$pName] ) || ( $this->mConfig[$pName] != $pValue ))) {\n\t\t\t\t// make sure the value doesn't exceede database limitations\n\t\t\t\t$pValue = substr( $pValue, 0, 250 );\n\n\t\t\t\t// store the preference in multisites, if used\n\t\t\t\tif( $this->isPackageActive( 'multisites' ) && @BitBase::verifyId( $gMultisites->mMultisiteId ) && isset( $gMultisites->mConfig[$pName] )) {\n\t\t\t\t\t$query = \"UPDATE `\".BIT_DB_PREFIX.\"multisite_preferences` SET `config_value`=? WHERE `multisite_id`=? AND `config_name`=?\";\n\t\t\t\t\t$result = $this->mDb->query( $query, array( empty( $pValue ) ? '' : $pValue, $gMultisites->mMultisiteId, $pName ) );\n\t\t\t\t} else {\n\t\t\t\t\t$query = \"DELETE FROM `\".BIT_DB_PREFIX.\"kernel_config` WHERE `config_name`=?\";\n\t\t\t\t\t$result = $this->mDb->query( $query, array( $pName ) );\n\t\t\t\t\t// make sure only non-empty values get saved, including '0'\n\t\t\t\t\tif( isset( $pValue ) && ( !empty( $pValue ) || is_numeric( $pValue ))) {\n\t\t\t\t\t\t$query = \"INSERT INTO `\".BIT_DB_PREFIX.\"kernel_config`(`config_name`,`config_value`,`package`) VALUES (?,?,?)\";\n\t\t\t\t\t\t$result = $this->mDb->query( $query, array( $pName, $pValue, strtolower( $pPackage )));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Force the ADODB cache to flush\n\t\t\t\t$isCaching = $this->mDb->isCachingActive();\n\t\t\t\t$this->mDb->setCaching( FALSE );\n\t\t\t\t$this->loadConfig();\n\t\t\t\t$this->mDb->setCaching( $isCaching );\n\t\t\t}\n\t\t}\n\t\t$this->setConfig( $pName, $pValue );\n\t\treturn TRUE;\n\t}", "public function postProcess()\n {\n if (Tools::isSubmit('saveSettings')) {\n ConfPPM::setConf(\n 'paysto_merchant_id',\n Tools::getValue(ConfPPM::formatConfName('paysto_merchant_id'))\n );\n ConfPPM::setConf(\n 'paysto_secret',\n Tools::getValue(ConfPPM::formatConfName('paysto_secret'))\n );\n ConfPPM::setConf('server_list', Tools::getValue(ConfPPM::formatConfName('server_list')));\n ConfPPM::setConf('ip_only_from_server_list',\n Tools::getValue(ConfPPM::formatConfName('ip_only_from_server_list')));\n ConfPPM::setConf('disable_tax_shop',\n Tools::getValue(ConfPPM::formatConfName('disable_tax_shop')));\n ConfPPM::setConf('tax_delivery', Tools::getValue(ConfPPM::formatConfName('tax_delivery')));\n Tools::redirectAdmin(ToolsModulePPM::getModuleTabAdminLink() . '&conf=6');\n }\n }", "public function setRegistry()\n {\n $reg = controllers\\Registry::getInstance();\n foreach ($this->config as $key => $value)\n {\n $reg->setResource($key, $value, true);\n }\n\n\n }", "public function save_settings() {\n\n if (!isset($_REQUEST['action']) || !isset($_GET['page']))\n return;\n\n if ('swpm-settings' !== $_GET['page'])\n return;\n\n if ('swpm_settings' !== $_REQUEST['action'])\n return;\n\n check_admin_referer('swpm-update-settings');\n\n $data = array();\n\n foreach ($_POST['swpm-settings'] as $key => $val) {\n $data[$key] = esc_html($val);\n }\n\n update_option('swpm-settings', $data);\n }", "public function save_country_settings() {\n if ($this->checkLogin('A') == '') {\n redirect(ADMIN_ENC_URL);\n } else {\n if ($this->checkPrivileges('admin', '2') == TRUE) {\n $condition = array('admin_id' => '1');\n $this->admin_model->commonInsertUpdate(ADMIN, 'update', array(), array(), $condition);\n $countryId = $this->input->post(\"countryId\");\n $config = '<?php ';\n foreach ($this->data['countryList'] as $country) {\n if ($countryId == $country->_id) {\n $countryName = addslashes($country->name);\n $config .= \"\\n\\$config['countryId'] = '$country->_id'; \";\n $config .= \"\\n\\$config['countryName'] = '$countryName'; \";\n $config .= \"\\n\\$config['countryCode'] = '$country->cca3'; \";\n $config .= \"\\n\\$config['dialCode'] = '$country->dial_code'; \";\n }\n }\n $config .= \"\\n ?>\";\n $file = 'commonsettings/dectar_country_settings.php';\n file_put_contents($file, $config);\n $this->setErrorMessage('success', 'Country settings updated successfully','admin_adminlogin_country_setting_updated');\n redirect(ADMIN_ENC_URL.'/adminlogin/admin_country_settings');\n } else {\n redirect(ADMIN_ENC_URL);\n }\n }\n }", "protected function addToConfig()\n {\n $path = $this->getConfigPath();\n $config = require($path);\n if (isset($config[$this->moduleId])) {\n if (\\Yii::$app->controller->confirm('Rewrite exist config?')) {\n $config[$this->moduleId] = $this->getConfigArray();\n echo 'Module config was rewrote' . PHP_EOL;\n }\n } else {\n $config[$this->moduleId] = $this->getConfigArray();\n }\n\n\n $this->writeArrayToFile($this->getConfigPath(), $config);\n }", "public function saveConfig() {\n\t\tif(!$this->_configTitle) throw new Exception(lang('error_4'));\n\t\tif(!$this->_configDatabase) throw new Exception(lang('error_4'));\n\t\tif(!$this->_configTable) throw new Exception(lang('error_4'));\n\t\tif(!$this->_configCreditsCol) throw new Exception(lang('error_4'));\n\t\tif(!$this->_configUserCol) throw new Exception(lang('error_4'));\n\t\tif(!$this->_configUserColId) throw new Exception(lang('error_4'));\n\t\t\n\t\t$data = array(\n\t\t\t'title' => $this->_configTitle,\n\t\t\t'database' => $this->_configDatabase,\n\t\t\t'table' => $this->_configTable,\n\t\t\t'creditscol' => $this->_configCreditsCol,\n\t\t\t'usercol' => $this->_configUserCol,\n\t\t\t'usercolid' => $this->_configUserColId,\n\t\t\t'checkonline' => $this->_configCheckOnline,\n\t\t\t'display' => $this->_configDisplay,\n\t\t\t'phrase' => $this->_configPhrase\n\t\t);\n\t\t\n\t\t$query = \"INSERT INTO \"._WE_CREDITSYS_.\" \"\n\t\t\t. \"(config_title, config_database, config_table, config_credits_col, config_user_col, config_user_col_id, config_checkonline, config_display, config_phrase) \"\n\t\t\t. \"VALUES \"\n\t\t\t. \"(:title, :database, :table, :creditscol, :usercol, :usercolid, :checkonline, :display, :phrase)\";\n\t\t\n\t\t$saveConfig = $this->db->query($query, $data);\n\t\tif(!$saveConfig) throw new Exception(lang('error_140'));\n\t}", "protected function saveConfiguration($name, $value)\n {\n // TODO: Implement saveConfiguration() method.\n }", "public function saveSettings() {\n\t\t\tif ( isset( $_POST['muut_settings_save'] )\n\t\t\t\t&& $_POST['muut_settings_save'] == 'true'\n\t\t\t\t&& check_admin_referer( 'muut_settings_save', 'muut_settings_nonce' )\n\t\t\t) {\n\t\t\t\t$this->submittedSettings = $_POST['setting'];\n\n\t\t\t\t$settings = $this->settingsValidate( $this->getSubmittedSettings() );\n\n\t\t\t\t// Save all the options by passing an array into setOption.\n\t\t\t\tif ( muut()->setOption( $settings ) ) {\n\t\t\t\t\tif ( !empty( $this->errorQueue ) ) {\n\t\t\t\t\t\t// Display partial success notice if they were updated or matched the previous settings.\n\t\t\t\t\t\tmuut()->queueAdminNotice( 'updated', __( 'Settings successfully saved, other than the errors listed.', 'muut' ) );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Display success notice if they were updated or matched the previous settings.\n\t\t\t\t\t\tmuut()->queueAdminNotice( 'updated', __( 'Settings successfully saved.', 'muut' ) );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Display error if the settings failed to save.\n\t\t\t\t\tmuut()->queueAdminNotice( 'error', __( 'Failed to save settings.', 'muut' ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function save_config()\n {\n $i = 0;\n $rows = list_to_map('id', $GLOBALS['SITE_DB']->query_select('pstore_customs', array('*')));\n while (array_key_exists('custom_' . strval($i), $_POST)) {\n $id = post_param_integer('custom_' . strval($i));\n $title = post_param_string('custom_title_' . strval($i));\n $description = post_param_string('custom_description_' . strval($i));\n $enabled = post_param_integer('custom_enabled_' . strval($i), 0);\n $cost = post_param_integer('custom_cost_' . strval($i));\n $one_per_member = post_param_integer('custom_one_per_member_' . strval($i), 0);\n $mail_subject = post_param_string('custom_mail_subject_' . strval($i));\n $mail_body = post_param_string('custom_mail_body_' . strval($i));\n\n $delete = post_param_integer('delete_custom_' . strval($i), 0);\n\n $_title = $rows[$id]['c_title'];\n $_description = $rows[$id]['c_description'];\n $_mail_subject = $rows[$id]['c_mail_subject'];\n $_mail_body = $rows[$id]['c_mail_body'];\n\n if ($delete == 1) {\n delete_lang($_title);\n delete_lang($_description);\n delete_lang($_mail_subject);\n delete_lang($_mail_body);\n $GLOBALS['SITE_DB']->query_delete('pstore_customs', array('id' => $id), '', 1);\n } else {\n $map = array(\n 'c_enabled' => $enabled,\n 'c_cost' => $cost,\n 'c_one_per_member' => $one_per_member,\n );\n $map += lang_remap('c_title', $_title, $title);\n $map += lang_remap_comcode('c_description', $_description, $description);\n $map += lang_remap('c_mail_subject', $_mail_subject, $mail_subject);\n $map += lang_remap('c_mail_body', $_mail_body, $mail_body);\n $GLOBALS['SITE_DB']->query_update('pstore_customs', $map, array('id' => $id), '', 1);\n }\n $i++;\n }\n $title = post_param_string('custom_title', null);\n if (!is_null($title)) {\n $description = post_param_string('custom_description');\n $enabled = post_param_integer('custom_enabled', 0);\n $cost = post_param_integer('custom_cost');\n $one_per_member = post_param_integer('custom_one_per_member', 0);\n $mail_subject = post_param_string('custom_mail_subject');\n $mail_body = post_param_string('custom_mail_body');\n\n $map = array(\n 'c_enabled' => $enabled,\n 'c_cost' => $cost,\n 'c_one_per_member' => $one_per_member,\n );\n $map += insert_lang('c_title', $title, 2);\n $map += insert_lang_comcode('c_description', $description, 2);\n $map += insert_lang('c_mail_subject', $mail_subject, 2);\n $map += insert_lang('c_mail_body', $mail_body, 2);\n $GLOBALS['SITE_DB']->query_insert('pstore_customs', $map);\n }\n\n log_it('POINTSTORE_AMEND_CUSTOM_PRODUCTS');\n }", "private function reconfigure() {\n\t\t$global = JConfig::getInstance();\n\t\tforeach ($global as $key => $value) {\n\t\t\tif (array_key_exists($key, $this->config)) {\n\t\t\t\t$this->config[$key] = $value;\n\t\t\t}\n\t\t}\n\t\ttry {\n\t\t\tif (class_exists('JPConfig')) {\n\t\t\t\t$this->config = array_merge($this->config, JPConfig::getData());\n\t\t\t}\n\t\t} catch (Exception $e) {\n\t\t\t// class JPConfig doesn't exist\n\t\t}\n\t}" ]
[ "0.73557836", "0.73534995", "0.72220504", "0.71607596", "0.7125758", "0.7087439", "0.70787233", "0.70186245", "0.7009788", "0.69988835", "0.69421685", "0.69299436", "0.69073206", "0.6895742", "0.6852896", "0.68376774", "0.67874604", "0.6702718", "0.66797036", "0.66246474", "0.657314", "0.6571096", "0.653526", "0.65275866", "0.6526766", "0.65185195", "0.65095854", "0.6494733", "0.64859897", "0.6475367", "0.6473393", "0.6420957", "0.6409091", "0.63979703", "0.63883823", "0.63790196", "0.6351354", "0.6331576", "0.632024", "0.6320062", "0.6291632", "0.6246565", "0.6226", "0.6225486", "0.62212795", "0.6181402", "0.61802596", "0.6172175", "0.6168713", "0.61647105", "0.6152659", "0.6142956", "0.6124012", "0.6114621", "0.60753673", "0.6067625", "0.6065371", "0.6053997", "0.6053569", "0.60341305", "0.60309595", "0.60236436", "0.59895635", "0.5985032", "0.59832555", "0.595648", "0.5950678", "0.5938236", "0.59379214", "0.5934549", "0.59322834", "0.58954716", "0.5894523", "0.5888828", "0.58805865", "0.5876569", "0.5870485", "0.58614004", "0.5848006", "0.582905", "0.58261454", "0.5804639", "0.5803436", "0.5799622", "0.5799397", "0.5790976", "0.5790299", "0.57896495", "0.57749444", "0.57683", "0.5757526", "0.57568103", "0.57506335", "0.5745323", "0.57439923", "0.57395154", "0.5734575", "0.5730029", "0.5714312", "0.5713343", "0.5711876" ]
0.0
-1
Display a listing of the resource.
public function index() { $produk = DB::table('produk')->get(); return view('blog.index', compact('produk')); }
{ "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('blog.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) { $request->validate([ 'nama_produk' => 'required|unique:produk', 'keterangan' => 'required', 'harga' => 'required', 'jumlah' => 'required' ]); $query = DB::table('produk')->insert([ "nama_produk" => $request["nama_produk"], "keterangan" => $request["keterangan"], "harga" => $request["harga"], "jumlah" => $request["jumlah"] ]); return redirect('/produk'); }
{ "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) { $produ = DB::table('produk')->where('id', $id)->first(); return view('blog.show', compact('produ')); }
{ "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) { $produ = DB::table('produk')->where('id', $id)->first(); return view('blog.edit', compact('produ')); }
{ "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) { $request->validate([ 'nama_produk' => 'required|unique:produk', 'keterangan' => 'required', 'harga' => 'required', 'jumlah' => 'required' ]); $query = DB::table('produk') ->where('id', $id) ->update([ 'nama_produk' => $request['nama_produk'], 'keterangan' => $request['keterangan'], 'harga' => $request['harga'], 'jumlah' => $request['jumlah'] ]); return redirect('/produk'); }
{ "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) { $query = DB::table('produk')->where('id', $id)->delete(); return redirect('/produk'); }
{ "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
Generates a randomlygenerated float number comprised between 0.0 (inclusive) and 1.0 (inclusive)
public static function randomFloat(): float { return mt_rand() / mt_getrandmax(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function frand()\n {\n return 0.0001 * mt_rand(0, 9999);\n }", "function rand_float(float $min = null, float $max = null, int $precision = null): float\n{\n return Numbers::randomFloat($min, $max, $precision);\n}", "public static function getFloat()\n\t{\n\t\treturn (float)rand() / (float)getrandmax();\n\t}", "function random_float(float $min = null, float $max = null, int $precision = null): float\n{\n return Numbers::randomFloat($min, $max, $precision);\n}", "private function random_0_1()\n\t\t\t{ \n\t\t\t\treturn (float)rand()/(float)getrandmax();\n\t\t\t}", "public function randomFloat($min = 0, $max = 1)\n {\n return $min + mt_rand() / mt_getrandmax() * ($max - $min);\n }", "function random_float($min, $max, int $precision = null): float\n{\n $result = $min + \\lcg_value() * \\abs($max - $min);\n\n if (null !== $precision) {\n return \\round($result, $precision);\n }\n\n return $result;\n}", "public static function floats()\n {\n // First, make sure the most common numbers are covered.\n yield 0.0;\n yield -1.0;\n yield 1.0;\n\n // Then generate random numbers from an increasing range.\n $lim = 0.01;\n $iterations = 0;\n while (true) {\n $iterations++;\n\n yield $lim * (2 * mt_rand() / mt_getrandmax() - 1);\n\n if ($lim <= mt_getrandmax() / 2) {\n $lim *= 2;\n } else {\n // Start over when maxed out.\n $lim = 0.01;\n }\n }\n }", "public function testRandomFloat()\n {\n $initial_value = random_float();\n \n $this->assertInternalType('float', $initial_value);\n }", "function frand($min, $max, $decimals = 0) {\n $scale = pow(10, $decimals);\n return mt_rand($min * $scale, $max * $scale) / $scale;\n}", "function frand($min = 0, $max = 1) {\n\treturn $min + mt_rand() / mt_getrandmax() * ($max - $min);\n}", "function random(int|float $min = null, int|float $max = null, int $precision = null): int|float\n{\n return Numbers::random($min, $max, $precision);\n}", "public static function getRandomValue()\n {\n preg_match('/0.([0-9]+) ([0-9]+)/', microtime(), $regs);\n return $regs[2].$regs[1].sprintf('%03d', rand(0, 999));\n }", "public static function getFloat($min = 0, $max = 1) {\n return $min + mt_rand() / mt_getrandmax() * ($max - $min);\n }", "public static function getRandomFloat($fMin = 0.0, $fMax = 1.0, $iDecimals = 2) {\n\t\t$fScale = pow(10, $iDecimals);\n\t\t\n\t\treturn mt_rand($fMin * $fScale, $fMax * $fScale) / $fScale;\n\t}", "protected static function rand_float($min, $max) {\n\t\t$f = mt_rand(0, 100000) * 0.00001;\n\t\treturn $min + (1 - $f) * $max;\n\t}", "public static function randomFloat($limit1 = 0, $limit2 = 1)\n {\n $min = min($limit1, $limit2);\n $max = max($limit1, $limit2);\n\n return ((mt_rand() / mt_getrandmax()) * ($max - $min)) + $min;\n }", "function getRandomNumber() {\n return rand(0, 0x7fffffff);\n }", "function randomise() {\n list($usec, $sec) = explode(' ', microtime());\n return (float) $sec + ((float) $usec * 100000);\n}", "function randomise() {\n\n list($usec, $sec) = explode(' ', microtime());\n\n return (float) $sec + ((float) $usec * 100000);\n\n}", "public static function random () {\n\t\treturn mt_rand() / mt_getrandmax();\n\t}", "public static function getRandomFloat($min, $max, $num = 1, $precision = 3) {\n if ($num < 1) {\n return NULL;\n }\n\n $numbers = array();\n foreach (range(0, $num - 1) as $index) {\n $number = $min + mt_rand() / mt_getrandmax() * ($max - $min);\n $numbers[] = substr(round($number, 3), 0, 10);\n }\n\n return $numbers;\n }", "function random($min = null, $max = null, $precision = null)\n{\n if (is_array($min))\n {\n for ($i=1; $i<=rand(1,count($min)); $i++)\n {\n shuffle($min);\n }\n\n return array_shift($min);\n }\n elseif (is_numeric($min))\n {\n if (!is_numeric($max))\n {\n $max = floor($min+1);\n }\n\n $multiplier = 1;\n\n if ($precision === null)\n {\n $min_decimal = '';\n if ((int)$min != $min)\n {\n $min_decimal = explode('.', $min);\n $min_decimal = array_pop($min_decimal);\n }\n $max_decimal = '';\n if ((int)$max != $max)\n {\n $max_decimal = explode('.', $max);\n $max_decimal = array_pop($max_decimal);\n }\n\n $precision = max(strlen($min_decimal), strlen($max_decimal));\n }\n\n for ($i=1; $i<=$precision; $i++)\n {\n $multiplier = $multiplier * 10;\n \n $min = $min * 10;\n $max = $max * 10;\n }\n\n $value = rand($min, $max);\n \n $value = $value / $multiplier;\n\n return $value;\n }\n else\n {\n return random([$min, $max]);\n }\n}", "private static function getSamplePressure(): float\n {\n return 6 * random_int(0, mt_getrandmax()) / mt_getrandmax() * random_int(0, mt_getrandmax()) / mt_getrandmax();\n }", "public static function seedRand() {\r\n\t\tsrand((int)((($m=microtime(true))-((int)$m))*pow(10,(int)log10(PHP_INT_MAX)))); \r\n\t}", "private function makeSeed() {\r\n\t\t\tlist($usec, $sec) = explode(' ', microtime());\r\n\t\t\treturn (float) $sec + ((float) $usec * 100000);\r\n\t\t}", "public function randomLinear()\n {\n return mt_rand($this->min(), $this->max());\n }", "private function makeSeed()\r\n {\r\n list($usec, $sec) = explode(' ', microtime());\r\n return (float) $sec + ((float) $usec * 100000);\r\n }", "public function randomize()\n {\n return mt_rand(1, $this->maxnumber());\n }", "function single_trial($cutoff) {\n global $PRIOR_LOWER_MAX;\n $lower_value = $PRIOR_LOWER_MAX * (float) rand() / (float) getrandmax(); \n $higher_value = 2 * $lower_value;\n if (rand(0, 1) == 0) {\n return $lower_value >= $cutoff ? $lower_value : $higher_value;\n } else {\n return $higher_value >= $cutoff ? $higher_value : $lower_value;\n }\n}", "function generate_random_number($start, $end, $flag){\r\n\tglobal $g_var;\r\n\tsrand((double)microtime()*1000000);\r\n\t$random = (rand($start,$end));\r\n\t\r\n\treturn $random;\r\n}", "function rand_num() {\n\t\t\t\t\n\t\t\t\t$r = rand(1000000, 9999999);\n\t\t\t\treturn $r;\n\t\t\t\n\t\t\t}", "public static function makeSeed()\n\t{\n\t\tlist( $usec, $sec ) = explode( ' ', microtime() );\n\t\treturn (float)$sec + ( (float)$usec * 100000 );\n\t}", "public static function getRandomNumber() {\n return rand(10, 10000000);\n }", "function php05($min,$max){\n\t$random = rand($min,$max);\n\treturn $random;\n}", "function number_from_gaussian_centered_on($number) {\n\t$sign = rand(0, 1);\n\tif($sign === 0) {\n\t\treturn ceil($number * (1 - (quadratic_rand() * 0.1)));\n\t} else {\n\t\treturn ceil($number * (1 + (quadratic_rand() * 0.1)));\n\t}\n}", "private function f_rand($min=0,$max=1,$mul=1000000){\n if ($min>$max) return false;\n return mt_rand($min*$mul,$max*$mul)/$mul;\n }", "public function random();", "function make_seed() {\n // explode microtime to 2 value\n list($usec, $sec) = explode(\" \",microtime());\n return (float)$usec * 100000 + (float)$sec;\n}", "function make_seed()\n{\n\tlist($usec, $sec) = explode(' ', microtime());\n\treturn (float) $sec + ((float) $usec * 100000);\n}", "public function getRandomInt()\n {\n return random_int(0, 1);\n }", "function dd_generate($min, $max, $int = FALSE) {\n $func = 'rand';\n if (function_exists('mt_rand')) {\n $func = 'mt_rand';\n }\n $number = $func($min, $max);\n if ($int || $number === $min || $number === $max) {\n return $number;\n }\n $decimals = $func(1, pow(10, 5)) / pow(10, 5);\n return round($number + $decimals, 5);\n }", "function devurandom_rand($min = 0, $max = 0x7FFFFFFF) {\n $diff = $max - $min;\n if ($diff < 0 || $diff > 0x7FFFFFFF) {\n\tthrow new RuntimeException(\"Bad range\");\n }\n $bytes = mcrypt_create_iv(4, MCRYPT_DEV_URANDOM);\n if ($bytes === false || strlen($bytes) != 4) {\n throw new RuntimeException(\"Unable to get 4 bytes\");\n }\n $ary = unpack(\"Nint\", $bytes);\n $val = $ary['int'] & 0x7FFFFFFF; // 32-bit safe \n $fp = (float) $val / 2147483647.0; // convert to [0,1] \n return round($fp * $diff) + $min;\n}", "public static function generateQualityValue(): int\n {\n return rand(self::getLowestQuality(), self::getHighestQuality());\n }", "function random( $min = 0, $max = 0 ) {\n\tglobal $rnd_value;\n\n\t// Reset $rnd_value after 14 uses\n\t// 32(md5) + 40(sha1) + 40(sha1) / 8 = 14 random numbers from $rnd_value\n\tif ( strlen($rnd_value) < 8 ) {\n\t\tstatic $seed = 'jimmy';\n\t\t$rnd_value = md5( uniqid(microtime() . mt_rand(), true ) . $seed );\n\t\t$rnd_value .= sha1($rnd_value);\n\t\t$rnd_value .= sha1($rnd_value . $seed);\n\t\t$seed = md5($seed . $rnd_value);\n\t}\n\n\t// Take the first 8 digits for our value\n\t$value = substr($rnd_value, 0, 8);\n\n\t// Strip the first eight, leaving the remainder for the next call to wp_rand().\n\t$rnd_value = substr($rnd_value, 8);\n\n\t$value = abs(hexdec($value));\n\n\t// Reduce the value to be within the min - max range\n\t// 4294967295 = 0xffffffff = max random number\n\tif ( $max != 0 )\n\t\t$value = $min + (($max - $min + 1) * ($value / (4294967295 + 1)));\n\n\treturn abs(intval($value));\n}", "public static function float() {}", "function random($data=false) {\r\n if (func_num_args()>1) $data=func_get_args();\r\n if (!$data) $r = (float)rand()/(float)getrandmax();\r\n elseif (is_array($data)) $r=$data[ array_rand($data) ];\r\n else $r=rand(0,$data);\r\n\r\n if (DEV)\r\n xlogc('random', $r, $data);\r\n return $r;\r\n}", "public static function random(float $alpha = null)\n {\n return new static(random_int(0, 255), random_int(0, 255), random_int(0, 255), $alpha ?? (random_int(0, 100) / 100));\n }", "public static function random(float $alpha = null)\n {\n return new static(random_int(0, 255), random_int(0, 255), random_int(0, 255), $alpha ?? (random_int(0, 100) / 100));\n }", "function getSpin(){\n\t$s=rand(1,38);\n\treturn $s;\n}", "function psuedo_random_number($min, $max) {\n $bytes = openssl_random_pseudo_bytes(4);\n $int = unpack('l', $bytes);\n return $min + abs($int[1] % ($max-$min+1));\n}", "public function getDynamicValue()\n {\n return rand(1, 100);\n }", "public function getRandomValue()\n {\n if ($this->isNativeField()) {\n switch ($this->getDataType()) {\n case DField::DATA_TYPE_TINYINT:\n case DField::DATA_TYPE_SMALLINT:\n case DField::DATA_TYPE_MEDIUMINT:\n case DField::DATA_TYPE_INT:\n case DField::DATA_TYPE_BIGINT:\n $value = rand(0, 100);\n break;\n case DField::DATA_TYPE_FLOAT:\n $value = rand(10, 1000) / 10;\n break;\n default:\n $value = null;\n break;\n }\n } else {\n $value = null;\n }\n\n return $value;\n }", "public static function randomNormalStd()\r\n\t\t{\r\n\t\t\tdo {\r\n\t\t\t\t$x = rand() / getrandmax() * 2 - 1;\r\n\t\t\t\t$y = rand() / getrandmax() * 2 - 1;\r\n\r\n\t\t\t\t$r = ($x * $x) + ($y * $y);\r\n\r\n\t\t\t} while (($r > 1) || ($x + $y == 0));\r\n\r\n\t\t\t$z = $x * sqrt(-2 * log($r) / $r);\r\n\r\n\t\t\treturn $z;\r\n\t\t}", "static function getRandomValueUrandom($min = 0, $max = 0x7FFFFFFF)\n\t{\n\t\tif( !self::isInt($min) || !self::isInt($max) || $max < $min || ($max - $min) > 0x7FFFFFFF ) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$diff = $max - $min;\n\t\t \n\t\t$bytes = mcrypt_create_iv(4, MCRYPT_DEV_URANDOM);\n\t\t \n\t\tif ($bytes === false || strlen($bytes) != 4) {\n\t\t\treturn false;\n\t\t}\n\t\t \n\t\t$ary = unpack(\"Nint\", $bytes);\n\t\t$val = $ary['int'] & 0x7FFFFFFF; // 32-bit safe\n\t\t$fp = (float) $val / 2147483647.0; // convert to [0,1]\n\t\t \n\t\treturn round($fp * $diff) + $min;\n\t}", "public function randomMemberNOZero();", "protected function generate()\n {\n\t\t$this->value = md5(uniqid(rand(), true));\n }", "function tep_rand($min = null, $max = null) {\n static $seeded;\n\n if (!$seeded) {\n mt_srand((double)microtime()*1000000);\n $seeded = true;\n }\n\n if (isset($min) && isset($max)) {\n if ($min >= $max) {\n return $min;\n } else {\n return mt_rand($min, $max);\n }\n } else {\n return mt_rand();\n }\n}", "public static function floatRange($min, $max)\n {\n $min = (float)$min;\n $max = (float)$max;\n\n if ($min > $max) {\n throw new \\Exception(\"Invalid integer range: \\$max should be at least $min, but it was set to $max\");\n }\n\n while (true) {\n yield $min + mt_rand() / mt_getrandmax() * ($max - $min);\n }\n }", "function random($max) {\r\n\t// create random number between 0 and $max\r\n\tsrand((double)microtime() * 1000000);\r\n\t$r = round(rand(0, $max));\r\n\tif ($r!=0) $r=$r-1;\r\n\treturn $r;\r\n}", "protected static function number ()\n {\n $range = static::getRange();\n\n $number = $range[mt_rand(0, count($range) - 1)];\n\n return $number;\n }", "private static function getRandomReferenceNumber()\n {\n return sprintf('%02X', mt_rand(0, 0xFF));\n }", "function randUntil(Num &$n) { # :: (Num, Num) -> Int\n return new Num\\Int(rand($this->value, $$n->value));\n }", "function SM_randomint($max) {\n static $startseed = 0; \n if (!$startseed) {\n $startseed = (double)microtime()*getrandmax(); \n srand($startseed); \n }\n return(rand()%$max); \n}", "function generateUniformRandomNumber($start, $end)\n{\n if (!is_numeric($start) || $start < 0) {\n throw new \\InvalidArgumentException('$start must be a number greater than or equal to 0');\n }\n\n if (!is_numeric($end) || $end < 0) {\n throw new \\InvalidArgumentException('$end must be a number greater than or equal to 0');\n }\n\n if ($start > $end) {\n throw new \\InvalidArgumentException('$start must be less than $end');\n }\n\n $start = (int) $start;\n $end = (int) $end;\n\n $range = $end - $start + 1;\n\n do {\n $result = 0;\n\n // Make sure that if 1 << $i is less than zero we stop. Otherwise we will loop forever\n for ($i = 0; ((1 << $i) < $range) && ((1 << $i) > 0); $i++) {\n $result = ($result << 1) | rand(0, 1);\n }\n } while ($result >= $range);\n\n return $result + $start;\n}", "public static function random()\n {\n return '#' . str_pad(dechex(mt_rand(0, 0xFFFFFF)), 6, '0', STR_PAD_LEFT);\n }", "function tep_rand($min = null, $max = null) {\n static $seeded;\n\n if (!isset($seeded)) {\n mt_srand((double)microtime()*1000000);\n $seeded = true;\n }\n\n if (isset($min) && isset($max)) {\n if ($min >= $max) {\n return $min;\n } else {\n return mt_rand($min, $max);\n }\n } else {\n return mt_rand();\n }\n }", "function generateNumber()\n {\n \t/*\n $random_number = 0;\n $digits = 0;\n \n while($digits < $digits_quantity)\n {\n $rand_max .= \"9\";\n $digits++;\n }\n \n mt_srand((double) microtime() * 1000000); \n $random_number = mt_rand($zero, intval($rand_max));\n \n if($string)\n {\n if(strlen(strval($random_number)) < $digits_quantity)\n {\n $zeros_quantity = $digits_quantity - strlen(strval($random_number));\n $digits = 0;\n while($digits < $zeros_quantity)\n {\n $str_zeros .= \"0\";\n $digits++;\n }\n $random_number = $str_zeros . $random_number;\n }\n }\n return '7'.$random_number;\n */\n \t//$random_number = intval( \"0\" . rand(1,9) . rand(0,9) . rand(0,9) . rand(0,9) . rand(0,9) );\n \t//$n=5;\n \t//$random_number = rand(0, pow(10, $n));\n \t$lenth=5;\n\t $aZ09 = array_merge(range('A', 'Z'), range('a', 'z'),range(0, 9));\n\t $random_number ='';\n\t for($c=0;$c < $lenth;$c++) {\n\t $random_number .= $aZ09[mt_rand(0,count($aZ09)-1)];\n\t }\n \n\t\treturn $random_number;\n }", "function randombytes_uniform($upperBoundNonInclusive)\n {\n return 0;\n }", "function randomNum($length){\n $rangeMin = pow(36, $length-1);\n $rangeMax = pow(36, $length)-1;\n $base10Rand = mt_rand($rangeMin, $rangeMax);\n $newRand = base_convert($base10Rand, 10, 36);\n return $newRand;\n}", "function probability($chance, $out_of = 100)\n{\n if ($out_of > mt_getrandmax())\n {\n // out of range of the random function\n return -1;\n }\n\n $random = mt_rand(1, $out_of);\n return $random <= $chance;\n}", "function generate() ;", "function crypt_random($min = 0, $max = 0x7FFFFFFF)\r\n{\r\n if ($min == $max) {\r\n return $min;\r\n }\r\n\r\n // see http://en.wikipedia.org/wiki//dev/random\r\n static $urandom = true;\r\n if ($urandom === true) {\r\n // Warning's will be output unles the error suppression operator is used. Errors such as\r\n // \"open_basedir restriction in effect\", \"Permission denied\", \"No such file or directory\", etc.\r\n $urandom = @fopen('/dev/urandom', 'rb');\r\n }\r\n if (!is_bool($urandom)) {\r\n extract(unpack('Nrandom', fread($urandom, 4)));\r\n\r\n // say $min = 0 and $max = 3. if we didn't do abs() then we could have stuff like this:\r\n // -4 % 3 + 0 = -1, even though -1 < $min\r\n return abs($random) % ($max - $min) + $min;\r\n }\r\n\r\n /* Prior to PHP 4.2.0, mt_srand() had to be called before mt_rand() could be called.\r\n Prior to PHP 5.2.6, mt_rand()'s automatic seeding was subpar, as elaborated here:\r\n\r\n http://www.suspekt.org/2008/08/17/mt_srand-and-not-so-random-numbers/\r\n\r\n The seeding routine is pretty much ripped from PHP's own internal GENERATE_SEED() macro:\r\n\r\n http://svn.php.net/viewvc/php/php-src/branches/PHP_5_3_2/ext/standard/php_rand.h?view=markup */\r\n if (version_compare(PHP_VERSION, '5.2.5', '<=')) {\r\n static $seeded;\r\n if (!isset($seeded)) {\r\n $seeded = true;\r\n mt_srand(fmod(time() * getmypid(), 0x7FFFFFFF) ^ fmod(1000000 * lcg_value(), 0x7FFFFFFF));\r\n }\r\n }\r\n\r\n static $crypto;\r\n\r\n // The CSPRNG's Yarrow and Fortuna periodically reseed. This function can be reseeded by hitting F5\r\n // in the browser and reloading the page.\r\n\r\n if (!isset($crypto)) {\r\n $key = $iv = '';\r\n for ($i = 0; $i < 8; $i++) {\r\n $key.= pack('n', mt_rand(0, 0xFFFF));\r\n $iv .= pack('n', mt_rand(0, 0xFFFF));\r\n }\r\n switch (true) {\r\n case class_exists('Crypt_AES'):\r\n $crypto = new Crypt_AES(CRYPT_AES_MODE_CTR);\r\n break;\r\n case class_exists('Crypt_TripleDES'):\r\n $crypto = new Crypt_TripleDES(CRYPT_DES_MODE_CTR);\r\n break;\r\n case class_exists('Crypt_DES'):\r\n $crypto = new Crypt_DES(CRYPT_DES_MODE_CTR);\r\n break;\r\n case class_exists('Crypt_RC4'):\r\n $crypto = new Crypt_RC4();\r\n break;\r\n default:\r\n extract(unpack('Nrandom', pack('H*', sha1(mt_rand(0, 0x7FFFFFFF)))));\r\n return abs($random) % ($max - $min) + $min;\r\n }\r\n $crypto->setKey($key);\r\n $crypto->setIV($iv);\r\n $crypto->enableContinuousBuffer();\r\n }\r\n\r\n extract(unpack('Nrandom', $crypto->encrypt(\"\\0\\0\\0\\0\")));\r\n return abs($random) % ($max - $min) + $min;\r\n}", "function generateRandomNumber() {\n return chr(mt_rand(48, 57));\n }", "public static function getRandomValue(): string\n {\n $values = self::getValues();\n return $values[array_rand($values)];\n }", "public function randomTriangular()\n {\n $u = $this::randomFloat(0,1);\n $a = $this->min();\n $b = $this->max();\n $c = $this->centre;\n $Fc = ($c - $a) / ($b - $a);\n\n if (0 < $u && $u < $Fc) {\n return $a + sqrt($u * ($b - $a) * ($c - $a));\n } else {\n return $b - sqrt((1 - $u) * ($b - $a) * ($b - $c));\n }\n }", "public function rand($min,$max);", "function generate($generator, $seed = 10) {\n mt_srand($seed);\n return Eris\\Sample::of($generator, 'mt_rand')->repeat(1)->collected()[0];\n}", "public function random(): int\n {\n return rand(1, 100);\n }", "public function findRandom();", "function recy($c)\n {\n $min = round(min((sqrt(($c )*35)),100)*100);\n $max = round(min((sqrt(($c+2)*35)),100)*100);\n return mt_rand($min,$max)/10000;\n }", "function rand($min = null, $max = null)\n{\n if ($min == null && $max == null) {\n return \\Genesis\\SQLExtension\\Tests\\Context\\SQLHandlerTest::INT_NUMBER;\n }\n\n return \\Genesis\\SQLExtension\\Tests\\Context\\SQLHandlerTest::TINY_INT_NUMBER;\n}", "function testGenRandom() {\n $this->markTestIncomplete(\n 'This test has not been implemented yet.'\n );\n }", "public function generate()\n {\n return lcg_value();\n }", "function olc_rand_x($min = null, $max = null) {\n\tstatic $seeded;\n\n\tif (!$seeded) {\n\t\tmt_srand((double)microtime()*1000000);\n\t\t$seeded = true;\n\t}\n\n\tif (isset($min) && isset($max)) {\n\t\tif ($min >= $max) {\n\t\t\treturn $min;\n\t\t} else {\n\t\t\treturn mt_rand($min, $max);\n\t\t}\n\t} else {\n\t\treturn mt_rand();\n\t}\n}", "private function randHex()\n\t{\n\t\treturn dechex(floor(rand(100,65536)));\n\t}", "function _randomSteps(){\n return rand(3000, 9000);\n }", "function randomLCG($x,$pos) {\n $variable = (2*$x[$pos]+0)%100;\n $number[$pos] = $variable;\n $verdadero = repetidos($number,$pos);\n if (is_numeric($verdadero) == true){\n\t\treturn $verdadero;\n }\n\n}", "function randfuzz($len) \n{\n if (is_readable('/dev/urandom')) {\n $f=fopen('/dev/urandom', 'r');\n $urandom=fread($f, $len);\n fclose($f);\n }\n else\n {\n die(\"either /dev/urandom isnt readable or this isnt a linux \nmachine!\");\n }\n $return='';\n for ($i=0;$i < $len;++$i) {\n if (!!empty($urandom)) {\n if ($i%2==0) mt_srand(time()%2147 * 1000000 + \n(double)microtime() * 1000000);\n $rand=48+mt_rand()%64;\n } else $rand=48+ord($urandom[$i])%64;\n\n if ( 57 < $rand ) $rand+=7; \n if ( 90 < $rand ) $rand+=6; \n\n if ($rand==123) $rand=45;\n if ($rand==124) $rand=46;\n $return.=chr($rand);\n }\n return $return; \n}", "public function random()\n {\n $values = [];\n $priorities = [];\n foreach ($this->values as $columns) {\n foreach ($columns as $column) {\n $values[] = $column[0];\n $priorities[] = $column[1];\n }\n }\n\n $key = 0;\n $sum = array_sum($priorities);\n $random = mt_rand(0, $sum);\n foreach ($priorities as $key => $priority) {\n if ($random <= $priority) break;\n $random -= $priority;\n }\n\n return $values[$key];\n }", "function tf_md5rand() {\r\n return md5( time() .'-'. uniqid(rand(), true) .'-'. mt_rand(1, 1000) );\r\n }", "public static function getRandomNumber($from = 0, $to = NULL) {\n if ($from === NULL) {\n $from = 0;\n }\n if ($to === NULL) {\n $to = getrandmax();\n }\n return rand($from, $to);\n }", "function genNum(){\n $cant = 20;\n $posit = 0;\n for($i=0; $i<$cant; $i++){\n $num = rand(-99,99);\n echo $num .\" , \";\n $posit = NumPost($num,$posit);\n }\n return $posit;\n}", "function dice_up($current_value, $lo, $hi) {\n \n $old_value = $current_value;\n $current_value += mt_rand($lo, $hi);\n if ($current_value > 10) $current_value = 10;\n if ($current_value < 0) $current_value = 0;\n return $current_value - $old_value;\n}", "private static function getRandomNumber()\n {\n if (defined('PHP_WINDOWS_VERSION_BUILD') && version_compare(PHP_VERSION, '5.3.4', '<')) {\n $useOpenSsl = false;\n } elseif (!function_exists('openssl_random_pseudo_bytes')) {\n $useOpenSsl = false;\n } else {\n $useOpenSsl = true;\n }\n\n $nbBytes = 32;\n\n if ($useOpenSsl) {\n $bytes = openssl_random_pseudo_bytes($nbBytes, $strong);\n\n if (false !== $bytes && true === $strong) {\n return $bytes;\n }\n }\n\n return hash('sha256', uniqid(mt_rand(), true), true);\n }", "function randNumber($len=6,$start=false,$end=false) {\n\n mt_srand ((double) microtime() * 1000000);\n $start=(!$len && $start)?$start:str_pad(1,$len,\"0\",STR_PAD_RIGHT);\n $end=(!$len && $end)?$end:str_pad(9,$len,\"9\",STR_PAD_RIGHT);\n \n return mt_rand($start,$end);\n }", "function weighted_random_simple($values, $weights){ \n $count = count($values); \n $i = 0; \n $n = 0; \n $num = mt_rand(0, array_sum($weights)); \n while($i < $count){\n $n += $weights[$i]; \n if($n >= $num){\n break; \n }\n $i++; \n } \n return $values[$i]; \n}", "function p3_ex2() {\n $rand = mt_rand(1, 100); // mt_rand is very better\n for ($i = 0; $i <= 20; $i++) {\n if ($i % 5 == 0 && $i != 0)\n $return .= 'resultat : '.($i * $rand).'<br />';\n else\n $return .= 'resultat : '.($i * $rand).', ';\n }\n\n return $return;\n}", "public function random(): GifData;", "function log1p() { # :: Num -> Float\n return new Num\\Float(log1p($this->value));\n }" ]
[ "0.81829107", "0.79908967", "0.7847552", "0.78428197", "0.7749316", "0.7499693", "0.7442871", "0.73207486", "0.72612965", "0.7256418", "0.7174154", "0.71326053", "0.70733196", "0.70392764", "0.70219713", "0.68738025", "0.6703973", "0.6643067", "0.65991896", "0.6561416", "0.65546995", "0.64953756", "0.6459531", "0.6415936", "0.632825", "0.6294051", "0.6292449", "0.6285728", "0.62730044", "0.6194978", "0.61853373", "0.6175654", "0.6151532", "0.6124392", "0.6106781", "0.6101925", "0.60911214", "0.6090472", "0.6064126", "0.6058841", "0.6022714", "0.59824234", "0.59780943", "0.5966978", "0.5957789", "0.59551674", "0.5923175", "0.58874553", "0.58874553", "0.5795629", "0.5710623", "0.56997526", "0.56984586", "0.5662864", "0.56601405", "0.5653975", "0.5649229", "0.5637147", "0.5629405", "0.56221473", "0.5594426", "0.5583463", "0.558079", "0.5567885", "0.555799", "0.5557376", "0.55476624", "0.5521063", "0.5511977", "0.55090404", "0.549975", "0.5487418", "0.54753464", "0.5471798", "0.5464627", "0.54641247", "0.5457323", "0.5440969", "0.54252934", "0.5415122", "0.539999", "0.53840804", "0.53824985", "0.5368129", "0.53607666", "0.5359611", "0.5305954", "0.52996796", "0.5290876", "0.5288642", "0.52831423", "0.52821976", "0.5281699", "0.5275477", "0.52738273", "0.5270554", "0.5265019", "0.524408", "0.5241396", "0.5237702" ]
0.8046515
1
Seed the application's database.
public function run() { \DB::transaction(function () { $this->call([ Injections\AuthorizationSeeder::class, Injections\UserRoleSeeder::class, Injections\ApiSeeder::class, Injections\GenderSeeder::class, Injections\TrialBalanceAccountGroupSeeder::class, Injections\ProfitLossAccountGroupSeeder::class, Injections\AccountTypeSeeder::class, Injections\AccountSeeder::class, Injections\ProductTypeSeeder::class, ]); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function dbSeed(){\n\t\tif (App::runningUnitTests()) {\n\t\t\t//Turn foreign key checks off\n\t\t\tDB::statement('SET FOREIGN_KEY_CHECKS=0;');// <- USE WITH CAUTION!\n\t\t\t//Seed tables\n\t\t\tArtisan::call('db:seed');\n\t\t\t//Turn foreign key checks on\n\t\t\tDB::statement('SET FOREIGN_KEY_CHECKS=1;');// <- SHOULD RESET ANYWAY BUT JUST TO MAKE SURE!\n\t\t}\n\t}", "protected function seedDB()\n {\n $ans = $this->ask('Seed your database?: ', 'y');\n\n // Check if the answer is true\n if (preg_match('/^y/', $ans))\n {\n $this->call('db:seed');\n $this->comment('');\n $this->comment('Database successfully seeded.');\n $this->comment('=====================================');\n echo \"Your app is now ready!\";\n }\n }", "protected function seedDatabase(): void\n {\n $this->seedProductCategories();\n $this->seedProducts();\n }", "public function setupDatabase()\n {\n Artisan::call('migrate:refresh');\n Artisan::call('db:seed');\n\n self::$setupDatabase = false;\n }", "public function run()\n {\n $this->seed('FormsMenuItemsTableSeeder');\n $this->seed('FormsDataTypesTableSeeder');\n $this->seed('FormsDataRowsTableSeeder');\n $this->seed('FormsPermissionsTableSeeder');\n $this->seed('FormsSettingsTableSeeder');\n $this->seed('FormsTableSeeder');\n }", "public function run()\n {\n if (defined('STDERR')) fwrite(STDERR, print_r(\"\\n--- Seeding ---\\n\", TRUE));\n\n if (App::environment('production')) {\n if (defined('STDERR')) fwrite(STDERR, print_r(\"--- ERROR: Seeding in Production is prohibited ---\\n\", TRUE));\n return;\n }\n\n $this->call(RolesTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(ProvincesTableSeeder::class);\n $this->call(CitiesTableSeeder::class);\n $this->call(DistrictsTableSeeder::class);\n $this->call(ConfigsTableSeeder::class);\n $this->call(ConfigContentsTableSeeder::class);\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n if (defined('STDERR')) fwrite(STDERR, print_r(\"Set FOREIGN_KEY_CHECKS=1 --- DONE\\n\", TRUE));\n\n // \\Artisan::call('command:regenerate-user-feeds');\n\n \\Cache::flush();\n\n if (defined('STDERR')) fwrite(STDERR, print_r(\"--- End Seeding ---\\n\\n\", TRUE));\n }", "protected function setupDatabase()\n {\n $this->call('migrate');\n $this->call('db:seed');\n\n $this->info('Database migrated and seeded.');\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 seedDatabase(): void\n {\n echo \"Running seeds\";\n\n // Folder where all the seeds are.\n $folder = __DIR__ . '/../seeds/';\n\n // Scan all files/folders inside database.\n $files = \\scandir($folder);\n\n $seeders = [];\n foreach ($files as $key => $file) {\n\n // All files that don't start with a dot.\n if ($file[0] !== '.') {\n\n // Load the file.\n require_once $folder . $file;\n\n // We have to call the migrations after because\n // some seeds are dependant from other seeds.\n $seeders[] = explode('.', $file)[0];\n }\n }\n\n // Run all seeds.\n foreach ($seeders as $seeder) {\n (new $seeder)->run();\n }\n }", "protected function seedDatabase()\n {\n //$this->app->make('db')->table(static::TABLE_NAME)->delete();\n\n TestExtendedModel::create([\n 'unique_field' => '999',\n 'second_field' => null,\n 'name' => 'unchanged',\n 'active' => true,\n 'hidden' => 'invisible',\n ]);\n\n TestExtendedModel::create([\n 'unique_field' => '1234567',\n 'second_field' => '434',\n 'name' => 'random name',\n 'active' => false,\n 'hidden' => 'cannot see me',\n ]);\n\n TestExtendedModel::create([\n 'unique_field' => '1337',\n 'second_field' => '12345',\n 'name' => 'special name',\n 'active' => true,\n 'hidden' => 'where has it gone?',\n ]);\n }", "public function initDatabase()\n {\n $this->call('migrate');\n\n $userModel = config('admin.database.users_model');\n\n if ($userModel::count() == 0) {\n $this->call('db:seed', ['--class' => AdminSeeder::class]);\n }\n }", "public function run ()\n {\n if (App::environment() === 'production') {\n exit('Seed should be run only in development/debug environment.');\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n DB::table('role_user')->truncate();\n\n // Root user\n $user = User::find(1);\n $user->assignRole('owner');\n\n $user = User::find(2);\n $user->assignRole('admin');\n\n $user = User::find(3);\n $user->assignRole('admin');\n\n $user = User::find(4);\n $user->assignRole('moderator');\n\n $user = User::find(5);\n $user->assignRole('moderator');\n \n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }", "public function run()\n {\n Model::unguard();\n\n if (env('DB_CONNECTION') == 'mysql') {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n }\n\n $this->call(RolesTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(EntrustTableSeeder::class);\n\n $this->call(AccounttypeSeeder::class);\n $this->call(AppUserTableSeeder::class);\n $this->call(AppEmailUserTableSeeder::class);\n\n\n $this->call(CountryTableSeeder::class);\n $this->call(CityTableSeeder::class);\n\n\n $this->call(PostTypeTableSeeder::class);\n $this->call(PostSubTypeTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(AppPostSolvedTableSeeder::class);\n\n\n $this->call(AppCommentTypeTableSeeder::class);\n // $this->call(AppCommentTableSeeder::class);\n // $this->call(AppSubCommentTableSeeder::class);\n\n\n if (env('DB_CONNECTION') == 'mysql') {\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }\n\n Model::reguard();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n DB::table('users')->truncate();\n DB::table('password_resets')->truncate();\n DB::table('domains')->truncate();\n DB::table('folders')->truncate();\n DB::table('bookmarks')->truncate();\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\n $this->seedUserAccount('[email protected]');\n $this->seedUserAccount('[email protected]');\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n // $this->call(UsersTableSeeder::class);\n /* Schema::dropIfExists('employees');\n Schema::dropIfExists('users');\n Schema::dropIfExists('requests');\n Schema::dropIfExists('requeststatus');*/\n User::truncate();\n InstallRequest::truncate();\n RequestStatus::truncate();\n\n $cantidadEmployyes = 20;\n $cantidadUsers = 20;\n $cantidadRequestStatus = 3;\n $cantidadRequests = 200;\n\n factory(User::class, $cantidadUsers)->create();\n factory(RequestStatus::class, $cantidadRequestStatus)->create();\n factory(InstallRequest::class, $cantidadRequests)->create();\n }", "public function run()\n {\n Model::unguard();\n foreach (glob(__DIR__ . '/seeds/*.php') as $filename) {\n require_once($filename);\n }\n // $this->call(UserTableSeeder::class);\n //DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n// $this->call('CustomerTableSeeder');\n $this->call('PhotoTableSeeder');\n// $this->call('ProductTableSeeder');\n// $this->call('StaffTableSeeder');\n// $this->call('PasswordResetsTableSeeder');\n// $this->call('UsersTableSeeder');\n $this->call('CustomersTableSeeder');\n $this->call('EmployeesTableSeeder');\n $this->call('InventoryTransactionTypesTableSeeder');\n $this->call('OrderDetailsTableSeeder');\n $this->call('OrderDetailsStatusTableSeeder');\n $this->call('OrdersTableSeeder');\n $this->call('InvoicesTableSeeder');\n $this->call('OrdersTableSeeder');\n $this->call('OrderDetailsTableSeeder');\n $this->call('OrdersStatusTableSeeder');\n $this->call('OrderDetailsTableSeeder');\n\n $this->call('OrdersTaxStatusTableSeeder');\n $this->call('PrivilegesTableSeeder');\n $this->call('EmployeePrivilegesTableSeeder');\n $this->call('ProductsTableSeeder');\n $this->call('InventoryTransactionsTableSeeder');\n $this->call('PurchaseOrderDetailsTableSeeder');\n\n $this->call('PurchaseOrderStatusTableSeeder');\n $this->call('PurchaseOrdersTableSeeder');\n $this->call('SalesReportsTableSeeder');\n $this->call('ShippersTableSeeder');\n $this->call('StringsTableSeeder');\n $this->call('SuppliersTableSeeder');\n //DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\n Model::reguard();\n }", "public function run()\n\t{\n $this->cleanDatabase();\n\n Eloquent::unguard();\n\n\t\t$this->call('UsersTableSeeder');\n\t\t$this->call('ProductsTableSeeder');\n\t\t$this->call('CartsTableSeeder');\n $this->call('StoreTableSeeder');\n $this->call('AdvertisementsTableSeeder');\n \n\t}", "public function run()\n {\n \tDB::table('seeds')->truncate();\n\n $seeds = array(\n array(\n 'name' => 'PreferencesTableSeeder_Update_11_18_2013',\n ),\n array(\n 'name' => 'PreferencesTableSeeder_Update_11_20_2013',\n ),\n );\n\n // Uncomment the below to run the seeder\n DB::table('seeds')->insert($seeds);\n }", "public function run()\n {\n $this->createDefaultPermissionSeeder(env('DB_CONNECTION', 'mysql'));\n }", "public function run()\n {\n $this->createDefaultPermissionSeeder(env('DB_CONNECTION', 'mysql'));\n }", "protected function setUp(): void\n {\n $db = new DB;\n\n $db->addConnection([\n 'driver' => 'sqlite',\n 'database' => ':memory:',\n ]);\n\n $db->bootEloquent();\n $db->setAsGlobal();\n\n $this->createSchema();\n }", "public function run()\n {\n //$this->call('UserTableSeeder');\n //$this->call('ProjectTableSeeder');\n //$this->call('TaskTableSeeder');\n\n /**\n * Prepare seeding\n */\n $faker = Faker::create();\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n Model::unguard();\n\n /**\n * Seeding user table\n */\n App\\User::truncate();\n factory(App\\User::class)->create([\n 'name' => 'KCK',\n 'email' => '[email protected]',\n 'password' => bcrypt('password')\n ]);\n\n /*factory(App\\User::class, 9)->create();\n $this->command->info('users table seeded');*/\n\n /**\n * Seeding roles table\n */\n Spatie\\Permission\\Models\\Role::truncate();\n DB::table('model_has_roles')->truncate();\n $superAdminRole = Spatie\\Permission\\Models\\Role::create([\n 'name' => '최고 관리자'\n ]);\n $adminRole = Spatie\\Permission\\Models\\Role::create([\n 'name' => '관리자'\n ]);\n $regularRole = Spatie\\Permission\\Models\\Role::create([\n 'name' => '정회원'\n ]);\n $associateRole = Spatie\\Permission\\Models\\Role::create([\n 'name' => '준회원'\n ]);\n\n App\\User::where('email', '!=', '[email protected]')->get()->map(function ($user) use ($regularRole) {\n $user->assignRole($regularRole);\n });\n\n App\\User::whereEmail('[email protected]')->get()->map(function ($user) use ($superAdminRole) {\n $user->assignRole($superAdminRole);\n });\n $this->command->info('roles table seeded');\n\n /**\n * Seeding articles table\n */\n App\\Article::truncate();\n $users = App\\User::all();\n\n $users->each(function ($user) use ($faker) {\n $user->articles()->save(\n factory(App\\Article::class)->make()\n );\n });\n $this->command->info('articles table seeded');\n\n /**\n * Seeding comments table\n */\n App\\Comment::truncate();\n $articles = App\\Article::all();\n\n $articles->each(function ($article) use ($faker, $users) {\n for ($i = 0; $i < 10; $i++) {\n $article->comments()->save(\n factory(App\\Comment::class)->make([\n 'author_id' => $faker->randomElement($users->pluck('id')->toArray()),\n //'parent_id' => $article->id\n ])\n );\n };\n });\n $this->command->info('comments table seeded');\n\n /**\n * Seeding tags table\n */\n App\\Tag::truncate();\n DB::table('article_tag')->truncate();\n $articles->each(function ($article) use ($faker) {\n $article->tags()->save(\n factory(App\\Tag::class)->make()\n );\n });\n $this->command->info('tags table seeded');\n\n /**\n * Seeding attachments table\n */\n App\\Attachment::truncate();\n if (!File::isDirectory(attachment_path())) {\n File::deleteDirectory(attachment_path(), true);\n }\n\n $articles->each(function ($article) use ($faker) {\n $article->attachments()->save(\n factory(App\\Attachment::class)->make()\n );\n });\n\n //$files = App\\Attachment::pluck('name');\n\n if (!File::isDirectory(attachment_path())) {\n File::makeDirectory(attachment_path(), 777, true);\n }\n\n /*\n foreach ($files as $file) {\n File::put(attachment_path($file), '');\n }\n */\n\n $this->command->info('attachments table seeded');\n\n /**\n * Close seeding\n */\n Model::reguard();\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\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(CountriesTableSeeder::class);\n $this->call(StatesTableSeeder::class);\n $this->call(CitiesTableSeeder::class);\n\n factory(Group::class)->create();\n factory(Contact::class, 5000)->create();\n }", "public function run()\n\t{\n\t\tEloquent::unguard();\n\n\t\t// $this->call('AdminTableSeeder');\n\t\t// $this->call('UserTableSeeder');\n\t\t// $this->call('MenuTableSeeder');\n\t\t// $this->call('ProductTableSeeder');\n\t\t// $this->call('CategoryTableSeeder');\n\t\t// $this->call('OptionTableSeeder');\n\t\t// $this->call('OptionGroupTableSeeder');\n\t\t// $this->call('TypeTableSeeder');\n\t\t// $this->call('LayoutTableSeeder');\n\t\t// $this->call('LayoutDetailTableSeeder');\n\t\t// $this->call('BannerTableSeeder');\n\t\t// $this->call('ConfigureTableSeeder');\n\t\t// $this->call('PageTableSeeder');\n\t\t// $this->call('ImageTableSeeder');\n\t\t// $this->call('ImageableTableSeeder');\n\t\t// ======== new Seed =======\n\t\t$this->call('AdminsTableSeeder');\n\t\t$this->call('BannersTableSeeder');\n\t\t$this->call('CategoriesTableSeeder');\n\t\t$this->call('ConfiguresTableSeeder');\n\t\t$this->call('ImageablesTableSeeder');\n\t\t$this->call('ImagesTableSeeder');\n\t\t$this->call('LayoutsTableSeeder');\n\t\t$this->call('LayoutDetailsTableSeeder');\n\t\t$this->call('MenusTableSeeder');\n\t\t$this->call('OptionablesTableSeeder');\n\t\t$this->call('OptionsTableSeeder');\n\t\t$this->call('OptionGroupsTableSeeder');\n\t\t$this->call('PagesTableSeeder');\n\t\t$this->call('PriceBreaksTableSeeder');\n\t\t$this->call('ProductsTableSeeder');\n\t\t$this->call('ProductsCategoriesTableSeeder');\n\t\t$this->call('SizeListsTableSeeder');\n\t\t$this->call('TypesTableSeeder');\n\t\t$this->call('UsersTableSeeder');\n\t\t$this->call('ContactsTableSeeder');\n\t\t$this->call('RolesTableSeeder');\n\t\t$this->call('PermissionsTableSeeder');\n\t\t$this->call('PermissionRoleTableSeeder');\n\t\t$this->call('AssignedRolesTableSeeder');\n\t\t$this->call('OrdersTableSeeder');\n\t\t$this->call('OrderDetailsTableSeeder');\n\t\tCache::flush();\n\t\t// BackgroundProcess::copyFromVI();\n\t}", "public function run()\n {\n Model::unguard();\n\n User::create([\n 'email' => '[email protected]',\n 'name' => 'admin',\n 'password' => Hash::make('1234'),\n 'email_verified_at' => Carbon::now()\n ]);\n\n factory(User::class, 200)->create();\n\n // $this->call(\"OthersTableSeeder\");\n }", "public function run()\n {\n $this->seedRegularUsers();\n $this->seedAdminUser();\n }", "public function run()\n {\n if (\\App::environment() === 'local') {\n\n // Delete existing data\n\n\n Eloquent::unguard();\n\n //disable foreign key check for this connection before running seeders\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // Truncate all tables, except migrations\n $tables = array_except(DB::select('SHOW TABLES'), ['migrations']);\n foreach ($tables as $table) {\n $tables_in_database = \"Tables_in_\" . Config::get('database.connections.mysql.database');\n DB::table($table->$tables_in_database)->truncate();\n }\n\n // supposed to only apply to a single connection and reset it's self\n // but I like to explicitly undo what I've done for clarity\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\n //get roles\n $this->call('AccountSeeder');\n $this->call('CountrySeeder');\n $this->call('StateSeeder');\n $this->call('CitySeeder');\n $this->call('OptionSeeder');\n $this->call('TagSeeder');\n $this->call('PrintTemplateSeeder');\n $this->call('SettingsSeeder');\n\n\n\n if(empty($web_installer)) {\n $admin = Sentinel::registerAndActivate(array(\n 'email' => '[email protected]',\n 'password' => \"admin\",\n 'first_name' => 'Admin',\n 'last_name' => 'Doe',\n ));\n $admin->user_id = $admin->id;\n $admin->save();\n\n $adminRole = Sentinel::findRoleById(1);\n $adminRole->users()->attach($admin);\n }\n else {\n $admin = Sentinel::findById(1);\n }\n\n //add dummy staff and customer\n $staff = Sentinel::registerAndActivate(array(\n 'email' => '[email protected]',\n 'password' => \"staff\",\n 'first_name' => 'Staff',\n 'last_name' => 'Doe',\n ));\n $admin->users()->save($staff);\n\n foreach ($this->getPermissions() as $permission) {\n $staff->addPermission($permission);\n }\n $staff->save();\n\n $customer = Sentinel::registerAndActivate(array(\n 'email' => '[email protected]',\n 'password' => \"customer\",\n 'first_name' => 'Customer',\n 'last_name' => 'Doe',\n ));\n Customer::create(array('user_id' => $customer->id, 'belong_user_id' => $staff->id));\n $staff->users()->save($customer);\n\n //add respective roles\n\n $staffRole = Sentinel::findRoleById(2);\n $staffRole->users()->attach($staff);\n $customerRole = Sentinel::findRoleById(3);\n $customerRole->users()->attach($customer);\n\n\n\n DB::table('sales_teams')->truncate();\n DB::table('opportunities')->truncate();\n\n //Delete existing seeded users except the first 4 users\n User::where('id', '>', 3)->get()->each(function ($user) {\n $user->forceDelete();\n });\n\n //Get the default ADMIN\n $user = User::find(1);\n $staffRole = Sentinel::getRoleRepository()->findByName('staff');\n $customerRole = Sentinel::getRoleRepository()->findByName('customer');\n\n //Seed Sales teams for default ADMIN\n foreach (range(1, 4) as $j) {\n $this->createSalesTeam($user->id, $j, $user);\n $this->createOpportunity($user, $user->id, $j);\n }\n\n\n //Get the default STAFF\n $staff = User::find(2);\n $this->createSalesTeam($staff->id, 1, $staff);\n $this->createSalesTeam($staff->id, 2, $staff);\n\n //Seed Sales teams for each STAFF\n foreach (range(1, 4) as $j) {\n $this->createSalesTeam($staff->id, $j, $staff);\n $this->createOpportunity($staff, $staff->id, $j);\n }\n\n foreach (range(1, 3) as $i) {\n $staff = $this->createStaff($i);\n $user->users()->save($staff);\n $staffRole->users()->attach($staff);\n\n $customer = $this->createCustomer($i);\n $staff->users()->save($customer);\n $customerRole->users()->attach($customer);\n $customer->customer()->save(factory(\\App\\Models\\Customer::class)->make());\n\n\n //Seed Sales teams for each STAFF\n foreach (range(1, 5) as $j) {\n $this->createSalesTeam($staff->id, $j, $staff);\n $this->createOpportunity($staff, $i, $j);\n }\n\n }\n\n //finally call it installation is finished\n file_put_contents(storage_path('installed'), 'Welcome to LCRM');\n }\n }", "public function run()\n {\n if (env('DB_DATABASE') == 'connection') {\n Connection::create([\n \"ruc\" => \"12312312312\",\n \"basedata\" => \"nbdata2018_1\",\n ]);\n \n Connection::create([\n \"ruc\" => \"12312312315\",\n \"basedata\" => \"nbdata2018_2\",\n ]);\n \n $this->call(ConnectionTableSeeder::class);\n } else {\n $this->call(AppSeeder::class);\n }\n }", "public function setupDatabase()\n {\n exec('rm ' . storage_path() . '/testdb.sqlite');\n exec('cp ' . 'database/database.sqlite ' . storage_path() . '/testdb.sqlite');\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 # truncates tables before seeding\n foreach ($this->toTruncate as $table) {\n DB::table($table)->delete();\n }\n\n factory(App\\Models\\Product::class, 25)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n Post::truncate();\n Comment::truncate();\n // CommentReply::truncate();\n \n\n\n factory(User::class,10)->create();\n factory(Post::class,20)->create();\n factory(Comment::class,30)->create();\n // factory(CommentReply::class,30)->create();\n }", "public function run()\n\t{\n \n Eloquent::unguard();\n //DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\t\t$this->call('UserTableSeeder');\n\t $this->call('LayerTableSeeder');\n $this->call('UserLevelTableSeeder');\n $this->call('RoleUserTableSeeder');\n $this->call('RoleLayerTableSeeder');\n $this->call('BookmarkTableSeeder');\n \n //DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\t}", "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 DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\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 DB::statement('SET foreign_key_checks = 0');\n DB::table('topics')->truncate();\n\n factory(\\App\\Topic::class, 100)->create();\n // ->each(function($topic) {\n\n // // Seed para a relação com group\n // $topic->group()->save(factory(App\\Group::class)->make());\n\n // // Seed para a relação com topicMessages\n // $topic->topicMessages()->save(factory(App\\TopicMessage::class)->make());\n\n // // Seed para a relação com user\n // $topic->user()->save(factory(App\\User::class)->make());\n // });\n \n DB::statement('SET foreign_key_checks = 1');\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n Categoria::truncate();\n Atractivo::truncate();\n Galeria::truncate();\n User::truncate();\n\n $this->call(CategoriasTableSeeder::class);\n $this->call(AtractivosTableSeeder::class);\n $this->call(GaleriasTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n }", "public function run(Faker $faker)\n {\n Schema::disableForeignKeyConstraints();\n DB::table('users')->insert([\n 'name' => $faker->name(),\n 'email' => '[email protected]',\n 'password' => Hash::make('12345678'),\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\t $this->call(CategoryTableSeed::class);\n\t $this->call(ProductTableSeed::class);\n\t $this->call(UserTableSeed::class);\n }", "public function run()\n {\n $this->cleanDatabase();\n\n factory(User::class, 50)->create();\n factory(Document::class, 30)->create();\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 \t// DB::table('webapps')->delete();\n\n $webapps = array(\n\n );\n\n // Uncomment the below to run the seeder\n // DB::table('webapps')->insert($webapps);\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 $tables = array(\n 'users',\n 'companies',\n 'stands',\n 'events',\n 'visitors',\n 'api_keys'\n );\n\n if (!App::runningUnitTests()) {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n }\n\n foreach ($tables as $table) {\n DB::table($table)->truncate();\n }\n\n $this->call(UsersTableSeeder::class);\n $this->call(EventsTableSeeder::class);\n $this->call(CompaniesTableSeeder::class);\n $this->call(StandsTableSeeder::class);\n $this->call(VisitorsTableSeeder::class);\n\n if (!App::runningUnitTests()) {\n DB::statement('SET FOREIGN_KEY_CHECKS = 1');\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n $clear = $this->command->confirm('Wil je de database leegmaken? (Dit haalt alle DATA weg)');\n\n if ($clear):\n $this->command->callSilent('migrate:refresh');\n $this->command->info('Database Cleared, starting seeding');\n endif;\n\n $this->call([\n SeedSeeder::class,\n RoleSeeder::class,\n UserSeeder::class,\n // BoardgameSeeder::class,\n BoardgamesTableSeeder::class,\n StatusSeeder::class,\n TournamentSeeder::class,\n AchievementsSeeder::class,\n TournamentUsersSeeder::class,\n ]);\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n $this->call(PaisSeeder::class);\n $this->call(DepartamentoSeeder::class);\n $this->call(MunicipioSeeder::class);\n $this->call(PersonaSeeder::class);\n }", "public function run()\n {\n //\n if (App::environment() === 'production') {\n exit('Do not seed in production environment');\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // disable foreign key constraints\n\n DB::table('events')->truncate();\n \n Event::create([\n 'id' => 1,\n 'name' => 'Spot Registration For Throat Cancer',\n 'cancerId' => 1,\n 'startDate'\t\t=> Carbon::now(),\n 'endDate'\t\t=> Carbon::now()->addMonths(12),\n 'eventType'\t\t=> 'register',\n 'formId'\t\t=> null,\n ]);\n\n Event::create([\n 'id' => 2,\n 'name' => 'Spot Screening For Throat Cancer',\n 'cancerId' => 1,\n 'startDate'\t\t=> Carbon::now(),\n 'endDate'\t\t=> Carbon::now()->addMonths(12),\n 'eventType'\t\t=> 'screen',\n 'formId'\t\t=> 1,\n ]);\n \n Event::create([\n 'id' => 3,\n 'name' => 'Spot Registration For Skin Cancer',\n 'cancerId' => 2,\n 'startDate'\t\t=> Carbon::now(),\n 'endDate'\t\t=> Carbon::now()->addMonths(12),\n 'eventType'\t\t=> 'register',\n 'formId'\t\t=> null,\n ]);\n\n\n Event::create([\n 'id' => 3,\n 'name' => 'Registration cum Screening camp for Throat Cancer',\n 'cancerId' => 1,\n 'startDate'\t\t=> Carbon::now(),\n 'endDate'\t\t=> Carbon::now()->addWeeks(1),\n 'eventType'\t\t=> 'register_screen',\n 'formId'\t\t=> 1,\n ]);\n \n DB::statement('SET FOREIGN_KEY_CHECKS = 1'); // enable foreign key constraints\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // Para que no verifique el control de claves foráneas al hacer el truncate haremos:\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS=0');\n\n\t\t// Primero hacemos un truncate de las tablas para que no se estén agregando datos\n\t\t// cada vez que ejecutamos el seeder.\n\t\t//Foto::truncate();\n\t\t//Album::truncate();\n\t\t//Usuario::truncate();\n DB::table('users')->delete();\n DB::table('ciudades')->delete();\n DB::table('tiendas')->delete();\n DB::table('ofertas')->delete();\n DB::table('ventas')->delete();\n\n\n\t\t// Es importante el orden de llamada.\n\t\t$this->call('UserSeeder');\n $this->call('CiudadSeeder');\n\t\t$this->call('TiendaSeeder');\n $this->call('OfertaSeeder');\n $this->call('VentaSeeder');\n }", "public function run()\n {\n $this->call(\\Database\\Seeders\\GroupByRecordTableSeeder::class);\n $this->call(\\Database\\Seeders\\SingleIndexRecordTableSeeder::class);\n $this->call(\\Database\\Seeders\\MultiIndexRecordTableSeeder::class);\n $this->call(\\Database\\Seeders\\JoinFiveTablesSeeder::class);\n\n// DB::table('users')->truncate();\n// DB::table('user_details')->truncate();\n//\n// // 試しに一回流す\n// $data = $this->makeData(0, 'userFactory', 1);\n// DB::table('users')->insert($data);\n// $data = $this->makeData(0, 'userDetailFactory', 1);\n// DB::table('user_details')->insert($data);\n//\n// // $this->call(UsersTableSeeder::class);\n// DB::table('users')->truncate();\n// DB::table('user_details')->truncate();\n//\n// for ($i = 0; $i < 40; $i++) {\n// $data = $this->makeData($i, 'userFactory', 2500);\n// DB::table('users')->insert($data);\n// }\n//\n// for ($i = 0; $i < 40; $i++) {\n// $data = $this->makeData($i, 'userDetailFactory', 2500);\n// DB::table('user_details')->insert($data);\n// }\n }", "public function run()\n {\n $this->truncateTables([\n 'users',\n 'categories',\n 'types',\n 'courses',\n 'classrooms',\n 'contents',\n 'companies',\n ]);\n\n $this->call(CompanyTableSeeder::class);\n $this->call(TypeTableSeeder::class);\n $this->call(RoleTableSeeder::class);\n $this->call(CategoryTableSeeder::class);\n $this->call(CoursesTableSeeder::class);\n $this->call(PermissionTableSeeder::class);\n $this->call(ContentTableSeeder::class);\n $this->call(UserTableSeeder::class);\n $this->call(ClassroomTableSeeder::class);\n $this->call(TestTableSeeder::class);\n $this->call(BankTableSeeder::class);\n\n\n // factory(\\App\\User::class, 50)\n // ->create()\n // ->each(function ($user) {\n // // $user->companies()->save();\n // $company = \\App\\Company::inRandomOrder()->first();\n // $user->companies()->attach($company->id);\n // $user->assignRole(['participante']);\n // });\n /*\n factory(\\App\\User::class, 50)\n ->create()\n ->each(function ($user) {\n $user->assignRole(['participante']);\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 DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n User::truncate();\n Question::truncate();\n Option::truncate();\n// Answer::truncate();\n Quiz::truncate();\n QuizQuestion::truncate();\n\n //for admin\n $admin = factory(User::class)->create([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'is_admin' => 1,\n ]);\n\n //for user\n $user = factory(User::class)->create([\n 'name' => 'User',\n 'email' => '[email protected]',\n ]);\n\n factory(Question::class, 100)->create()->each(function ($question) {\n factory(Option::class, mt_rand(2, 4))->create([\n 'question_id' => $question->id,\n ]);\n });\n\n factory(Quiz::class, 10)->create()->each(function ($quiz) {\n\n factory(QuizQuestion::class, mt_rand(5, 10))->create();\n });\n\n\n }", "public function run()\n {\n $this->call([\n SiteSettingsSeeder::class,\n LaratrustSeeder::class,\n CountrySeeder::class,\n GovernorateSeeder::class,\n FaqSeeder::class,\n SitePageSeeder::class,\n UsersSeeder::class,\n ]);\n\n Country::whereiso(\"EG\")->update(['enable_shipping' => true]);\n\n factory(User::class, 400)->create();\n\n Category::create([\n 'en' => [\n 'name' => \"cake tools\"\n ]\n ]);\n\n Category::create([\n 'en' => [\n 'name' => \"Party Supplies\"\n ]\n ]);\n\n $this->call([\n ProductCategorySeeder::class,\n ProductSeeder::class\n ]);\n }", "public function run()\n {\n $this->call(PermissionsTableSeeder::class);\n\n if (App::environment('local')) {\n $this->call(FakeUsersTableSeeder::class);\n $this->call(FakeArticlesTableSeeder::class);\n $this->call(FakeEventsTableSeeder::class);\n }\n }", "public function run()\n {\n Model::unguard();\n\n $this->call(CategoryTypesTableSeeder::class);\n $this->call(CategoryTableSeeder::class);\n $this->call(AccountTypesTableSeeder::class);\n $this->call(TransactionTypesTableSeeder::class);\n\n if (App::environment() !== 'production') {\n $this->call(UserTableSeeder::class);\n $this->call(AccountBudgetTableSeeder::class);\n $this->call(TransactionTableSeeder::class);\n }\n\n Model::reguard();\n }", "public function run()\n {\n User::truncate();\n Product::truncate();\n User::forceCreate([\n 'name' => 'foo',\n 'email' => '[email protected]',\n 'password' => bcrypt('password'),\n ]);\n factory(User::class, 5)->create();\n factory(Product::class, 5)->create();\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 {\n $this->call([UsersTableSeeder::class]);\n $this->call([ContratosTableSeeder::class]);\n $this->call([UsuariosTableSeeder::class]);\n $this->call([UnidadesTableSeeder::class]);\n $this->call([AtestadosTableSeeder::class]);\n }", "public function run()\n {\n Model::unguard();\n\n // $this->call(\"OthersTableSeeder\");\n\n // DB::table('locations')->insert([\n // 'id' => 1,\n // 'name' => 'Default',\n // 'name' => 'district',\n // 'district_id' => 1,\n // 'province_id' => 1,\n // ]);\n }", "public function run()\n {\n $data = include env('DATA_SEED');\n\n \\Illuminate\\Support\\Facades\\DB::table('endpoints')->insert((array)$data);\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n DB::table('admins')->truncate();\n\n for ($i = 0; $i < 10; $i++)\n {\n $faker = Factory::create('en_US');\n $values = [\n 'name' => $faker->userName,\n 'email' => $faker->freeEmail,\n 'password' => bcrypt($faker->password),\n 'phone' => $faker->phoneNumber,\n 'status' => random_int(0,1)\n ];\n admin::create($values);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n\n DB::beginTransaction();\n// $this->seed();\n DB::commit();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }", "public function run()\n {\n \\DB::table('provinces')->delete();\n \\DB::table('cities')->delete();\n \\DB::table('districts')->delete();\n // import provinces and cities from sql file\n $sqlFile = app_path() . '/../database/raw/administrative_indonesia_without_districts.sql';\n DB::unprepared(file_get_contents($sqlFile));\n $this->command->info('Successfully seed Provinces and Cities!');\n\n // import districts with latitude and longitude from csv file\n $csvFile = app_path() . '/../database/raw/administrative_indonesia_districts_with_lat_lng.csv';\n $districts = $this->csvToArray($csvFile);\n // check if lat lng exists\n foreach ($districts as $i => $d) {\n if ($d['latitude'] == '') $districts[$i]['latitude'] = 0;\n if ($d['longitude'] == '') $districts[$i]['longitude'] = 0;\n }\n // insert it\n $insert = District::insert($districts);\n if ($insert) $this->command->info('Successfully seed Districts!');\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(RegionsTableSeeder::class);\n $this->call(ProvincesTableSeeder::class);\n $this->call(DistrictsTableSeeder::class);\n $this->call(SubDistrictsTableSeeder::class);\n $this->call(PostcodesTableSeeder::class);\n\n if (env('APP_ENV') !== 'production') {\n // Wipe up 5 churches, and each church has 5 cells, and each cell has 20 members associated with.\n // In other word, we wipe up 500 church members.\n for ($i = 0; $i < 2; $i++) {\n $church = factory(\\App\\Models\\Church::class)->create();\n\n $church->areas()->saveMany(factory(\\App\\Models\\Area::class, 2)->create([\n 'church_id' => $church->id\n ])->each(function($area) {\n $area->cells()->saveMany(factory(\\App\\Models\\Cell::class, 2)->create([\n 'area_id' => $area->id\n ])->each(function($cell) {\n $cell->members()->saveMany(factory(App\\Models\\Member::class, 10)->create([\n 'cell_id' => $cell\n ]));\n }));\n }));\n }\n }\n }", "public function run()\n {\n User::create([\n 'name' => 'Regynald',\n 'email' => '[email protected]',\n 'password' => Hash::make('123456789'),\n 'url' => 'http://zreyleo-code.com',\n ]);\n\n User::create([\n 'name' => 'Leonardo',\n 'email' => '[email protected]',\n 'password' => Hash::make('123456789')\n ]);\n\n // seed sin model\n /* DB::table('users')->insert([\n 'name' => 'Regynald',\n 'email' => '[email protected]',\n 'password' => Hash::make('123456789'),\n 'url' => 'http://zreyleo-code.com',\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 {\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 // \\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->environmentPath = env('APP_ENV') === 'production' ||\n env('APP_ENV') === 'qa' ||\n env('APP_ENV') === 'integration' ?\n 'Production':\n 'local';\n //disable FK\n Model::unguard();\n DB::statement(\"SET session_replication_role = 'replica';\");\n\n // $this->call(HrEmployeeTableSeeder::class);\n $this->call(\"Modules\\HR\\Database\\Seeders\\\\$this->environmentPath\\HrEmployeePosTableSeeder\");\n // $this->call(HrEmployeePresetsDiscountTableSeeder::class);\n\n // Enable FK\n DB::statement(\"SET session_replication_role = 'origin';\");\n Model::reguard();\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 }", "protected static function seed()\n {\n foreach (self::fetch('database/seeds', false) as $file) {\n Bus::need($file);\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n $faker = F::create('App\\Proovedores');\n for($i=0; $i < 10; $i++){\n DB::table('users')->insert([\n 'usuario' => $i,\n 'password' => $i,\n 'email' => $faker->email,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Delete all records.\n DB::table('users')->delete();\n // Reset AUTO_INCREMENT.\n DB::table('users')->truncate();\n\n // Dev user.\n App\\Models\\User::create([\n 'email' => '[email protected]',\n 'password' => '$2y$10$t6q81nz.XrMrh20NHDvxUu/szwHBwgzPd.01e8uuP0qVy0mPa6H/e',\n 'first_name' => 'L5',\n 'last_name' => 'App',\n 'username' => 'l5-app',\n 'is_email_verified' => 1,\n ]);\n\n // Dummy users.\n TestDummy::times(10)->create('App\\Models\\User');\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n User::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // We did this for test purposes. Shouldn't be doing this for production\n $password = Hash::make('123456');\n\n User::create([\n 'name' => 'Administrator',\n 'email' => '[email protected]',\n 'password' => $password,\n ]);\n }", "public function run()\n {\n Model::unguard();\n \n factory('App\\User','admin')->create();\n factory('App\\Evento',100)->create();\n //factory('App\\User','miembro',10)->create();\n factory('App\\Telefono',13)->create();\n factory('App\\Notificacion',10)->create();\n factory('App\\Rubro',10)->create();\n factory('App\\Tecnologia',10)->create();\n factory('App\\Cultivo',10)->create();\n factory('App\\Etapa',10)->create();\n factory('App\\Variedad',10)->create();\n factory('App\\Caracteristica',10)->create();\n factory('App\\Practica',30)->create();\n factory('App\\Tag',15)->create();\n // $this->call(PracticaTableSeeder::class);\n $this->call(TrTableSeeder::class);\n $this->call(MesTableSeeder::class);\n $this->call(SemanasTableSeeder::class);\n $this->call(PsTableSeeder::class);\n $this->call(MsTableSeeder::class);\n $this->call(CeTableSeeder::class);\n $this->call(CvTableSeeder::class);\n $this->call(PtSeeder::class);\n \n\n Model::unguard();\n }", "public function run() {\n $this->call(UserSeeder::class);\n $this->call(PermissionSeeder::class);\n $this->call(CreateAdminUserSeeder::class);\n // $this->call(PhoneSeeder::class);\n // $this->call(AddressSeeder::class);\n\n $this->call(ContactFormSeeder::class);\n //$this->call(ContactSeeder::class);\n\n User::factory()->count(20)->create()->each(function ($user) {\n // Seed the relation with one address\n $address = Address::factory()->make();\n $user->address()->save($address);\n\n // Seed the relation with one phone\n $phone = Phone::factory()->make();\n $user->phone()->save($phone);\n\n // Seed the relation with 15 contacts\n $contact = Contact::factory()->count(25)->make();\n $user->contacts()->saveMany($contact);\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 DB::statement('SET FOREIGN_KEY_CHECKS=0');\n Activity::truncate();\n User::truncate();\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n $this->call(UserTableSeeder::class);\n $this->call(ActivityTableSeeder::class);\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\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n \\App\\User::truncate();\n \\App\\Category::truncate();\n \\App\\Product::truncate();\n \\App\\Transaction::truncate();\n DB::table('category_product')->truncate();\n\n \\App\\User::flushEventListeners();\n \\App\\Category::flushEventListeners();\n \\App\\Product::flushEventListeners();\n \\App\\Transaction::flushEventListeners();\n\n\n $usersQuentity = 1000;\n $categoriesQuentity = 30;\n $productsQuentity = 1000;\n $transactionsQuentity = 1000;\n\n factory(\\App\\User::class, $usersQuentity)->create();\n factory(\\App\\Category::class, $categoriesQuentity)->create();\n factory(\\App\\Product::class, $productsQuentity)->create()->each(\n function ($product){\n $categories = \\App\\Category::all()->random(mt_rand(1, 5))->pluck('id');\n\n $product->categories()->attach($categories);\n }\n );\n factory(\\App\\Transaction::class, $transactionsQuentity)->create();\n\n }", "public function run()\n {\n Eloquent::unguard();\n \n $this->call('AdminMemberTableSeeder');\n $this->call('BankInfoTableSeeder');\n $this->call('LocationLookUpTableSeeder');\n $this->call('OrderStatusTableSeeder');\n $this->call('AdminRoleTableSeeder');\n\n }", "public static function setUpBeforeClass()\n {\n parent::setUpBeforeClass();\n $app = require __DIR__ . '/../../bootstrap/app.php';\n /** @var \\Pterodactyl\\Console\\Kernel $kernel */\n $kernel = $app->make(Kernel::class);\n $kernel->bootstrap();\n $kernel->call('migrate:fresh');\n\n \\Artisan::call('db:seed');\n }", "public function run()\n {\n Model::unguard();\n\n if( !User::where('email', '[email protected]')->count() ) {\n User::create([\n 'nombre'=>'Nick'\n ,'apellidos'=>'Palomino'\n ,'email'=>'[email protected]'\n ,'password'=> Hash::make('1234567u')\n ,'celular'=>'966463589'\n ]);\n }\n\n $this->call('CategoriaTableSeeder');\n $this->call('WhateverSeeder');\n $this->call('ProductTableSeeder');\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 Model::unguard();\n\n $this->command->info('seed start!');\n\n // 省市县\n $this->call('RegionTableSeeder');\n // 用户、角色\n $this->call('UserTableSeeder');\n // 权限\n $this->call('PurviewTableSeeder');\n // 博文分类\n $this->call('CategoryTableSeeder');\n // 博文、评论、标签\n $this->call('ArticleTableSeeder');\n // 心情\n $this->call('MoodTableSeeder');\n // 留言\n $this->call('MessageTableSeeder');\n // 文件\n $this->call('StorageTableSeeder');\n\n $this->command->info('seed end!');\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 $this->call(RolesDatabaseSeeder::class);\n $this->call(UsersDatabaseSeeder::class);\n $this->call(LocalesDatabaseSeeder::class);\n $this->call(MainDatabaseSeeder::class);\n }", "public function run()\n {\n\n Schema::disableForeignKeyConstraints(); //in order to execute truncate before seeding\n\n $this->call(UsersTableSeeder::class);\n $this->call(PostCategoriesSeeder::class);\n $this->call(TagsSeeder::class);\n $this->call(PostsSeeder::class);\n\n Schema::enableForeignKeyConstraints();\n\n\n }", "public function run()\n {\n // DB::table('users')->insert([\n // ['id'=>1, 'email'=>'nhat','password'=>bcrypt(1234), 'lever'=>0]\n // ]);\n // $this->call(UsersTableSeeder::class);\n // $this->call(CatTableSeeder::class);\n // $this->call(TypeTableSeeder::class);\n // $this->call(AppTableSeeder::class);\n // $this->call(GameTableSeeder::class);\n \n \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 $this->seedUsers();\n $this->seedAdmins();\n $this->seedMeals();\n\n $this->seedOrder();\n $this->seedOrderlist();\n\n $this->seedReload();\n }", "public function run()\n\t{\n\t\t//composer require fzaninotto/faker\n\t\t\n\t\t$this->call(populateAllSeeder::class);\n\t\t\n\t}", "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 $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 Model::unguard();\n\n $faker =Faker\\Factory::create();\n\n // $this->call(UserTableSeeder::class);\n\n $this->seedTasks($faker);\n $this->seedTags($faker);\n\n Model::reguard($faker);\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 Schema::disableForeignKeyConstraints();\n\n $this->call([\n CountriesSeeder::class,\n ProvincesSeeder::class,\n SettingsSeeder::class,\n AdminsTableSeeder::class,\n ]);\n }" ]
[ "0.8064933", "0.7848158", "0.7674873", "0.724396", "0.7216743", "0.7132209", "0.70970356", "0.70752203", "0.704928", "0.699208", "0.6987078", "0.69839287", "0.6966499", "0.68990964", "0.6868679", "0.68468624", "0.68307716", "0.68206114", "0.6803113", "0.6803113", "0.6801801", "0.6789746", "0.6788733", "0.6788008", "0.6786291", "0.67765796", "0.67742485", "0.677106", "0.67651874", "0.6761959", "0.675823", "0.67337847", "0.6733437", "0.67295784", "0.67290515", "0.6724652", "0.67226326", "0.6722267", "0.6721339", "0.6715842", "0.67070943", "0.67060536", "0.67031103", "0.6702514", "0.6702361", "0.67017967", "0.6695973", "0.6693496", "0.66868156", "0.66837406", "0.6678434", "0.66755766", "0.66726524", "0.666599", "0.664943", "0.6640641", "0.663921", "0.66387916", "0.6636016", "0.6633116", "0.6629787", "0.6627134", "0.6625862", "0.661699", "0.66093796", "0.6602538", "0.65996546", "0.659914", "0.6596484", "0.6596383", "0.65922767", "0.65922284", "0.65913564", "0.65889347", "0.65812707", "0.65811145", "0.6579546", "0.6578819", "0.6575912", "0.65749073", "0.6574314", "0.657148", "0.65696406", "0.6568972", "0.65624833", "0.6560332", "0.6559092", "0.6557491", "0.65555155", "0.6554255", "0.65509576", "0.6548099", "0.65479296", "0.6545845", "0.65443295", "0.65434265", "0.65432936", "0.654295", "0.65426385", "0.6541781", "0.6539325" ]
0.0
-1
Returns the public member variables of an object. This method is provided such that we can get the public member variables of an object. It is different from "get_object_vars()" because the latter will return private and protected variables if it is called within the object itself.
public static function getObjectVars($object) { return get_object_vars($object); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getPublicProperties() {\n\t\t$getPublicProperties = function($obj) { return get_object_vars($obj); };\n\t\treturn $getPublicProperties($this);\n\t}", "public function getProperties($public = true)\n {\n $vars = get_object_vars($this);\n\n if ($public) {\n foreach ($vars as $key => $value) {\n if ('_' == substr($key, 0, 1)) {\n unset($vars[$key]);\n }\n }\n }\n\n return $vars;\n }", "public static function getObjectVars($object)\n {\n return get_object_vars($object);\n }", "function getProperties($public = true) {\n\t\t$vars = get_object_vars ( $this );\n\n\t\tif ($public) {\n\t\t\tforeach ( $vars as $key => $value ) {\n\t\t\t\tif ('_' == substr ( $key, 0, 1 )) {\n\t\t\t\t\tunset ( $vars [$key] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $vars;\n\t}", "private static function getProperties($object) {\n\t\t$properties = array();\n\t\ttry {\n\t\t\t$reflect = new \\ReflectionClass(get_class($object));\n\t\t\tforeach ($reflect->getProperties(\\ReflectionProperty::IS_PUBLIC) as $property) {\n\t\t\t\t$properties[$property->getName()] = $property->getValue($object);\n\t\t\t}\n\t\t} catch (\\ReflectionException $ex) {\n\t\t\tErrorHandler::logException($ex);\n\t\t}\n\t\treturn $properties;\n\t}", "public function get_properties()\r\n\t{\r\n\t\treturn get_object_vars($this);\r\n\t}", "public function getProperties()\n {\n return get_object_vars($this);\n }", "public function getProperties($object): array\n {\n if (!is_object($object)) {\n return [];\n }\n\n $reflectedClass = new \\ReflectionClass($object);\n $classProperties = $this->getClassProperties($reflectedClass);\n\n // Also get (private) variables from parent class.\n $privateProperties = [];\n while ($reflectedClass = $reflectedClass->getParentClass()) {\n $privateProperties[] = $this->getClassProperties($reflectedClass, static::GET_ONLY_PRIVATES);\n }\n\n return array_merge($classProperties, ...$privateProperties);\n }", "public function getAllProperties(): array\n {\n return get_object_vars($this);\n }", "public function expose() {\n return get_object_vars($this);\n }", "public function getProperties(): array\n {\n return array_keys(get_object_vars($this));\n }", "public function vars()\n {\n \n return new ArrayWrapper(get_object_vars($this->object));\n \n }", "public function getObjectInfo($obj) : array {\n return get_object_vars($obj);\n }", "public function getVars()\n {\n $vars = get_object_vars($this);\n foreach ($vars as $key => $value) {\n if ('_' == substr($key, 0, 1)) {\n unset($vars[$key]);\n }\n }\n\n return $vars;\n }", "public static function getProperties($object, $filter = null){\r\n\r\n if(!is_object($object)){\r\n throw new \\RuntimeException(sprintf('Obj::getProperties() expects parameter 1 to be object, %s given', gettype($object)));\r\n }\r\n \r\n if(is_null($filter)){\r\n $filter = \\ReflectionProperty::IS_PUBLIC | \r\n \\ReflectionProperty::IS_PROTECTED | \r\n \\ReflectionProperty::IS_PRIVATE |\r\n \\ReflectionProperty::IS_STATIC;\r\n }\r\n \r\n $refClass = new \\ReflectionObject($object);\r\n $properties = $refClass->getProperties($filter);\r\n $array = array();\r\n\r\n foreach($properties as $property){\r\n $property->setAccessible(true);\r\n $array[$property->getName()] = $property->getValue($object);\r\n }\r\n return $array;\r\n }", "function getObjectVars(&$obj)\n\t{\n\t\t$parent_object_vars=get_class_vars(get_parent_class($obj));\n\t\t$object_vars=get_object_vars($obj);\n\t\tforeach ($parent_object_vars as $key=>$value)\n\t\t\tforeach ($object_vars as $_key=>$_value)\n\t\t\t\tif ($key==$_key) { unset($object_vars[$_key]); break; }\n\t\treturn $object_vars;\n\t}", "public function __debugInfo()\n {\n $reflect = new \\ReflectionObject($this);\n $varArray = array();\n \n foreach ($reflect->getProperties(\\ReflectionProperty::IS_PUBLIC) as $prop) {\n $propName = $prop->getName();\n \n if ($propName !== 'DI') {\n // print '--> '.$propName.'<br />';\n $varArray[$propName] = $this->$propName;\n }\n }\n \n return $varArray;\n }", "public static function getReflectionProperties($object)\n {\n return self::getReflectionClass($object)->getProperties();\n }", "public static function convert($obj) {\n\t\t$result=get_object_vars($obj);\n\t\t$rc=new \\ReflectionClass($obj);\n\t\t$meths=$rc->getMethods(\\ReflectionMethod::IS_PUBLIC);\n\t\tforeach($meths as $m) {\n\t\t\t$n=$m->getShortName();\n\t\t\t$n2=lcfirst(substr($n,3));\n\t\t\tif(strpos($n,'get')===0 && $m->getNumberOfRequiredParameters()==0) {\n\t\t\t\t$result[$n2]=$m->invoke($obj);\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "protected function getVars()\n {\n return array_merge(parent::getVars(),get_object_vars($this));\n }", "public function getProperties()\n {\n $vars = get_object_vars($this);\n\n foreach ($vars as $key => $value) {\n if (strcmp(\"db\", $key) == 0) {\n unset($vars[$key]);\n break;\n }\n }\n\n return $vars;\n }", "public function getAllVariables(): MapperVariables\n {\n $thisName = $this->name();\n\n if (!isset(MapperCache::me()->allVariables[$thisName])) {\n\n /**\n * All available variables\n * Columns are always PUBLIC\n * Complex, Constraints and Embedded are always PROTECTED\n */\n $allVars = get_object_vars($this);\n $publicVars = Utils::getObjectVars($this);\n $protectedVars = Utils::arrayDiff($allVars, $publicVars);\n\n $constraints = $embedded = $complex = $columns = [];\n\n foreach ($publicVars as $varName => $varValue) {\n $this->checkProperty($varValue, $varName);\n $columns[$varName] = $varValue;\n }\n\n foreach ($protectedVars as $varName => $varValue) {\n $this->checkProperty($varValue, $varName);\n\n if (isset($varValue[Constraint::LOCAL_COLUMN])) {\n $constraints[$varName] = $varValue;\n } else {\n if (isset($varValue[Embedded::NAME])) {\n $embedded[$varName] = $varValue;\n } else if (isset($varValue[Complex::TYPE])) {\n $complex[$varName] = $varValue;\n }\n }\n }\n\n $this->processComplexes($complex);\n\n $this->processEmbedded($embedded);\n\n $this->processColumns($columns);\n\n $this->processConstraints($constraints, $columns, $embedded, $complex);\n\n }\n\n return MapperCache::me()->allVariables[$thisName];\n }", "public function __debugInfo() {\n \n \t$reflect\t= new \\ReflectionObject($this);\n \t$varArray\t= array();\n \n \tforeach ($reflect->getProperties(\\ReflectionProperty::IS_PUBLIC) as $prop) {\n \t\t$propName = $prop->getName();\n \t\t \n \t\tif($propName !== 'DI') {\n \t\t\t//print '--> '.$propName.'<br />';\n \t\t\t$varArray[$propName] = $this->$propName;\n \t\t}\n \t}\n \n \treturn $varArray;\n }", "public function getProperties()\n {\n $class = get_called_class();\n $reflection = new \\ReflectionClass($class);\n $members = array_keys($reflection->getdefaultProperties());\n return $members;\n }", "protected function getVars()\n {\n if (!$this->vars) {\n $this->loadVarsByObjectType();\n }\n\n return $this->vars;\n }", "static public function getDefinedFields() {\n\t\treturn Arrays::getPublicPropertiesOfClass(get_called_class());\n\t}", "public function getFields() : array\n {\n return get_object_vars($this);\n }", "public static function recursiveGetObjectVars($obj){\n \t\t$arr = array();\n \t\t$_arr = is_object($obj) ? get_object_vars($obj) : $obj;\n \t\t\n \t\tforeach ($_arr as $key => $val) {\n \t\t\t$val = (is_array($val) || is_object($val)) ? self::recursiveGetObjectVars($val) : $val;\n \t\t\t\n \t\t\t// Transform boolean into 1 or 0 to make it safe across all Opauth HTTP transports\n \t\t\tif (is_bool($val)) $val = ($val) ? 1 : 0;\n \t\t\t\n \t\t\t$arr[$key] = $val;\n \t\t}\n \t\t\n \t\treturn $arr;\n }", "public function properties()\r\n {\r\n $props = $this->class->getProperties();\r\n \r\n sort( $props );\r\n \r\n foreach ( $props as $key => $property )\r\n {\r\n // Only show public properties, because Reflection can't get the private ones\n if ( $property->isPublic() )\r\n {\r\n $props[$key] = new Docs_Property( $this->class->name, $property->name );\r\n }\r\n else\r\n {\r\n unset( $props[$key] );\r\n }\r\n }\r\n \r\n return $props;\r\n }", "protected function toArray($object)\n {\n $reflect = new \\ReflectionObject($object);\n $props = $reflect->getProperties(\\ReflectionProperty::IS_PUBLIC);\n\n $result = [];\n\n foreach ($props as $prop) {\n $result[$prop->getName()] = $prop->getValue($object);\n }\n\n return $result;\n }", "public function getObjects()\n {\n return get_object_vars($this);\n }", "public function getObjects()\n {\n return get_object_vars($this);\n }", "public function getVars()\n {\n return $this->_variables;\n }", "public function vars()\n\t{\n\t\treturn $this->vars;\n\t}", "public function __debugInfo()\n {\n $properties = $this->_properties;\n foreach ($this->_virtual as $field) {\n $properties[$field] = $this->$field;\n }\n\n return $properties;\n }", "protected function properties()\n {\n // return get_object_vars($this);\n\n $properties = array();\n foreach (self::$db_table_fields as $db_field) {\n if (property_exists($this, $db_field)) {\n $properties[$db_field] = $this->$db_field;\n }\n }\n\n return $properties;\n }", "protected function properties()\n {\n // return get_object_vars($this);\n\n $properties = array();\n foreach (self::$db_table_fields as $db_field) {\n if (property_exists($this, $db_field)) {\n $properties[$db_field] = $this->$db_field;\n }\n }\n\n return $properties;\n }", "public function get_all(){\n return get_object_vars($this);\n }", "protected function get_variables_for_view()\n\t{\n\t\t$ary = array();\n\t\tforeach (get_object_vars ($this->set) as $k => $v)\n\t\t\t$ary[$k] = $v;\n\t\treturn $ary;\n\t}", "public function __debugInfo() : array\n {\n return get_object_vars($this);\n }", "public function vars()\n {\n return $this->vars;\n }", "public function getParameters()\n {\n return get_object_vars($this->record);\n }", "function get_assigned_variables() {\n\n $assigns = array();\n $protected = get_class_vars(get_class($this));\n\n foreach (get_object_vars($this) as $var => $value) {\n if (!array_key_exists($var, $protected)) {\n $assigns[$var] =& $this->$var;\n }\n }\n\n $assigns['controller'] = $this;\n\n return $assigns;\n }", "public function Properties($visible=true){\r\n $reflection=new ReflectionClass($this);\r\n $properties=$reflection->getProperties();\r\n $result=array();\r\n if($visible){\r\n foreach ($properties as $property) {\r\n $result[$property->getName()]=$property->getValue($this);\r\n }\r\n }\r\n else{\r\n foreach ($properties as $property) {\r\n $result[]=$property->getName();\r\n }\r\n }\r\n return $result;\r\n }", "public function visibleProperties()\n {\n return array_keys($this->_properties);\n }", "protected function getProperties($obj)\n {\n $class = new ReflectionClass(get_class($obj));\n $properties = $class->getProperties();\n $propertyArray = array();\n\n foreach ($properties as $property)\n {\n $pos1 = strpos($property, \"$\");\n $tmp = substr($property, $pos1 + 1);\n $pos2 = strpos($tmp, \" \");\n $propertyName = substr($tmp, 0, $pos2);\n if ($propertyName != '_entityMap'\n && $propertyName != '_entityKey'\n && $propertyName != '_baseURI'\n && $propertyName != '_relLinks'\n && $propertyName != '_objectID')\n {\n $propertyArray[] = $propertyName;\n }\n }\n return $propertyArray;\n }", "public function getVars()\n\t{\n\t\treturn $this->vars;\n\t}", "public function __getVars(){\r\n $vars = isset($this->vars)? $this->vars:array();\r\n return $vars;\r\n }", "public function getStaticVariables() {\n if ( $this->reflectionSource instanceof ReflectionFunction ) {\n return $this->reflectionSource->getStaticVariables();\n } else {\n return parent::getStaticVariables();\n }\n }", "function getVars() {\n return $this->vars;\n }", "function dismount($object) {\n $reflectionClass = new \\ReflectionClass(get_class($object));\n $array = array();\n foreach ($reflectionClass->getProperties() as $property) {\n $property->setAccessible(true);\n $array[$property->getName()] = $property->getValue($object);\n $property->setAccessible(false);\n }\n return $array;\n }", "public function getAttributesFromClass($object): array\n {\n return get_object_vars($object);\n }", "public function getVars() {\n\t\treturn $this->vars;\n\t}", "public function getVars() {\n\t\treturn $this->vars;\n\t}", "private function __keys() {\n $vars = get_object_vars($this);\n $vars = array_filter($vars, function ($x) {\n return $x[0] !== '_';\n }, ARRAY_FILTER_USE_KEY);\n return $vars;\n }", "public function getVars()\n {\n return $this->vars;\n }", "public function getVars()\n {\n return $this->vars;\n }", "public function getVars()\n {\n return $this->vars;\n }", "public function getPublicAccess()\n {\n return $this->_publicAccess;\n }", "protected function getReflectedProperties()\n {\n if (is_null($this->_ReflectedPropertiesCache)) {\n $this->_ReflectedPropertiesCache = array();\n\n $refectionClass = new ReflectionClass($this);\n $propertiesArray = $refectionClass->getProperties();\n if (is_array($propertiesArray) and count($propertiesArray) > 0) {\n while (list(, $property) = each($propertiesArray)) {\n $refectionProperty = new ReflectionProperty($property->class, $property->name);\n if ($refectionProperty->isPublic() || $refectionProperty->isProtected()) {\n $this->_ReflectedPropertiesCache[] = $property->name;\n }\n }\n }\n }\n\n return $this->_ReflectedPropertiesCache;\n }", "public function props()\n\t{\n\t\treturn $this->props;\n\t}", "public function getExposedProperties(): array;", "protected function properties(){\n //return get_object_vars($this);\n $properties = array();\n //foreach(self::$db_table_fields as $db_field){\n foreach(static::$db_table_fields as $db_field){\n if(property_exists($this, $db_field)){\n \n $properties[$db_field] = $this->$db_field;\n }\n }\n return $properties;\n\n }", "public function getProperties()\n {\n return $this->_propDict;\n }", "public function getProperties()\n {\n return $this->_propDict;\n }", "public static function getProperties()\n\t\t{\n\t\t\treturn self::$properties;\n\t\t}", "public function getProperties() {\n return array_keys($this->_properties);\n }", "public static function getProperties()\n {\n return static::$properties;\n }", "public function properties() : array\n {\n return array_keys($this->_properties);\n }", "public static function getProperties() : array {\r\n return self::$properties;\r\n }", "public function members() {\n return array_filter(parent::members(), function ($member) {\n return !$member->isStatic();\n });\n }", "public function attributes(){\r\n /*\r\n $attributes = array();\r\n foreach(self::$db_fields as $field){\r\n if(property_exists($this, $field)){\r\n\t $attributes[$field] = $this->$field;\r\n\t }\r\n }\r\n return $attributes;\r\n */\r\n \r\n //return get_object_vars($this);\r\n return $this->variables;\r\n }", "public function getVars(){\n return $this->getClassVars()->getValues();\n }", "public function objectToArray()\n {\n return get_object_vars($this);\n }", "public function &getProperties($includePrimaryKey = false)\n\t{\n\t\t$pk =& $this->primaryKey;\n\t\t$props = array();\n\t\t\n\t\tforeach($this->__reflection()->getProperties() as $prop) {\n\t\t\tif($prop->isPublic() && !$prop->isStatic()) {\n\t\t\t\t$name = $prop->getName();\n\t\t\t\tif(!$includePrimaryKey && $name == $pk)\n\t\t\t\t\tcontinue;\n\t\t\t\t$props[$name] =& $this->$name;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $props;\n\t}", "public function getVars() : array {\n\n\t\t\treturn $this->variables;\n\t\t}", "public function variables() : Variables {\n return $this->_variables;\n }", "function _getProperties() ;", "public function vars()\n {\n $v = &$this->vars;\n return $v;\n }", "public function dump()\r\n {\r\n return get_object_vars($this);\r\n }", "public function _getProperties() {}", "function jsonSerialize()\n {\n $vars = get_object_vars($this);\n return $vars;\n }", "public function getVariables()\n {\n return $this->variables;\n }", "public function getVariables()\n {\n return $this->variables;\n }", "public function getVariables()\n {\n return $this->variables;\n }", "public function getPublicValues()\n {\n // filter and sort values\n $publicValues = [];\n\n foreach (self::$publicDatatypes as $datatypeId) {\n if (isset($this->values[$datatypeId])) {\n $publicValues[$datatypeId] = $this->values[$datatypeId];\n }\n }\n\n return $publicValues;\n }", "public function getVariables() {\n\t\treturn $this->variables;\n\t}", "public function getProperties()\r\n\t{\r\n\t\treturn $this->_properties;\r\n\t}", "public function getProperties() {}", "public function getProperties() {}", "public function getProperties() {}", "public function getProperties() {}", "public function getProperties();", "public function getProperties();", "public function getProperties();", "public function getProperties();", "public function getProperties(): array {\n\t\treturn array_keys($this->properties);\n\t}", "public function properties()\n\t{\n\t\treturn $this->properties;\n\t}", "public function &getVars()\n\t{\n\t\treturn $this->_vars;\n\t}", "public function getProperties()\n\t{\n\t\treturn $this->_properties;\n\t}" ]
[ "0.7657319", "0.691973", "0.69016236", "0.6810207", "0.67653835", "0.6454348", "0.64089495", "0.6349854", "0.61569643", "0.61165404", "0.6074519", "0.60425764", "0.6005266", "0.59973323", "0.59489536", "0.5891904", "0.58909637", "0.5888946", "0.5865437", "0.58579993", "0.58309156", "0.5823288", "0.58206797", "0.58109254", "0.57787704", "0.5756712", "0.5692697", "0.5671966", "0.56005216", "0.55838305", "0.551256", "0.551256", "0.54317576", "0.54070395", "0.53899026", "0.5386879", "0.5386879", "0.5381846", "0.53788626", "0.5365475", "0.53366476", "0.53310156", "0.53168625", "0.53050715", "0.5300243", "0.53000295", "0.52869797", "0.5284655", "0.5266914", "0.5262112", "0.52564776", "0.5248139", "0.5244922", "0.5244922", "0.52353346", "0.52248156", "0.52248156", "0.52242833", "0.52211523", "0.5219865", "0.52143216", "0.52061474", "0.5195591", "0.51204467", "0.51204467", "0.5118633", "0.511853", "0.5113691", "0.5113151", "0.50764954", "0.5056619", "0.50494885", "0.50452846", "0.50379455", "0.50266093", "0.5019534", "0.5019028", "0.50140834", "0.5010598", "0.5003672", "0.50021464", "0.4987852", "0.49869463", "0.49869463", "0.49869463", "0.49868897", "0.4982376", "0.49606267", "0.49503076", "0.49489254", "0.49489254", "0.49489254", "0.49466512", "0.49466512", "0.49466512", "0.49466512", "0.49377152", "0.49376622", "0.49197227", "0.4907951" ]
0.6784884
4
get the total votes
public static function totalvote($post_id){ return Vote::where('post_id', $post_id)->count(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTotalVotes()\n\t{\n\t\treturn $this->ratings['total.votes'];\n\t}", "public function getVotosTotal()\n {\n return $this->getVotosPositivos()->count() - $this->getVotosNegativos()->count();\n }", "public function getVotes()\n {\n return $this->votes;\n }", "public function getTotalVoterCount(): int\n {\n return $this->totalVoterCount;\n }", "public function calculate_votes()\r\n\t{\r\n\t\t$this->votes_total = $this->votes_up + $this->votes_down;\r\n\t\t$this->votes_balance = $this->votes_up - $this->votes_down;\r\n\r\n\t\t// Note: division by zero must be prevented\r\n\t\t$this->votes_pct_up = ($this->votes_total === 0) ? 0 : $this->votes_up / $this->votes_total * 100;\r\n\t\t$this->votes_pct_down = ($this->votes_total === 0) ? 0 : $this->votes_down / $this->votes_total * 100;\r\n\t}", "public function getVotingResult()\n {\n $value = Vote::find()\n ->andWhere([\n 'project_id' => $this->id\n ])\n ->sum('value');\n\n return (int) $value;\n }", "public function getTotalVote($idea_id,$version = 0)\r\n {\r\n $model = new Ynidea_Model_DbTable_Ideavotes; \r\n $select = $model->select()\r\n ->from('engine4_ynidea_ideavotes',array('count(*) AS total_vote'))\r\n ->where('idea_id = ?',$idea_id)->where('version_id=?',$version); \r\n $row = $model->fetchRow($select);\r\n return $row->total_vote ; \r\n }", "public static function totalvote($post_id, $option_id){\n return Vote::where('post_id', $post_id)->where('option_id', $option_id)->count();\n }", "public function total(): int\n {\n return Arr::get($this->meta, 'total', $this->count());\n }", "public function countVotes($id, $type)\n {\n \t$totalVotes = 0;\n\n $currentVotes = Vote::where('votable_id', '=', $id)->where('votable_type', $type)->get();\n \tforeach($currentVotes as $v)\n \t{\n \t\t$totalVotes += $v->vote;\n \t}\n\n \treturn $totalVotes;\n }", "public function upVotesCount()\n {\n return $this->post_votes()\n ->selectRaw('post_id, count(*) as count')\n ->where('vote', '=', '1')\n ->groupBy('post_id');\n }", "public function countPollOptionVotes() {\n\t\t$sql = \"SELECT\tCOUNT(*) AS count\n\t\t\tFROM\t\".$this->databasePrefix.\"poll_votes\n\t\t\tWHERE\tvote_user_id <> ?\";\n\t\t$statement = $this->database->prepareStatement($sql);\n\t\t$statement->execute(array(0));\n\t\t$row = $statement->fetchArray();\n\t\treturn $row['count'];\n\t}", "public function countPollOptionVotes() {\n\t\t$sql = \"SELECT\tCOUNT(*) AS count\n\t\t\tFROM\twcf\".$this->dbNo.\"_poll_option_vote\n\t\t\tWHERE\tpollID IN (\n\t\t\t\t\tSELECT\tpollID\n\t\t\t\t\tFROM\twcf\".$this->dbNo.\"_poll\n\t\t\t\t\tWHERE\tmessageType = ?\n\t\t\t\t)\n\t\t\t\tAND userID <> ?\";\n\t\t$statement = $this->database->prepareStatement($sql);\n\t\t$statement->execute(array('post', 0));\n\t\t$row = $statement->fetchArray();\n\t\treturn $row['count'];\n\t}", "function getvotes($id)\r\n\t{\r\n\t\t$query = 'SELECT rating_sum, rating_count FROM #__content_rating WHERE content_id = '.(int)$id;\r\n\t\t$this->_db->setQuery($query);\r\n\t\t$votes = $this->_db->loadObjectlist();\r\n\r\n\t\treturn $votes;\r\n\t}", "public function getVotesPercentage()\n {\n if ($this->votesPercentage) {\n return $this->votesPercentage;\n }\n\n if ($this->question->getTotalVotes() > 0) {\n return $this->votesPercentage = round($this->votes / $this->question->getTotalVotes() * 100);\n }\n\n return 0;\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 }", "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 total()\n {\n return $this->total;\n }", "public function total()\n {\n return $this->total;\n }", "public function totalResults()\n {\n\t\treturn (int) $this->totalResultsReturned;\n }", "protected function extractTotalVotes($oXPath)\n {\n $this->debug('Extracting total votes for the card');\n\n $aXPathVotes = $oXPath->query(\n '//div[@id=\"' . self::DIV_PREFIX . $this->sPrefix . '_currentRating_textRatingContainer\"]/span[@id=\"' . self::DIV_PREFIX . $this->sPrefix . '_currentRating_totalVotes\"]'\n );\n foreach ($aXPathVotes as $sTmp) {\n return (int)trim($sTmp->nodeValue);\n break;\n }\n\n return;\n }", "public function total()\n\t{\n\t\treturn $this->total;\n\t}", "public function total(){\n\t\treturn $this->total;\n\t}", "public function getTotal() : int\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 getTotal()\n {\n return $this->total;\n }", "public function total()\n {\n return $this->calculateTotal();\n }", "public function getVoteValue(): int {\n\t\treturn ($this->voteValue);\n\t}", "public function getLikesSum()\n {\n return intval($this->getData('likes.summ'));\n }", "public function GetTotalPoints(){\r\n\t\t\r\n\t\treturn $this->totalPoints;\r\n\t }", "public function total();", "public function total();", "public function total();", "public function getTotal()\n\t{\n\t\treturn $this->total;\n\t}", "public function totalCount();", "public function totalCount();", "public function gettotal()\r\n {\r\n return $this->total;\r\n }", "public function get_total_points() {\n\t\t\treturn $this->total_points;\n\t\t}", "public function getTotal() {\n\t\treturn $this->total;\n\t}", "public function getTotalResults() {\n return $this->totalResults;\n }", "public function totalViews()\n\t{\n\t\t$totalViewsQuery = $this->_generateColumnSumQuery('page_views');\n\n\t\treturn (int) $this->_runQuery($totalViewsQuery);\n\t}", "public function getUpVotes()\n\t{\n\t\treturn $this->up_votes;\n\t}", "function getTotalVoucher($id){\n\t\t$t=0;\n\t\t$a = Voucher::all();\n\t\tforeach($a as $n){\n\t\t$dur= $a->amount;\n\t\t\n\t\t$r=$dur;\n\t\t$t = $t + $r;\n\t\t}\n\t\treturn $t;\n\t\t}", "public function getTotalResults()\n {\n return $this->totalResults;\n }", "public function getTotalResults()\n {\n return $this->totalResults;\n }", "public function total () {\n return $this->since($this->iniTmstmp);\n }", "public function total()\n {\n $total = 0;\n\n foreach ($this->contents() as $item) $total += (float)$item->total();\n\n return (float)$total;\n }", "public function total(): int\n {\n return count($this->all());\n }", "public function getTotalVotes(Request $request, Response $response): Response\r\n {\r\n /** @var User $user */\r\n $user = user($request);\r\n\r\n $votes = $this->voteRepository->getUserVoteList($user->getId());\r\n\r\n return $this->respond(\r\n $response,\r\n response()\r\n ->setData($votes)\r\n );\r\n }", "public function getTotal(){\n\t\treturn $this->_total;\n\t}", "function getTotal()\n\t{\n\t\treturn $this->_total;\n\t}", "public function getTodayVotes()\n\t{\n\t\treturn $this->today_votes;\n\t}", "public function getTotal() {\n return $this->get(self::TOTAL);\n }", "public static function totalNumber()\n {\n return (int)self::find()->count();\n }", "public function getTotalPoints() {\n $points = $this->getPoints() ?? 0;\n return $points + $this->bonusPoints;\n }", "public static function votesLeft()\n {\n self::checkForExpiredVotes();\n $voteLimit = Constants::VOTES;\n $voteCount = count(self::where('user_id', Auth::user()->id)->get());\n\n $calcVotes = $voteLimit - $voteCount;\n\n return $calcVotes < 1 ? 0 : $calcVotes;\n }", "public function get_total()\n {\n }", "public function getTotal():int{\r\n\t return (int)$this->_vars['total_items']??0;\r\n\t}", "public function total(): float\n {\n return $this->getTotal();\n }", "public function getTotalPrice()\n {\n $stat = $this->getAllStat();\n return $stat['totalPrice'];\r\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 getTotalResults() : int\n {\n return $this->totalResults;\n }", "public function getTotalResults(): int\n {\n return $this->totalResults;\n }", "public static function searchTotal()\n\t{\n\t\t$total = self::all()->total();\n\t\treturn $total;\n\t}", "public function sumViews()\n {\n $query = \"SELECT SUM(views) FROM blog_post \n WHERE deleted = 0\";\n\n $stmt = static::$dbh->query($query);\n\n $views = $stmt->fetchAll(\\PDO::FETCH_ASSOC);\n\n return $views;\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 }", "function totals()\n\t{\n\t\treturn $this->_tour_voucher_contents['totals'];\n\t}", "public function getTotalInvoiced();", "public static function GetTotalVendas(){\n self::$results = self::query(\"SELECT sum(vlTotal) from tbComanda\");\n if (is_array(self::$results) || is_object(self::$results)){\n foreach(self::$results as $result){\n $result[0] = str_replace('.', ',', $result[0]);\n array_push(self::$resultRetorno, $result);\n return $result[0];\n }\n }\n return 0;\n }", "public function total(): float;", "public function total(): float;", "public function total_results()\n\t{\n\t\t$results = $this->get_results();\n\t\t$total = 0;\n\n\t\tforeach\t( $results as $set ) {\n\t\t\t$total = $total + count( $set );\n\t\t}\n\n\t\treturn $total;\n\t}", "function getVotes() {\n\t\tif ($this->votes !== false) {\n\t\t\treturn $this->votes;\n\t\t}\n\n\t\t$voters = $this->ArtifactType->getVoters();\n\t\tunset($voters[0]);\t/* just in case */\n\t\tunset($voters[100]);\t/* need users */\n\t\tif (($numvoters = count($voters)) < 1) {\n\t\t\t$this->votes = array(0, 0, 0);\n\t\t\treturn $this->votes;\n\t\t}\n\n\t\t$res = db_query_params('SELECT COUNT(*) AS count FROM artifact_votes WHERE artifact_id=$1 AND user_id=ANY($2)',\n\t\t\t\t\tarray($this->getID(), db_int_array_to_any_clause($voters)));\n\t\t$db_count = db_fetch_array($res);\n\t\t$numvotes = $db_count['count'];\n\n\t\t/* check for invalid values */\n\t\tif ($numvotes < 0 || $numvoters < $numvotes) {\n\t\t\t$this->votes = array(-1, -1, 0);\n\t\t} else {\n\t\t\t$this->votes = array($numvotes, $numvoters,\n\t\t\t\t(int)($numvotes * 100 / $numvoters + 0.5));\n\t\t}\n\t\treturn $this->votes;\n\t}", "function getvotes($user) {\n\tglobal $wpdb;\n\tif(user_can($user, 'banda')) {\n\t\t$votos = $wpdb->get_var( \"SELECT count(1) FROM \".$wpdb->prefix . \"poptest_votos where usuario = \".$user.\" group by usuario\");\n\t\treturn $votos;\n\t} else {\n\t\t//Error\n\t\treturn false;\n\t}\n}", "public function getTotalResults()\n {\n return isset($this['info']['results'])\n ? (int) $this['info']['results']\n : 0;\n }", "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 bp_word_count_total() {\r\n\r\n\t\t/* Set ID for current user */\r\n\t\t$current_user = wp_get_current_user();\r\n\t\t$current_user_id = $current_user->ID;\r\n\r\n\t\t/* Retrieve word count of all posts that current user has published */\r\n\t\t$all_post = $this->bp_get_meta_values('word_count', 'post', 'publish', $current_user_id);\r\n\r\n\t\t/* Add all integers to get to a total */\r\n\t\t$count_all_post = array_sum($all_post);\r\n\r\n\t\treturn $count_all_post;\r\n\t}", "public function getTotalPoints() {\n return $this->getNonHiddenPoints() + $this->getHiddenPoints();\n }", "function total_video_revenue() {\n return PayPerView::sum('amount');\n}", "abstract public function countTotal();", "public function total()\n {\n \treturn $this->price()*$this->quantity;\n }", "function total_itineraries()\n\t{\n\t\treturn $this->_tour_voucher_contents['total_itineraries'];\n\t}", "public function total() {\n\t\t$query = \"select count(us.sentimento_id) as total\n\t\t\t\t from usuario_sentimento us where us.sentimento_id = \" . $this->id;\n\t\t$this->db->ExecuteSQL($query);\n\t\t$res = $this->db->ArrayResult();\n\t\treturn $res['total'];\n\t}", "public function getTotalCollectionValue() {\n return $this->totalCollectionValue;\n }", "public function total()\n {\n return $this->subtotal() + $this->shipping() + $this->vat()->sum();\n }", "public function getTotal()\n {\n return $this->getAmount() * $this->getPrice();\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}", "function getTot()\n {\n if (!is_array($this->aDades)) {\n $this->DBCarregar('tot');\n }\n return $this->aDades;\n }", "public static function totalAmountOfOffers()\n {\n return Offer::getTotalAmountOfOffers();\n\n }", "public function getTotal(): int\n {\n return\n $this->getAttack() +\n $this->getDefense() +\n $this->getStamina();\n }", "public function count_votes(){\n \t$query = \"SELECT igetit, idontgetit FROM classes WHERE classname = $1;\";\n \t$query_result = pg_prepare($this->con, \"myquery12\", $query);\n \t$query_result = pg_execute($this->con, \"myquery12\", array($this->prof_currentclass));\n \t$row = pg_fetch_row($query_result);\n \tif (!$row) {\n \t\t\techo \"An error hasssss occurred.\\n\";\n \t\t\texit;\n\t\t}\n global $iGetit ;\n $iGetit = \"$row[0]\";\n global $idontGetit ;\n $idontGetit = \"$row[1]\";\n global $Currentclass ;\n $Currentclass = $this->prof_currentclass;\n\n \n }", "public function getTotalCount()\n {\n return $this->totalCount;\n }", "public function get_total_questions() {\n\t\t\treturn $this->total_questions;\n\t\t}", "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 total(){\n $total = $this->qualification + $this->referee_report + $this->interview;\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 }" ]
[ "0.879904", "0.7526774", "0.7512407", "0.75018114", "0.7385708", "0.7296012", "0.7291133", "0.70570546", "0.6953723", "0.69467914", "0.67941916", "0.677021", "0.67692304", "0.6756869", "0.6743946", "0.67292523", "0.67087835", "0.670066", "0.670066", "0.6672021", "0.6666426", "0.66329426", "0.6631783", "0.66233253", "0.6574796", "0.6574796", "0.6574796", "0.6574796", "0.6574796", "0.6574796", "0.65579563", "0.65572405", "0.6551618", "0.65253395", "0.6512548", "0.6512548", "0.6512548", "0.65041035", "0.6495892", "0.6495892", "0.6492978", "0.6490432", "0.6481742", "0.647964", "0.6452002", "0.6450157", "0.6446153", "0.644225", "0.644225", "0.6439625", "0.64284873", "0.6425632", "0.6420024", "0.64098674", "0.64089614", "0.64073116", "0.6402892", "0.63807577", "0.63409114", "0.63237935", "0.6322253", "0.63065976", "0.6303188", "0.62844616", "0.6283346", "0.62620234", "0.62575275", "0.6245831", "0.6241012", "0.62385714", "0.62347496", "0.6229134", "0.6228132", "0.6215267", "0.6215267", "0.6215229", "0.6211347", "0.6204572", "0.62012947", "0.61970097", "0.6188476", "0.6177328", "0.6174233", "0.61721087", "0.6168879", "0.6165119", "0.61623055", "0.6155043", "0.6153465", "0.61459696", "0.6143404", "0.6142874", "0.61245394", "0.61201596", "0.6119758", "0.61188346", "0.6116227", "0.6114062", "0.61081105", "0.61039597" ]
0.751435
2
get the option votes totla
public static function totalvote($post_id, $option_id){ return Vote::where('post_id', $post_id)->where('option_id', $option_id)->count(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function countPollOptionVotes() {\n\t\t$sql = \"SELECT\tCOUNT(*) AS count\n\t\t\tFROM\t\".$this->databasePrefix.\"poll_votes\n\t\t\tWHERE\tvote_user_id <> ?\";\n\t\t$statement = $this->database->prepareStatement($sql);\n\t\t$statement->execute(array(0));\n\t\t$row = $statement->fetchArray();\n\t\treturn $row['count'];\n\t}", "public function countPollOptionVotes() {\n\t\t$sql = \"SELECT\tCOUNT(*) AS count\n\t\t\tFROM\twcf\".$this->dbNo.\"_poll_option_vote\n\t\t\tWHERE\tpollID IN (\n\t\t\t\t\tSELECT\tpollID\n\t\t\t\t\tFROM\twcf\".$this->dbNo.\"_poll\n\t\t\t\t\tWHERE\tmessageType = ?\n\t\t\t\t)\n\t\t\t\tAND userID <> ?\";\n\t\t$statement = $this->database->prepareStatement($sql);\n\t\t$statement->execute(array('post', 0));\n\t\t$row = $statement->fetchArray();\n\t\treturn $row['count'];\n\t}", "public function getVotes()\n {\n return $this->votes;\n }", "public function getTotalVotes()\n\t{\n\t\treturn $this->ratings['total.votes'];\n\t}", "function voter() {\n\t\tif (isset($_GET['id']) && isset($_GET['vote'])) {\n\t\t\tif ($this -> modele -> getSondage($_GET['id']) && $this -> modele -> getAVote($_GET['id'], $_SESSION['id']) == 0) {\n\t\t\t\tif ($this -> modele -> insertAVote($_GET['id'], $_SESSION['id'], $_GET['vote']) != 0 && $this -> modele -> updateSondage($_GET['vote'], $_GET['id'])) {\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t$sondage = $this -> modele -> getSondage($_GET['id']);\n\t\t\t$resultats = '';\n\t\t\t$totalVote = $sondage[5] + $sondage[6] + $sondage[7] + $sondage[8];\n\t\t\tif (is_array($sondage) || is_object($sondage)) {\n\t\t\t\tforeach ($sondage as $key => $reponse) {\n\t\t\t\t\tif ($key > 0 && $key < 5 && $reponse != null) {\n\t\t\t\t\t\tif ($totalVote == 0)\n\t\t\t\t\t\t\t$resultats .= $this -> vue -> resultat($reponse, 0);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$resultats .= $this -> vue -> resultat($reponse, $sondage[$key + 4] / $totalVote * 100);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\techo $this -> vue -> resultatSondage($resultats);\n\t\t}\n\t}", "public function getTotalVote($idea_id,$version = 0)\r\n {\r\n $model = new Ynidea_Model_DbTable_Ideavotes; \r\n $select = $model->select()\r\n ->from('engine4_ynidea_ideavotes',array('count(*) AS total_vote'))\r\n ->where('idea_id = ?',$idea_id)->where('version_id=?',$version); \r\n $row = $model->fetchRow($select);\r\n return $row->total_vote ; \r\n }", "function getvotes($user) {\n\tglobal $wpdb;\n\tif(user_can($user, 'banda')) {\n\t\t$votos = $wpdb->get_var( \"SELECT count(1) FROM \".$wpdb->prefix . \"poptest_votos where usuario = \".$user.\" group by usuario\");\n\t\treturn $votos;\n\t} else {\n\t\t//Error\n\t\treturn false;\n\t}\n}", "public function getVotingResult()\n {\n $value = Vote::find()\n ->andWhere([\n 'project_id' => $this->id\n ])\n ->sum('value');\n\n return (int) $value;\n }", "function getvotes($id)\r\n\t{\r\n\t\t$query = 'SELECT rating_sum, rating_count FROM #__content_rating WHERE content_id = '.(int)$id;\r\n\t\t$this->_db->setQuery($query);\r\n\t\t$votes = $this->_db->loadObjectlist();\r\n\r\n\t\treturn $votes;\r\n\t}", "function getvotesavailable($user) {\n\tglobal $wpdb;\n\tif(user_can($user, 'integrante')) {\n\t\t$votos = $wpdb->get_var( \"SELECT cantvotos FROM \".$wpdb->prefix . \"poptest_votosdisponibles where usuario = \".$user);\n\t\treturn $votos;\n\t} else {\n\t\treturn false;\n\t}\n}", "public function getVotacion() {\n return $this->votacion;\n }", "public function getListOfVotingOptions(): array\n {\n return $this->votingOptions;\n }", "public function calculate_votes()\r\n\t{\r\n\t\t$this->votes_total = $this->votes_up + $this->votes_down;\r\n\t\t$this->votes_balance = $this->votes_up - $this->votes_down;\r\n\r\n\t\t// Note: division by zero must be prevented\r\n\t\t$this->votes_pct_up = ($this->votes_total === 0) ? 0 : $this->votes_up / $this->votes_total * 100;\r\n\t\t$this->votes_pct_down = ($this->votes_total === 0) ? 0 : $this->votes_down / $this->votes_total * 100;\r\n\t}", "function getVoterVotes($id){\n\t\t\t\n\t\t\t$url = \"https://www.govtrack.us/api/v2/vote_voter?vote=$id&limit=500\";\n\t\t\treturn json_decode(file_get_contents($url));\n\t\t\t\n\t\t}", "function getvotados($user) {\n\tglobal $wpdb;\n\tif(user_can($user, 'integrante')) {\n\t\t$votos = $wpdb->get_var( \"SELECT count(1) FROM \".$wpdb->prefix . \"poptest_votos where votante = \".$user.\" group by votante\");\n\t\treturn $votos;\n\t} else {\n\t\treturn false;\n\t}\n}", "function getVotes() {\n\t\tif ($this->votes !== false) {\n\t\t\treturn $this->votes;\n\t\t}\n\n\t\t$voters = $this->ArtifactType->getVoters();\n\t\tunset($voters[0]);\t/* just in case */\n\t\tunset($voters[100]);\t/* need users */\n\t\tif (($numvoters = count($voters)) < 1) {\n\t\t\t$this->votes = array(0, 0, 0);\n\t\t\treturn $this->votes;\n\t\t}\n\n\t\t$res = db_query_params('SELECT COUNT(*) AS count FROM artifact_votes WHERE artifact_id=$1 AND user_id=ANY($2)',\n\t\t\t\t\tarray($this->getID(), db_int_array_to_any_clause($voters)));\n\t\t$db_count = db_fetch_array($res);\n\t\t$numvotes = $db_count['count'];\n\n\t\t/* check for invalid values */\n\t\tif ($numvotes < 0 || $numvoters < $numvotes) {\n\t\t\t$this->votes = array(-1, -1, 0);\n\t\t} else {\n\t\t\t$this->votes = array($numvotes, $numvoters,\n\t\t\t\t(int)($numvotes * 100 / $numvoters + 0.5));\n\t\t}\n\t\treturn $this->votes;\n\t}", "public function vote()\r\n\t{\r\n\r\n\t\t$poll_id = $_POST['poll_id']; \r\n\r\n\t\t// Increate vote for desired field\r\n\t\tif (have_rows('polls_options', $poll_id)) {\r\n\t\t\twhile (have_rows('polls_options', $poll_id)) {\r\n\t\t\t\tthe_row();\r\n\t\t\t\tif (get_sub_field('poll_option') === $_POST[\"votes_question\"]) {\r\n\r\n\t\t\t\t\t// Update vote count into ACF field\r\n\t\t\t\t\t$current_votes_count = get_sub_field('poll_option_votes');\r\n\t\t\t\t\t$vote = update_sub_field('poll_option_votes', $current_votes_count ? ++$current_votes_count : 1, $poll_id);\r\n\r\n\t\t\t\t\t// Add poll ID to session \r\n\t\t\t\t\tsession_start();\r\n\t\t\t\t\tif (!isset($_SESSION['wppoll'])) {\r\n\t\t\t\t\t\t$_SESSION['wppoll'] = array();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tarray_push($_SESSION['wppoll'], (int) $poll_id);\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\twp_die();\r\n\r\n\t\tif (!$vote) {\r\n\t\t\t$data = array('type' => 'error', 'message' => 'Voting failed');\r\n\t\t\theader('HTTP/1.1 400 Bad Request');\r\n\t\t\theader('Content-Type: application/json; charset=UTF-8');\r\n\t\t\techo json_encode($data);\r\n\t\t}\r\n\t\twp_die();\r\n\t}", "public function votes()\n {\n $this->response->setCache(['max-age' => 300, 's-maxage' => 900, 'etag' => '187d475']);\n\n $data = ['page_title' => lang('votes._page_votes')];\n $data['breadcrumb'][] = ['url' => admin_url('home/index'), 'title' => lang('home.dashboard')];\n $data['breadcrumb'][] = ['title' => lang('votes._page_votes'), 'class' => 'active'];\n\n $this->_render('votes', $data);\n }", "public function getVotes() {\n\n\t\t//DataBase connection & query\n\t\t$db = Dbconn::getDB();\n\t\t$query = \"SELECT * FROM votes\";\n\t\t$result = $db->query($query);\n\n\t\t$votes = array();\n\n\t\tforeach ($result as $row)\n\t\t{\n\t\t\t$vote = new Vote(\n\t\t\t\t\t\t\t$row['vote_id'],\n\t\t\t\t\t\t\t$row['caselaw_id'],\n\t\t\t\t\t\t\t$row['votes_up'],\n\t\t\t\t\t\t\t$row['votes_down'],\n\t\t\t\t\t\t\t$row['user_id']\n\t\t\t\t\t\t\t);\n\t\t\t$votes[] = $vote;\n\t\t}\n\n\t\treturn $votes;\n\t}", "public function getUpVotes()\n\t{\n\t\treturn $this->up_votes;\n\t}", "public function getVotes($id)\n {\n $queryBuilder = $this->createQueryBuilder('review');\n $queryBuilder->select('review.id','review.votes')\n ->where(\"review.id = :id\")\n ->setParameter('id', $id);\n\n $query = $queryBuilder->getQuery();\n $result = $query->getSingleResult();\n\n return $result;\n }", "public function count_votes(){\n \t$query = \"SELECT igetit, idontgetit FROM classes WHERE classname = $1;\";\n \t$query_result = pg_prepare($this->con, \"myquery12\", $query);\n \t$query_result = pg_execute($this->con, \"myquery12\", array($this->prof_currentclass));\n \t$row = pg_fetch_row($query_result);\n \tif (!$row) {\n \t\t\techo \"An error hasssss occurred.\\n\";\n \t\t\texit;\n\t\t}\n global $iGetit ;\n $iGetit = \"$row[0]\";\n global $idontGetit ;\n $idontGetit = \"$row[1]\";\n global $Currentclass ;\n $Currentclass = $this->prof_currentclass;\n\n \n }", "public function votes_get($pollId){\n $this->load->model(\"poll\");\n $this->load->model(\"answer\");\n $this->load->model(\"vote\");\n\n try {\n //Check to see if the poll exists (this throws an exception if it doesn't)\n $poll = $this->poll->getPoll($pollId);\n $answers = $this->answer->getAnswers($pollId);\n $votes = $this->vote->getVotes($pollId);\n\n $answerVotes = array();\n foreach ($answers as $answer) {\n //Set the number of votes for this answer to 0\n $answerVotes[$answer->optionNo - 1] = 0;\n foreach ($votes as $vote){\n //Foreach vote that counts towards this answer\n //add one to the number of vote it has\n if ($vote->answerId == $answer->id){\n $answerVotes[$answer->optionNo - 1] += 1;\n }\n }\n }\n\n $this->response($answerVotes, 200);\n }catch (Exception $e){\n $this->response(array(\"errorMessage\"=>\"Poll does not exist!\"), 404);\n }\n }", "public function getTodayVotes()\n\t{\n\t\treturn $this->today_votes;\n\t}", "public function getVotosTotal()\n {\n return $this->getVotosPositivos()->count() - $this->getVotosNegativos()->count();\n }", "function getVoted()\n {\n JSession::checkToken() or jexit('Invalid Token');\n\n $app = JFactory::getApplication();\n $idea_id = JRequest::getInt('id', 0);\n $option_id = JRequest::getInt('voteid', 0);\n $idea = JTable::getInstance('Idea', 'Table');\n\n if(!$idea->load($idea_id) || $idea->published != 1)\n {\n $app->redirect('index.php', JText::_('ALERTNOTAUTH 1'));\n\n return true;\n }\n\n require_once(JPATH_COMPONENT . '/models/idea.php');\n $model = new JUIdeiModelIdea();\n $params = new JRegistry($idea->params);\n $cookieName = JApplicationHelper::getHash($app->getName() . 'idea' . $idea_id);\n\n\n $voted_cookie = JRequest::getVar($cookieName, '0', 'COOKIE', 'INT');\n $voted_ip = $model->ipVoted($idea, $idea_id);\n\n if($params->get('ip_check') and ($voted_cookie or $voted_ip or !$option_id))\n {\n /*if($voted_cookie || $voted_ip)\n {\n $msg = JText::_('COM_MIR_ALREADY_VOTED');\n $tom = \"error\";\n }\n\n if(!$option_id)\n {\n $msg = JText::_('COM_MIR_NO_SELECTED');\n $tom = \"error\";\n }\n */\n\n $this->_voted = 0;\n }\n else\n {\n if($model->vote($idea_id, $option_id))\n {\n $this->_voted = 1;\n\n setcookie($cookieName, '1', time() + 60 * $idea->lag);\n }\n else\n {\n $this->_voted = 0;\n }\n }\n\n return $this->_voted = 1;\n }", "public static function totalvote($post_id){\n return Vote::where('post_id', $post_id)->count();\n }", "function getVotes(){\n\t\t\t$date = date(\"Y-m-d\", strtotime(\"-1 day\"));\n\t\t\t$url = \"https://www.govtrack.us/api/v2/vote?created__gt=$date\";\n return json_decode(file_get_contents($url));\n }", "public function countVotes($id, $type)\n {\n \t$totalVotes = 0;\n\n $currentVotes = Vote::where('votable_id', '=', $id)->where('votable_type', $type)->get();\n \tforeach($currentVotes as $v)\n \t{\n \t\t$totalVotes += $v->vote;\n \t}\n\n \treturn $totalVotes;\n }", "function getPollOptionDetail($pollid) {\r\n\r\n\t$res = 0;\r\n\r\n\t$ci = & get_instance();\r\n\r\n\t$ci->db->select('option_id,poll_id,options_text,votes_counts');\r\n\r\n\t$ci->db->from('cs_polloptions');\r\n\r\n\t$ci->db->where(array('poll_id'=>$pollid));\r\n\r\n \t$query = $ci->db->get();\r\n\r\n\tif ($query->num_rows() > 0) {\r\n\r\n\t\t$res = $query->result_array();\r\n\r\n \t}\r\n\r\n\treturn $res; \r\n\r\n }", "public function getVoteValue(): int {\n\t\treturn ($this->voteValue);\n\t}", "function vote_edition() {\n\t$nonce = $_POST['nonce'];\n\n\tif ( ! wp_verify_nonce( $nonce, 'ajax-nonce' ) )\n\t\tdie ( 'Busted!');\n\t\n\t// get edition\n\t$editionID = $_POST['tag_id'];\n\n\t// get edition data\n\t$editionData = get_edition_data($editionID);\n\n\t// get current IP\n\t$currentVoterIP = get_client_ip();\n\n\t// check if already voted\n\t$voterCheck = check_if_voted($currentVoterIP, $editionID, $editionData[\"votes\"]);\n\t\n\t// if not yet voted\n\tif( empty($voterCheck) ) {\n\t\n\t\t// add new vote\n\t\t$editionData[\"votes\"] = addVote($currentVoterIP, $editionID, $editionData[\"votes\"]);\n\t}\n\t// if already voted\n\telse {\n\t\n\t\t// remove vote\n\t\t$editionData[\"votes\"] = removeVote($currentVoterIP, $editionID, $editionData[\"votes\"]);\n\t}\n\t\n\t//$editionData[\"votes\"] = [];\n\t// save new data\t\n\tsave_extra_post_tag_fields( $editionID, $editionData );\n\n\t// get votes count for current edition\n\t$count = count( $editionData[\"votes\"] );\n\t\n\t// display count (ie jQuery return value)\n\techo $count;\n\t\n\tdie();\n}", "public function upVotesCount()\n {\n return $this->post_votes()\n ->selectRaw('post_id, count(*) as count')\n ->where('vote', '=', '1')\n ->groupBy('post_id');\n }", "public function viewPendingVotes()\r\n {\r\n // array que contindrà les votacions amb els seus usuaris a avaluar\r\n $voting = array();\r\n // actualitza els pesos de tots els usuaris\r\n $this->weightCalculation();\r\n // obté l'usuari actual\r\n $currentUser = $this->getUser();\r\n // obté les votacions pendents per a l'usuari\r\n $votes = $this->votingModel->getPendingVotes($currentUser['id']);\r\n \r\n // recorre cada votació pendent\r\n foreach ($votes as $vote) {\r\n // carrega a l'array la votació i l'usuari a avaluar\r\n $voting[$vote['id']] = array(\r\n 'vote' => $vote,\r\n 'owner' => $this->userModel->getById($vote['evaluated_user_id'])\r\n );\r\n }\r\n \r\n // mostra la vista amb la llista de votacions\r\n $this->response->html($this->helper->layout->app('Voting:view/votingList', array(\r\n 'voting' => $voting,\r\n 'user' => $currentUser\r\n )));\r\n }", "function fantacalcio_load_voti($round) {\n drupal_set_title(filter_xss('Risultati ' . $round . '&ordf; giornata'));\n\n $providers = get_vote_providers();\n $votes = get_votes_html_data($round, $providers);\n\n foreach($providers as $p_id => $provider) {\n insert_votes($votes[$p_id], $round, $p_id);\n } \n return \"\";\n}", "public function voteAction()\n {\n $return = 0;\n\n /* Getting current user's data */\n $user = Auth::getUser();\n\n /* Checking if user is online and answer_id > 0 */\n if ($user && $_GET['id'] > 0) {\n \n /* Vote answer and return number of votes */\n $return = VotedAnswer::vote($user->id, $_GET['id']);\n }\n \n /* Return response */\n header('Content-Type: application/json');\n echo json_encode($return);\n }", "public function getDownVotes()\n\t{\n\t\treturn $this->down_votes;\n\t}", "function getCurrentCategoryVotes($conn, $id_user, $category)\n{\n\t//Retrieve current size\n $selectQuery = \"SELECT ? \n FROM [Nominee] \n WHERE User_id_user = ?;\";\n $selectStatement = sqlsrv_query($conn, $selectQuery, array($category, $id_user));\n if ($selectStatement===false)\n {\n echo \"error NomineeScript.php : current votes query fail -> \";\n \tdie(print_r(sqlsrv_errors(),true));\n }\n $categoryVotes = sqlsrv_fetch_array($selectStatement);\n sqlsrv_free_stmt($selectStatement);\n return $categoryVotes[0];\n}", "private function formVotingOptions()\n {\n $content = '';\n $count = 1;\n extract($this->language[$this->selectLanguage()]);\n foreach ($this->votingOptions AS $option)\n {\n $content .= '\n <dt><label for=\"votingText\">' . $txtVotingOption. ' #' . $count++ . '</label></dt>\n <dd><input type=\"text\" name=\"votingOptions[]\" value=\"' . $option . '\" /></dd>';\n }\n return $content;\n }", "public function getTotalVoterCount(): int\n {\n return $this->totalVoterCount;\n }", "public function getOptionPrice()\n {\n return $this->optionPrice;\n }", "public function berekenVerkoopWaarde() {\n return $this->aantal * $this->artikel->verkoopprijs;\n }", "function getVotes($pdo) {\n\t$statement = $pdo->prepare\n\t(\"SELECT vote_id, post_id, user_id\n\tFROM votes\n\tWHERE post_id = post_id\");\n\n\t$statement->execute();\n\t$votes = $statement->fetchAll(PDO::FETCH_ASSOC);\n\n\t\tif (!$statement) {\n\t\t\tdie(var_dump($pdo->errorInfo()));\n\t\t}\n\n\treturn $votes;\n}", "protected function getAllAvailableNumberOfResultsOptions() {}", "protected function calculeQuizzMisEnAvant(){\n $quizzRandom = $this->getDoctrine()->getEntityManager()->getRepository('MetinetFacebookBundle:Quizz')->findOneByIsPromoted(1);\n return $quizzRandom ;\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 }", "public function getVoting($items, $vote ='') {\r\n $votstdy = $this->votstdyDb($items); // gets array with items voted by the user\r\n\r\n // if $vote not empty, perform to register the vote, $items contains one item to vote\r\n if(!empty($vote)) {\r\n // if $voter empty means user not loged\r\n if($this->voter ==='') return \"alert('Vote Not registered.\\\\nYou must be logged in to can vote')\";\r\n\r\n // if already voted, returns JSON from which JS alert message and will reload the page\r\n // else, accesses the method to add the new vote\r\n if(in_array($items[0], $votstdy) || ($this->nrvot ===1 && count($votstdy) >0)) return json_encode([$items[0]=>['v_plus'=>0, 'v_minus'=>0, 'voted'=>3]]);\r\n else $this->setVotDb($items, $vote, $votstdy); // add the new vote in mysql\r\n\r\n array_push($votstdy, $items[0]); // adds curent item as voted\r\n }\r\n\r\n // if $nrvot is 1, and $votstdy has item, set $setvoted=1 (user already voted today)\r\n // else, user can vote multiple items, after Select is checked if already voted the existend $item\r\n $setvoted = ($this->nrvot === 1 && count($votstdy) > 0) ? 1 : 0;\r\n\r\n // get array with items and their votings\r\n $votitems = $this->getVotDb($items, $votstdy, $setvoted);\r\n\r\n return json_encode($votitems);\r\n }", "public function getResult($id){\n\n $vote_pour= DB::table('survey_vouter')->where('survey_id', $id )->where('vote','Pour')->count();\n $vote_contre= DB::table('survey_vouter')->where('survey_id', $id )->where('vote','Contre')->count();\n $result = $vote_pour * 100/($vote_pour + $vote_contre);\n //var_dump($result);\n Survey::where('id',$id)->update(['resultat'=>$result]);\n return $result;\n }", "function updaterating($sel_id)\n{\n global $xoopsDB;\n $sel_id = intval($sel_id);\n $sql = \"SELECT COUNT(*), FORMAT(AVG(rating),4) FROM \" . $xoopsDB->prefix(\"mylinks_votedata\") . \" WHERE lid={$sel_id}\";\n $voteResult = $xoopsDB->query($sql);\n if ($voteResult) {\n list($votesDB, $finalrating) = $xoopsDB->fetchRow($voteResult);\n/*\n $query = \"SELECT rating FROM \" . $xoopsDB->prefix(\"mylinks_votedata\") . \" WHERE lid={$sel_id}\";\n $voteresult = $xoopsDB->query($query);\n $votesDB = $xoopsDB->getRowsNum($voteresult);\n $totalrating = 0;\n while(list($rating)=$xoopsDB->fetchRow($voteresult)){\n $totalrating += $rating;\n }\n $finalrating = $totalrating/$votesDB;\n $finalrating = number_format($finalrating, 4);\n*/\n $query = \"UPDATE \" . $xoopsDB->prefix(\"mylinks_links\") . \" SET rating={$finalrating}, votes={$votesDB} WHERE lid = {$sel_id}\";\n $xoopsDB->query($query) or exit();\n }\n}", "public static function vote($id) {\n $poll = Poll::find($id);\n self::check_flag_true($poll->can_vote);\n $poll_options = PollOption::all($id);\n View::make('poll/vote.html',\n array('poll' => $poll, 'poll_options' => $poll_options));\n }", "public function getTotalProductsByOptionId($optionid){\n\t\t$sql = \"SELECT COUNT(*) AS total FROM product_option WHERE optionid = '\" . (int)$optionid . \"'\";\n\t\t$query = $this->db->query($sql);\n\n\t\treturn $query->row['total'];\n\t}", "private function fileVotingOptions()\n {\n $content = '';\n foreach ($this->post['votingOptions'] AS $option)\n {\n $content .= \"\\$vote_option[] = '\" . addslashes($option) . \"';\\n \";\n }\n return $content;\n }", "function getTot()\n {\n if (!is_array($this->aDades)) {\n $this->DBCarregar('tot');\n }\n return $this->aDades;\n }", "private function getTotalVendas()\n {\n return $vendas = DB::table('vendas')->where('confirmado', '=' ,'S')->sum('valor_total');\n }", "public function getVotos() {\n return $this->votos;\n }", "function get_user_vote_by_answer($user_id, $answer_id) {\r\n // set connection var\r\n global $db;\r\n\r\n // query to get all vote survey_ids for session user\r\n $sql = \"SELECT id\r\n FROM votes\r\n WHERE is_active = '1' AND user_id = '$user_id' AND answer_id = '$answer_id';\";\r\n\r\n $votes_data = array();\r\n $votes = array();\r\n foreach ($db->query($sql) as $key => $value) {\r\n $votes_data[$key] = $value;\r\n foreach ($votes_data[$key] as $subkey => $subvalue) {\r\n if (is_int($subkey)) {\r\n $votes[] = $subvalue;\r\n }\r\n }\r\n }\r\n\r\n return $votes;\r\n}", "public function votes()\n\t{\n\t\treturn $this->hasMany('Vote');\n\t}", "public function addVotes ()\n {\n $query = \"\";\n\n // insert SQL command for inserting data to $query\n foreach ($this->votes as $vote)\n {\n $query .= \"INSERT INTO Sabat_proposal_votes\n SET member_ID=\".$this->memberID.\",\n sabat_proposal_ID=\".$vote->proposal_ID.\",\n created_at=\\\"\".$this->createdAt.\"\\\",\n value=\".$vote->value.\";\";\n }\n\n if (!$this->canVote($this->votes[0]->proposal_ID))\n {\n return array(\n \"status\" => 503,\n \"statusMsg\" => \"Service unavailable\",\n \"data\" => array(\"message\" => \"Hlasování není povoleno.\")\n );\n }\n else if ($this->hasNotVoted($this->votes[0]->proposal_ID))\n {\n $stmt = $this->conn->prepare($query);\n\n if ($stmt->execute())\n return array(\n \"status\" => 201,\n \"statusMsg\" => \"Created\",\n \"data\" => array(\"message\" => \"Hlas(y) byl(y) úspěšně zaznamenán(y).\")\n );\n else\n return array(\n \"status\" => 503,\n \"statusMsg\" => \"Service unavailable\",\n \"data\" => array(\"message\" => \"Nepodařilo se zaznamenat hlas(y).\")\n );\n }\n else\n return array(\n \"status\" => 503,\n \"statusMsg\" => \"Service unavailable\",\n \"data\" => array(\"message\" => \"Už si volil. Pozdě měnit svá rozhodnutí.\")\n );\n\n }", "function get_votes_by_answer($answer_id) {\r\n // set connection var\r\n global $db;\r\n\r\n //query to get all associated surveys\r\n $sql = \"SELECT id\r\n FROM votes\r\n WHERE is_active = '1' AND answer_id = '$answer_id';\";\r\n\r\n $answers_data = array();\r\n $answers = array();\r\n\r\n foreach ($db->query($sql) as $key => $value) {\r\n $answers_data[$key] = $value;\r\n foreach ($answers_data[$key] as $subkey => $subvalue) {\r\n if (is_int($subkey)) {\r\n $answers[] = $subvalue;\r\n }\r\n }\r\n }\r\n\r\n return $answers;\r\n}", "public function votes()\n {\n return $this->hasMany(Vote::class);\n }", "public function votes()\n {\n return $this->hasMany(Vote::class);\n }", "public function iva_articulos(){\r\n\t\t\t$total = $this->cesta_con_iva()-$this->cesta_sin_iva();\t\t\t\r\n\t\t\treturn $total;\r\n\t\t}", "public function getCountJudgeVote($trophy_id,$idea_id)\r\n {\r\n $model = new Ynidea_Model_DbTable_Trophyvotes; \r\n $select = $model->select() \r\n ->from('engine4_ynidea_trophyvotes',array('count(user_id) AS total_judge')) \r\n ->where('trophy_id = ?',$trophy_id)->where('idea_id=?',$idea_id); \r\n $row = $model->fetchRow($select);\r\n return $row->total_judge; \r\n }", "public function upvote(): array {\n return $this->castVote(1);\n }", "public function getAnswerVotes($criteria = null, PropelPDO $con = null)\n\t{\n\t\tif ($criteria === null) {\n\t\t\t$criteria = new Criteria(UserPeer::DATABASE_NAME);\n\t\t}\n\t\telseif ($criteria instanceof Criteria)\n\t\t{\n\t\t\t$criteria = clone $criteria;\n\t\t}\n\n\t\tif ($this->collAnswerVotes === null) {\n\t\t\tif ($this->isNew()) {\n\t\t\t $this->collAnswerVotes = array();\n\t\t\t} else {\n\n\t\t\t\t$criteria->add(AnswerVotePeer::USER_ID, $this->id);\n\n\t\t\t\tAnswerVotePeer::addSelectColumns($criteria);\n\t\t\t\t$this->collAnswerVotes = AnswerVotePeer::doSelect($criteria, $con);\n\t\t\t}\n\t\t} else {\n\t\t\t// criteria has no effect for a new object\n\t\t\tif (!$this->isNew()) {\n\t\t\t\t// the following code is to determine if a new query is\n\t\t\t\t// called for. If the criteria is the same as the last\n\t\t\t\t// one, just return the collection.\n\n\n\t\t\t\t$criteria->add(AnswerVotePeer::USER_ID, $this->id);\n\n\t\t\t\tAnswerVotePeer::addSelectColumns($criteria);\n\t\t\t\tif (!isset($this->lastAnswerVoteCriteria) || !$this->lastAnswerVoteCriteria->equals($criteria)) {\n\t\t\t\t\t$this->collAnswerVotes = AnswerVotePeer::doSelect($criteria, $con);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->lastAnswerVoteCriteria = $criteria;\n\t\treturn $this->collAnswerVotes;\n\t}", "function countAlternatives()\r\n {\r\n $returnArray = array();\r\n $db =& eZDB::globalDatabase();\r\n $db->query_single( $result, \"SELECT count( ID ) AS COUNT FROM eZQuiz_Alternative WHERE QuestionID='$this->ID'\" );\r\n\r\n $ret = false;\r\n\r\n if ( is_numeric( $result[$db->fieldName( \"COUNT\" )] ) )\r\n {\r\n $ret = $result[$db->fieldName( \"COUNT\" )];\r\n }\r\n\r\n return $ret;\r\n }", "function get_vote_by_user_and_survey($user_id, $survey_id) {\r\n // set connection var\r\n global $db;\r\n\r\n // query to get all vote answer_ids for user\r\n $sql = \"SELECT id\r\n FROM votes\r\n WHERE is_active='1' AND survey_id='$survey_id' AND user_id='$user_id'\";\r\n\r\n $votes_data = array();\r\n $votes = array();\r\n foreach ($db->query($sql) as $key => $value) {\r\n $votes_data[$key] = $value;\r\n foreach ($votes_data[$key] as $subkey => $subvalue) {\r\n if (is_int($subkey)) {\r\n $votes[] = $subvalue;\r\n }\r\n }\r\n }\r\n\r\n return $votes;\r\n}", "function votes($pid, $query = array(), $rawJson = false) {\n \t\tif ( $json = $this->_get('/merchants/'.$pid.'/votes.json', $query) )\n \t\t\treturn $this->_parseApi($json, $rawJson);\n \t\telse\n \t\t\treturn false;\n \t}", "public function initAnswerVotes()\n\t{\n\t\t$this->collAnswerVotes = array();\n\t}", "public function getResultByVote()\n {\n if (NODE_ACCESS_IGNORE === $this->result) {\n return NODE_ACCESS_IGNORE;\n }\n if ($this->denied < $this->allowed) {\n return NODE_ACCESS_ALLOW;\n }\n return NODE_ACCESS_DENY;\n }", "function upVoteQuestion($idq) {\n\t$query = \"UPDATE question SET vote=vote-1 WHERE id='$idq'\";\n\t//select vote from question table\n\t$retquery =\"SELECT vote FROM question WHERE id='$idq' \";\n\t$data = mysql_query ($query)or die(mysql_error());\n\t$retdata = mysql_query ($retquery)or die(mysql_error());\n\t$row = mysql_fetch_array($retdata, MYSQL_ASSOC); \n\t\n\tif($data )\n\t{\n\t \techo $row['vote'];\n\t} \n}", "public function getVotingResult($id)\n {\n $query = sprintf('\n SELECT\n (vote/usr) as voting, usr\n FROM\n %sfaqvoting\n WHERE\n artikel = %d',\n PMF_Db::getTablePrefix(),\n $id\n );\n $result = $this->_config->getDb()->query($query);\n if ($this->_config->getDb()->numRows($result) > 0) {\n $row = $this->_config->getDb()->fetchObject($result);\n\n return sprintf(\n ' <span data-rating=\"%s\">%s</span> ('.$this->plr->GetMsg('plmsgVotes', $row->usr).')',\n round($row->voting, 2),\n round($row->voting, 2)\n );\n } else {\n return ' <span data-rating=\"0\">0</span> ('.$this->plr->GetMsg('plmsgVotes', 0).')';\n }\n }", "public function getPotentialPlus($idea_id,$version = 0){\r\n \r\n $model = new Ynidea_Model_DbTable_Ideavotes; \r\n $select = $model->select()\r\n ->from('engine4_ynidea_ideavotes',array('SUM(potential_plus) AS potential_plus'))\r\n ->where('idea_id = ?',$idea_id)->where('version_id=?',$version); \r\n $row = $model->fetchRow($select); \r\n return $row->potential_plus; \r\n }", "function lgot_vne()\r\n\t{\r\n\t\t$obr = \"SELECT ID, LGOTAVNEKONK FROM LGOTAVNEKONK ORDER BY ID\";\t\r\n\t\t$res_obr = mysql_query($obr);\r\n\t\t$number = 1;\r\n /* show result */\r\n\t \twhile ($row = mysql_fetch_array($res_obr, MYSQL_ASSOC)) \r\n\t\t{\r\n\t\t\tprintf(\"<option value='\".$row[\"ID\"].\"'>\");\r\n \tprintf ($row[\"LGOTAVNEKONK\"]);\r\n\t\t\tprintf(\"</option>\");\r\n\t\t\t$number ++;\r\n\t\t}\r\n\t\tmysql_free_result($res_obr);\r\n\t}", "function verifVadsAmount($data) {\n $amountTotal = $data / 100;\n return $amountTotal;\n }", "public function getAllVotes($id,$number=20)\n {\n $topics = DB::table('、')->select('topic_id')->where('user_id',[$id])->get();\n $topicId = [];\n foreach ($topics as $topic)\n $topicId[] = $topic->topic_id;\n return Topic::whereIn('id',$topicId)->whereNotIn('user_id',[$id])\n ->whereHas('category',function($q){\n $q->where('is_blocked','no');\n })->paginate($number);\n\n }", "function cb_votes_form($form, &$form_state, $entity = NULL) { \t\r\n $form = array();\r\n $options = array();\r\n $results = db_select('cb_options', 'o')\r\n ->fields('o', array('id', 'cb_option'))\r\n ->execute()\r\n ->fetchAll();\r\n foreach($results as $row) {\r\n $options[$row->id] = $row->cb_option; \r\n }\r\n $form['cb_option_id'] = array(\r\n '#title' => t('Select Option'),\r\n '#type' => 'select',\r\n '#options' => $options,\r\n '#default_value' => isset($entity->cb_option_id) ? $entity->cb_option_id : '',\r\n '#description' => t('Choose option to which this vote casts to'),\r\n '#required' => TRUE, \r\n );\r\n $form['vote'] = array(\r\n '#title' => t('Preference'),\r\n '#type' => 'textfield',\r\n '#default_value' => isset($entity->vote) ? $entity->vote : '',\r\n '#description' => t('Preference'),\r\n '#required' => TRUE, \r\n );\r\n field_attach_form('cb_votes', $entity, $form, $form_state);\r\n\r\n $form['actions'] = array(\r\n '#type' => 'actions',\r\n 'submit' => array(\r\n '#type' => 'submit',\r\n '#value' => isset($entity->id) ? t('Update') : t('Save'),\r\n ),\r\n );\r\n\r\n return $form;\r\n}", "public function berekenInkoopWaarde() {\n //var_dump(['aantal'=>$this->aantal, 'waarde'=>$this->artikel->verkoopprijs]);\n return $this->aantal * $this->artikel->inkoopprijs;\n }", "public function exportPollOptionVotes($offset, $limit) {\n\t\t$sql = \"SELECT\t\t*\n\t\t\tFROM\t\twcf\".$this->dbNo.\"_poll_option_vote\n\t\t\tWHERE\t\tpollID IN (\n\t\t\t\t\t\tSELECT\tpollID\n\t\t\t\t\t\tFROM\twcf\".$this->dbNo.\"_poll\n\t\t\t\t\t\tWHERE\tmessageType = ?\n\t\t\t\t\t)\n\t\t\t\t\tAND userID <> ?\n\t\t\tORDER BY\tpollOptionID, userID\";\n\t\t$statement = $this->database->prepareStatement($sql, $limit, $offset);\n\t\t$statement->execute(array('post', 0));\n\t\twhile ($row = $statement->fetchArray()) {\n\t\t\tImportHandler::getInstance()->getImporter('com.woltlab.wbb.poll.option.vote')->import(0, array(\n\t\t\t\t'pollID' => $row['pollID'],\n\t\t\t\t'optionID' => $row['pollOptionID'],\n\t\t\t\t'userID' => $row['userID']\n\t\t\t));\n\t\t}\n\t}", "public function votes()\n\t{\n\t\treturn $this->belongsToMany('Tangfastics\\Models\\User', 'votes');\n\t}", "function votos($idCancion){\n\t$sql = 'SELECT * FROM votos WHERE cancion = '.$idCancion;\n\t$resultado = mysql_query($sql);\n\t$resultado = mysql_fetch_array($resultado);\n\t\n\tif(isset($resultado['votos'])){\n\t\treturn $resultado['votos'];\n\t}else{\n\t\treturn '0';\n\t}\n}", "function GetPollVotesOfUserFormatted($userId){\n AddActionLog(\"GetPollVotesOfUserFormatted\");\n StartTimer(\"GetPollVotesOfUserFormatted\");\n \n $data = $this->pollDbInterface->SelectPollVotesOfUser($userId);\n \n StopTimer(\"GetPollVotesOfUserFormatted\");\n return ArrayToHTML(MySQLDataToArray($data));\n }", "public function votes()\n\t{\n\t\treturn $this->oneShiftsToMany('Vote', 'item_id', 'item_type');\n\t}", "public function voteAction()\n {\n\n }", "function get_amt_selection($id)\n {\n $query = $this->db->query(\"SELECT COUNT(*) as amount FROM fis_dtraining_feedback_selections\n where tfselect_tfque_fk = $id\");\n return $query->row();\n }", "public function voteValue($user_id)\n {\n $vote = Vote::where([\n ['article_id', $this->id],\n ['user_id', $user_id]\n ])->first();\n\n if ($vote) {\n return $vote->value;\n } else {\n return 0;\n }\n }", "public function getScoreVoteIdeas($type=null)\n {\n if($type == null)\n return getScoreVoteIdeas('truth') + getScoreVoteIdeas('dare');\n else\n {\n //Prepare Query\n $criteria = new CDbCriteria;\n $criteria->group = \" $type.idUser \";\n $criteria->select = \" SUM(CASE WHEN t.voteDate >= :minDateSubmitWeek THEN (CASE t.voteType WHEN 1 THEN 1 ELSE -1 END) END) AS scoreWeek, \";\n $criteria->select .= \" SUM(CASE WHEN t.voteDate >= :minDateSubmitMonth THEN (CASE t.voteType WHEN 1 THEN 1 ELSE -1 END) END) AS scoreMonth, \";\n $criteria->select .= \" SUM(CASE WHEN t.voteDate >= :minDateSubmitYear THEN (CASE t.voteType WHEN 1 THEN 1 ELSE -1 END) END) AS scoreYear, \";\n $criteria->select .= \" SUM(CASE t.voteType WHEN 1 THEN 1 ELSE -1 END) AS score \";\n $criteria->with = array($type);\n $criteria->addCondition(\" $type.idUser = :idUser \");\n\n //Bind Parameters\n $criteria->params = array(':idUser'=>$this->idUser);\n $criteria->params[':minDateSubmitWeek'] = MyFunctions::getFirstDayWeek();\n $criteria->params[':minDateSubmitMonth'] = MyFunctions::getFirstDayMonth();\n $criteria->params[':minDateSubmitYear'] = MyFunctions::getFirstDayYear();\n\n //Execute Query\n $result = VotingDetail::model()->find($criteria);\n\n //Fetch results\n $scoreTotal = $result['score'] === null? 0 : $result->score;\n $scoreWeek = $result['scoreWeek'] === null? 0 : $result->scoreWeek;\n $scoreMonth = $result['scoreMonth'] === null? 0 : $result->scoreMonth;\n $scoreYear = $result['scoreYear'] === null? 0 : $result->scoreYear;\n\n return array('total'=>$scoreTotal,'week'=>$scoreWeek,'month'=>$scoreMonth,'year'=>$scoreYear);\n }\n }", "public function downVotesCount()\n {\n return $this->post_votes()\n ->selectRaw('post_id, count(*) as count')\n ->where('vote', '=', '-1')\n ->groupBy('post_id');\n }", "public function get_atletas_resultados_viento() {\n return $this->atletas_resultados_viento;\n }", "public function getAnswerCount();", "public static function getVumValidVotes() {\n\t\tglobal $wpdb;\n\n\t\tif (self::$numValidVotes)\n\t\t\treturn self::$numValidVotes;\n\n\t\t$count=$wpdb->get_var(\"SELECT COUNT(*) from {$wpdb->prefix}vote WHERE valid=1\");\n\n\t\tif ($wpdb->last_error)\n\t\t\tthrow new Exception($wpdb->last_error);\n\n\t\tself::$numValidVotes=$count;\n\n\t\treturn $count;\n\t}", "public function usersNeedChoice()\n {\n $madechoice = (R::count('choice'))/2;\n $choicedecided = R::count('finalchoice');\n return $madechoice - $choicedecided;\n }", "static function add_voting(): void {\r\n\t\tself::add_acf_inner_field(self::roles, self::voting, [\r\n\t\t\t'label' => 'Automatic voting rights?',\r\n\t\t\t'type' => 'true_false',\r\n\t\t\t'instructions' => 'As opposed to earned.',\r\n\t\t\t'required' => 0,\r\n\t\t\t'conditional_logic' => 0,\r\n\t\t\t'wrapper' => [\r\n\t\t\t\t'width' => '25',\r\n\t\t\t\t'class' => '',\r\n\t\t\t\t'id' => '',\r\n\t\t\t],\r\n\t\t\t'message' => '',\r\n\t\t\t'default_value' => 0,\r\n\t\t\t'ui' => 1,\r\n\t\t]);\r\n\t}", "public function votes()\n {\n return $this->hasMany('App\\Vote');\n }", "public function votes()\n {\n return $this->hasMany('App\\Vote');\n }", "public function votes()\n {\n return $this->hasMany('App\\Vote');\n }", "public function votes()\n {\n return $this->hasMany('App\\Vote');\n }", "public function userVotes(): array {\n $key = sprintf(self::VOTED_USER, $this->user->id());\n $votes = self::$cache->get_value($key);\n if ($votes === false) {\n self::$db->prepared_query(\"\n SELECT GroupID,\n CASE WHEN Type = 'Up' THEN 1 ELSE 0 END AS vote\n FROM users_votes\n WHERE UserID = ?\n \", $this->user->id()\n );\n $votes = self::$db->to_pair('GroupID', 'vote', false);\n self::$cache->cache_value($key, $votes);\n }\n return $votes;\n }", "public function cesta_con_iva(){\r\n\t\t\t$total = 0;\r\n\t\t\tforeach ($this->listArticulos as $elArticulo){\r\n\t\t\t\t$precio = $elArticulo->oferta_iva>0?$elArticulo->oferta_iva:$elArticulo->precio_iva;\r\n\t\t\t\t$total+= round($elArticulo->unidades*$precio,2);\r\n\t\t\t}\r\n\t\t\treturn $total;\r\n\t\t}", "public function getQuantidadePaginas(){\n return $this->qtdPaginas;\n }" ]
[ "0.7052345", "0.705221", "0.69964594", "0.66728306", "0.6626416", "0.65633285", "0.65489864", "0.6437692", "0.63872325", "0.62472475", "0.6218615", "0.61841154", "0.6180212", "0.60825694", "0.60738146", "0.60443175", "0.6019061", "0.6018049", "0.5929912", "0.59272134", "0.5910246", "0.5906613", "0.5880229", "0.5838441", "0.58226633", "0.58027166", "0.5787557", "0.5784101", "0.57707894", "0.57635605", "0.5723444", "0.57127625", "0.5702015", "0.569943", "0.56895787", "0.5684969", "0.56787515", "0.56618726", "0.5643391", "0.5635947", "0.5633597", "0.5594136", "0.5579303", "0.5578079", "0.5564139", "0.555603", "0.55442667", "0.551532", "0.55141085", "0.55130005", "0.550836", "0.5507612", "0.5495498", "0.54867613", "0.5484496", "0.546394", "0.54536974", "0.5452366", "0.5433044", "0.5420662", "0.5420662", "0.54184216", "0.5404618", "0.53867424", "0.53837454", "0.5380892", "0.53693986", "0.53560466", "0.5355897", "0.534443", "0.53388286", "0.5337363", "0.5336683", "0.53271633", "0.53265613", "0.53254724", "0.532016", "0.5316752", "0.53121793", "0.53070325", "0.529605", "0.52938086", "0.5269802", "0.52671504", "0.52622503", "0.5248189", "0.52472436", "0.5243515", "0.5241518", "0.5240333", "0.52347106", "0.52328885", "0.5225912", "0.5224087", "0.5224087", "0.5224087", "0.5224087", "0.52238226", "0.52206427", "0.5215183" ]
0.6629984
4
/end of helper for breadcrumb
function getMinOffersPrice($offers) { $minPrice = 0; foreach ($offers as $key => $offer) { if ($offer['ITEM_PRICES'][0]['PRICE']) { if ($minPrice == 0 || $minPrice > $offer['ITEM_PRICES'][0]['PRICE']) { $minPrice = $offer['ITEM_PRICES'][0]['PRICE']; } } } return $minPrice; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function BreadCrumb(){}", "function eo_bbpm_get_breadcrumb() {\n}", "public function trail() {\n\n\t\t$breadcrumb = '';\n\t\t$item_count = count( $this->items );\n\t\t$item_position = 0;\n\n\t\tif ( 0 < $item_count ) {\n\n\t\t\tif ( true === $this->args['show_browse'] )\n\t\t\t\t$breadcrumb .= sprintf( '<h2 class=\"trail-browse\">%s</h2>', $this->labels['browse'] );\n\n\t\t\t$breadcrumb .= '<ol class=\"breadcrumb '.$this->args['classes'].'\" itemscope itemtype=\"http://schema.org/BreadcrumbList\">';\n\n\t\t\t$breadcrumb .= sprintf( '<meta name=\"numberOfItems\" content=\"%d\" />', absint( $item_count ) );\n\t\t\t$breadcrumb .= '<meta name=\"itemListOrder\" content=\"Ascending\" />';\n\n\t\t\tforeach ( $this->items as $item ) {\n\n\t\t\t\t++$item_position;\n\n\t\t\t\tpreg_match( '/(<a.*?>)(.*?)(<\\/a>)/i', $item, $matches );\n\n\t\t\t\t$item = !empty( $matches ) ? sprintf( '%s<span itemprop=\"name\">%s</span>%s', $matches[1], $matches[2], $matches[3] ) : sprintf( '<span itemprop=\"name\">%s</span>', $item );\n\n\t\t\t\t$item_class = 'breadcrumb-item';\n\n\t\t\t\tif ( $item_count === $item_position )\n\t\t\t\t\t$item_class .= ' active';\n\n\t\t\t\t$attributes = 'itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\" class=\"' . $item_class . '\"';\n\n\t\t\t\t$meta = sprintf( '<meta itemprop=\"position\" content=\"%s\" />', absint( $item_position ) );\n\n\t\t\t\t$breadcrumb .= sprintf( '<li %s>%s%s</li>', $attributes, $item, $meta );\n\t\t\t}\n\n\t\t\t$breadcrumb .= '</ol>';\n\n\t\t\t$breadcrumb = sprintf(\n\t\t\t\t'<%1$s role=\"navigation\" aria-label=\"%2$s\" class=\"breadcrumbs\" itemprop=\"breadcrumb\">%3$s%4$s%5$s</%1$s>',\n\t\t\t\ttag_escape( $this->args['container'] ),\n\t\t\t\tesc_attr( $this->labels['aria_label'] ),\n\t\t\t\t$this->args['before'],\n\t\t\t\t$breadcrumb,\n\t\t\t\t$this->args['after']\n\t\t\t);\n\t\t}\n\n\t\tif ( false === $this->args['echo'] )\n\t\t\treturn $breadcrumb;\n\n\t\techo $breadcrumb;\n\t}", "function breadcrumb(){\n\t global $view;\n\t \n \t$view_header = ucfirst($view);\n\treturn \"<ul class='breadcrumb'>\n\t <li>System</li>\n\t <li class='active'>$view_header</li>\n\t\t </ul>\";\n }", "function hbreadcrumbs()\n\t{\n\t\t$uri = luri_get();\n\t\t$html = \"\";\n\n\t\t$cat = lconf_dbget(\"default_uri\");\n\t\t$cat = mcategories_read($cat);\n\t\t$html = $cat[\"name\"];\n\n\t\tif (strlen($uri[0]))\n\t\t{\n\t\t\t$html = '<a href=\"' . hanchor_shref() . '\">' . $html . '</a>';\n\n\t\t\tfor($i = 0; $i < count($uri); $i++)\n\t\t\t{\n\t\t\t\t$cat = mcategories_read($uri[$i]);\n\t\t\t\tif ($i < count($uri) - 1 && $cat) $html .= ' &gt; <a href=\"' . hanchor_href(\"main/index/content\", mcategories_read_path($uri[$i], false)) . '\">' . $cat[\"name\"] . '</a>';\n\t\t\t\telse if ($cat) $html .= ' &gt; <span>' . $cat[\"name\"] . '</span>';\n\t\t\t}\n\t\t}\n\t\telse $html = '<span>' . $html . '</span>';\n\n\t\treturn $html;\n\t}", "function the_breadcrumb() {\n\tif (!is_home()) {\n\t\techo '<span title=\"';\n\t\techo get_option('home');\n\t echo '\">';\n\t\tbloginfo('name');\n\t\techo \"</span> » \";\n\t\tif (is_page_template()) {\n\t\t\t\techo \" » \";\n echo the_title();\n\n \n \t\n\t\t} elseif (is_single()) {\n\t\t\techo the_title();\n\t\t}\n\t}\n}", "function _update_breadcrumb_line()\n {\n $tmp = Array();\n\n $tmp[] = Array\n (\n MIDCOM_NAV_URL => \"/\",\n MIDCOM_NAV_NAME => $this->_l10n->get('index'),\n );\n\n $_MIDCOM->set_custom_context_data('midcom.helper.nav.breadcrumb', $tmp);\n }", "function the_breadcrumb() {\n\t global $post;\n\t $separator = '<span class=\"breadcrumb-divider\"><svg width=\"16\" height=\"17\" viewBox=\"0 0 16 17\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M16 8.49993L13.4394 5.93933V7.99599H0V9.00394H13.4394V11.0606L16 8.49993Z\" fill=\"#121212\" /></svg></span>';\n\t echo '<nav aria-label=\"breadcrumb\"><ol class=\"breadcrumb\">';\n\t if (!is_home()) {\n\t\t\t echo '<li class=\"breadcrumb-item\"><a href=\"';\n\t\t\t echo get_option('home');\n\t\t\t echo '\">';\n\t\t\t echo __( 'Home', 'thegrapes' );\n\t\t\t echo '</a></li>' . $separator;\n\t\t\t if ( is_category() ) {\n\t\t\t\t\t echo '<li class=\"breadcrumb-item active\">';\n\t\t\t\t\t the_category(' </li>' . $separator . '<li class=\"breadcrumb-item\"> ');\n\t\t\t } elseif ( is_single() ) {\n echo '<li class=\"breadcrumb-item\">';\n echo '<a href=\"' . get_post_type_archive_link( 'post' ) . '\">';\n echo get_the_title( get_option('page_for_posts', true) );\n echo '</a>';\n echo '</li>' . $separator . '<li class=\"breadcrumb-item active\">';\n the_title();\n echo '</li>';\n } elseif ( is_page() ) {\n\t\t\t\t\t if($post->post_parent){\n\t\t\t\t\t\t\t $anc = get_post_ancestors( $post->ID );\n\t\t\t\t\t\t\t $title = get_the_title();\n\t\t\t\t\t\t\t foreach ( $anc as $ancestor ) {\n\t\t\t\t\t\t\t\t\t $output = '<li class=\"breadcrumb-item\"><a href=\"'.get_permalink($ancestor).'\" title=\"'.get_the_title($ancestor).'\">'.get_the_title($ancestor).'</a></li>' . $separator;\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t echo $output;\n\t\t\t\t\t\t\t echo '<li class=\"breadcrumb-item active\">'.$title.'</li>';\n\t\t\t\t\t } else {\n\t\t\t\t\t\t\t echo '<li class=\"breadcrumb-item active\">'.get_the_title().'</li>';\n\t\t\t\t\t }\n\t\t\t }\n\t }\n\t elseif (is_tag()) {single_tag_title();}\n\t elseif (is_day()) {echo\"<li>Archive for \"; the_time('F jS, Y'); echo'</li>';}\n\t elseif (is_month()) {echo\"<li>Archive for \"; the_time('F, Y'); echo'</li>';}\n\t elseif (is_year()) {echo\"<li>Archive for \"; the_time('Y'); echo'</li>';}\n\t elseif (is_author()) {echo\"<li>Author Archive\"; echo'</li>';}\n\t elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {echo \"<li>Blog Archives\"; echo'</li>';}\n\t elseif (is_search()) {echo\"<li>Search Results\"; echo'</li>';}\n\t echo '</ol></nav>';\n}", "function mpcth_display_breadcrumb() {\r\n\tglobal $post;\r\n\t$id = $post->ID;\r\n\t$return = '<a href=\"/\">' . __('Home', 'mpcth') . '</a>';\r\n\r\n\tif(is_front_page()) {\r\n\t\t// do nothing\r\n\t} elseif(is_page()) {\r\n\t\t$page = get_post($id);\r\n\r\n\t\t$parent_pages = array();\r\n\t\t$parent_pages[] = ' <span class=\"mpcth-header-devider\">/</span> ' . $page->post_title . \"\\n\";\r\n\r\n\t\twhile ($page->post_parent) {\r\n\t\t\t$page = get_post($page->post_parent);\r\n\t\t\t$parent_pages[] = ' <span class=\"mpcth-header-devider\">/</span> <a href=\"' . get_permalink($page->ID) . '\">' . $page->post_title . '</a>';\r\n\t\t}\r\n\r\n\t\t$parent_pages = array_reverse($parent_pages);\r\n\r\n\t\tforeach ($parent_pages as $parent) {\r\n\t\t\t$return .= $parent;\r\n\t\t}\r\n\t} elseif(is_single()) {\r\n\t\tif($post->post_type == 'post') {\r\n\t\t\t$category = get_the_category($id);\r\n\r\n\t\t\tif(!empty($category)){\r\n\t\t\t\t$data = get_category_parents($category[0]->cat_ID, true, ' <span class=\"mpcth-header-devider\">/</span> ');\r\n\t\t\t\t$return .= ' <span class=\"mpcth-header-devider\">/</span> ' . substr($data, 0, -strlen(' <span class=\"mpcth-header-devider\">/</span> '));\r\n\t\t\t}\r\n\t\t} elseif($post->post_type == 'portfolio') {\r\n\t\t\t$terms = get_the_terms($id, 'mpcth_portfolio_category');\r\n\t\t\t\r\n\t\t\tif(!empty($terms)){\r\n\t\t\t\t$return .= ' <span class=\"mpcth-header-devider\">/</span> ';\r\n\r\n\t\t\t\tforeach ($terms as $term) {\r\n\t\t\t\t\t$return .= ' <a href=\"' . get_term_link($term) . '\">' . $term->name . '</a>';\r\n\t\t\t\t\t\r\n\t\t\t\t\tif($term !== end($terms))\r\n\t\t\t\t\t\t$return .= ', ';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$return .= ' <span class=\"mpcth-header-devider\">/</span> ' . $post->post_title . \"\\n\";\r\n\t} elseif(is_category()) {\r\n\t\t$category = get_the_category($id);\r\n\t\t$data = get_category_parents($category[0]->cat_ID, true, ' <span class=\"mpcth-header-devider\">/</span> ');\r\n\r\n\t\tif(!empty($category)){\r\n\t\t\t$return .= ' <span class=\"mpcth-header-devider\">/</span> ' . substr($data,0,-8);\r\n\t\t}\r\n\t} elseif(is_tax()) {\r\n\t\t$term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));\r\n\t\t$return .= ' <span class=\"mpcth-header-devider\">/</span> <a href=\"' . get_term_link($term) . '\">' . $term->name . '</a>';\r\n\t}\r\n\r\n\treturn $return;\r\n}", "public static function breadcrumbs() {\n\t\tif(!self::has_breadcrumbs()) return;\n\t\t?>\n\t\t\t<h6 id=\"header-breadcrumbs\">\n\t\t\t\t<?php dimox_breadcrumbs('&middot;') ?>\n\t\t\t</h6>\n\t\t<?php\n\t}", "public function breadCrumb()\n\t{\n\t\treturn parent::breadCrumb().\" \".$GLOBALS['super']->config->crumbSeperator.\" \".$this->getName();\n\t}", "public function breadCrumb()\n\t{\n\t\treturn parent::breadCrumb().\" \".$GLOBALS['super']->config->crumbSeperator.\" \".$this->getName();\n\t}", "protected function getBreadcrumbsPart()\n {\n ?>\n <?php\n //breadCrums\n $bc = $this->getBreadcrumbs();\n ?>\n\n <ol class=\"breadcrumb\" style=\"\">\n <?php\n\n foreach ($bc as $item):\n ?>\n <li><a href=\"<?= $item['url'] ?>\"><?= $item['name'] ?></a></li>\n <?php\n endforeach;\n ?>\n </ol>\n\n <?php\n }", "function thim_learnpress_breadcrumb() {\n\t\tif ( is_front_page() || is_404() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Get the query & post information\n\t\tglobal $post;\n\n\t\t// Build the breadcrums\n\t\techo '<ul itemprop=\"breadcrumb\" itemscope itemtype=\"http://schema.org/BreadcrumbList\" id=\"breadcrumbs\" class=\"breadcrumbs\">';\n\n\t\t// Home page\n\t\techo '<li itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\"><a itemprop=\"item\" href=\"' . esc_html( get_home_url() ) . '\" title=\"' . esc_attr__( 'Home', 'eduma' ) . '\"><span itemprop=\"name\">' . esc_html__( 'Home', 'eduma' ) . '</span></a></li>';\n\n\t\tif ( is_single() ) {\n\n\t\t\t$categories = get_the_terms( $post, 'course_category' );\n\n\t\t\tif ( get_post_type() == 'lp_course' ) {\n\t\t\t\t// All courses\n\t\t\t\techo '<li itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\"><a itemprop=\"item\" href=\"' . esc_url( get_post_type_archive_link( 'lp_course' ) ) . '\" title=\"' . esc_attr__( 'All courses', 'eduma' ) . '\"><span itemprop=\"name\">' . esc_html__( 'All courses', 'eduma' ) . '</span></a></li>';\n\t\t\t} else {\n\t\t\t\techo '<li itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\"><a itemprop=\"item\" href=\"' . esc_url( get_permalink( get_post_meta( $post->ID, '_lp_course', true ) ) ) . '\" title=\"' . esc_attr( get_the_title( get_post_meta( $post->ID, '_lp_course', true ) ) ) . '\"><span itemprop=\"name\">' . esc_html( get_the_title( get_post_meta( $post->ID, '_lp_course', true ) ) ) . '</span></a></li>';\n\t\t\t}\n\n\t\t\t// Single post (Only display the first category)\n\t\t\tif ( isset( $categories[0] ) ) {\n\t\t\t\techo '<li itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\"><a itemprop=\"item\" href=\"' . esc_url( get_term_link( $categories[0] ) ) . '\" title=\"' . esc_attr( $categories[0]->name ) . '\"><span itemprop=\"name\">' . esc_html( $categories[0]->name ) . '</span></a></li>';\n\t\t\t}\n\t\t\techo '<li itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\"><span itemprop=\"name\" title=\"' . esc_attr( get_the_title() ) . '\">' . esc_html( get_the_title() ) . '</span></li>';\n\n\t\t} else if ( is_tax( 'course_category' ) || is_tax( 'course_tag' ) ) {\n\t\t\t// All courses\n\t\t\techo '<li itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\"><a itemprop=\"item\" href=\"' . esc_url( get_post_type_archive_link( 'lp_course' ) ) . '\" title=\"' . esc_attr__( 'All courses', 'eduma' ) . '\"><span itemprop=\"name\">' . esc_html__( 'All courses', 'eduma' ) . '</span></a></li>';\n\n\t\t\t// Category page\n\t\t\techo '<li itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\"><span itemprop=\"name\" title=\"' . esc_attr( single_term_title( '', false ) ) . '\">' . esc_html( single_term_title( '', false ) ) . '</span></li>';\n\t\t} else if ( !empty( $_REQUEST['s'] ) && !empty( $_REQUEST['ref'] ) && ( $_REQUEST['ref'] == 'course' ) ) {\n\t\t\t// All courses\n\t\t\techo '<li itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\"><a itemprop=\"item\" href=\"' . esc_url( get_post_type_archive_link( 'lp_course' ) ) . '\" title=\"' . esc_attr__( 'All courses', 'eduma' ) . '\"><span itemprop=\"name\">' . esc_html__( 'All courses', 'eduma' ) . '</span></a></li>';\n\n\t\t\t// Search result\n\t\t\techo '<li itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\"><span itemprop=\"name\" title=\"' . esc_attr__( 'Search results for:', 'eduma' ) . ' ' . esc_attr( get_search_query() ) . '\">' . esc_html__( 'Search results for:', 'eduma' ) . ' ' . esc_html( get_search_query() ) . '</span></li>';\n\t\t} else {\n\t\t\techo '<li itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\"><span itemprop=\"name\" title=\"' . esc_attr__( 'All courses', 'eduma' ) . '\">' . esc_html__( 'All courses', 'eduma' ) . '</span></li>';\n\t\t}\n\n\t\techo '</ul>';\n\t}", "function get_breadcrumb() {\n\n // Outputs home breadcrumb \n echo '<a href=\"'.home_url().'\" rel=\"nofollow\">Home</a>';\n\n // Retrievea post categories.\n $category = get_the_category();\n\n // Checks if page template is category or single \n if (is_category() || is_single() || is_tag() || is_date()) {\n\n // Outputs arrows\n echo \"&nbsp;&nbsp;&#187;&nbsp;&nbsp;\";\n\n // Checks if category array is not empty\n if ( $category[0] ) {\n // Outputs current category of post (NOTE: only outputs one category)\n echo '<a href=\"' . get_category_link( $category[0]->term_id ) . '\">' . $category[0]->cat_name . '</a>';\n }\n\n // Determines whether the query is for an existing single post\n if (is_single()) {\n // Outputs arrows \n echo \" &nbsp;&nbsp;&#187;&nbsp;&nbsp; \";\n // Outputs the title\n the_title();\n }\n\n } \n}", "function thumbwhere_contentcollectionitem_set_breadcrumb() {\n $breadcrumb = array(\n l(t('Home'), '<front>'),\n l(t('Administration'), 'admin'),\n l(t('ContentCollectionItem'), 'admin/content'),\n l(t('ContentCollectionItem'), 'admin/thumbwhere/thumbwhere_contentcollectionitems'),\n );\n\n drupal_set_breadcrumb($breadcrumb);\n}", "function breadcrumb()\r\n\t{\r\n\t\t$breadcrumbs = array();\r\n\t\tpr($this->Link);\r\n\t\t//$cLink = ClassRegistry::init('JavanLink');pr($cLink);\r\n\t\t//$conditions = array(\"controller\"=>$this->info['controller'], \"action\"=>$this->info['action']);\r\n\t\t//$link = $cLink->find(\"first\", array(\"conditions\"=>$conditions, \"recursive\"=>-1));\r\n\t\t//if(!$link){\r\n\t\t//\t//trigger_error(__('Alamat yang Anda akses tidak terdaftar.', true), E_USER_WARNING);\r\n\t\t//\treturn false ;\r\n\t\t//}else{\r\n\t\t//\t$breadcrumbs = $cLink->getpath($link['Link']['id']);\r\n\t\t//}\r\n\t\treturn $breadcrumbs;\r\n\t}", "public function getBreadcrumbs();", "protected function breadcrumbForIndex()\n {\n $breadcrumbTree = new ullPhoneBreadcrumbTree();\n $this->setVar('breadcrumb_tree', $breadcrumbTree, true);\n }", "function ou_df_easy_breadcrumb($variables) {\n\n $breadcrumb = $variables['breadcrumb'];\n $segments_quantity = $variables['segments_quantity'];\n $separator = $variables['separator'];\n\n $html = '';\n\n if ($segments_quantity > 0) {\n\n $html .= '<dl class=\"breadcrumb\"><dt>You are here:</dt><dd>';\n\n for ($i = 0, $s = $segments_quantity - 1; $i < $segments_quantity; ++$i) {\n $it = $breadcrumb[$i];\n $content = decode_entities($it['content']);\n if (isset($it['url'])) {\n $html .= l($content, $it['url'], array('attributes' => array('class' => $it['class'])));\n } else {\n $class = implode(' ', $it['class']);\n $html .= '<span class=\"' . $class . '\">'\t. $content . '</span>';\n }\n if ($i < $s) {\n $html .= '<span class=\"easy-breadcrumb_segment-separator\"> ' . $separator . ' </span>';\n }\n }\n\n $html .= '</dd></dl>';\n }\n\n return $html;\n}", "function susy_breadcrumb($vars) {\n\n $breadcrumb = isset($vars['breadcrumb']) ? $vars['breadcrumb'] : array();\n\n if (theme_get_setting('susy_breadcrumb_hideonlyfront')) {\n $condition = count($breadcrumb) > 1;\n } else {\n $condition = !empty($breadcrumb);\n }\n\n if(theme_get_setting('susy_breadcrumb_showtitle')) {\n $title = drupal_get_title();\n if(!empty($title)) {\n $condition = true;\n $breadcrumb[] = $title;\n }\n }\n\n $separator = theme_get_setting('susy_breadcrumb_separator');\n\n if (!$separator) {\n $separator = '»';\n }\n\n if ($condition) {\n return implode(\" {$separator} \", $breadcrumb);\n }\n}", "function thumbwhere_contentcollection_set_breadcrumb() {\n $breadcrumb = array(\n l(t('Home'), '<front>'),\n l(t('Administration'), 'admin'),\n l(t('ContentCollection'), 'admin/content'),\n l(t('ContentCollection'), 'admin/thumbwhere/thumbwhere_contentcollections'),\n );\n\n drupal_set_breadcrumb($breadcrumb);\n}", "function get_breadcrumb() {\n echo '<a href=\"'.home_url().'\" rel=\"nofollow\">Home</a>';\n if (is_category() || is_single()) {\n echo \"&nbsp;&nbsp;&#187;&nbsp;&nbsp;\";\n the_category(' &bull; ');\n if (is_single()) {\n echo \" &nbsp;&nbsp;&#187;&nbsp;&nbsp; \";\n the_title();\n }\n } elseif (is_page()) {\n echo \"&nbsp;&nbsp;&#187;&nbsp;&nbsp;\";\n echo the_title();\n }\n}", "function rella_breadcrumb( $args = array() ) {\n\n\t$breadcrumb = new Rella_Breadcrumb( $args );\n\n\treturn $breadcrumb->trail();\n}", "function breadcrumbs(): void\n{\n\tif (function_exists('yoast_breadcrumb')) {\n\t\tyoast_breadcrumb(\n\t\t\t'<nav aria-label=\"You are here:\" role=\"navigation\" xmlns:v=\"http://rdf.data-vocabulary.org/#\">\n\t\t\t\t<ul class=\"breadcrumbs\">',\n\t\t\t'</ul></nav>'\n\t\t);\n\t}\n}", "function create_crumbs() {\n\t\n\t\t$breadcrumb = '';\n\t\t$args = $this->args;\n\n\t\t// Get the items based on page context \n\t\t$trail = $this->get_trail();\n\n\t\t// If items are found, build the trail \n\t\tif ( !empty( $trail ) && is_array( $trail ) ) {\n\n\t\t\t// Wrap the trail and add the 'Before' element\n\t\t\t$breadcrumb = '<'.$args['container']. ' class=\"breadcrumb-trail breadcrumbs\">';\n\t\t\t$breadcrumb .= ( !empty( $args['before'] ) ? '<span class=\"trail-before\">' . $args['before'] . '</span> ' : '' );\n\t\t\t\n\t\t\t// Adds the 'trail-end' class around last item \n\t\t\tarray_push( $trail, '<span class=\"trail-end\">' . array_pop( $trail ) . '</span>' );\n\t\t\t\n\t\t\t// Format the separator \n\t\t\t$separator = ( !empty( $args['separator'] ) ? $args['separator'] : '' );\n\n\t\t\t// Join the individual trail items into a single string \n\t\t\t$breadcrumb .= join( \" {$separator} \", $trail );\n\n\t\t\t// Close the breadcrumb trail containers \n\t\t\t$breadcrumb .= '</' . $args['container'] . '>';\n\t\t}\n\n\t\t// Return the formatted breadcrumbs\n\t\treturn $breadcrumb;\n\t}", "function atwork_breadcrumb($variables) {\n $breadcrumb = $variables['breadcrumb']; // Determine if we are to display the breadcrumb.\n $show_breadcrumb = theme_get_setting('atwork_breadcrumb');\n if ($show_breadcrumb == 'yes' || ($show_breadcrumb == 'admin' && arg(0) == 'admin')) {\n\n // Optionally get rid of the homepage link.\n $show_breadcrumb_home = theme_get_setting('atwork_breadcrumb_home');\n if (!$show_breadcrumb_home) {\n array_shift($breadcrumb);\n }\n\n // Return the breadcrumb with separators.\n if (!empty($breadcrumb)) {\n $breadcrumb_separator = theme_get_setting('atwork_breadcrumb_separator');\n $trailing_separator = $title = '';\n if (theme_get_setting('atwork_breadcrumb_title')) {\n $item = menu_get_item();\n if (!empty($item['tab_parent'])) {\n // If we are on a non-default tab, use the tab's title.\n $title = check_plain($item['title']);\n }\n else {\n $title = drupal_get_title();\n }\n if ($title) {\n $trailing_separator = $breadcrumb_separator;\n }\n }\n elseif (theme_get_setting('atwork_breadcrumb_trailing')) {\n $trailing_separator = $breadcrumb_separator;\n }\n\n return '<h2 class=\"breadcrumb\">' . implode($breadcrumb_separator, $breadcrumb) . $trailing_separator . $title . '</h2>';\n }\n }\n // Otherwise, return an empty string.\n return '';\n}", "function appointment_set_breadcrumb() {\n $breadcrumb = array(\n l(t('Home'), '<front>'),\n l(t('Administration'), 'admin'),\n l(t('Content'), 'admin/content'),\n l(t('Appointment'), 'admin/content/appointment'),\n );\n \n drupal_set_breadcrumb($breadcrumb);\n}", "function print_breadcrumb()\n{\n $breadcrumbs = get_breadcrumb();\n for ($i = 0; $i < sizeof($breadcrumbs); $i++) {\n echo '<li class=\"breadcrumb-path breadcrumb-level-' . $i . '\">';\n echo '<a href=\"' . $breadcrumbs[$i]['url'] . '\">' . $breadcrumbs[$i]['title'] . '</a>';\n echo '</li>';\n }\n}", "function YOURTHEME_breadcrumb($variables) {\n $breadcrumb = $variables['breadcrumb'];\n\n if (!empty($breadcrumb)) {\n $crumbs = '<ul class=\"breadcrumbs\">';\n\n foreach($breadcrumb as $value) {\n $crumbs .= '<li class=\"changes\">'.$value.'</li>';\n }\n $crumbs .= '</ul>';\n }\n return $crumbs;\n }", "function ento_cdn_breadcrumb($variables) {\n // Use the Path Breadcrumbs theme function if it should be used instead.\n //if (_bootstrap_use_path_breadcrumbs()) {\n // return path_breadcrumbs_breadcrumb($variables);\n //}\n\n $output = '';\n $breadcrumb = $variables['breadcrumb'];\n\n if (!empty($breadcrumb)) {\n // Provide a navigational heading to give context for breadcrumb links to\n // screen-reader users. Make the heading invisible with .element-invisible.\n $output = '<h2 class=\"element-invisible\">' . t('You are here') . '</h2>';\n $crumbs = '<ol class=\"breadcrumb\">';\n $array_size = count($breadcrumb);\n $i = 0;\n while ( $i < $array_size) {\n $crumbs .= '<li';\n if ($i+1 == $array_size) {\n $crumbs .= ' class=\"active\"';\n }\n $crumbs .= '>';\n if ($i+1 == $array_size) {\n $crumbs .= ' <strong>' . $breadcrumb[$i] . '</strong>' . '</li>';\n } else {\n \t$crumbs .= $breadcrumb[$i] . '</li>';\n }\n $i++;\n }\n $crumbs .= '</ol>';\n return $crumbs;\n }\n\n // Determine if we are to display the breadcrumb.\n/* $bootstrap_breadcrumb = bootstrap_setting('breadcrumb');\n if (($bootstrap_breadcrumb == 1 || ($bootstrap_breadcrumb == 2 && arg(0) == 'admin')) && !empty($breadcrumb)) {\n $output = theme('item_list', array(\n 'attributes' => array(\n 'class' => array('breadcrumb'),\n ),\n 'items' => $breadcrumb,\n 'type' => 'ol',\n ));\n }\n return $output;*/\n}", "function the_breadcrumb() {\r\n\techo '<a href=\"';\r\n\techo get_option('home');\r\n\techo '\">';\r\n\techo \"HOME\";\r\n\techo \"</a>\";\r\n\tif(is_home()){\r\n\t\techo \" &#47; <span style='font-size:12px;letter-spacing:0px;'>Welcome to Under One Roof Properties, a new generation of workspace.</span>\";\r\n\t}\r\n\tif(!is_home()) {\r\n\t\techo \" &#47; \";\r\n\t\tif (is_category() || is_single()) {\r\n\t\t\tthe_category('title_li=');\r\n\t\t\tif (is_single()) {\r\n\t\t\t\techo \" &#47; \";\r\n\t\t\t\tstrtoupper(the_title());\r\n\t\t\t}\r\n\t\t} elseif (is_page()) {\r\n\t\t\techo strtoupper(the_title());\r\n\t\t}\r\n\t}\r\n}", "function the_breadcrumb() {\r\n\tif (!is_home()) {\r\n\t\techo '<div class=\"breadcrumb\"><a href=\"';\r\n\t\techo get_option('home');\r\n\t\techo '\">'.__('Home','templatic');\r\n\t\techo \"</a>\";\r\n\t\tif (is_category() || is_single() || is_archive()) {\r\n\t\t\tthe_category('title_li=');\r\n\t\t\tif(is_archive())\r\n\t\t\t{\t\t\r\n\t\t\t\techo \" » \";\r\n\t\t\t\tsingle_cat_title();\r\n\t\t\t}\r\n\t\t\tif (is_single()) {\r\n\t\t\t\techo \" » \";\r\n\t\t\t\tthe_title();\r\n\t\t\t}\r\n\t\t} elseif (is_page()) {\r\n\t\t\techo the_title();\r\n\t\t}\t\t\r\n\t\techo \"</div>\";\r\n\t}\t\r\n}", "function wimbase_breadcrumb($variables) {\n if (module_exists('hansel')) {\n $hansel_breadcrumb = hansel_get_breadcrumbs();\n $breadcrumb = $hansel_breadcrumb['breadcrumb'];\n }\n else {\n $breadcrumb = $variables['breadcrumb'];\n }\n\n if (!empty($breadcrumb)) {\n // Provide a navigational heading to give context for breadcrumb links to\n // screen-reader users. Make the heading invisible with .element-invisible.\n $title = '<p id=\"breadcrums-nav-title\" class=\"element-invisible\">'\n . t('You are here') . '</p>';\n $output = '<nav class=\"breadcrumb\" aria-labelledby=\"breadcrums-nav-title\"\">'\n . $title . implode(' / ', $breadcrumb) . '</nav>';\n return $output;\n }\n}", "function okcdesign_breadcrumb($variables) {\n $html = theme_plugins_invoke(__FUNCTION__, $variables);\n if ($html) return $html;\n return theme_breadcrumb($variables);\n}", "function breadcrumbs(){\n global $post;\n $seperator = \"/\";\n $home = \"Home\";\n \n echo \"<ul class='breadcrumbs'>\";\n echo \"<li>You are here: </li>\";\n \n if(is_front_page()){\n echo \"<li>\" . $home . \"</li>\";\n }else{\n echo \"<li><a href=\" . get_site_url() . \">\" . $home . \"</a></li>\";\n }\n \n if(is_home() || is_single()){\n echo \"<li>\" . $seperator . \"</li>\";\n if(is_home()){\n echo \"<li>Recipe</li>\";\n }else {\n echo \"<li><a href=\" . get_post_type_archive_link('post') . \">Shop</a></li>\";\n echo \"<li>\" . $seperator . \"</li>\";\n echo \"<li>\" . $post->post_title . \"</li>\";\n }\n }\n \n if(is_page() && !is_front_page()){\n echo \"<li>\" . $seperator . \"</li>\";\n if(!empty($post->post_parent)){\n echo \"<li>\";\n echo \"<a href=\" . get_permalink($post->post_parent). \">\";\n echo get_the_title($post->post_parent);\n echo \"</a></li>\";\n echo \"<li>\" . $seperator . \"</li>\";\n }\n echo \"<li>\" . $post->post_title . \"</li>\";\n }\n \n echo \"</ul>\";\n }", "function phptemplate_breadcrumb($breadcrumb) {\n if (!empty($breadcrumb)) {\n //return '<div class=\"breadcrumb\">'. implode(' › ', $breadcrumb) .'</div>';\n }\n}", "protected function breadcrumbForList()\n {\n $breadcrumbTree = new ullPhoneBreadcrumbTree();\n $breadcrumbTree->addDefaultListEntry();\n $this->setVar('breadcrumb_tree', $breadcrumbTree, true);\n }", "protected function _generateBreadcrumb()\r\n {\r\n $links = null;\r\n $texthomelink = $this->view->translate('id_menu_home');\r\n // id_title_overseas = 'Overseas Representatives'\r\n $title = $this->view->translate('id_title_overseas');\r\n $links = array(\r\n $texthomelink => $this->view->baseUrl('/'),\r\n $title => '',\r\n );\r\n $this->view->pageTitle = $title;\r\n\r\n Zend_Registry::set('breadcrumb', $links);\r\n }", "function breadcrumbs_view($delim = '<b>&raquo;</b>') {\n\tglobal $file_name, $file, $root_filename;\n\t$temp_breadcrumb_path = '';\n\t$temp_breadcrumb_url = '';\n\t$directory_names = explode('/', $file);\n\tunset($directory_names[sizeof($directory_names)-1]);\n\tforeach($directory_names as $directory_name) {\n\t\t$temp_breadcrumb_path .= $directory_name.'/';\n\t\t$temp_breadcrumb_url = substr($temp_breadcrumb_path, 0, -1);\n\t\t$temp_breadcrumb .= $delim.' <a href=\"'.url($temp_breadcrumb_url,'dir').'\">'.$directory_name.'</a> ';\n\t}\n\treturn \"<a href=\\\"\".url('home', 'dir').\"\\\">Home</a> $temp_breadcrumb $delim <b>$file_name</b>\";\n}", "function dimox_breadcrumbs() {\n\t\t$text['home'] = 'Home'; // text for the 'Home' link\n\t\t$text['category'] = '%s'; // text for a category page\n\t\t$text['search'] = 'Wyniki wyszukiwania dla \"%s\"'; // text for a search results page\n\t\t$text['404'] = 'Błąd 404'; // text for the 404 page\n\t\t$text['page'] = '%s'; // text 'Page N'\n\t\t$text['cpage'] = 'Comment Page %s'; // text 'Comment Page N'\n\t\t$wrap_before = '<div class=\"breadcrumbs\" itemscope itemtype=\"htt://schema.org/BreadCrumbList\">'; // the opening wrapper tag\n\t\t$wrap_after = '</div><!-- .breadcrumbs -->'; // the closing wrapper tag\n\t\t$sep = '›'; // separator between crumbs\n\t\t$sep_before = '<span class=\"sep\">'; // tag before separator\n\t\t$sep_after = '</span>'; // tag after separator\n\t\t$show_home_link = 1; // 1 - show the 'Home' link, 0 - don't show\n\t\t$show_on_home = 0; // 1 - show breadcrumbs on the homepage, 0 - don't show\n\t\t$show_current = 1; // 1 - show current page title, 0 - don't show\n\t\t$before = '<span class=\"current\">'; // tag before the current crumb\n\t\t$after = '</span>'; // tag after the current crumb\n\t\t/* === END OF OPTIONS === */\n\t\tglobal $post;\n\t\t$home_link = home_url('/');\n\t\t$link_before = '<span itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\">';\n\t\t$link_after = '</span>';\n\t\t$link_attr = ' itemprop=\"url\"';\n\t\t$link_in_before = '<span itemprop=\"title\">';\n\t\t$link_in_after = '</span>';\n\t\t$link = $link_before . '<a href=\"%1$s\"' . $link_attr . '>' . $link_in_before . '%2$s' . $link_in_after . '</a>' . $link_after;\n\t\t$frontpage_id = get_option('page_on_front');\n\t\t$parent_id = $post->post_parent;\n\t\t$sep = ' ' . $sep_before . $sep . $sep_after . ' ';\n\t\tif (is_home() || is_front_page()) {\n\t\t\tif ($show_on_home) echo $wrap_before . '<a href=\"' . $home_link . '\">' . $text['home'] . '</a>' . $wrap_after;\n\t\t} else {\n\t\t\techo $wrap_before;\n\t\t\tif ($show_home_link) echo sprintf($link, $home_link, $text['home']);\n\t\t\tif ( is_category() ) {\n\t\t\t\t$cat = get_category(get_query_var('cat'), false);\n\t\t\t\tif ($cat->parent != 0) {\n\t\t\t\t\t$cats = get_category_parents($cat->parent, TRUE, $sep);\n\t\t\t\t\t$cats = preg_replace(\"#^(.+)$sep$#\", \"$1\", $cats);\n\t\t\t\t\t$cats = preg_replace('#<a([^>]+)>([^<]+)<\\/a>#', $link_before . '<a$1' . $link_attr .'>' . $link_in_before . '$2' . $link_in_after .'</a>' . $link_after, $cats);\n\t\t\t\t\tif ($show_home_link) echo $sep;\n\t\t\t\t\techo $cats;\n\t\t\t\t}\n\t\t\t\tif ( get_query_var('paged') ) {\n\t\t\t\t\t$cat = $cat->cat_ID;\n\t\t\t\t\techo $sep . sprintf($link, get_category_link($cat), get_cat_name($cat)) . $sep . $before . sprintf($text['page'], get_query_var('paged')) . $after;\n\t\t\t\t} else {\n\t\t\t\t\tif ($show_current) echo $sep . $before . sprintf($text['category'], single_cat_title('', false)) . $after;\n\t\t\t\t}\n\t\t\t} elseif ( is_search() ) {\n\t\t\t\tif (have_posts()) {\n\t\t\t\t\tif ($show_home_link && $show_current) echo $sep;\n\t\t\t\t\tif ($show_current) echo $before . sprintf($text['search'], get_search_query()) . $after;\n\t\t\t\t} else {\n\t\t\t\t\tif ($show_home_link) echo $sep;\n\t\t\t\t\techo $before . sprintf($text['search'], get_search_query()) . $after;\n\t\t\t\t}\n\t\t\t} elseif ( is_single() && !is_attachment() ) {\n\t\t\t\tif ($show_home_link) echo $sep;\n\t\t\t\tif ( get_post_type() != 'post' ) {\n\t\t\t\t\t$post_type = get_post_type_object(get_post_type());\n\t\t\t\t\t$slug = $post_type->rewrite;\n\t\t\t\t\tprintf($link, $home_link . $slug['slug'] . '/', $post_type->labels->singular_name);\n\t\t\t\t\tif ($show_current) echo $sep . $before . get_the_title() . $after;\n\t\t\t\t} else {\n\t\t\t\t\t$cat = get_the_category(); $cat = $cat[0];\n\t\t\t\t\t$cats = get_category_parents($cat, TRUE, $sep);\n\t\t\t\t\tif (!$show_current || get_query_var('cpage')) $cats = preg_replace(\"#^(.+)$sep$#\", \"$1\", $cats);\n\t\t\t\t\t$cats = preg_replace('#<a([^>]+)>([^<]+)<\\/a>#', $link_before . '<a$1' . $link_attr .'>' . $link_in_before . '$2' . $link_in_after .'</a>' . $link_after, $cats);\n\t\t\t\t\techo $cats;\n\t\t\t\t\tif ( get_query_var('cpage') ) {\n\t\t\t\t\t\techo $sep . sprintf($link, get_permalink(), get_the_title()) . $sep . $before . sprintf($text['cpage'], get_query_var('cpage')) . $after;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ($show_current) echo $before . get_the_title() . $after;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t// custom post type\n\t\t\t} elseif ( !is_single() && !is_page() && get_post_type() != 'post' && !is_404() ) {\n\t\t\t\t$post_type = get_post_type_object(get_post_type());\n\t\t\t\tif ( get_query_var('paged') ) {\n\t\t\t\t\techo $sep . sprintf($link, get_post_type_archive_link($post_type->name), $post_type->label) . $sep . $before . sprintf($text['page'], get_query_var('paged')) . $after;\n\t\t\t\t} else {\n\t\t\t\t\tif ($show_current) echo $sep . $before . $post_type->label . $after;\n\t\t\t\t}\n\t\t\t} elseif ( is_page() && !$parent_id ) {\n\t\t\t\tif ($show_current) echo $sep . $before . get_the_title() . $after;\n\t\t\t} elseif ( is_page() && $parent_id ) {\n\t\t\t\tif ($show_home_link) echo $sep;\n\t\t\t\tif ($parent_id != $frontpage_id) {\n\t\t\t\t\t$breadcrumbs = array();\n\t\t\t\t\twhile ($parent_id) {\n\t\t\t\t\t\t$page = get_page($parent_id);\n\t\t\t\t\t\tif ($parent_id != $frontpage_id) {\n\t\t\t\t\t\t\t$breadcrumbs[] = sprintf($link, get_permalink($page->ID), get_the_title($page->ID));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$parent_id = $page->post_parent;\n\t\t\t\t\t}\n\t\t\t\t\t$breadcrumbs = array_reverse($breadcrumbs);\n\t\t\t\t\tfor ($i = 0; $i < count($breadcrumbs); $i++) {\n\t\t\t\t\t\techo $breadcrumbs[$i];\n\t\t\t\t\t\tif ($i != count($breadcrumbs)-1) echo $sep;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($show_current) echo $sep . $before . get_the_title() . $after;\n\t\t\t} elseif ( is_404() ) {\n\t\t\t\tif ($show_home_link && $show_current) echo $sep;\n\t\t\t\tif ($show_current) echo $before . $text['404'] . $after;\n\t\t\t} elseif ( has_post_format() && !is_singular() ) {\n\t\t\t\tif ($show_home_link) echo $sep;\n\t\t\t\techo get_post_format_string( get_post_format() );\n\t\t\t}\n\t\t\techo $wrap_after;\n\t\t}\n\t}", "function x_breadcrumbs() {\n\n\tif ( x_get_option( 'x_breadcrumb_display', '1' ) ) {\n\n\t GLOBAL $post;\n\n\t $is_ltr = ! is_rtl();\n\t $stack = x_get_stack();\n\t $delimiter = x_get_breadcrumb_delimiter();\n\t $home_text = x_get_breadcrumb_home_text();\n\t $home_link = home_url();\n\t $current_before = x_get_breadcrumb_current_before();\n\t $current_after = x_get_breadcrumb_current_after();\n\t $page_title = get_the_title();\n\t $blog_title = get_the_title( get_option( 'page_for_posts', true ) );\n\n\t if ( ! is_404() ) {\n\t\t$post_parent = $post->post_parent;\n\t } else {\n\t\t$post_parent = '';\n\t }\n\n\t if ( X_WOOCOMMERCE_IS_ACTIVE ) {\n\t\t//$shop_url = x_get_shop_link();\n\t\t$shop_url = home_url() . 'products';\n\t\t$shop_title = x_get_option( 'x_' . $stack . '_shop_title', __( 'The Shop', '__x__' ) );\n\t\t$shop_link = '<a href=\"'. $shop_url .'\">' . $shop_title . '</a>';\n\t }\n\n\t echo '<div class=\"x-breadcrumbs\"><a href=\"' . $home_link . '\">' . $home_text . '</a>' . $delimiter;\n\n\t\tif ( is_home() ) {\n\n\t\t echo $current_before . $blog_title . $current_after;\n\n\t\t} elseif ( is_category() ) {\n\n\t\t $the_cat = get_category( get_query_var( 'cat' ), false );\n\t\t if ( $the_cat->parent != 0 ) echo get_category_parents( $the_cat->parent, TRUE, $delimiter );\n\t\t echo $current_before . single_cat_title( '', false ) . $current_after;\n\n\t\t} elseif ( x_is_product_category() ) {\n\t\t\n\t\t $the_cat = get_queried_object();\n\t\t if ( $the_cat->parent != 0 ) echo x_get_taxonomy_parents( $the_cat->parent, $the_cat->taxonomy, TRUE, $delimiter );\n\t\t echo $current_before . single_cat_title( '', false ) . $current_after;\n\t\t\n\t\t /*\n\t\t if ( $is_ltr ) {\n\t\t\techo $shop_link . $delimiter . $current_before . single_cat_title( '', false ) . $current_after;\n\t\t } else {\n\t\t\techo $current_before . single_cat_title( '', false ) . $current_after . $delimiter . $shop_link;\n\t\t }\n\t\t */\n\t\t\n\t\t} elseif ( x_is_product_tag() ) {\n\n\t\t if ( $is_ltr ) {\n\t\t\techo $shop_link . $delimiter . $current_before . single_tag_title( '', false ) . $current_after;\n\t\t } else {\n\t\t\techo $current_before . single_tag_title( '', false ) . $current_after . $delimiter . $shop_link;\n\t\t }\n\n\t\t} elseif ( is_search() ) {\n\n\t\t echo $current_before . __( 'Search Results for ', '__x__' ) . '&#8220;' . get_search_query() . '&#8221;' . $current_after;\n\n\t\t} elseif ( is_singular( 'post' ) ) {\n\n\t\t if ( get_option( 'page_for_posts' ) == is_front_page() ) {\n\t\t\techo $current_before . $page_title . $current_after;\n\t\t } else {\n\t\t\tif ( $is_ltr ) {\n\t\t\t echo '<a href=\"' . get_permalink( get_option( 'page_for_posts' ) ) . '\">' . $blog_title . '</a>' . $delimiter . $current_before . $page_title . $current_after;\n\t\t\t} else {\n\t\t\t echo $current_before . $page_title . $current_after . $delimiter . '<a href=\"' . get_permalink( get_option( 'page_for_posts' ) ) . '\">' . $blog_title . '</a>';\n\t\t\t}\n\t\t }\n\n\t\t} elseif ( x_is_portfolio() ) {\n\n\t\t echo $current_before . get_the_title() . $current_after;\n\n\t\t} elseif ( x_is_portfolio_item() ) {\n\n\t\t $link = x_get_parent_portfolio_link();\n\t\t $title = x_get_parent_portfolio_title();\n\n\t\t if ( $is_ltr ) {\n\t\t\techo '<a href=\"' . $link . '\">' . $title . '</a>' . $delimiter . $current_before . $page_title . $current_after;\n\t\t } else {\n\t\t\techo $current_before . $page_title . $current_after . $delimiter . '<a href=\"' . $link . '\">' . $title . '</a>';\n\t\t }\n\n\t\t} elseif ( x_is_product() ) {\n\n\t\t if ( $is_ltr ) {\n\t\t\techo $shop_link . $delimiter . $current_before . $page_title . $current_after;\n\t\t } else {\n\t\t\techo $current_before . $page_title . $current_after . $delimiter . $shop_link;\n\t\t }\n\t\t \n\t\t} elseif ( x_is_buddypress() ) {\n\n\t\t if ( bp_is_group() ) {\n\t\t\techo '<a href=\"' . bp_get_groups_directory_permalink() . '\">' . x_get_option( 'x_buddypress_groups_title', __( 'Groups', '__x__' ) ) . '</a>' . $delimiter . $current_before . x_buddypress_get_the_title() . $current_after;\n\t\t } elseif ( bp_is_user() ) {\n\t\t\techo '<a href=\"' . bp_get_members_directory_permalink() . '\">' . x_get_option( 'x_buddypress_members_title', __( 'Members', '__x__' ) ) . '</a>' . $delimiter . $current_before . x_buddypress_get_the_title() . $current_after;\n\t\t } else {\n\t\t\techo $current_before . x_buddypress_get_the_title() . $current_after;\n\t\t }\n\n\t\t} elseif ( x_is_bbpress() ) {\n\n\t\t remove_filter( 'bbp_no_breadcrumb', '__return_true' );\n\n\t\t if ( bbp_is_forum_archive() ) {\n\t\t\techo $current_before . bbp_get_forum_archive_title() . $current_after;\n\t\t } else {\n\t\t\techo bbp_get_breadcrumb();\n\t\t }\n\n\t\t add_filter( 'bbp_no_breadcrumb', '__return_true' );\n\n\t\t} elseif ( is_page() && ! $post_parent ) {\n\n\t\t echo $current_before . $page_title . $current_after;\n\n\t\t} elseif ( is_page() && $post_parent ) {\n\n\t\t $parent_id = $post_parent;\n\t\t $breadcrumbs = array();\n\n\t\t if ( is_rtl() ) {\n\t\t\techo $current_before . $page_title . $current_after . $delimiter;\n\t\t }\n\n\t\t while ( $parent_id ) {\n\t\t\t$page = get_page( $parent_id );\n\t\t\t$breadcrumbs[] = '<a href=\"' . get_permalink( $page->ID ) . '\">' . get_the_title( $page->ID ) . '</a>';\n\t\t\t$parent_id = $page->post_parent;\n\t\t }\n\n\t\t if ( $is_ltr ) {\n\t\t\t$breadcrumbs = array_reverse( $breadcrumbs );\n\t\t }\n\n\t\t for ( $i = 0; $i < count( $breadcrumbs ); $i++ ) {\n\t\t\techo $breadcrumbs[$i];\n\t\t\tif ( $i != count( $breadcrumbs ) -1 ) echo $delimiter;\n\t\t }\n\n\t\t if ( $is_ltr ) {\n\t\t\techo $delimiter . $current_before . $page_title . $current_after;\n\t\t }\n\n\t\t} elseif ( is_tag() ) {\n\n\t\t echo $current_before . single_tag_title( '', false ) . $current_after;\n\n\t\t} elseif ( is_author() ) {\n\n\t\t GLOBAL $author;\n\t\t $userdata = get_userdata( $author );\n\t\t echo $current_before . __( 'Posts by ', '__x__' ) . '&#8220;' . $userdata->display_name . $current_after . '&#8221;';\n\n\t\t} elseif ( is_404() ) {\n\n\t\t echo $current_before . __( '404 (Page Not Found)', '__x__' ) . $current_after;\n\n\t\t} elseif ( is_archive() ) {\n\n\t\t if ( x_is_shop() ) {\n\t\t\techo $current_before . $shop_title . $current_after;\n\t\t } else {\n\t\t\techo $current_before . __( 'Archives ', '__x__' ) . $current_after;\n\t\t }\n\n\t\t}\n\n\t echo '</div>';\n\n\t}\n}", "function the_breadcrumb() {\n global $post;\n echo '<ol class=\"breadcrumb\">';\n if (!is_home()) {\n echo '<li><a href=\"';\n echo get_option('home');\n echo '\">';\n echo 'Home';\n echo '</a></li>';\n if (is_category() || is_single()) {\n echo '<li>';\n the_category('</li><li> ');\n if (is_single()) {\n echo '</li><li>';\n the_title();\n echo '</li>';\n }\n } elseif (is_page()) {\n if($post->post_parent){\n $anc = get_post_ancestors( $post->ID );\n $title = get_the_title();\n foreach ( $anc as $ancestor ) {\n $output = '<li><a href=\"'.get_permalink($ancestor).'\" title=\"'.get_the_title($ancestor).'\">'.get_the_title($ancestor).'</a></li>';\n }\n echo $output;\n echo '<strong title=\"'.$title.'\"> '.$title.'</strong>';\n } else {\n echo '<li><strong>'.get_the_title().'</strong></li>';\n }\n }\n }\n elseif (is_tag()) {single_tag_title();}\n elseif (is_day()) {echo\"<li>Archive for \"; the_time('F jS, Y'); echo'</li>';}\n elseif (is_month()) {echo\"<li>Archive for \"; the_time('F, Y'); echo'</li>';}\n elseif (is_year()) {echo\"<li>Archive for \"; the_time('Y'); echo'</li>';}\n elseif (is_author()) {echo\"<li>Author Archive\"; echo'</li>';}\n elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {echo \"<li>Blog Archives\"; echo'</li>';}\n elseif (is_search()) {echo\"<li>Search Results\"; echo'</li>';}\n echo '</ol>';\n}", "function open_omega_breadcrumb($vars) {\n $breadcrumb = $vars['breadcrumb'];\n\n if (!empty($breadcrumb)) {\n // Provide a navigational heading to give context for breadcrumb links to\n // screen-reader users. Make the heading invisible with .element-invisible.\n $output = '<h2 class=\"element-invisible\">' . t('You are here') . '</h2>';\n\n $output .= '<div class=\"breadcrumb\">' . implode(' » ', $breadcrumb) . '</div>';\n return $output;\n }\n}", "function simple_breadcrumb() {\n global $post;\n global $staticVars;\n // print_r(has_term($staticVars['industryNewTypeID'], 'new-type', $post));exit;\n $sep = ' / ';\n\techo '<a href=\"'.pll_home_url().'\">'.pll__('Lietuvos kino centras').'</a>'.$sep;\n\t//echo '<a href=\"'.pll_home_url().'\">'.get_bloginfo('name').'</a>'.$sep;\n\n/*\tif ( is_category() || is_single() ) {\n\t\tthe_category(', ');\n\t\tif ( is_single() ) {\n\t\t\techo $sep;\n\t\t\tthe_title();\n\t\t}*/\n\n\tif (is_single()) {\n\t\tif(get_post_type() == 'post'){\n\t\t\tif(has_term($staticVars['industryNewTypeID'], 'new-type', $post)){\n\t\t\t\t$news_link = $staticVars['industryNewsUrl'];\n\t\t\t\t$news_link_text = pll__('Industrijos naujienos');\n\t\t\t} else {\n\t\t\t\t$news_link = $staticVars['newsUrl'];\n\t\t\t\t$news_link_text = pll__('Naujienos');\n\t\t\t}\n\t\t\techo '<a href=\"'.$news_link.'\">';\n\t\t\techo $news_link_text;\n\t\t\techo \"</a>\";\n\t\t} elseif(get_post_type() == 'interesting-fact') {\n\n\t\t\t$pages = get_pages(array(\n\t\t\t 'meta_key' => '_wp_page_template',\n\t\t\t 'meta_value' => 'page-templates/interesting_facts.php',\n\t\t\t 'lang' => pll_current_language('slug')\n\t\t\t //'hierarchical' => 0\n\t\t\t));\n\t\t\t//print_r($pages);\n\n\t\t\techo '<a href=\"'.get_permalink($pages[0]->ID).'\">';\n\t\t\tpll_e('Įdomūs faktai');\n\t\t\techo \"</a>\";\n\t\t} elseif(get_post_type() == 'tribe_events'){\n\t\t\t$url = $staticVars['eventsUrl'];\n\t\t\techo '<a href=\"'.$url.'\">'.pll__('Renginiai').'</a>';\n\t\t} elseif(get_post_type() == 'education-resource'){\n\t\t\t$url = $staticVars['educationResourceUrl'];\n\t\t\t$title = get_the_title(kcsite_getPageByTempate('education_list.php'));\n\t\t\techo '<a href=\"'.$url.'\">'.$title.'</a>';\n\t\t} elseif(get_post_type() == 'film'){\n $url = get_permalink($staticVars['filmRegisterSearchPageId']);\n $title = get_the_title($staticVars['filmRegisterSearchPageId']);\n echo '<a href=\"'.$url.'\">'.$title.'</a>';\n } elseif(get_post_type() == 'lithfilm'){\n\t\t\t$url = get_permalink($staticVars['lithuanianFilmsSearchPageId']);\n\t\t\t$title = get_the_title($staticVars['lithuanianFilmsSearchPageId']);\n\t\t\techo '<a href=\"'.$url.'\">'.$title.'</a>';\n\t\t}\n\t\techo $sep;\n\t\tthe_title();\n\n\t} elseif(!is_single() && get_post_type() == 'tribe_events'){ //event calendar view\n\t\tpll_e('Renginiai');\n\t} elseif ( is_page() && $post->post_parent ) {\n\t\t\n\t\t//checkiing home page is not needed, but dos make no difference, so left\n\t\t$home = get_page_by_title('home');\n\t\t//show all ancestors (parent pages)\n\t\tfor ($i = count($post->ancestors)-1; $i >= 0; $i--) {\n\t\t\tif (($home->ID) != ($post->ancestors[$i])) {\n\t\t\t\techo '<a href=\"';\n\t\t\t\techo get_permalink($post->ancestors[$i]); \n\t\t\t\techo '\">';\n\t\t\t\techo get_the_title($post->ancestors[$i]);\n\t\t\t\techo \"</a>\".$sep;\n\t\t\t}\n\t\t}\n\t\techo the_title();\n\t} elseif (is_page()) {\n\t\techo the_title();\n\t} elseif (is_404()) {\n\t\techo of_get_option_by_lang('kcsite_404_page_title');\n\t}\n}", "function Breadcrumb2010 () {\n$pathinfo = $_SERVER[REQUEST_URI];\n$divider = \">\";\n$pre_path = \"/docs\";\n$more_path= \"/\";\n$pathinfo = chop ($pathinfo, \"/\");\n$path = split (\"/\", $pathinfo);\n print \"<span class=\\\"crumb\\\"><a href=\\\"/lib/\\\">Library Homepage</a></span>\";\n $count = count($path);\n $less = $count-1;\n\n \nif (preg_match(\"/^index\\./\",\"$path[$less]\",$matches)) \n {\n array_pop($path);\n // $count = $count-2;\n $count = count($path);\n } \n\n for ($i=1; $i<$count; $i++) {\n $dir = $path[$i];\n $fn = \"$pre_path$more_path$dir/breadcrumb.data\";\n if (file_exists($fn)) {\n if ($file = fopen(\"$fn\", \"r\")) {\n\t$line=fgetss($file,255);\n\tif (preg_match(\"/\\\"(.+)\\\"/\",$line,$matches)) { \n\t $line = preg_replace(\"/\\s+/\",\"&nbsp;\",$matches[1]); \n\t}\n\tprint \" $divider <span class=\\\"crumb\\\"><a href=\\\"$more_path$dir/\\\">$line</a></span>\";\n\tfclose($file);\n } // end if file opens\n } //end if file exists\n $more_path .= \"$dir/\";\n } // end for\n}", "function YOUR_THEME_easy_breadcrumb($variables) {\n\n $breadcrumb = $variables['breadcrumb'];\n $segments_quantity = $variables['segments_quantity'];\n\n $breadcrumb_items = [];\n $link_options = [\n 'attributes' => [\n 'class' => [\n 'ecl-breadcrumbs__link',\n ],\n ],\n 'html' => TRUE\n ];\n $breadcrumb_items = [];\n $menu_breadcrumb = menu_tree_page_data('menu-breadcrumb-menu');\n $i = 0;\n foreach ($menu_breadcrumb as $item) {\n $breadcrumb_item = [\n 'data' => l($item['link']['link_title'], $item['link']['link_path'], $link_options),\n 'class' => [\n 'ecl-breadcrumbs__segment',\n ],\n ];\n if ($i == 0) {\n $breadcrumb_item['class'][] = 'ecl-breadcrumbs__segment--first';\n }\n $breadcrumb_items[] = $breadcrumb_item;\n $i++;\n }\n\n if ($segments_quantity > 0) {\n\n for ($i = 0, $s = $segments_quantity - 1; $i < $segments_quantity; ++$i) {\n $it = $breadcrumb[$i];\n $content = decode_entities($it['content']);\n if (isset($it['url'])) {\n $breadcrumb_item = [\n 'data' => l($content, $it['url'], $link_options),\n 'class' => [\n 'ecl-breadcrumbs__segment',\n ],\n ];\n } else {\n $breadcrumb_item = [\n 'data' => filter_xss($content),\n 'class' => [\n 'ecl-breadcrumbs__segment',\n ],\n ];\n }\n if ($i == $segments_quantity) {\n $breadcrumb_item['class'][] = 'ecl-breadcrumbs__segment--last';\n }\n\n $breadcrumb_items[] = $breadcrumb_item;\n }\n }\n\n $items = [\n 'items' => $breadcrumb_items,\n 'type' => 'ol',\n 'attributes' => [\n 'class' => [\n 'ecl-breadcrumbs__segments-wrapper',\n ],\n ],\n ];\n\n return theme('item_list', $items);\n}", "function minorite_breadcrumb($variables) {\n $breadcrumb = $variables['breadcrumb'];\n\n if (!empty($breadcrumb)) {\n return '<ul class=\"nav\"><li>' . implode('</li><li>', $breadcrumb) . '</li></ul>';\n }\n}", "function shop_breadcrumb($variables) {\n $breadcrumb = $variables['breadcrumb'];\n\n if (!empty($breadcrumb)) {\n // Provide a navigational heading to give context for breadcrumb links to\n // screen-reader users. Make the heading invisible with .element-invisible.\n $output = '<h2 class=\"element-invisible\">' . t('You are here') . '</h2>';\n\n $output .= '<div class=\"breadcrumb\">' . implode(' › ', $breadcrumb) . '</div>';\n return $output;\n }\n}", "function megatron_ubc_clf_breadcrumbs($variables) {\n $title = drupal_set_title();\n $output = '';\n $output .= '<ul class=\"breadcrumb expand\">';\n\n if (theme_get_setting('clf_crumbumbrellaunit')) {\n $output .= '<li><a href=\"' . theme_get_setting('clf_crumbumbrellawebsite') . '\">' . theme_get_setting('clf_crumbumbrellaunit') . '</a><span class=\"divider\">/</span>';\n }\n if (theme_get_setting('clf_crumbunit')) {\n $output .= '<li><a href=\"' . theme_get_setting('clf_crumbwebsite') . '\">' . theme_get_setting('clf_crumbunit') . '</a><span class=\"divider\">/</span>';\n }\n $output .= '<li>' . $title . '</li></ul>';\n return $output;\n}", "function breadcrumb_navigation( $page, $ref = array() ){\n\t$breadcrumb = $ref;\n\tif( !count( $breadcrumb ) ){\n\t\tarray_unshift( $breadcrumb, array( $page->post_title ) );\n\t} else {\n\t\tarray_unshift( $breadcrumb, array( $page->post_title, get_permalink( $page->ID ) ) );\n\t}\n\tif( $page->post_parent ){\n\t\tbreadcrumb_navigation( get_page( $page->post_parent ), $breadcrumb );\n\t\treturn;\n\t} else {\n\t\t/// process the breadcrumb\n\t\t$output = '<li class=\"home\"><a href=\"' . get_home_url() . '\">' . __( 'Home', '_supply_ontario' ) . '</a></li>';\n\t\tfor( $q = 0; $q < count( $breadcrumb ); ++$q ){\n\t\t\tif( count( $breadcrumb[$q] ) > 1 ){\n\t\t\t\t$output .= '<li><a href=\"' . $breadcrumb[$q][1] . '\">' . $breadcrumb[$q][0] . '</a></li>';\n\t\t\t} else {\n\t\t\t\t$output .= '<li class=\"current\">' . $breadcrumb[$q][0] . '</li>';\n\t\t\t}\n\t\t}\n\t\techo '<ul class=\"breadcrumb\">' . $output . '</ul>';\n\t}\n}", "function Breadcrumb ($pathinfo) {\n if (strlen($pathinfo)<1) { $pathinfo = $REQUEST_URI; } \n $divider = \">>\";\n print \"<p id=\\\"breadcrumbs\\\" style=\\\"clear: both; margin-left: 8ex; text-indent:-8ex\\\">\\n\";\n $pre_path = \"/docs\";\n $more_path= \"/\";\n $path = split (\"/\", $pathinfo);\n print \"Return to: <a href=\\\"/lib/\\\">Library Homepage</a>\";\n \n $count = count($path);\n $less = $count-1;\n \n if (preg_match(\"/^index\\./\",\"$path[$less]\",$matches)) {\n array_pop($path);\n // $count = $count-2;\n $count = count($path);\n } \n /*\n print \"<!-- COUNT ME: $count -->\";\n print \"<!--\";\n print_r($path);\n print \"-->\";\n */\n\n for ($i=1; $i<$count; $i++) {\n $dir = $path[$i];\n $fn = \"$pre_path$more_path$dir/breadcrumb.data\";\n if (file_exists($fn)) {\n if ($file = fopen(\"$fn\", \"r\")) {\n\t$line=fgetss($file,255);\n\tif (preg_match(\"/\\\"(.+)\\\"/\",$line,$matches)) { \n\t $line = preg_replace(\"/\\s+/\",\"&nbsp;\",$matches[1]); \n\t}\n\tprint \" $divider <a href=\\\"$more_path$dir/\\\">$line</a>\";\n\tfclose($file);\n } // end if file opens\n } //end if file exists\n $more_path .= \"$dir/\";\n } // end for\n}", "function print_breadcrumb() {\n\t?>\n\t<div class=\"breadcrumb-wrapper\">\n\t\t<nav aria-label=\"breadcrumb\">\n\t\t\t<ol class=\"breadcrumb\">\n\t\t\t\t<li class=\"breadcrumb-item\"><a href=\"<?php echo esc_url( site_url() ); ?>\">Home</a></li>\n\t\t\t\t<?php if ( is_page() ) : ?>\n\t\t\t\t\t<?php the_title( '<li class=\"breadcrumb-item active\">', '</li>' ); ?>\n\t\t\t\t<?php elseif ( is_home() ) : ?>\n\t\t\t\t\t<li class=\"breadcrumb-item active\">Insights</li>\n\t\t\t\t<?php elseif ( is_singular( 'post' ) ) : ?>\n\t\t\t\t\t<li class=\"breadcrumb-item\"><a href=\"<?php echo esc_url( get_permalink( get_option( 'page_for_posts' ) ) ); ?>\">Insights</a></li>\n\t\t\t\t\t<?php the_title( '<li class=\"breadcrumb-item active\">', '</li>' ); ?>\n\t\t\t\t<?php elseif ( is_singular( 'service' ) ) : ?>\n\t\t\t\t\t<?php $term = get_the_terms( get_the_ID(), 'service-category' )[0]; ?>\n\t\t\t\t\t<li class=\"breadcrumb-item active\">\n\t\t\t\t\t\t<?php echo wp_kses_post( $term->name ); ?>\n\t\t\t\t\t</li>\n\t\t\t\t<?php elseif ( is_singular() ) : ?>\n\t\t\t\t\t<?php\n\t\t\t\t\tglobal $post;\n\t\t\t\t\t$post_type = get_post_type( $post );\n\t\t\t\t\t$post_type_object = get_post_type_object( $post_type );\n\t\t\t\t\t?>\n\t\t\t\t\t<li class=\"breadcrumb-item\">\n\t\t\t\t\t\t<a href=\"<?php echo esc_url( get_post_type_archive_link( $post_type ) ); ?>\">\n\t\t\t\t\t\t\t<?php echo wp_kses_post( $post_type_object->label ); ?>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</li>\n\t\t\t\t\t<?php the_title( '<li class=\"breadcrumb-item active\">', '</li>' ); ?>\n\t\t\t\t<?php elseif ( is_tax() ) : ?>\n\t\t\t\t\t<li class=\"breadcrumb-item active\">\n\t\t\t\t\t\t<?php echo wp_kses_post( get_queried_object()->name ); ?>\n\t\t\t\t\t</li>\n\t\t\t\t<?php endif; ?>\n\t\t\t</ol>\n\t\t</nav>\n\t</div>\n\t<?php\n}", "function phptemplate_breadcrumb($breadcrumb) {\n if (!empty($breadcrumb)) {\n return '<div class=\"breadcrumb\">'. implode(' › ', $breadcrumb) .'</div>';\n }\n}", "function phptemplate_breadcrumb($breadcrumb) {\n if (!empty($breadcrumb)) {\n return '<div class=\"breadcrumb\">'. implode(' › ', $breadcrumb) .'</div>';\n }\n}", "function phptemplate_breadcrumb($breadcrumb) {\n if (!empty($breadcrumb)) {\n return '<div class=\"breadcrumb\">' . implode(' › ', $breadcrumb) . '</div>';\n }\n}", "private function buildBreadCrumb() {\n if (is_array($this->breadcrumb)) {\n foreach ($this->breadcrumb as $index => $value) {\n $breadcrumb .= ! is_null($breadcrumb) ? \"<li>&#8250;&nbsp;</li>\" : NULL;\n if (is_string($index))\n $breadcrumb .= sprintf(\"<li><a class='current_page' href='%s' title='%s' alt='%s'>%s</a></li>\", $value, $index, $index, $index);\n else\n $breadcrumb .= sprintf(\"<li>%s</li>\", $value);\n }\n }\n return $breadcrumb;\n }", "public function getBreadcrumb() \r\n {\r\n if(!empty($this->_current_cms_seo)) {\r\n return isset($this->_current_cms_seo['breadcrumb']) ? $this->_current_cms_seo['breadcrumb'] : '';\r\n }\r\n }", "function breadcrumbs($separator = ' &raquo; ', $home = 'Home') {\n $path = array_filter(explode('/', parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)));\n\n // This will build our \"base URL\" ... Also accounts for HTTPS :)\n $base = ($_SERVER['HTTPS'] ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . '/';\n\n // Initialize a temporary array with our breadcrumbs. (starting with our home page, which I'm assuming will be the base URL)\n $breadcrumbs = array(\"<a href=\\\"$base\\\">$home</a>\");\n\n // Initialize crumbs to track path for proper link\n $crumbs = '';\n\n // Find out the index for the last value in our path array\n $last = @end(array_keys($path));\n\n // Build the rest of the breadcrumbs\n foreach ($path as $x => $crumb) {\n // Our \"title\" is the text that will be displayed (strip out .php and turn '_' into a space)\n $title = ucwords(str_replace(array('.php', '_', '%20'), array('', ' ', ' '), $crumb));\n\n // If we are not on the last index, then display an <a> tag\n if ($x != $last) {\n $breadcrumbs[] = \"<a href=\\\"$base$crumbs$crumb\\\">$title</a>\";\n $crumbs .= $crumb . '/';\n }\n // Otherwise, just display the title (minus)\n else {\n $breadcrumbs[] = $title;\n }\n\n }\n\n // Build our temporary array (pieces of bread) into one big string :)\n return implode($separator, $breadcrumbs);\n}", "function breadcrumbs($separator = ' &raquo; ', $home = 'Home') {\n\t // This gets the REQUEST_URI (/path/to/file.php), splits the string (using '/') into an array, and then filters out any empty values\n\t $path = array_filter(explode('/', parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)));\n\t //pre($path);\n\t // This will build our \"base URL\" ... Also accounts for HTTPS :)\n\t $base = base_url();\n\t \n\t // Initialize a temporary array with our breadcrumbs. (starting with our home page, which I'm assuming will be the base URL)\n\t $breadcrumbs = Array(\"<a href=\\\"$base\\\">$home</a>\");\n\t \n\t // Find out the index for the last value in our path array\n\t $last = end(array_keys($path));\n\t \n\t // Build the rest of the breadcrumbs\n\t foreach ($path AS $x => $crumb) {\n\t // Our \"title\" is the text that will be displayed (strip out .php and turn '_' into a space)\n\t $title = ucwords(str_replace(Array('.php', '_'), Array('', ' '), $crumb));\n\t \n\t // If we are not on the last index, then display an <a> tag\n\t if ($x != $last)\n\t $breadcrumbs[] = \"<a href=\\\"$base$crumb\\\">$title</a>\";\n\t // Otherwise, just display the title (minus)\n\t else\n\t $breadcrumbs[] = $title;\n\t }\n\t \n\t // Build our temporary array (pieces of bread) into one big string :)\n\t return implode($separator, $breadcrumbs);\n\t}", "function apoc_breadcrumbs( $args = array() ) {\n\t$crumbs = new Apoc_Breadcrumbs( $args );\n\techo $crumbs->crumbs;\n}", "function gwt_drupal_breadcrumb($variables) {\n $breadcrumb = $variables['breadcrumb'];\n $output = '';\n\n // Determine if we are to display the breadcrumb.\n $show_breadcrumb = theme_get_setting('gwt_drupal_breadcrumb');\n if ($show_breadcrumb == 'yes' || $show_breadcrumb == 'admin' && arg(0) == 'admin') {\n\n // Optionally get rid of the homepage link.\n $show_breadcrumb_home = theme_get_setting('gwt_drupal_breadcrumb_home');\n if (!$show_breadcrumb_home) {\n array_shift($breadcrumb);\n }\n\n // Return the breadcrumb with separators.\n if (!empty($breadcrumb)) {\n $breadcrumb_separator = filter_xss_admin(theme_get_setting('gwt_drupal_breadcrumb_separator'));\n $trailing_separator = $title = '';\n if (theme_get_setting('gwt_drupal_breadcrumb_title')) {\n $item = menu_get_item();\n if (!empty($item['tab_parent'])) {\n // If we are on a non-default tab, use the tab's title.\n $breadcrumb[] = check_plain($item['title']);\n }\n else {\n $breadcrumb[] = drupal_get_title();\n }\n }\n elseif (theme_get_setting('gwt_drupal_breadcrumb_trailing')) {\n $trailing_separator = $breadcrumb_separator;\n }\n\n // Provide a navigational heading to give context for breadcrumb links to\n // screen-reader users.\n if (empty($variables['title'])) {\n $variables['title'] = t('You are here');\n }\n $variables['title_attributes_array']['class'][] = 'breadcrumbs-here-label';\n\n // Build the breadcrumb trail.\n $output = '<nav role=\"navigation\">';\n $output .= '<ol class=\"breadcrumbs\">'.\n '<li'.drupal_attributes($variables['title_attributes_array']) . '>' . $variables['title'] . ':</li>'.\n '<li>' . implode('</li>'.\n '<li>', $breadcrumb) . '</li>'.\n '</ol>';\n $output .= '</nav>';\n }\n }\n\n return $output;\n}", "function circle_breadcrumb() {\n\tif ( ! class_exists( 'Breadcrumb_Trail' ) ) {\n\t\treturn;\n\t}\n\n\treturn breadcrumb_trail( array(\n\t\t'before' => '',\n\t\t'after' => '',\n\t\t'container' => 'div',\n\t\t'show_title' => true,\n\t\t'show_on_front' => false,\n\t\t'show_browse' => false,\n\t\t'echo' => true,\n\t) );\n}", "function isfnet_breadcrumb($variables) {\n $breadcrumb = $variables['breadcrumb'];\n\n if (!empty($breadcrumb)) {\n // Provide a navigational heading to give context for breadcrumb links to\n // screen-reader users. Make the heading invisible with .element-invisible.\n $heading = '<h2 class=\"element-invisible\">' . t('You are here') . '</h2>';\n // Uncomment to add current page to breadcrumb\n\t// $breadcrumb[] = drupal_get_title();\n return '<nav class=\"breadcrumb\">' . $heading . implode(' » ', $breadcrumb) . '</nav>';\n }\n}", "public function breadCrumbs()\n {\n $menu = Menu::new()\n ->addClass('m-subheader__breadcrumbs m-nav m-nav--inline')\n ->add(\n Link::toRoute('home', '<i class=\"m-nav__link-icon la la-home\"></i>')\n ->addClass('m-nav__link m-nav__link--icon')\n ->addParentClass('m-nav__item m-nav__item--home')\n )\n ;\n\n foreach ($this->crumbs($this->sections()) as $item) {\n $menu\n ->add(\n Html::raw('>')\n ->addParentClass('m-nav__separator')\n )\n ->add(\n Link::to($item['link'], '<span class=\"m-nav__link-text\">'. $item['text'] . '</span>')\n ->addClass('m-nav__link')\n ->addParentClass('m-nav__item')\n )\n ;\n }\n\n return $menu;\n }", "function thumbwhere_host_set_breadcrumb() {\n $breadcrumb = array(\n l(t('Home'), '<front>'),\n l(t('Administration'), 'admin'),\n l(t('Host'), 'admin/content'),\n l(t('Host'), 'admin/thumbwhere/thumbwhere_hosts'),\n );\n\n drupal_set_breadcrumb($breadcrumb);\n}", "function hudson_breadcrumb($variables) {\n $breadcrumb = $variables['breadcrumb'];\n $output = '';\n\n // Determine if we are to display the breadcrumb.\n $show_breadcrumb = theme_get_setting('zen_breadcrumb');\n if ($show_breadcrumb == 'yes' || $show_breadcrumb == 'admin' && arg(0) == 'admin') {\n\n // Optionally get rid of the homepage link.\n $show_breadcrumb_home = theme_get_setting('zen_breadcrumb_home');\n if (!$show_breadcrumb_home) {\n array_shift($breadcrumb);\n }\n\n // Return the breadcrumb with separators.\n if (!empty($breadcrumb)) {\n $zen_breadcrumb_separator = theme_get_setting('zen_breadcrumb_separator');\n $breadcrumb_separator = '<span class=\"separator\">&nbsp;' . $zen_breadcrumb_separator . '&nbsp;</span>';\n $trailing_separator = $title = '';\n if (theme_get_setting('zen_breadcrumb_title')) {\n $item = menu_get_item();\n if (!empty($item['tab_parent'])) {\n // If we are on a non-default tab, use the tab's title.\n $breadcrumb[] = check_plain($item['title']);\n }\n else {\n $breadcrumb[] = drupal_get_title();\n }\n }\n elseif (theme_get_setting('zen_breadcrumb_trailing')) {\n $trailing_separator = $breadcrumb_separator;\n }\n\n // Provide a navigational heading to give context for breadcrumb links to\n // screen-reader users.\n if (empty($variables['title'])) {\n $variables['title'] = t('You are here');\n }\n // Unless overridden by a preprocess function, make the heading invisible.\n if (!isset($variables['title_attributes_array']['class'])) {\n $variables['title_attributes_array']['class'][] = 'element-invisible';\n }\n\n // Build the breadcrumb trail.\n $output = '<nav class=\"breadcrumb\" role=\"navigation\">';\n $output .= '<h2' . drupal_attributes($variables['title_attributes_array']) . '>' . $variables['title'] . '</h2>';\n $output .= '<ol><li>' . implode($breadcrumb_separator . '</li><li>', $breadcrumb) . $trailing_separator . '</li></ol>';\n $output .= '</nav>';\n }\n }\n\n return $output;\n}", "function bbpress_crumbs() {\n\t\t\n\t\t// Setup the trail\n\t\t$bbp_trail = array();\n\t\t\n\t\t// If it is the forum root, just display \"Forums\"\n\t\tif ( bbp_is_forum_archive() ) {\n\t\t\t$bbp_trail[] = 'Forums';\n\t\t\treturn $bbp_trail;\n\t\t}\n\t\t\t\t\t\n\t\t// Otherwise link to the root forums\n\t\t$bbp_trail[] = '<a href=\"' . get_post_type_archive_link( 'forum' ) . '\">Forums</a>';\n\t\t\n\t\t// Recent topics page \n\t\tif ( bbp_is_topic_archive() ) :\n\t\t\t$bbp_trail[] = 'Recent Topics';\n\t\t\n\t\t// Topic tag archives \n\t\telseif ( bbp_is_topic_tag() ) :\n\t\t\t$bbp_trail[] = bbp_get_topic_tag_name();\n\t\t\n\t\t// Editing a topic tag\n\t\telseif ( bbp_is_topic_tag_edit() ) :\n\t\t\t$bbp_trail[] = '<a href=\"' . bbp_get_topic_tag_link() . '\">' . bbp_get_topic_tag_name() . '</a>';\n\t\t\t$bbp_trail[] = 'Edit';\n\t\t\n\t\t// Single topic \n\t\telseif ( bbp_is_single_topic() ) :\t\n\t\t\t$topic_id = get_queried_object_id();\n\t\t\t$bbp_trail = array_merge( $bbp_trail, $this->trail_parents( bbp_get_topic_forum_id( $topic_id ) ) );\n\t\t\t$bbp_trail[] = bbp_get_topic_title( $topic_id );\n\t\t\t\t\n\t\t// If it's a split, merge, or edit, link back to the topic \n\t\telseif ( bbp_is_topic_split() || bbp_is_topic_merge() || bbp_is_topic_edit() ) :\n\t\t\t$topic_id = get_queried_object_id();\n\t\t\t$bbp_trail = array_merge( $bbp_trail, $this->trail_parents( $topic_id ) );\n\t\t\n\t\t\tif ( bbp_is_topic_split() ) \t\t: $bbp_trail[] = 'Split Topic';\n\t\t\telseif ( bbp_is_topic_merge() ) \t: $bbp_trail[] = 'Merge Topic';\n\t\t\telseif ( bbp_is_topic_edit() ) \t\t: $bbp_trail[] = 'Edit Topic';\n\t\t\tendif;\n\t\t\t\n\t\t// Single reply \n\t\telseif ( bbp_is_single_reply() ) :\n\t\t\t$reply_id = get_queried_object_id();\n\t\t\t$bbp_trail = array_merge( $bbp_trail, $this->trail_parents( bbp_get_reply_topic_id( $reply_id ) ) );\n\t\t\t$bbp_trail[] = bbp_get_reply_title( $reply_id );\n\t\t\n\t\t// Single reply edit \n\t\telseif ( bbp_is_reply_edit() ) :\n\t\t\t$reply_id = get_queried_object_id();\n\t\t\t$bbp_trail = array_merge( $bbp_trail, $this->trail_parents( bbp_get_reply_topic_id( $reply_id ) ) );\n\t\t\t$bbp_trail[] = 'Edit Reply';\n\t\t\t\n\t\t// Single forum \n\t\telseif ( bbp_is_single_forum() ) :\n\t\t\n\t\t\t// Get the queried forum ID and its parent forum ID. \n\t\t\t$forum_id \t\t\t= get_queried_object_id();\n\t\t\t$forum_parent_id \t= bbp_get_forum_parent_id( $forum_id );\n\t\t\t\n\t\t\t// Get the forum parents\n\t\t\tif ( 0 != $forum_parent_id) \n\t\t\t\t$bbp_trail = array_merge( $bbp_trail, $this->trail_parents( $forum_parent_id ) );\n\t\t\t\t\n\t\t\t// Give the forum title\n\t\t\t$bbp_trail[] = bbp_get_forum_title( $forum_id );\n\t\t\n\t\tendif;\n\t\t\n\t\t// Return the bbPress trail \n\t\treturn $bbp_trail;\n\t}", "function create_breadcrumb() {\n\t$ci = &get_instance();\n $segments = $ci->uri->segment_array(); \n $segment_count = count($segments);//echo $ci->uri->segment(1);exit;\n $uri = $ci->uri->segment(1); ///adede (1) by shubhranshu\n $role = $ci->data['user']->role_id;\n\t$link = '<ol class=\"breadcrumb breadcrumb_style\"> <a href=\"'.site_url().'\">Home</a>'; \n if ($segment_count >= 2) {\n for ($i=0; $i<2;$i++) {\n if ($role == 'COMPACT') {\n if ($segments[1] == 'profile' && $segments[2] == 'change_password') {\n $i=2;\n $link .= ' >> ';\n break;\n }\n }\n $prep_link .= $ci->uri->segment($i).'/';\n $link_text = ucwords(str_replace('_', ' ', $segments[$i]));\n $link.='<li><a href=\"'.site_url($prep_link).'\">'. $link_text .'</a></li>';\n }\n }else {\n $link = '<ol class=\"breadcrumb breadcrumb_style\"><li><a href=\"'.site_url().'\">Home</a></li>'; \n $i=1;\n }\n if ($segments[$i]) {\n if (is_numeric($segments[$i])) {\n $link_text = 'Page '. $segments[$i];\n $link.='<li>'. $link_text .'</li>';\n }else {\n $link.='<li>'. ucwords(str_replace('_', ' ', $segments[$i])) .'</li>';\n }\n }\n $link .= '</ol>';\n return $link;\n}", "function tac_override_yoast_breadcrumb_trail( $links ) {\n global $post;\n\n if ( is_home() || is_singular( 'post' ) || is_archive() ) :\n\n \tif ( 'event' == get_post_type() ) :\n\n\t $breadcrumb[] = array(\n\t 'url' => get_permalink( get_post_type_archive_link( 'event' ) ),\n\t 'text' => 'Our Events',\n\t );\n\n\t array_splice( $links, 1, -2, $breadcrumb );\n\n\t elseif ( 'course' == get_post_type() ) :\n\n\t \t$breadcrumb[] = array(\n\t 'url' => get_permalink( get_post_type_archive_link( 'course' ) ),\n\t 'text' => 'Our Learning',\n\t );\n\n\t array_splice( $links, 1, -2, $breadcrumb );\n\n\t else :\n\n\t \t\t$breadcrumb[] = array(\n\t 'url' => get_permalink( get_option( 'page_for_posts' ) ),\n\t 'text' => 'Our Series',\n\t );\n\n\t array_splice( $links, 1, -2, $breadcrumb );\n\t endif;\n endif;\n\n return $links;\n}", "function the_breadcrumb() {\n echo '<ul id=\"crumbs\">';\n if (!is_home()) {\n echo '<li><a href=\"';\n echo get_option('home');\n echo '\">';\n echo 'Home';\n echo \"</a></li>\";\n if (is_category() || is_single()) {\n echo '<li>';\n the_category(' </li><li> ');\n if (is_single()) {\n echo \"</li><li>\";\n the_title();\n echo '</li>';\n }\n } elseif (is_page()) {\n echo '<li>';\n echo the_title();\n echo '</li>';\n }\n }\n elseif (is_tag()) {single_tag_title();}\n elseif (is_day()) {echo\"<li>Archive for \"; the_time('F jS, Y'); echo'</li>';}\n elseif (is_month()) {echo\"<li>Archive for \"; the_time('F, Y'); echo'</li>';}\n elseif (is_year()) {echo\"<li>Archive for \"; the_time('Y'); echo'</li>';}\n elseif (is_author()) {echo\"<li>Author Archive\"; echo'</li>';}\n elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {echo \"<li>Blog Archives\"; echo'</li>';}\n elseif (is_search()) {echo\"<li>Search Results\"; echo'</li>';}\n echo '</ul>';\n }", "public function getBreadcrumb()\n {\n return $this->breadcrumb;\n }", "function wb_get_breadcrumbs()\n{\n return Westudio_Bootstrap_Breadcrumbs::items();\n}", "function _get_breadcrumbs($starting_page, $container = array())\n{\n\n //make sure you're working with an object\n $sp = (!is_object($starting_page)) ? get_post($starting_page) : $starting_page;\n\n //make sure to insert starting page only once\n if (!in_array(get_permalink($sp->ID), $container)) {\n $container[get_permalink($sp->ID)] = get_the_title($sp->ID);\n }\n\n //if parent, recursion!\n if ($sp->post_parent > 0) {\n $container[get_permalink($sp->post_parent)] = get_the_title($sp->post_parent);\n $container = _get_breadcrumbs($sp->post_parent, $container);\n }\n\n return $container;\n}", "function phptemplate_breadcrumb($breadcrumb) {\n if (!empty($breadcrumb)) {\n return implode(' <span class=\"bull\">&bull;</span> ', $breadcrumb);\n }\n}", "function slug_post_type_breadcrumb( $divider = '&gt;&gt;' ) {\n\t$front = slug_link( site_url(), 'Home' );\n\tif ( is_home() || is_front_page() ) {\n\t\treturn $front;\n\n\t}\n\n\tif( is_post_type_archive() || ( is_singular() && get_post_type() !== false ) ) {\n\t\t$post_type = get_post_type();\n\t\t$pod = pods_api()->load_pod( $post_type );\n\t\tif ( !is_string( $pod ) ) {\n\t\t\t$single = $pod->options[ 'single_label' ];\n\t\t\t$plural = slug_link( get_post_type_archive( $post_type ), $pod->label, 'All ' . $single );\n\n\n\t\t\tif ( is_post_type_archive() ) {\n\t\t\t\treturn $front . $divider . $plural;\n\n\t\t\t}\n\n\t\t\tglobal $post;\n\t\t\t$single = slug_link( get_permalink( $post->ID ), get_the__title( $post->ID ), 'View '.$single );\n\t\t\treturn $front . $divider . $single;\n\n\t\t}\n\t\telse {\n\n\t\t\treturn;\n\n\t\t}\n\t}\n\n}", "public static function getBreadcrumbs($sep='&#x279D;')\n\t{\n\t\t$path = parse_url($_SERVER[\"REQUEST_URI\"], PHP_URL_PATH);\n\n\t\t$str = '';\n\t\t$linkURL = '';\n\n\t\t$pagesList = explode('/',ltrim($path, \"/\"));\n\n\t\t$c = count($pagesList);\n\t\tfor ($i=0; $i < $c; $i++) {\n\t\t\tunset($linkText);\n\n\t\t\t$page = array_shift($pagesList);\n\t\t\t\n\t\t\t$linkURL .= \"/$page\";\n\t\t\t\n\t\t\t$fullFilePath = BP.\"/app/views$linkURL.phtml\";\n\t\t\t\n\t\t\t# find the break point for the meta data\n\t\t\tif (file_exists($fullFilePath)) {\n\t\t\t\t$fileParts = explode(\"{endmeta}\", file_get_contents($fullFilePath), 2);\n\t\t\t\t\n\t\t\t\tif (isset($fileParts[0])) # does the template have meta data\n\t\t\t\t\t$metaDataArray = parse_ini_string($fileParts[0]);\n\t\t\t\t\n\t\t\t\tif (isset($metaDataArray['linkText']))\n\t\t\t\t\t$linkText = $metaDataArray['linkText'];\n\t\t\t\telseif (isset($metaDataArray['title']))\n\t\t\t\t\t$linkText = $metaDataArray['title'];\n\t\t\t}\n\n\t\t\tif (!isset($linkText))\n\t\t\t\t$linkText = self::ucwordss(str_replace('-',' ',$page), [\"is\", \"to\", \"the\", \"for\"]);\t\t\t\t\n\n\t\t\tif ($i+1 == $c) # last one\n\t\t\t\t$str .= ' '.$sep.' '.$linkText;\n\t\t\telse\n\t\t\t\t$str .= ' '.$sep.' <a href=\"'.$linkURL.'\">'.$linkText.'</a>';\n\t\t}\n\n\t\t$indexFileParts = explode(\"{endmeta}\", file_get_contents(BP.\"/app/views/index.phtml\"), 2);\n\t\t\t\t\n\t\tif (isset($indexFileParts[0])) # does the template have meta data\n\t\t\t$metaDataArray = parse_ini_string($indexFileParts[0]);\n\t\t\n\t\tif (isset($metaDataArray['linkText']))\n\t\t\t$linkText = $metaDataArray['linkText'];\n\t\telse\n\t\t\t$linkText = 'Home';\n\n\t\treturn '<a href=\"/\">'.$linkText.'</a>'.$str;\n\t}", "public static function yoast_breadcrumbs_markup() {\r\n if ( function_exists( 'yoast_breadcrumb' ) ) {\r\n yoast_breadcrumb( '<p class=\"wfc-yoast-breadcrumbs\">','</p>' );\r\n }\r\n }", "function breadcrumbs()\n{\n $home = __('Home'); // text for the 'Home' link\n $before = '<li class=\"active\">'; // tag before the current crumb\n $sep = '';//'<span class=\"divider\">/</span>';\n $after = '</li>'; // tag after the current crumb\n if (!is_home() && !is_front_page() || is_paged()) {\n echo '<ul class=\"breadcrumb\">';\n global $post;\n $homeLink = home_url();\n echo '<li><a href=\"' . $homeLink . '\">' . $home . '</a> '.$sep. '</li> ';\n if (is_category()) {\n global $wp_query;\n $cat_obj = $wp_query->get_queried_object();\n $thisCat = $cat_obj->term_id;\n $thisCat = get_category($thisCat);\n $parentCat = get_category($thisCat->parent);\n if ($thisCat->parent != 0) {\n echo get_category_parents($parentCat, true, $sep);\n }\n echo $before . __('Archive by category') . ' \"' . single_cat_title('', false) . '\"' . $after;\n } elseif (is_day()) {\n echo '<li><a href=\"' . get_year_link(get_the_time('Y')) . '\">' . get_the_time(\n 'Y'\n ) . '</a></li> ';\n echo '<li><a href=\"' . get_month_link(get_the_time('Y'), get_the_time('m')) . '\">' . get_the_time(\n 'F'\n ) . '</a></li> ';\n echo $before . get_the_time('d') . $after;\n } elseif (is_month()) {\n echo '<li><a href=\"' . get_year_link(get_the_time('Y')) . '\">' . get_the_time(\n 'Y'\n ) . '</a></li> ';\n echo $before . get_the_time('F') . $after;\n } elseif (is_year()) {\n echo $before . get_the_time('Y') . $after;\n } elseif (is_single() && !is_attachment()) {\n if (get_post_type() != 'post') {\n $post_type = get_post_type_object(get_post_type());\n $slug = $post_type->rewrite;\n echo '<li><a href=\"' . $homeLink . '/' . $slug['slug'] . '/\">' . $post_type->labels->singular_name . '</a></li> ';\n echo $before . get_the_title() . $after;\n } else {\n $cat = get_the_category();\n $cat = $cat[0];\n echo '<li>'.get_category_parents($cat, true, $sep).'</li>';\n echo $before . get_the_title() . $after;\n }\n } elseif (!is_single() && !is_page() && get_post_type() != 'post' && !is_404()) {\n $post_type = get_post_type_object(get_post_type());\n echo $before . $post_type->labels->singular_name . $after;\n } elseif (is_attachment()) {\n $parent = get_post($post->post_parent);\n $cat = get_the_category($parent->ID);\n $cat = $cat[0];\n echo get_category_parents($cat, true, $sep);\n echo '<li><a href=\"' . get_permalink(\n $parent\n ) . '\">' . $parent->post_title . '</a></li> ';\n echo $before . get_the_title() . $after;\n } elseif (is_page() && !$post->post_parent) {\n echo $before . get_the_title() . $after;\n } elseif (is_page() && $post->post_parent) {\n $parent_id = $post->post_parent;\n $breadcrumbs = array();\n while ($parent_id) {\n $page = get_page($parent_id);\n $breadcrumbs[] = '<li><a href=\"' . get_permalink($page->ID) . '\">' . get_the_title(\n $page->ID\n ) . '</a>' . $sep . '</li>';\n $parent_id = $page->post_parent;\n }\n $breadcrumbs = array_reverse($breadcrumbs);\n foreach ($breadcrumbs as $crumb) {\n echo $crumb;\n }\n echo $before . get_the_title() . $after;\n } elseif (is_search()) {\n echo $before . __('Search results for') . ' \"'. get_search_query() . '\"' . $after;\n } elseif (is_tag()) {\n echo $before . __('Posts tagged') . ' \"' . single_tag_title('', false) . '\"' . $after;\n } elseif (is_author()) {\n global $author;\n $userdata = get_userdata($author);\n echo $before . __('Articles posted by') . ' ' . $userdata->display_name . $after;\n } elseif (is_404()) {\n echo $before . __('Error 404') . $after;\n }\n // if (get_query_var('paged')) {\n // if (is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author()\n // ) {\n // echo ' (';\n // }\n // echo __('Page', 'bootstrapwp') . $sep . get_query_var('paged');\n // if (is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author()\n // ) {\n // echo ')';\n // }\n // }\n echo '</ul>';\n }\n}", "public function create_links()\n {\n \t$txt = '<ul>';\n \t$last = end($this->breadcrumb);\n \tforeach($this->breadcrumb AS $breadcrumb)\n \t{\n \t\t$url = '';\n \t\t$class = FALSE;\n \t\tif($breadcrumb['active'] == '1')\n \t\t{\n \t\t\t$class = 'active';\n \t\t}\n \t\t$txt .= '<li><a href=\"'.$breadcrumb['url'].'\" class=\"'.$class.'\" title=\"'.$breadcrumb['txt'].'\">'.$breadcrumb['txt'].'</a></li>';\n \t\t$class = '';\n \t}\n \t\n \t$txt .= '</ul>';\n \treturn $txt;\n }", "function breadcrumbs(BreadcrumbsParams $params) : string\n{\n $path = array_filter(explode('/', parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)));\n // This one removes 'oildiscovery' from the path in development environment\n $path = array_diff($path, ['oildiscovery']);\n\n // This is the base URL\n $base = URLROOT;\n \n\n // Initialize a temporary array with our breadcrumbs. (starting with our home page, which will be the base URL)\n $breadcrumbs = array(\"<a class='breadcrumbs__link' href=\\\"$base\\\">$params->home</a>\");\n\n // Find out the index for the last value in our path array\n $pathkeys = array_keys($path);\n $last = end($pathkeys);\n // Build the rest of the breadcrumbs\n foreach ($path as $key => $crumb) {\n // \"title\" is the text that will be displayed (strip out .php and turn '_' into a space)\n $title = ucwords(str_replace(array('.php', '_'), array('', ' '), $crumb));\n\n // If we are not on the last index, then display an <a> tag\n if ($key != $last) {\n $breadcrumbs[] = \"<a class='breadcrumbs__link' href=\\\"$base\\\\$crumb\\\">$title</a>\";\n }\n // Otherwise, just display the title (minus)\n if ($key === $last) {\n // If the last index is an integer then replace the post id with post title\n if (is_numeric($crumb)) {\n $breadcrumbs[] = $params->post_title;\n } else {\n $breadcrumbs[] = $title;\n }\n }\n\n if (is_numeric($crumb)) {\n }\n }\n\n // Build our temporary array (pieces of bread) into one big string :)\n return implode($params->separator, $breadcrumbs);\n}", "function buddypress_crumbs() {\n\t\n\t\t// Setup the trail\n\t\t$bp_trail = array();\n\t\t\t\t\n\t\t// User Profiles\n\t\tif ( bp_is_user() ) : \n\t\t\n\t\t\t// Your own profile\n\t\t\tif ( bp_is_my_profile() ) :\n\t\t\t\t $bp_trail[] = '<a href=\"'.bp_displayed_user_domain().'\" title=\"Your Profile\">Your Profile</a>';\n\t\t\t\t \n\t\t\t// Someone else's profile\n\t\t\telse :\n\t\t\t\t$bp_trail[] = '<a href=\"'. bp_get_members_directory_permalink() .'\" title=\"Members Directory\">Members</a>';\n\t\t\t\t$bp_trail[] = '<a href=\"'.bp_displayed_user_domain().'\" title=\"'.bp_get_displayed_user_fullname(). '\">' . bp_get_displayed_user_fullname() . '</a>';\n\t\t\tendif;\n\n\t\t\t// Display the current component\n\t\t\t$bp_trail[] = ucfirst( bp_current_component() );\n\t\t\t\n\t\t// Guild Profile\n\t\telseif ( bp_is_group() ) :\n\t\t\t$bp_trail[] = '<a href=\"'. bp_get_groups_directory_permalink() .'\" title=\"Groups and Guilds Directory\">Groups</a>';\n\t\t\t\n\t\t\t// Group Creation\n\t\t\tif ( bp_is_group_create() ) :\n\t\t\t\t$bp_trail[] = 'Create New Group';\n\t\t\t\t\n\t\t\t// Group Profile Home\n\t\t\telseif ( 'home' == bp_current_action() ) :\n\t\t\t\t$bp_trail[] = bp_get_group_name();\n\t\t\t\t\n\t\t\t// Group Profile Sub-Component\n\t\t\telseif ( bp_current_action() != 'forum' ) : \n\t\t\t\t$bp_trail[] = '<a href=\"'. bp_get_group_permalink() .'\" title=\"'.bp_get_current_group_name().'\">'.bp_get_current_group_name().'</a>';\n\t\t\t\t$bp_trail[] = ucfirst( bp_current_action() );\n\t\t\tendif;\n\t\t\t\t\n\t\t\tif ( bp_current_action() == 'forum' ) :\n\t\t\t\t$bp_trail[] = '<a href=\"'. bp_get_group_permalink() .'\" title=\"'.bp_get_current_group_name().'\">'.bp_get_current_group_name().'</a>';\n\t\t\t\t$bp_trail = array_merge( $bp_trail, $this->group_forum_crumbs() );\n\t\t\tendif;\n\n\t\t// Directories\n\t\telseif ( bp_is_directory() ) :\t\n\t\t\tif ( bp_is_activity_component() ) \t\t$bp_trail[] = 'Sitewide Activity';\n\t\t\telseif ( bp_is_members_component() )\t$bp_trail[] = 'Members Directory';\n\t\t\telseif ( bp_is_groups_component() )\t\t$bp_trail[] = 'Guilds Directory';\n\t\t\telse \t\t\t\t\t\t\t\t\t$bp_trail[] = ucfirst( bp_current_component() );\n\t\t\t\n\t\telseif ( bp_is_register_page() || bp_is_activation_page() ) :\n\t\t\t$bp_trail[] = 'New User Registration';\n\t\t\t\t\n\t\t// Backup Placeholder\n\t\telse :\n\t\t\t$bp_trail[] = '404 Page Not Found';\n\t\tendif;\n\t\t\t\n\t\t// Return the BuddyPress trail\n\t\treturn $bp_trail;\n\t}", "function bootstrapwp_breadcrumbs()\n{\n $home = 'Home'; // text for the 'Home' link\n $before = '<li class=\"active\">'; // tag before the current crumb\n $sep = '<span class=\"divider\">/</span>';\n $after = '</li>'; // tag after the current crumb\n\n if (!is_home() && !is_front_page() || is_paged()) {\n\n echo '<ul class=\"breadcrumb\">';\n\n global $post;\n $homeLink = home_url();\n echo '<li><a href=\"' . $homeLink . '\">' . $home . '</a> '.$sep. '</li> ';\n if (is_category()) {\n global $wp_query;\n $cat_obj = $wp_query->get_queried_object();\n $thisCat = $cat_obj->term_id;\n $thisCat = get_category($thisCat);\n $parentCat = get_category($thisCat->parent);\n if ($thisCat->parent != 0) {\n echo get_category_parents($parentCat, true, $sep);\n }\n echo $before . 'Archive by category \"' . single_cat_title('', false) . '\"' . $after;\n } elseif (is_day()) {\n echo '<li><a href=\"' . get_year_link(get_the_time('Y')) . '\">' . get_the_time(\n 'Y'\n ) . '</a></li> ';\n echo '<li><a href=\"' . get_month_link(get_the_time('Y'), get_the_time('m')) . '\">' . get_the_time(\n 'F'\n ) . '</a></li> ';\n echo $before . get_the_time('d') . $after;\n } elseif (is_month()) {\n echo '<li><a href=\"' . get_year_link(get_the_time('Y')) . '\">' . get_the_time(\n 'Y'\n ) . '</a></li> ';\n echo $before . get_the_time('F') . $after;\n } elseif (is_year()) {\n echo $before . get_the_time('Y') . $after;\n } elseif (is_single() && !is_attachment()) {\n if (get_post_type() != 'post') {\n $post_type = get_post_type_object(get_post_type());\n $slug = $post_type->rewrite;\n echo '<li><a href=\"' . $homeLink . '/' . $slug['slug'] . '/\">' . $post_type->labels->singular_name . '</a>'.$sep.'</li> ';\n echo $before . get_the_title() . $after;\n } else {\n $cat = get_the_category();\n $cat = $cat[0];\n echo '<li>'.get_category_parents($cat, true, $sep).'</li>';\n echo $before . get_the_title() . $after;\n }\n } elseif (!is_single() && !is_page() && get_post_type() != 'post' && !is_404()) {\n $post_type = get_post_type_object(get_post_type());\n echo $before . $post_type->labels->singular_name . $after;\n } elseif (is_attachment()) {\n $parent = get_post($post->post_parent);\n $cat = get_the_category($parent->ID);\n $cat = $cat[0];\n echo get_category_parents($cat, true, $sep);\n echo '<li><a href=\"' . get_permalink(\n $parent\n ) . '\">' . $parent->post_title . '</a></li> ';\n echo $before . get_the_title() . $after;\n\n } elseif (is_page() && !$post->post_parent) {\n echo $before . get_the_title() . $after;\n } elseif (is_page() && $post->post_parent) {\n $parent_id = $post->post_parent;\n $breadcrumbs = array();\n while ($parent_id) {\n $page = get_page($parent_id);\n $breadcrumbs[] = '<li><a href=\"' . get_permalink($page->ID) . '\">' . get_the_title(\n $page->ID\n ) . '</a>' . $sep . '</li>';\n $parent_id = $page->post_parent;\n }\n $breadcrumbs = array_reverse($breadcrumbs);\n foreach ($breadcrumbs as $crumb) {\n echo $crumb;\n }\n echo $before . get_the_title() . $after;\n } elseif (is_search()) {\n echo $before . 'Search results for \"' . get_search_query() . '\"' . $after;\n } elseif (is_tag()) {\n echo $before . 'Posts tagged \"' . single_tag_title('', false) . '\"' . $after;\n } elseif (is_author()) {\n global $author;\n $userdata = get_userdata($author);\n echo $before . 'Articles posted by ' . $userdata->display_name . $after;\n } elseif (is_404()) {\n echo $before . 'Error 404' . $after;\n }\n // if (get_query_var('paged')) {\n // if (is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author()\n // ) {\n // echo ' (';\n // }\n // echo __('Page', 'bootstrapwp') . $sep . get_query_var('paged');\n // if (is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author()\n // ) {\n // echo ')';\n // }\n // }\n\n echo '</ul>';\n\n }\n}", "function custom_breadcrumbs() {\n\n // Settings\n $breadcrums_id = 'breadcrumbs';\n $breadcrums_class = 'breadcrumbs';\n $home_title = 'TOP';\n\n // If you have any custom post types with custom taxonomies, put the taxonomy name below (e.g. care_cat)\n $custom_taxonomy = 'knowledge-cat';\n\n // Get the query & post information\n global $post;\n\n // Do not display on the Home\n if ( !is_front_page() ) {\n\n // Build the breadcrums\n echo '<ul id=\"' . $breadcrums_id . '\" class=\"' . $breadcrums_class . '\">';\n\n // Home page\n echo '<li class=\"item-home\"><a class=\"bread-link bread-home\" href=\"' . get_home_url() . '\" title=\"' . $home_title . '\"><i class=\"fa fa-home\" aria-hidden=\"true\"></i>' . $home_title . '</a></li>';\n\n if ( is_archive() && !is_tax() && !is_category() && !is_tag() ) {\n\n echo '<li class=\"item-current item-archive\"><strong class=\"bread-current bread-archive\">' . post_type_archive_title($prefix, false) . '</strong></li>';\n\n } else if ( is_archive() && is_tax() && !is_category() && !is_tag() ) {\n\n // If post is a custom post type\n $post_type = get_post_type();\n\n // If it is a custom post type display name and link\n \t\t\t\t\t\t if($post_type == 'post') {\n $post_type_object = get_post_type_object($post_type);\n\n\t\t\t\t\t\t\t $post_type_archive_label = \"整骨院・接骨院・整体・鍼灸院\";\n\t\t\t\t\t\t\t\t$post_type_archive_link = get_category_link(get_category_by_slug('clinic')->term_id);\n\n echo '<li class=\"item-cat item-custom-post-type-' . $post_type . '\"><a class=\"bread-cat bread-custom-post-type-' . $post_type . '\" href=\"' . $post_type_archive_link . '\" title=\"' . $post_type_archive_label . '\">' . $post_type_archive_label . '</a></li>';\n }\n\n $custom_tax_name = get_queried_object()->name;\n echo '<li class=\"item-current item-archive\"><strong class=\"bread-current bread-archive\">' . $custom_tax_name . '</strong></li>';\n\n } else if ( is_single() ) {\n\n // If post is a custom post type\n $post_type = get_post_type();\n\n if( $post_type == 'post' ) {\n $clinic_cat = get_the_category(get_the_ID())[0];\n $post_type_archive_label = $clinic_cat->name;\n $post_type_archive_link = get_category_link($clinic_cat->term_id);\n echo '<li class=\"item-cat item-custom-post-type-' . $post_type . '\"><a class=\"bread-cat bread-custom-post-type-' . $post_type . '\" href=\"' . $post_type_archive_link . '\" title=\"' . $post_type_archive_label . '\">' . $post_type_archive_label . '</a></li>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if( $post_type == 'hikikomori' || $post_type == 'violence' || $post_type == 'voice' || $post_type == 'question' ) {\n $clinic_id = $clinic_page->ID;\n $clinic_cat = get_the_category($clinic_id)[0];\n $post_type_archive_label = $clinic_cat->name;\n $post_type_archive_link = get_category_link($clinic_cat->term_id);\n echo '<li class=\"item-cat item-custom-post-type-' . $post_type . '\"><a class=\"bread-cat bread-custom-post-type-' . $post_type . '\" href=\"' . $post_type_archive_link . '\" title=\"' . $post_type_archive_label . '\">' . $post_type_archive_label . '</a></li>';\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$post_type_object = get_post_type_object($post_type);\n\t\t\t\t\t\t\t\t$post_type_archive_label = $post_type_object->label;\n\t\t\t\t\t\t\t\t$post_type_archive_link = get_post_type_archive_link( $post_type );\n\t\t\t\t\t\t\t\techo '<li class=\"item-cat item-custom-post-type-' . $post_type . '\"><a class=\"bread-cat bread-custom-post-type-' . $post_type . '\" href=\"' . $post_type_archive_link . '\" title=\"' . $post_type_archive_label . '\">' . $post_type_archive_label . '</a></li>';\n\t\t\t\t\t\t\t}\n\n // Get post category info\n $category = get_the_category();\n\n if(!empty($category)) {\n\n // Get last category post is in\n $last_category = end(array_values($category));\n\n // Get parent any categories and create array\n $get_cat_parents = rtrim(get_category_parents($last_category->term_id, true, ','),',');\n $cat_parents = explode(',',$get_cat_parents);\n\n // Loop through parent categories and store in variable $cat_display\n $cat_display = '';\n // foreach($cat_parents as $parents) {\n \t\t\t\t\t\t\t\t// \t $cat_display .= '<li class=\"item-cat\">'.$parents.'</li>';\n // }\n \t\t\t\t\t\t\t\t $cat_display .= '<li class=\"item-cat\">'.$cat_parents[0].'</li>';\n\n }\n\n // If it's a custom post type within a custom taxonomy\n $taxonomy_exists = taxonomy_exists($custom_taxonomy);\n if(empty($last_category) && !empty($custom_taxonomy) && $taxonomy_exists) {\n\n $taxonomy_terms = get_the_terms( $post->ID, $custom_taxonomy );\n $cat_id = $taxonomy_terms[0]->term_id;\n $cat_nicename = $taxonomy_terms[0]->slug;\n $cat_link = get_term_link($taxonomy_terms[0]->term_id, $custom_taxonomy);\n $cat_name = $taxonomy_terms[0]->name;\n\n }\n\n // Check if the post is in a category\n if(!empty($last_category)) {\n // echo $cat_display;\n echo '<li class=\"item-current item-' . $post->ID . '\"><strong class=\"bread-current bread-' . $post->ID . '\" title=\"' . get_the_title() . '\">' . get_the_title() . '</strong></li>';\n\n // Else if post is in a custom taxonomy\n } else if(!empty($cat_id)) {\n\n echo '<li class=\"item-cat item-cat-' . $cat_id . ' item-cat-' . $cat_nicename . '\"><a class=\"bread-cat bread-cat-' . $cat_id . ' bread-cat-' . $cat_nicename . '\" href=\"' . $cat_link . '\" title=\"' . $cat_name . '\">' . $cat_name . '</a></li>';\n echo '<li class=\"item-current item-' . $post->ID . '\"><strong class=\"bread-current bread-' . $post->ID . '\" title=\"' . get_the_title() . '\">' . get_the_title() . '</strong></li>';\n\n } else {\n\n echo '<li class=\"item-current item-' . $post->ID . '\"><strong class=\"bread-current bread-' . $post->ID . '\" title=\"' . get_the_title() . '\">' . get_the_title() . '</strong></li>';\n\n }\n\n } else if ( is_category() ) {\n\n // Category page\n echo '<li class=\"item-current item-cat\"><strong class=\"bread-current bread-cat\">' . single_cat_title('', false) . '</strong></li>';\n\n } else if ( is_page() ) {\n\n // Standard page\n if( $post->post_parent ){\n\n // If child page, get parents\n $anc = get_post_ancestors( $post->ID );\n\n // Get parents in the right order\n $anc = array_reverse($anc);\n\n // Parent page loop\n foreach ( $anc as $ancestor ) {\n $parents .= '<li class=\"item-parent item-parent-' . $ancestor . '\"><a class=\"bread-parent bread-parent-' . $ancestor . '\" href=\"' . get_permalink($ancestor) . '\" title=\"' . get_the_title($ancestor) . '\">' . get_the_title($ancestor) . '</a></li>';\n }\n\n // Display parent pages\n echo $parents;\n\n // Current page\n echo '<li class=\"item-current item-' . $post->ID . '\"><strong title=\"' . get_the_title() . '\"> ' . get_the_title() . '</strong></li>';\n\n } else {\n\n // Just display current page if not parents\n echo '<li class=\"item-current item-' . $post->ID . '\"><strong class=\"bread-current bread-' . $post->ID . '\"> ' . get_the_title() . '</strong></li>';\n\n }\n\n } else if ( is_tag() ) {\n // Tag page\n // Get tag information\n $term_id = get_query_var('tag_id');\n $taxonomy = 'post_tag';\n $args = 'include=' . $term_id;\n $terms = get_terms( $taxonomy, $args );\n $get_term_id = $terms[0]->term_id;\n $get_term_slug = $terms[0]->slug;\n $get_term_name = $terms[0]->name;\n\n // Display the tag name\n echo '<li class=\"item-current item-tag-' . $get_term_id . ' item-tag-' . $get_term_slug . '\"><strong class=\"bread-current bread-tag-' . $get_term_id . ' bread-tag-' . $get_term_slug . '\">' . $get_term_name . '</strong></li>';\n\n } elseif ( is_day() ) {\n // Day archive\n\n // Year link\n echo '<li class=\"item-year item-year-' . get_the_time('Y') . '\"><a class=\"bread-year bread-year-' . get_the_time('Y') . '\" href=\"' . get_year_link( get_the_time('Y') ) . '\" title=\"' . get_the_time('Y') . '\">' . get_the_time('Y') . ' Archives</a></li>';\n\n // Month link\n echo '<li class=\"item-month item-month-' . get_the_time('m') . '\"><a class=\"bread-month bread-month-' . get_the_time('m') . '\" href=\"' . get_month_link( get_the_time('Y'), get_the_time('m') ) . '\" title=\"' . get_the_time('M') . '\">' . get_the_time('M') . ' Archives</a></li>';\n\n // Day display\n echo '<li class=\"item-current item-' . get_the_time('j') . '\"><strong class=\"bread-current bread-' . get_the_time('j') . '\"> ' . get_the_time('jS') . ' ' . get_the_time('M') . ' Archives</strong></li>';\n\n } else if ( is_month() ) {\n\n // Month Archive\n\n // Year link\n echo '<li class=\"item-year item-year-' . get_the_time('Y') . '\"><a class=\"bread-year bread-year-' . get_the_time('Y') . '\" href=\"' . get_year_link( get_the_time('Y') ) . '\" title=\"' . get_the_time('Y') . '\">' . get_the_time('Y') . ' Archives</a></li>';\n\n // Month display\n echo '<li class=\"item-month item-month-' . get_the_time('m') . '\"><strong class=\"bread-month bread-month-' . get_the_time('m') . '\" title=\"' . get_the_time('M') . '\">' . get_the_time('M') . ' Archives</strong></li>';\n\n } else if ( is_year() ) {\n\n // Display year archive\n echo '<li class=\"item-current item-current-' . get_the_time('Y') . '\"><strong class=\"bread-current bread-current-' . get_the_time('Y') . '\" title=\"' . get_the_time('Y') . '\">' . get_the_time('Y') . ' Archives</strong></li>';\n\n } else if ( is_author() ) {\n\n // Auhor archive\n\n // Get the author information\n global $author;\n $userdata = get_userdata( $author );\n\n // Display author name\n echo '<li class=\"item-current item-current-' . $userdata->user_nicename . '\"><strong class=\"bread-current bread-current-' . $userdata->user_nicename . '\" title=\"' . $userdata->display_name . '\">' . 'Author: ' . $userdata->display_name . '</strong></li>';\n\n } else if ( get_query_var('paged') && !is_search() ) {\n\n // Paginated archives\n echo '<li class=\"item-current item-current-' . get_query_var('paged') . '\"><strong class=\"bread-current bread-current-' . get_query_var('paged') . '\" title=\"Page ' . get_query_var('paged') . '\">'.__('Page') . ' ' . get_query_var('paged') . '</strong></li>';\n\n } else if ( is_search() ) {\n\n // Search results page\n echo '<li class=\"item-current item-current-' . get_search_query() . '\"><strong class=\"bread-current bread-current-' . get_search_query() . '\" title=\"検索結果: ' . get_search_query() . '\">検索結果: ' . get_search_query() . '</strong></li>';\n\n } elseif ( is_404() ) {\n\n // 404 page\n echo '<li>' . 'Error 404' . '</li>';\n }\n echo '</ul>';\n }\n }", "function dimox_breadcrumbs() {\n\n\t/* === OPTIONS === */\n\t$text['home'] = 'Home'; // text for the 'Home' link\n\t$text['category'] = 'Archive by Category \"%s\"'; // text for a category page\n\t$text['search'] = 'Search Results for \"%s\" Query'; // text for a search results page\n\t$text['tag'] = 'Posts Tagged \"%s\"'; // text for a tag page\n\t$text['author'] = 'Articles Posted by %s'; // text for an author page\n\t$text['404'] = 'Error 404'; // text for the 404 page\n\t$text['page'] = 'Page %s'; // text 'Page N'\n\t$text['cpage'] = 'Comment Page %s'; // text 'Comment Page N'\n\n\t$wrap_before = '<div class=\"breadcrumbs\">'; // the opening wrapper tag\n\t$wrap_after = '</div><!-- .breadcrumbs -->'; // the closing wrapper tag\n\t$sep = '>'; // separator between crumbs\n\t$sep_before = '<span class=\"sep\">'; // tag before separator\n\t$sep_after = '</span>'; // tag after separator\n\t$show_home_link = 1; // 1 - show the 'Home' link, 0 - don't show\n\t$show_on_home = 1; // 1 - show breadcrumbs on the homepage, 0 - don't show\n\t$show_current = 1; // 1 - show current page title, 0 - don't show\n\t$before = '<span class=\"current\">'; // tag before the current crumb\n\t$after = '</span>'; // tag after the current crumb\n\t/* === END OF OPTIONS === */\n\n\tglobal $post;\n\tglobal $pre_path;\n\t$home_link = 'https://www.nationalarchives.gov.uk/';\n\t$link_before = '<span itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\">';\n\t$link_after = '</span>';\n\t$link_attr = ' itemprop=\"url\"';\n\t$link_in_before = '<span itemprop=\"title\">';\n\t$link_in_after = '</span>';\n\t$link = $link_before . '<a href=\"%1$s\"' . $link_attr . '>' . $link_in_before . '%2$s' . $link_in_after . '</a>' . $link_after;\n\t$frontpage_id = get_option('page_on_front');\n\t$parent_id = $post->post_parent;\n\t$sep = ' ' . $sep_before . $sep . $sep_after . ' ';\n\n\tif (is_home() || is_front_page()) {\n\n\t\t// TNA additional breadcrumbs for front page\n\t\tglobal $pre_crumbs;\n\t\tif ( $pre_crumbs ) {\n\t\t\t$numItems = count($pre_crumbs);\n\t\t\t$i = 0;\n\t\t\tglobal $pre_crumbs_st;\n\t\t\tforeach ($pre_crumbs as $crumb_name => $crumb_path) {\n\t\t\t\tif (++$i === $numItems) {\n\t\t\t\t\t$pre_crumbs_st .= ' <span class=\"sep\">&gt;</span> <span>'. $crumb_name . '</span> ';\n\t\t\t\t} else {\n\t\t\t\t\t$pre_crumbs_st .= ' <span class=\"sep\">&gt;</span> <span><a href=\"' . $crumb_path . '\">'. $crumb_name . '</a></span> ';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tglobal $pre_crumbs_st;\n\t\tif ($show_on_home) echo $wrap_before . '<a href=\"' . $home_link . '\">' . $text['home'] . '</a>';\n\t\tif ($pre_crumbs_st) echo $pre_crumbs_st;\n\t\tif ($show_on_home) echo $wrap_after;\n\n\t} else {\n\n\t\t// TNA additional breadcrumbs\n\t\tglobal $pre_crumbs;\n\t\tif ( $pre_crumbs ) {\n\t\t\tglobal $pre_crumbs_st;\n\t\t\tforeach ($pre_crumbs as $crumb_name => $crumb_path) {\n\t\t\t\t$pre_crumbs_st .= ' <span class=\"sep\">&gt;</span> <span><a href=\"' . $crumb_path . '\">'. $crumb_name . '</a></span> ';\n\t\t\t}\n\t\t}\n\n\t\techo $wrap_before;\n\n\t\tif ($show_home_link) echo sprintf($link, $home_link, $text['home']);\n\n\t\tif ( is_page() && !$parent_id ) {\n\t\t\tglobal $pre_crumbs_st;\n\t\t\tif ($pre_crumbs_st) echo $pre_crumbs_st;\n\t\t\tif ($show_current) echo $sep . $before . get_the_title() . $after;\n\n\t\t} elseif ( is_page() && $parent_id ) {\n\t\t\tglobal $pre_crumbs_st;\n\t\t\tif ($pre_crumbs_st) echo $pre_crumbs_st;\n\t\t\tif ($show_home_link) echo $sep;\n\t\t\tif ($parent_id != $frontpage_id) {\n\t\t\t\t$breadcrumbs = array();\n\t\t\t\twhile ($parent_id) {\n\t\t\t\t\t$page = get_page($parent_id);\n\t\t\t\t\tif ($parent_id != $frontpage_id) {\n\t\t\t\t\t\t$breadcrumbs[] = sprintf($link, str_replace(home_url(), $pre_path, get_permalink($page->ID)), get_the_title($page->ID));\n\t\t\t\t\t}\n\t\t\t\t\t$parent_id = $page->post_parent;\n\t\t\t\t}\n\t\t\t\t$breadcrumbs = array_reverse($breadcrumbs);\n\t\t\t\tfor ($i = 0; $i < count($breadcrumbs); $i++) {\n\t\t\t\t\techo $breadcrumbs[$i];\n\t\t\t\t\tif ($i != count($breadcrumbs)-1) echo $sep;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($show_current) echo $sep . $before . get_the_title() . $after;\n\n\t\t} elseif ( is_404() ) {\n\t\t\tglobal $pre_crumbs_st;\n\t\t\tif ($pre_crumbs_st) echo $pre_crumbs_st;\n\t\t\tif ($show_home_link && $show_current) echo $sep;\n\t\t\tif ($show_current) echo $before . $text['404'] . $after;\n\n\t\t} elseif ( is_single() && !is_attachment() ) {\n\t\t\tglobal $pre_crumbs_st, $pre_crumbs_post;\n\t\t\tif ($pre_crumbs_st) echo $pre_crumbs_st;\n\t\t\tif ($pre_crumbs_post) echo $pre_crumbs_post;\n\t\t\tif ($show_home_link) echo $sep;\n\t\t\tif ( get_post_type() != 'post' ) {\n\t\t\t\t$post_type = get_post_type_object(get_post_type());\n\t\t\t\t$slug = $post_type->rewrite;\n\t\t\t\tprintf($link, $home_link . '/' . $slug['slug'] . '/', $post_type->labels->singular_name);\n\t\t\t\tif ($show_current) echo $sep . $before . get_the_title() . $after;\n\t\t\t} else {\n\t\t\t\t$cat = get_the_category(); $cat = $cat[0];\n\t\t\t\t$cats = get_category_parents($cat, TRUE, $sep);\n\t\t\t\tif (!$show_current || get_query_var('cpage')) $cats = preg_replace(\"#^(.+)$sep$#\", \"$1\", $cats);\n\t\t\t\t$cats = preg_replace('#<a([^>]+)>([^<]+)<\\/a>#', $link_before . '<a$1' . $link_attr .'>' . $link_in_before . '$2' . $link_in_after .'</a>' . $link_after, $cats);\n\t\t\t\t/*echo $cats;*/\n\t\t\t\tif ( get_query_var('cpage') ) {\n\t\t\t\t\techo $sep . sprintf($link, str_replace(home_url(), $pre_path, get_permalink()), get_the_title()) . $sep . $before . sprintf($text['cpage'], get_query_var('cpage')) . $after;\n\t\t\t\t} else {\n\t\t\t\t\tif ($show_current) echo $before . get_the_title() . $after;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\techo $wrap_after;\n\n\t}\n}", "function html_breadcrumb($hierarchy = null, $sep = ', ', $end = ' : ') {\n\t\tif(!is_array($hierarchy))\n\t\t\t$hierarchy = $this->hierarchy('page', PAGE_PATH);\n\t\t$nbr = count($hierarchy);\n\n\t\t$html = $plain = '';\n\t\tforeach($hierarchy as $id => $p) {\n\t\t\t// separators\n\t\t\tif($nbr > 1) {\n\t\t\t\tif($id < $nbr - 1) {\n\t\t\t\t\tif($id) {\n\t\t\t\t\t\t$plain.= $sep;\n\t\t\t\t\t\t$html .= $sep;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$plain.= $end;\n\t\t\t\t\t$html .= $end;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// titles\n\t\t\t$ttl = $this->page_title($p);\n\t\t\t$plain.= $ttl;\n\t\t\tif($id < $nbr-1)\n\t\t\t\t$html .= $this->parse_link($p);\n\t\t\telse\n\t\t\t\t$html .= '<strong><a id=\"title\" href=\"#top\">' . $ttl . '</a></strong>';\n\t\t}\n\t\treturn array('plain' => $plain, 'html' => $html);\n\t}", "function CreateBreadcrumb($categoryid, $tagtype='<a>') // or '<li>'\n{\n global $DB, $userinfo, $mainsettings, $pages_md_arr, $pages_parents_md_arr;\n\n if(!isset($pages_parents_md_arr)) return;\n $categories = array();\n $cat_id = $categoryid;\n while(!empty($cat_id))\n {\n if(isset($pages_md_arr[$cat_id]))\n {\n $cat = $pages_md_arr[$cat_id];\n array_unshift($categories, $cat);\n $cat_id = $cat['parentid'];\n }\n else\n {\n break;\n }\n }\n\n if(empty($categories))\n {\n return '';\n }\n\n $Breadcrumb = '';\n $count = count($categories);\n $idx = 1;\n // $categories is array with pages for a specific parent page\n foreach($categories as $category_arr)\n {\n // $category_arr contains actual page row (either cached or from DB)\n $category_name = strlen($category_arr['title'])?$category_arr['title']:$category_arr['name'];\n $category_link = strlen($category_arr['link']) ? $category_arr['link'] : RewriteLink('index.php?categoryid=' . $category_arr['categoryid']);\n $category_target = strlen($category_arr['target']) ? ' target=\"' . $category_arr['target'] . '\"' : '';\n switch($idx)\n {\n case 1 : $class ='class=\"first\" '; break;\n case $count: $class ='class=\"last\" '; break;\n default : $class = '';\n }\n //SD370: allow list items output\n //if($tagtype == '<li>') $Breadcrumb .= '<li>';\n if($category_arr['categoryid'] == $categoryid){\n $Breadcrumb .= '<li>'.$category_name.'</li>';\n }\n else{\n $Breadcrumb .= '<li><a '.$class.'href=\"'.$category_link.'\" '.$category_target.'>'.$category_name.'</a></li>';\n }\n //$Breadcrumb .= '<li><a '.$class.'href=\"'.$category_link.'\" '.$category_target.'>'.$category_name.'</a></li>';\n //if($tagtype == '<li>') $Breadcrumb .= '</li>';\n $idx++;\n }\n $Breadcrumb .= '<div style=\"clear:both;\"></div>'.\"\\n\";\n\n return $Breadcrumb;\n\n}", "function arlo_fn_breadcrumbs() {\n \n // Settings\n $separator = '<span></span>';\n $breadcrums_id = 'breadcrumbs';\n $breadcrums_class = 'breadcrumbs';\n $home_title = esc_html__('Home', 'arlo');\n \n // If you have any custom post types with custom taxonomies, put the taxonomy name below (e.g. product_cat)\n $custom_taxonomy = '';\n \n // Get the query & post information\n global $post,$wp_query;\n \n // Do not display on the homepage\n if ( !is_front_page() ) {\n \t\n\t\techo '<div class=\"arlo_fn_breadcrumbs\">';\n // Build the breadcrums\n echo '<ul id=\"' . esc_attr($breadcrums_id) . '\" class=\"' . esc_attr($breadcrums_class) . '\">';\n \n // Home page\n echo '<li class=\"item-home\"><a class=\"bread-link bread-home\" href=\"' . get_home_url() . '\" title=\"' . esc_attr($home_title) . '\">' . esc_html($home_title) . '</a></li>';\n echo '<li class=\"separator separator-home\"> ' . wp_kses_post($separator) . ' </li>';\n \n if ( is_archive() && !is_tax() && !is_category() && !is_tag() ) {\n \n\t\t\t echo '<li class=\"item-current item-archive\"><span class=\"bread-current bread-archive\">' . esc_html__('Archive', 'arlo') . '</span></li>';\n\t\t\t\n } else if ( is_archive() && is_tax() && !is_category() && !is_tag() ) {\n \n // If post is a custom post type\n $post_type = get_post_type();\n \n // If it is a custom post type display name and link\n if($post_type != 'post') {\n \n $post_type_object = get_post_type_object($post_type);\n $post_type_archive = get_post_type_archive_link($post_type);\n \n echo '<li class=\"item-cat item-custom-post-type-' . esc_attr($post_type) . '\"><a class=\"bread-cat bread-custom-post-type-' . esc_attr($post_type) . '\" href=\"' . esc_url($post_type_archive) . '\" title=\"' . esc_attr($post_type_object->labels->name) . '\">' . esc_attr($post_type_object->labels->name) . '</a></li>';\n echo '<li class=\"separator\"> ' . wp_kses_post($separator) . ' </li>';\n \n }\n \n $custom_tax_name = get_queried_object()->name;\n echo '<li class=\"item-current item-archive\"><span class=\"bread-current bread-archive\">' . esc_html($custom_tax_name) . '</span></li>';\n \n } else if ( is_single() ) {\n \n // If post is a custom post type\n $post_type = get_post_type();\n \n // If it is a custom post type display name and link\n if($post_type != 'post') {\n \n $post_type_object = get_post_type_object($post_type);\n $post_type_archive = get_post_type_archive_link($post_type);\n \n echo '<li class=\"item-cat item-custom-post-type-' . esc_attr($post_type) . '\"><a class=\"bread-cat bread-custom-post-type-' . esc_attr($post_type) . '\" href=\"' . esc_url($post_type_archive) . '\" title=\"' . esc_attr($post_type_object->labels->name) . '\">' . esc_html($post_type_object->labels->name) . '</a></li>';\n echo '<li class=\"separator\"> ' . wp_kses_post($separator) . ' </li>';\n \n }\n \n // Get post category info\n $category = get_the_category();\n \n if(!empty($category)) {\n \n // Get last category post is in\n $last_category = end(array_values($category));\n \n // Get parent any categories and create array\n $get_cat_parents = rtrim(get_category_parents($last_category->term_id, true, ','),',');\n $cat_parents = explode(',',$get_cat_parents);\n \n // Loop through parent categories and store in variable $cat_display\n $cat_display = '';\n foreach($cat_parents as $parents) {\n $cat_display .= '<li class=\"item-cat\">'.esc_html($parents).'</li>';\n $cat_display .= '<li class=\"separator\"> ' . esc_html($separator) . ' </li>';\n }\n \n }\n \n // If it's a custom post type within a custom taxonomy\n $taxonomy_exists = taxonomy_exists($custom_taxonomy);\n if(empty($last_category) && !empty($custom_taxonomy) && $taxonomy_exists) {\n $taxonomy_terms = get_the_terms( $post->ID, $custom_taxonomy );\n $cat_id = $taxonomy_terms[0]->term_id;\n $cat_nicename = $taxonomy_terms[0]->slug;\n $cat_link = get_term_link($taxonomy_terms[0]->term_id, $custom_taxonomy);\n $cat_name = $taxonomy_terms[0]->name;\n \n }\n \n // Check if the post is in a category\n if(!empty($last_category)) {\n echo wp_kses_post($cat_display);\n echo '<li class=\"item-current item-' . esc_attr($post->ID) . '\"><span class=\"bread-current bread-' . esc_attr($post->ID) . '\" title=\"' . get_the_title() . '\">' . get_the_title() . '</span></li>';\n \n // Else if post is in a custom taxonomy\n } else if(!empty($cat_id)) {\n \n echo '<li class=\"item-cat item-cat-' . esc_attr($cat_id) . ' item-cat-' . esc_attr($cat_nicename) . '\"><a class=\"bread-cat bread-cat-' . esc_attr($cat_id) . ' bread-cat-' . esc_attr($cat_nicename) . '\" href=\"' . esc_url($cat_link) . '\" title=\"' . esc_attr($cat_name) . '\">' . esc_html($cat_name) . '</a></li>';\n echo '<li class=\"separator\"> ' . wp_kses_post($separator) . ' </li>';\n echo '<li class=\"item-current item-' . esc_attr($post->ID) . '\"><span class=\"bread-current bread-' . esc_attr($post->ID) . '\" title=\"' . get_the_title() . '\">' . get_the_title() . '</span></li>';\n \n } else {\n \n echo '<li class=\"item-current item-' . esc_attr($post->ID) . '\"><span class=\"bread-current bread-' . esc_attr($post->ID) . '\" title=\"' . get_the_title() . '\">' . get_the_title() . '</span></li>';\n \n }\n \n } else if ( is_category() ) {\n \n // Category page\n echo '<li class=\"item-current item-cat\"><span class=\"bread-current bread-cat\">' . single_cat_title('', false) . '</span></li>';\n \n } else if ( is_page() ) {\n \n // Standard page\n if( $post->post_parent ){\n \n // If child page, get parents \n $anc = get_post_ancestors( $post->ID );\n \n // Get parents in the right order\n $anc = array_reverse($anc);\n \n // Parent page loop\n if ( !isset( $parents ) ) $parents = null;\n foreach ( $anc as $ancestor ) {\n $parents .= '<li class=\"item-parent item-parent-' . esc_attr($ancestor) . '\"><a class=\"bread-parent bread-parent-' . esc_attr($ancestor) . '\" href=\"' . get_permalink($ancestor) . '\" title=\"' . get_the_title($ancestor) . '\">' . get_the_title($ancestor) . '</a></li>';\n $parents .= '<li class=\"separator separator-' . esc_attr($ancestor) . '\"> ' . wp_kses_post($separator) . ' </li>';\n }\n \n // Display parent pages\n echo wp_kses_post($parents);\n \n // Current page\n echo '<li class=\"item-current item-' . esc_attr($post->ID) . '\"><span title=\"' . get_the_title() . '\"> ' . get_the_title() . '</span></li>';\n \n } else {\n \n // Just display current page if not parents\n echo '<li class=\"item-current item-' . esc_attr($post->ID) . '\"><span class=\"bread-current bread-' . esc_attr($post->ID) . '\"> ' . get_the_title() . '</span></li>';\n \n }\n \n } else if ( is_tag() ) {\n \n // Tag page\n \n // Get tag information\n $term_id = get_query_var('tag_id');\n $taxonomy = 'post_tag';\n $args = 'include=' . $term_id;\n $terms = get_terms( $taxonomy, $args );\n $get_term_id = $terms[0]->term_id;\n $get_term_slug = $terms[0]->slug;\n $get_term_name = $terms[0]->name;\n \n // Display the tag name\n echo '<li class=\"item-current item-tag-' . esc_attr($get_term_id) . ' item-tag-' . esc_attr($get_term_slug) . '\"><span class=\"bread-current bread-tag-' . esc_attr($get_term_id) . ' bread-tag-' . esc_attr($get_term_slug) . '\">' . esc_html($get_term_name) . '</span></li>';\n \n } elseif ( is_day() ) {\n \n // Day archive\n \n // Year link\n echo '<li class=\"item-year item-year-' . get_the_time('Y') . '\"><a class=\"bread-year bread-year-' . get_the_time('Y') . '\" href=\"' . get_year_link( get_the_time('Y') ) . '\" title=\"' . get_the_time('Y') . '\">' . get_the_time('Y') . esc_html__(' Archives', 'arlo').'</a></li>';\n echo '<li class=\"separator separator-' . get_the_time('Y') . '\"> ' . wp_kses_post($separator) . ' </li>';\n \n // Month link\n echo '<li class=\"item-month item-month-' . get_the_time('m') . '\"><a class=\"bread-month bread-month-' . get_the_time('m') . '\" href=\"' . get_month_link( get_the_time('Y'), get_the_time('m') ) . '\" title=\"' . get_the_time('M') . '\">' . get_the_time('M') . esc_html__(' Archives', 'arlo').'</a></li>';\n echo '<li class=\"separator separator-' . get_the_time('m') . '\"> ' . wp_kses_post($separator) . ' </li>';\n \n // Day display\n echo '<li class=\"item-current item-' . get_the_time('j') . '\"><span class=\"bread-current bread-' . get_the_time('j') . '\"> ' . get_the_time('jS') . ' ' . get_the_time('M') . esc_html__(' Archives', 'arlo').'</span></li>';\n \n } else if ( is_month() ) {\n \n // Month Archive\n \n // Year link\n echo '<li class=\"item-year item-year-' . get_the_time('Y') . '\"><a class=\"bread-year bread-year-' . get_the_time('Y') . '\" href=\"' . get_year_link( get_the_time('Y') ) . '\" title=\"' . get_the_time('Y') . '\">' . get_the_time('Y') . esc_html__(' Archives', 'arlo').'</a></li>';\n echo '<li class=\"separator separator-' . get_the_time('Y') . '\"> ' . wp_kses_post($separator) . ' </li>';\n \n // Month display\n echo '<li class=\"item-month item-month-' . get_the_time('m') . '\"><span class=\"bread-month bread-month-' . get_the_time('m') . '\" title=\"' . get_the_time('M') . '\">' . get_the_time('M') . esc_html__(' Archives', 'arlo').'</span></li>';\n \n } else if ( is_year() ) {\n \n // Display year archive\n echo '<li class=\"item-current item-current-' . get_the_time('Y') . '\"><span class=\"bread-current bread-current-' . get_the_time('Y') . '\" title=\"' . get_the_time('Y') . '\">' . get_the_time('Y') . esc_html__(' Archives', 'arlo').'</span></li>';\n \n } else if ( is_author() ) {\n \n // Auhor archive\n \n // Get the author information\n global $author;\n $userdata = get_userdata( $author );\n \n // Display author name\n echo '<li class=\"item-current item-current-' . esc_attr($userdata->display_name) . '\"><span class=\"bread-current bread-current-' . esc_attr($userdata->display_name) . '\" title=\"' . esc_attr($userdata->display_name) . '\">' . esc_html__('Author: ', 'arlo') . esc_html($userdata->display_name) . '</span></li>';\n \n } else if ( get_query_var('paged') ) {\n \n // Paginated archives\n echo '<li class=\"item-current item-current-' . get_query_var('paged') . '\"><span class=\"bread-current bread-current-' . get_query_var('paged') . '\" title=\"'.esc_attr__('Page ', 'arlo') . get_query_var('paged') . '\">'.esc_html__('Page', 'arlo') . ' ' . get_query_var('paged') . '</span></li>';\n \n } else if ( is_search() ) {\n \n // Search results page\n echo '<li class=\"item-current item-current-' . get_search_query() . '\"><span class=\"bread-current bread-current-' . get_search_query() . '\" title=\"'.esc_attr__('Search results for: ', 'arlo'). get_search_query() . '\">' .esc_html__('Search results for: ', 'arlo') . get_search_query() . '</span></li>';\n \n } elseif ( is_404() ) {\n \n // 404 page\n echo '<li>' . esc_html__('Error 404', 'arlo') . '</li>';\n }\n \n echo '</ul>';\n\t\techo '</div>';\n \n }\n \n}", "function ss_breadcrumbs() {\r\n\tglobal $post;\r\n\r\n\t$blog_page_title = get_the_title( get_queried_object_id() );\r\n\r\n\techo '<ul class=\"theme-breadcrumbs\">';\r\n\r\n\tif ( !is_front_page() ) {\r\n\t\techo '<li><a href=\"';\r\n\t\techo home_url();\r\n\t\techo '\">'.__( 'Home', 'spnoy' );\r\n\t\techo \"</a></li>\";\r\n\t}\r\n\r\n\t$params['link_none'] = '';\r\n\t$separator = '';\r\n\r\n\tif ( is_category() && !is_singular( 'portfolio' ) ) {\r\n\t\t$category = get_the_category();\r\n\t\t$ID = $category[0]->cat_ID;\r\n\t\techo is_wp_error( $cat_parents = get_category_parents( $ID, TRUE, '', FALSE ) ) ? '' : '<li>'.$cat_parents.'</li>';\r\n\t}\r\n\r\n\tif ( is_singular( 'portfolio' ) ) {\r\n\t\techo get_the_term_list( $post->ID, 'portfolio-category', '<li>', '&nbsp;/&nbsp;&nbsp;', '</li>' );\r\n\t\techo '<li>'.get_the_title().'</li>';\r\n\t}\r\n\r\n\tif ( is_tax( 'portfolio-category' ) ) {\r\n\t\techo '<li>'.get_query_var( 'portfolio-category' ).'</li>';\r\n\t}\r\n\r\n\tif ( is_home() ) { echo '<li>'.$blog_page_title.'</li>'; }\r\n\tif ( is_page() && !is_front_page() ) {\r\n\t\t$parents = array();\r\n\t\t$parent_id = $post->post_parent;\r\n\t\twhile ( $parent_id ) :\r\n\t\t\t$page = get_page( $parent_id );\r\n\t\tif ( $params[\"link_none\"] )\r\n\t\t\t$parents[] = get_the_title( $page->ID );\r\n\t\telse\r\n\t\t\t$parents[] = '<li><a href=\"' . get_permalink( $page->ID ) . '\" title=\"' . get_the_title( $page->ID ) . '\">' . get_the_title( $page->ID ) . '</a></li>' . $separator;\r\n\t\t$parent_id = $page->post_parent;\r\n\t\tendwhile;\r\n\t\t$parents = array_reverse( $parents );\r\n\t\techo join( ' ', $parents );\r\n\t\techo '<li>'.get_the_title().'</li>';\r\n\t}\r\n\tif ( is_single() && !is_singular( 'portfolio' ) ) {\r\n\t\t$categories_1 = get_the_category( $post->ID );\r\n\t\tif ( $categories_1 ):\r\n\t\t\tforeach ( $categories_1 as $cat_1 ):\r\n\t\t\t\t$cat_1_ids[] = $cat_1->term_id;\r\n\t\t\tendforeach;\r\n\t\t$cat_1_line = implode( ',', $cat_1_ids );\r\n\t\tendif;\r\n\t\t$categories = get_categories( array(\r\n\t\t\t\t'include' => $cat_1_line,\r\n\t\t\t\t'orderby' => 'id'\r\n\t\t\t) );\r\n\t\tif ( $categories ) :\r\n\t\t\tforeach ( $categories as $cat ) :\r\n\t\t\t\t$cats[] = '<li><a href=\"' . get_category_link( $cat->term_id ) . '\" title=\"' . $cat->name . '\">' . $cat->name . '</a></li>';\r\n\t\t\tendforeach;\r\n\t\techo join( ' ', $cats );\r\n\t\tendif;\r\n\t\techo '<li>'.get_the_title().'</li>';\r\n\t}\r\n\tif ( is_tag() ) { echo '<li>'.\"Tag: \".single_tag_title( '', FALSE ).'</li>'; }\r\n\tif ( is_404() ) { echo '<li>'.__( \"404 - Page not Found\", 'spnoy' ).'</li>'; }\r\n\tif ( is_search() ) { echo '<li>'.__( \"Search\", 'spnoy' ).'</li>'; }\r\n\tif ( is_year() ) { echo '<li>'.get_the_time( get_option( 'date_format' ) ).'</li>'; }\r\n\tif ( is_month() ) { echo '<li>'.get_the_time( get_option( 'date_format' ) ).'</li>'; }\r\n\tif ( is_day() ) { echo '<li>'.get_the_time( get_option( 'date_format' ) ).'</li>'; }\r\n\r\n\techo \"</ul>\";\r\n}", "function apoc_get_buddypress_breadcrumbs( $args = array() ) {\n\t$bp_trail = array();\n\t\n\t// Directories \n\tif ( bp_is_directory() ) :\n\t\tif ( bp_is_activity_component() ) : $bp_trail[] = 'Recent Activity';\n\t\telseif ( bp_is_members_component() ) : $bp_trail[] = 'Members Directory';\n\t\telseif ( bp_is_groups_component() ) : $bp_trail[] = 'Groups and Guilds Directory';\n\t\telse : $bp_trail[] = ucfirst( bp_current_component() );\n\t\tendif;\n\t\n\t// Single Member \n\telseif ( bp_is_user() ) : \n\t\t$bp_trail[] = '<a href=\"'. bp_get_members_directory_permalink() .'\" title=\"Members Directory\">Members</a>';\n\t\t\n\t\t// Get the displayed user \n\t\tif ( bp_is_my_profile() ) : $bp_trail[] = '<a href=\"'.bp_displayed_user_domain().'\" title=\"Your Profile\">Your Profile</a>';\n\t\telse : $bp_trail[] = '<a href=\"'.bp_displayed_user_domain().'\" title=\"'.bp_get_displayed_user_fullname(). '\">' . bp_get_displayed_user_fullname() . '</a>';\n\t\tendif;\n\n\t\t// Display the current component \n\t\t$bp_trail[] = ucfirst( bp_current_component() );\n\t\t\n\t// Single Group \n\telseif ( bp_is_group() ) :\n\t\t\n\t\t// Get the displayed group \n\t\tif ( bp_get_current_group_id() == 1 ) :\n\t\t\t$bp_trail[] = '<a href=\"'. home_url() . '/entropy-rising/\">Entropy Rising</a>';\n\t\telse :\n\t\t\t$bp_trail[] = '<a href=\"'. bp_get_groups_directory_permalink() .'\">Guilds</a>';\n\t\t\t$bp_trail[] = '<a href=\"'. bp_get_group_permalink() .'\" title=\"'.bp_get_current_group_name().'\">'.bp_get_current_group_name().'</a>';\n\t\tendif;\n\t\t\n\t\t// Display the current group action for everything except forums \n\t\tif ( 'home' == bp_current_action() ) : $bp_trail[] = 'Profile';\n\t\telseif ( bp_current_action() != 'forum' ) : $bp_trail[] = ucfirst( bp_current_action() );\n\t\telseif ( bp_current_action() == 'forum' ) : \n\t\t\t$bp_trail = array_merge( $bp_trail, apoc_get_group_forum_breadcrumbs() );\n\t\tendif;\n\t\n\t// User Registration \n\telseif ( bp_is_register_page() ) :\n\t\t$bp_trail[] = 'New User Registration';\n\t\n\t// User Activation \n\telseif ( bp_is_activation_page() ) :\n\t\t$bp_trail[] = 'User Account Activation';\n\t\n\t// New Group Creation \n\telseif ( bp_is_group_create() ) :\n\t\t$bp_trail[] = 'Create New Group';\n\n \tendif;\n\treturn $bp_trail;\n}", "public static function getCrumbsHtml()\n {\n $html = \"\\n\";\n $glue = ' <span class=\"glyphicon glyphicon-chevron-right\"></span> ';\n $trail = [];\n $menuArray = self::getMenuArray();\n\n // get pagePath (only from site-root), and adjust to the same format as how the $menu_array paths are defined\n $pagePath = self::pagePathFromSiteRoot(''); // '' = no extension as per $menu_array path definitions\n if(substr($pagePath,-5)=='index') $pagePath = substr($pagePath,0,strlen($pagePath)-5); // also remove /path/\"index\" as per $menu_array path definitions\n #dmsg('pagePath',$pagePath,'crumbs');\n\n // prepare home link for beginning of trail\n $homeLink = '<a href=\"' . self::_menuLink2href(self::homePath()) . '\">Home</a>';\n\n // search the menu array for matching path\n if ( self::findPageInMenu( $pagePath, $menuArray, $trail ) ) {\n $trail[] = $homeLink;\n dmsg('trail',$trail,'crumbs');\n $html .= implode( $glue, array_reverse( $trail ) );\n } else {\n // not in menuArray, use this pages dir components to build a virtual trail\n $trail = explode('/', trim(self::$pathComponentDirs,'/')); if(isset($trail[0]) && $trail[0]=='') $trail=[];\n #$trail[] = '<a href=\"' . self::_menuLink2href($pagePath) . '\">'.self::pageFilename('').'</a>';\n $trail[] = self::pageFilename(''); // dont href self\n array_unshift($trail, $homeLink);\n dmsg('trail',$trail,'crumbs');\n $html .= '<span class=\"capitalize\">' . implode( $glue, $trail ) . '</span>';\n }\n return $html;\n }", "function faculty_settings_breadcrumb() { \n faculty_setting_line(faculty_add_color_setting('breadcrumb_font_color', __('Font Color', FACULTY_DOMAIN)));\n faculty_setting_line(faculty_add_size_setting('breadcrumb_font_size', __('Font Size', FACULTY_DOMAIN)));\n faculty_setting_line(faculty_add_select_setting('breadcrumb_text_transform', __('Text Transform', FACULTY_DOMAIN), 'transform'));\n faculty_setting_line(faculty_add_border_setting('breadcrumb_border', __('Bottom Border', FACULTY_DOMAIN)));\n do_action('faculty_settings_breadcrumb');\n}", "function maincatBreadCrumb($arr)\n\t{\t\n\t\treturn '<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"resultDETAILS\">\n <tr>\n <td align=\"left\" scope=\"col\"><a href=\"?do=indexpage\">Home</a> <b>&gt;&gt;</b> '.$arr[0]['Category'].'</td></tr></table>';\n\t}", "function get_uams_breadcrumbs()\n{\n\nglobal $post;\n$ancestors = array_reverse( get_post_ancestors( $post->ID ) );\n$html = '<li><a href=\"http://inside.uams.edu\" title=\"University of Arkansas for Medical Scineces\">Home</a></li>';\nif ( !is_main_site() )\n{\n$html .= '<li' . (is_front_page() ? ' class=\"current\"' : '') . '><a href=\"' . home_url('/') . '\" title=\"' . str_replace(' ', ' ', get_bloginfo('title')) . '\">' . str_replace(' ', ' ', get_bloginfo('title')) . '</a><li>';\n}\n\nif ( is_404() )\n{\n $html .= '<li class=\"current\"><span>Ooops!</span>';\n} else\n\nif ( is_search() )\n{\n $html .= '<li class=\"current\"><span>Search results for ' . get_search_query() . '</span>';\n} else\n\nif ( is_author() )\n{\n $author = get_queried_object();\n $html .= '<li class=\"current\"><span> Author: ' . $author->display_name . '</span>';\n} else\n\nif ( get_queried_object_id() === (Int) get_option('page_for_posts') ) {\n $html .= '<li class=\"current\"><span> '. get_the_title( get_queried_object_id() ) . ' </span>';\n}\n\n// If the current view is a post type other than page or attachment then the breadcrumbs will be taxonomies.\nif( is_category() || is_tax() || is_single() || is_post_type_archive() )\n{\n\n if ( is_post_type_archive() && !is_tax() )\n {\n $posttype = get_post_type_object( get_post_type() );\n //$html .= '<li class=\"current\"><a href=\"' . get_post_type_archive_link( $posttype->query_var ) .'\" title=\"'. $posttype->labels->menu_name .'\">'. $posttype->labels->menu_name . '</a>';\n $html .= '<li class=\"current\"><span>'. $posttype->labels->menu_name . '</span>';\n }\n\n if ( is_category() )\n {\n $category = get_category( get_query_var( 'cat' ) );\n //$html .= '<li class=\"current\"><a href=\"' . get_category_link( $category->term_id ) .'\" title=\"'. get_cat_name( $category->term_id ).'\">'. get_cat_name($category->term_id ) . '</a>';\n $html .= '<li class=\"current\"><span>'. get_cat_name($category->term_id ) . '</span>';\n }\n\n if ( is_tax() && !is_post_type_archive() )\n {\n $term = get_term_by(\"slug\", get_query_var(\"term\"), get_query_var(\"taxonomy\") );\n $tax = get_taxonomy( get_query_var(\"taxonomy\") );\n //$html .= '<li class=\"current\"><a href=\"' . get_category_link( $category->term_id ) .'\" title=\"'. get_cat_name( $category->term_id ).'\">'. get_cat_name($category->term_id ) . '</a>';\n $html .= '<li class=\"current\"><span>'. $tax->labels->name .': '. $term->name .'</span>';\n }\n\n if ( is_tax() && is_post_type_archive() )\n {\n $tax = get_term_by(\"slug\", get_query_var(\"term\"), get_query_var(\"taxonomy\") );\n $posttype = get_post_type_object( get_post_type() );\n //$html .= '<li class=\"current\"><a href=\"' . get_category_link( $category->term_id ) .'\" title=\"'. get_cat_name( $category->term_id ).'\">'. get_cat_name($category->term_id ) . '</a>';\n $html .= '<li class=\"current\"><span>'. $tax->name . '</span>';\n }\n\n if ( is_single() )\n {\n if ( has_category() )\n {\n $thecat = get_the_category( $post->ID );\n $category = array_shift( $thecat ) ;\n $html .= '<li><a href=\"' . get_category_link( $category->term_id ) .'\" title=\"'. get_cat_name( $category->term_id ).'\">'. get_cat_name($category->term_id ) . '</a>';\n }\n if ( uams_is_custom_post_type() )\n {\n $posttype = get_post_type_object( get_post_type() );\n $archive_link = get_post_type_archive_link( $posttype->query_var );\n if (!empty($archive_link)) {\n $html .= '<li><a href=\"' . $archive_link .'\" title=\"'. $posttype->labels->menu_name .'\">'. $posttype->labels->menu_name . '</a>';\n }\n else if (!empty($posttype->rewrite['slug'])){\n $html .= '<li><a href=\"' . site_url('/' . $posttype->rewrite['slug'] . '/') .'\" title=\"'. $posttype->labels->menu_name .'\">'. $posttype->labels->menu_name . '</a>';\n }\n }\n $html .= '<li class=\"current\"><span>'. get_the_title( $post->ID ) . '</span>';\n }\n}\n\n// If the current view is a page then the breadcrumbs will be parent pages.\nelse if ( is_page() )\n{\n\n if ( ! is_home() || ! is_front_page() )\n $ancestors[] = $post->ID;\n\n if ( ! is_front_page() )\n {\n foreach ( array_filter( $ancestors ) as $index=>$ancestor )\n {\n $class = $index+1 == count($ancestors) ? ' class=\"current\" ' : '';\n $page = get_post( $ancestor );\n $url = get_permalink( $page->ID );\n $title_attr = esc_attr( $page->post_title );\n if (!empty($class)){\n $html .= \"<li $class><span>{$page->post_title}</span></li>\";\n }\n else {\n $html .= \"<li><a href=\\\"$url\\\" title=\\\"{$title_attr}\\\">{$page->post_title}</a></li>\";\n }\n }\n }\n\n}\n\nreturn \"<nav class='uams-breadcrumbs' aria-label='breadcrumbs'><ul>$html</ul></nav>\";\n}", "public function bread_menu()\n\t{\n\t\t// get current url address\n\t\t$VarServer = $_SERVER['REQUEST_URI'];\n\n\t\t// we trimed back slash left part of url to equal the string provided by the current address\n\t\t$trimed_server_name = ltrim($VarServer, '/');\n\t\t$xploded = explode('/', $trimed_server_name);\n\n\t\t\t// need to evaluate if there's extension to our url, if extended. we must trim the last part of url to find match in our query stated below\n\t\t\tif(count($xploded) > 2)\n\t\t\t{\n\t\t\t\t// url has extension\n\t\t\t\t// this should be match \n\t\t\t\t$on_the_go_url = $xploded[0].\"/\".$xploded[1];\n\t\t\t\t// this is the last part or the main display page name of breadcrumbs\n\t\t\t\t$bread_extend = $xploded[count($xploded)-1];\n\t\t\t} else\n\t\t\t{\n\t\t\t\t// no url extension, *condition\n\t\t\t\t$on_the_go_url = $xploded[0].\"/\".$xploded[1];\n\t\t\t\t$bread_extend = '';\n\t\t\t}\n\n\t\t// our main selecion query\n\t $module_name = $this->where('url', $on_the_go_url)->get();\n\n\t\t\tif(count($module_name) > 0)\n\t\t\t{\n\t\t\t\t// get database selection output\n\t\t\t\tforeach ($module_name as $tinapay) {\n\t\t\t\t\t$urls = '/'.$tinapay->url;\n\t\t\t\t\t$name_mod = $tinapay->name; \n\t\t\t\t}\n\n\t\t\t\t//main keyword functions or output generation if our breadcrumbs :D\n\t\t\t\tBreadcrumb::addbreadcrumb('Home', '/home/dashboard');\n\t\t\t\tBreadcrumb::addbreadcrumb($name_mod, $urls);\n\t\t\t\t// this is the extension name/display name\n\t\t\t\tif($bread_extend != null){\n\t\t\t\t\tBreadcrumb::addbreadcrumb($bread_extend);\n\t\t\t\t}\n\t\t\t\t// as you can see, it is a separator defined by itself :D\n\t\t\t\tBreadcrumb::setSeparator('>');\n\n\t\t\t\t// returns output of this method\n\t\t \treturn Breadcrumb::generate(); //Breadcrumbs UL is generated and stored in an array.\n\t\t\t}\n\t}", "public function testBreadcrumb() {\n\t\t$this->assertNull($this->Html->getCrumbs());\n\n\t\t$this->Html->addCrumb('First', '#first');\n\t\t$this->Html->addCrumb('Second', '#second');\n\t\t$this->Html->addCrumb('Third', '#third');\n\n\t\t$result = $this->Html->getCrumbs();\n\t\t$expected = array(\n\t\t\tarray('a' => array('href' => '#first')),\n\t\t\t'First',\n\t\t\t'/a',\n\t\t\t'&raquo;',\n\t\t\tarray('a' => array('href' => '#second')),\n\t\t\t'Second',\n\t\t\t'/a',\n\t\t\t'&raquo;',\n\t\t\tarray('a' => array('href' => '#third')),\n\t\t\t'Third',\n\t\t\t'/a',\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\n\t\t$result = $this->Html->getCrumbs(' &gt; ');\n\t\t$expected = array(\n\t\t\tarray('a' => array('href' => '#first')),\n\t\t\t'First',\n\t\t\t'/a',\n\t\t\t' &gt; ',\n\t\t\tarray('a' => array('href' => '#second')),\n\t\t\t'Second',\n\t\t\t'/a',\n\t\t\t' &gt; ',\n\t\t\tarray('a' => array('href' => '#third')),\n\t\t\t'Third',\n\t\t\t'/a',\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\n\t\t$this->Html->addCrumb('Fourth', null);\n\n\t\t$result = $this->Html->getCrumbs();\n\t\t$expected = array(\n\t\t\tarray('a' => array('href' => '#first')),\n\t\t\t'First',\n\t\t\t'/a',\n\t\t\t'&raquo;',\n\t\t\tarray('a' => array('href' => '#second')),\n\t\t\t'Second',\n\t\t\t'/a',\n\t\t\t'&raquo;',\n\t\t\tarray('a' => array('href' => '#third')),\n\t\t\t'Third',\n\t\t\t'/a',\n\t\t\t'&raquo;',\n\t\t\t'Fourth'\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\n\t\t$result = $this->Html->getCrumbs('-', 'Start');\n\t\t$expected = array(\n\t\t\tarray('a' => array('href' => '/')),\n\t\t\t'Start',\n\t\t\t'/a',\n\t\t\t'-',\n\t\t\tarray('a' => array('href' => '#first')),\n\t\t\t'First',\n\t\t\t'/a',\n\t\t\t'-',\n\t\t\tarray('a' => array('href' => '#second')),\n\t\t\t'Second',\n\t\t\t'/a',\n\t\t\t'-',\n\t\t\tarray('a' => array('href' => '#third')),\n\t\t\t'Third',\n\t\t\t'/a',\n\t\t\t'-',\n\t\t\t'Fourth'\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\t}", "public function Breadcrumbs() {\n\t\t$nonPageParts = array();\n\t\t$parts = array();\n\n\t\t$forumHolder = $this->getForumHolder();\n\t\t$member = $this->Member();\n\n\t\t$parts[] = '<a href=\"' . $forumHolder->Link() . '\">' . $forumHolder->Title . '</a>';\n\t\t$nonPageParts[] = _t('ForumMemberProfile.USERPROFILE', 'User Profile');\n\n\t\treturn implode(\" &raquo; \", array_reverse(array_merge($nonPageParts, $parts)));\n\t}", "public function getBreadCrumb()\n {\n $aPaths = array();\n $aPath = array();\n $iBaseLanguage = oxRegistry::getLang()->getBaseLanguage();\n $sSelfLink = $this->getViewConfig()->getSelfLink();\n\n $aPath['title'] = oxRegistry::getLang()->translateString('MY_ACCOUNT', $iBaseLanguage, false);\n $aPath['link'] = oxRegistry::get(\"oxSeoEncoder\")->getStaticUrl($sSelfLink . 'cl=account');\n $aPaths[] = $aPath;\n\n $aPath['title'] = oxRegistry::getLang()->translateString('ORDER_HISTORY', $iBaseLanguage, false);\n $aPath['link'] = $this->getLink();\n $aPaths[] = $aPath;\n\n return $aPaths;\n }", "function get_breadcrumb() {\n // Settings\n $separator = '<i class=\"fa fa-angle-right\"></i>';\n $breadcrums_id = 'breadcrumbs';\n $breadcrums_class = 'breadcrumbs';\n $home_title = 'Home';\n \n // If you have any custom post types with custom taxonomies, put the taxonomy name below (e.g. product_cat)\n $custom_taxonomy = 'product_cat';\n \n // Get the query & post information\n global $post,$wp_query;\n \n // Do not display on the homepage\n if ( !is_front_page() ) {\n \n // Build the breadcrums\n echo '<ul id=\"' . $breadcrums_id . '\" class=\"' . $breadcrums_class . '\">';\n \n // Home page\n echo '<li class=\"item-home\"><a class=\"bread-link bread-home\" href=\"' . get_home_url() . '\" title=\"' . $home_title . '\">' . $home_title . '</a></li>';\n echo '<li class=\"separator separator-home\"> ' . $separator . ' </li>';\n \n if ( is_archive() && !is_tax() && !is_category() && !is_tag() ) {\n \n echo '<li class=\"item-current item-archive\"><strong class=\"bread-current bread-archive\">' . post_type_archive_title($prefix, false) . '</strong></li>';\n \n } else if ( is_archive() && is_tax() && !is_category() && !is_tag() ) {\n \n // If post is a custom post type\n $post_type = get_post_type();\n \n // If it is a custom post type display name and link\n if($post_type != 'post') {\n \n $post_type_object = get_post_type_object($post_type);\n $post_type_archive = get_post_type_archive_link($post_type);\n \n echo '<li class=\"item-cat item-custom-post-type-' . $post_type . '\"><a class=\"bread-cat bread-custom-post-type-' . $post_type . '\" href=\"' . $post_type_archive . '\" title=\"' . $post_type_object->labels->name . '\">' . $post_type_object->labels->name . '</a></li>';\n echo '<li class=\"separator\"> ' . $separator . ' </li>';\n \n }\n \n $custom_tax_name = get_queried_object()->name;\n echo '<li class=\"item-current item-archive\"><strong class=\"bread-current bread-archive\">' . $custom_tax_name . '</strong></li>';\n \n } else if ( is_single() ) {\n \n // If post is a custom post type\n $post_type = get_post_type();\n \n // If it is a custom post type display name and link\n if($post_type != 'post') {\n \n $post_type_object = get_post_type_object($post_type);\n $post_type_archive = get_post_type_archive_link($post_type);\n \n echo '<li class=\"item-cat item-custom-post-type-' . $post_type . '\"><a class=\"bread-cat bread-custom-post-type-' . $post_type . '\" href=\"' . $post_type_archive . '\" title=\"' . $post_type_object->labels->name . '\">' . $post_type_object->labels->name . '</a></li>';\n echo '<li class=\"separator\"> ' . $separator . ' </li>';\n \n }\n \n // Get post category info\n // $category = get_the_category();\n \n // if(!empty($category)) {\n \n // // Get last category post is in\n // $last_category = end(array_values($category));\n \n // // Get parent any categories and create array\n // $get_cat_parents = rtrim(get_category_parents($last_category->term_id, true, ','),',');\n // $cat_parents = explode(',',$get_cat_parents);\n \n // // Loop through parent categories and store in variable $cat_display\n // $cat_display = '';\n // foreach($cat_parents as $parents) {\n // $cat_display .= '<li class=\"item-cat\">'.$parents.'</li>';\n // $cat_display .= '<li class=\"separator\"> ' . $separator . ' </li>';\n // }\n \n // }\n \n // If it's a custom post type within a custom taxonomy\n $taxonomy_exists = taxonomy_exists($custom_taxonomy);\n if(empty($last_category) && !empty($custom_taxonomy) && $taxonomy_exists) {\n \n $taxonomy_terms = get_the_terms( $post->ID, $custom_taxonomy );\n $cat_id = $taxonomy_terms[0]->term_id;\n $cat_nicename = $taxonomy_terms[0]->slug;\n $cat_link = get_term_link($taxonomy_terms[0]->term_id, $custom_taxonomy);\n $cat_name = $taxonomy_terms[0]->name;\n \n }\n \n // Check if the post is in a category\n if(!empty($last_category)) {\n echo $cat_display;\n echo '<li class=\"item-current item-' . $post->ID . '\"><strong class=\"bread-current bread-' . $post->ID . '\" title=\"' . get_the_title() . '\">' . get_the_title() . '</strong></li>';\n \n // Else if post is in a custom taxonomy\n } else if(!empty($cat_id)) {\n \n echo '<li class=\"item-cat item-cat-' . $cat_id . ' item-cat-' . $cat_nicename . '\"><a class=\"bread-cat bread-cat-' . $cat_id . ' bread-cat-' . $cat_nicename . '\" href=\"' . $cat_link . '\" title=\"' . $cat_name . '\">' . $cat_name . '</a></li>';\n echo '<li class=\"separator\"> ' . $separator . ' </li>';\n echo '<li class=\"item-current item-' . $post->ID . '\"><strong class=\"bread-current bread-' . $post->ID . '\" title=\"' . get_the_title() . '\">' . get_the_title() . '</strong></li>';\n \n } else {\n \n echo '<li class=\"item-current item-' . $post->ID . '\"><strong class=\"bread-current bread-' . $post->ID . '\" title=\"' . get_the_title() . '\">' . get_the_title() . '</strong></li>';\n \n }\n \n } else if ( is_category() ) {\n \n // Category page\n echo '<li class=\"item-current item-cat\"><strong class=\"bread-current bread-cat\">' . single_cat_title('', false) . '</strong></li>';\n \n } else if ( is_page() ) {\n \n // Standard page\n if( $post->post_parent ){\n \n // If child page, get parents \n $anc = get_post_ancestors( $post->ID );\n \n // Get parents in the right order\n $anc = array_reverse($anc);\n \n // Parent page loop\n if ( !isset( $parents ) ) $parents = null;\n foreach ( $anc as $ancestor ) {\n $parents .= '<li class=\"item-parent item-parent-' . $ancestor . '\"><a class=\"bread-parent bread-parent-' . $ancestor . '\" href=\"' . get_permalink($ancestor) . '\" title=\"' . get_the_title($ancestor) . '\">' . get_the_title($ancestor) . '</a></li>';\n $parents .= '<li class=\"separator separator-' . $ancestor . '\"> ' . $separator . ' </li>';\n }\n \n // Display parent pages\n echo $parents;\n \n // Current page\n echo '<li class=\"item-current item-' . $post->ID . '\"><strong title=\"' . get_the_title() . '\"> ' . get_the_title() . '</strong></li>';\n \n } else {\n \n // Just display current page if not parents\n echo '<li class=\"item-current item-' . $post->ID . '\"><strong class=\"bread-current bread-' . $post->ID . '\"> ' . get_the_title() . '</strong></li>';\n \n }\n \n } else if ( is_tag() ) {\n \n // Tag page\n \n // Get tag information\n $term_id = get_query_var('tag_id');\n $taxonomy = 'post_tag';\n $args = 'include=' . $term_id;\n $terms = get_terms( $taxonomy, $args );\n $get_term_id = $terms[0]->term_id;\n $get_term_slug = $terms[0]->slug;\n $get_term_name = $terms[0]->name;\n \n // Display the tag name\n echo '<li class=\"item-current item-tag-' . $get_term_id . ' item-tag-' . $get_term_slug . '\"><strong class=\"bread-current bread-tag-' . $get_term_id . ' bread-tag-' . $get_term_slug . '\">' . $get_term_name . '</strong></li>';\n \n } elseif ( is_day() ) {\n \n // Day archive\n \n // Year link\n echo '<li class=\"item-year item-year-' . get_the_time('Y') . '\"><a class=\"bread-year bread-year-' . get_the_time('Y') . '\" href=\"' . get_year_link( get_the_time('Y') ) . '\" title=\"' . get_the_time('Y') . '\">' . get_the_time('Y') . ' Archives</a></li>';\n echo '<li class=\"separator separator-' . get_the_time('Y') . '\"> ' . $separator . ' </li>';\n \n // Month link\n echo '<li class=\"item-month item-month-' . get_the_time('m') . '\"><a class=\"bread-month bread-month-' . get_the_time('m') . '\" href=\"' . get_month_link( get_the_time('Y'), get_the_time('m') ) . '\" title=\"' . get_the_time('M') . '\">' . get_the_time('M') . ' Archives</a></li>';\n echo '<li class=\"separator separator-' . get_the_time('m') . '\"> ' . $separator . ' </li>';\n \n // Day display\n echo '<li class=\"item-current item-' . get_the_time('j') . '\"><strong class=\"bread-current bread-' . get_the_time('j') . '\"> ' . get_the_time('jS') . ' ' . get_the_time('M') . ' Archives</strong></li>';\n \n } else if ( is_month() ) {\n \n // Month Archive\n \n // Year link\n echo '<li class=\"item-year item-year-' . get_the_time('Y') . '\"><a class=\"bread-year bread-year-' . get_the_time('Y') . '\" href=\"' . get_year_link( get_the_time('Y') ) . '\" title=\"' . get_the_time('Y') . '\">' . get_the_time('Y') . ' Archives</a></li>';\n echo '<li class=\"separator separator-' . get_the_time('Y') . '\"> ' . $separator . ' </li>';\n \n // Month display\n echo '<li class=\"item-month item-month-' . get_the_time('m') . '\"><strong class=\"bread-month bread-month-' . get_the_time('m') . '\" title=\"' . get_the_time('M') . '\">' . get_the_time('M') . ' Archives</strong></li>';\n \n } else if ( is_year() ) {\n \n // Display year archive\n echo '<li class=\"item-current item-current-' . get_the_time('Y') . '\"><strong class=\"bread-current bread-current-' . get_the_time('Y') . '\" title=\"' . get_the_time('Y') . '\">' . get_the_time('Y') . ' Archives</strong></li>';\n \n } else if ( is_author() ) {\n \n // Auhor archive\n \n // Get the author information\n global $author;\n $userdata = get_userdata( $author );\n \n // Display author name\n echo '<li class=\"item-current item-current-' . $userdata->user_nicename . '\"><strong class=\"bread-current bread-current-' . $userdata->user_nicename . '\" title=\"' . $userdata->display_name . '\">' . 'Author: ' . $userdata->display_name . '</strong></li>';\n \n } else if ( get_query_var('paged') ) {\n \n // Paginated archives\n echo '<li class=\"item-current item-current-' . get_query_var('paged') . '\"><strong class=\"bread-current bread-current-' . get_query_var('paged') . '\" title=\"Page ' . get_query_var('paged') . '\">'.__('Page') . ' ' . get_query_var('paged') . '</strong></li>';\n \n } else if ( is_search() ) {\n \n // Search results page\n echo '<li class=\"item-current item-current-' . get_search_query() . '\"><strong class=\"bread-current bread-current-' . get_search_query() . '\" title=\"Search results for: ' . get_search_query() . '\">Search results for: ' . get_search_query() . '</strong></li>';\n \n } elseif ( is_404() ) {\n \n // 404 page\n echo '<li>' . 'Error 404' . '</li>';\n }\n \n echo '</ul>';\n \n }\n \n}", "function ibio_breadcrumbs(){\n\n genesis_do_breadcrumbs();\n\n /*if ( function_exists('yoast_breadcrumb') ) {\n yoast_breadcrumb('<p id=\"breadcrumbs\">','</p>');\n } else{\n genesis_do_breadcrumbs();\n }*/\n}", "function knb_breadcrumb()\n{\n\n $breadcrumb = new \\DSC\\Reference\\Breadcrumbs();\n\n $breadcrumb_option = get_post_meta(get_the_ID(), '_knowledgebase_breadcrumbs_meta_key', true);\n\n\t$args = array(\n 'post_type' => 'knowledgebase',\n 'taxonomy' => 'knb-categories',\n 'separator_icon' => ' ' . get_option('reference_knb_breadcrumbs_separator') . ' ',\n 'breadcrumbs_id' => 'breadcrumbs-wrap',\n 'breadcrumbs_classes' => 'breadcrumb-trail breadcrumbs',\n 'home_title' => get_option('reference_knb_plural'),\n\t);\n\n if (empty($breadcrumb_option) && (bool)get_option('reference_knb_breadcrumbs') === true) {\n $breadcrumb_option = 'enable';\n }\n\n if ((bool)get_option('reference_knb_breadcrumbs') === true) {\n\n if (is_option_enabled($breadcrumb_option)) {\n\n echo $breadcrumb->render( $args );\n\n }\n }\n}" ]
[ "0.8025187", "0.7955037", "0.7809437", "0.76087844", "0.75647897", "0.7533084", "0.7529705", "0.7485665", "0.7476623", "0.7461509", "0.74334663", "0.74334663", "0.7419103", "0.7416697", "0.74019164", "0.7361746", "0.73549974", "0.7353994", "0.7350947", "0.7347768", "0.73331696", "0.7332475", "0.7328969", "0.7305589", "0.7279449", "0.7278175", "0.72673434", "0.7264445", "0.726124", "0.7243163", "0.72427523", "0.72365516", "0.72344536", "0.72343713", "0.7233671", "0.72331303", "0.72251284", "0.72171265", "0.7213476", "0.72130156", "0.7204459", "0.7194945", "0.7167655", "0.71549684", "0.714351", "0.71433234", "0.7138894", "0.71302986", "0.7111612", "0.71093714", "0.7105059", "0.7098925", "0.7098392", "0.70943373", "0.70943373", "0.7084355", "0.70689857", "0.7057386", "0.70397955", "0.7019867", "0.701511", "0.7012964", "0.6999742", "0.6999726", "0.69915754", "0.69864374", "0.69606096", "0.69583654", "0.69451", "0.69387233", "0.69371474", "0.69264716", "0.6925845", "0.68872845", "0.68819886", "0.68776447", "0.6875426", "0.6861906", "0.683295", "0.6830752", "0.68304396", "0.68252915", "0.6803702", "0.67966187", "0.67958003", "0.67914295", "0.67867893", "0.67861027", "0.67860085", "0.67759293", "0.6772381", "0.6771361", "0.67710537", "0.67630106", "0.67423403", "0.67404985", "0.673563", "0.6734461", "0.67204", "0.67045635", "0.66994166" ]
0.0
-1
easy image resize function
function smart_resize_image($file, $string = null, $width = 0, $height = 0, $proportional = false, $output = 'file', $delete_original = true, $use_linux_commands = false, $quality = 100, $grayscale = false ) { if ($height <= 0 && $width <= 0) return false; if ($file === null && $string === null) return false; # Setting defaults and meta $info = $file !== null ? getimagesize($file) : getimagesizefromstring($string); $image = ''; $final_width = 0; $final_height = 0; list($width_old, $height_old) = $info; $cropHeight = $cropWidth = 0; # Calculating proportionality if ($proportional) { if ($width == 0) $factor = $height / $height_old; elseif ($height == 0) $factor = $width / $width_old; else $factor = min($width / $width_old, $height / $height_old); $final_width = round($width_old * $factor); $final_height = round($height_old * $factor); } else { $final_width = ( $width <= 0 ) ? $width_old : $width; $final_height = ( $height <= 0 ) ? $height_old : $height; $widthX = $width_old / $width; $heightX = $height_old / $height; $x = min($widthX, $heightX); $cropWidth = ($width_old - $width * $x) / 2; $cropHeight = ($height_old - $height * $x) / 2; } # Loading image to memory according to type switch ($info[2]) { case IMAGETYPE_JPEG: $file !== null ? $image = imagecreatefromjpeg($file) : $image = imagecreatefromstring($string); break; case IMAGETYPE_GIF: $file !== null ? $image = imagecreatefromgif($file) : $image = imagecreatefromstring($string); break; case IMAGETYPE_PNG: $file !== null ? $image = imagecreatefrompng($file) : $image = imagecreatefromstring($string); break; default: return false; } # Making the image grayscale, if needed if ($grayscale) { imagefilter($image, IMG_FILTER_GRAYSCALE); } # This is the resizing/resampling/transparency-preserving magic $image_resized = imagecreatetruecolor($final_width, $final_height); if (($info[2] == IMAGETYPE_GIF) || ($info[2] == IMAGETYPE_PNG)) { $transparency = imagecolortransparent($image); $palletsize = imagecolorstotal($image); if ($transparency >= 0 && $transparency < $palletsize) { $transparent_color = imagecolorsforindex($image, $transparency); $transparency = imagecolorallocate($image_resized, $transparent_color['red'], $transparent_color['green'], $transparent_color['blue']); imagefill($image_resized, 0, 0, $transparency); imagecolortransparent($image_resized, $transparency); } elseif ($info[2] == IMAGETYPE_PNG) { imagealphablending($image_resized, false); $color = imagecolorallocatealpha($image_resized, 0, 0, 0, 127); imagefill($image_resized, 0, 0, $color); imagesavealpha($image_resized, true); } } imagecopyresampled($image_resized, $image, 0, 0, $cropWidth, $cropHeight, $final_width, $final_height, $width_old - 2 * $cropWidth, $height_old - 2 * $cropHeight); # Taking care of original, if needed if ($delete_original) { if ($use_linux_commands) exec('rm ' . $file); else @unlink($file); } # Preparing a method of providing result switch (strtolower($output)) { case 'browser': $mime = image_type_to_mime_type($info[2]); header("Content-type: $mime"); $output = NULL; break; case 'file': $output = $file; break; case 'return': return $image_resized; break; default: break; } # Writing image according to type to the output destination and image quality switch ($info[2]) { case IMAGETYPE_GIF: imagegif($image_resized, $output); break; case IMAGETYPE_JPEG: imagejpeg($image_resized, $output, $quality); break; case IMAGETYPE_PNG: $quality = 9 - (int) ((0.9 * $quality) / 10.0); imagepng($image_resized, $output, $quality); break; default: return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function resize(IImageInformation $src, $width, $height);", "function resize_image($src, $width, $height){\n // initializing\n $save_path = Wordless::theme_temp_path();\n $img_filename = Wordless::join_paths($save_path, md5($width . 'x' . $height . '_' . basename($src)) . '.jpg');\n\n // if file doesn't exists, create it\n if (!file_exists($img_filename)) {\n $to_scale = 0;\n $to_crop = 0;\n\n // Get orig dimensions\n list ($width_orig, $height_orig, $type_orig) = getimagesize($src);\n\n // get original image ... to improve!\n switch($type_orig){\n case IMAGETYPE_JPEG: $image = imagecreatefromjpeg($src);\n break;\n case IMAGETYPE_PNG: $image = imagecreatefrompng($src);\n break;\n case IMAGETYPE_GIF: $image = imagecreatefromgif($src);\n break;\n default:\n return;\n }\n\n // which is the new smallest?\n if ($width < $height)\n $min_dim = $width;\n else\n $min_dim = $height;\n\n // which is the orig smallest?\n if ($width_orig < $height_orig)\n $min_orig = $width_orig;\n else\n $min_orig = $height_orig;\n\n // image of the right size\n if ($height_orig == $height && $width_orig == $width) ; // nothing to do\n // if something smaller => scale\n else if ($width_orig < $width) {\n $to_scale = 1;\n $ratio = $width / $width_orig;\n }\n else if ($height_orig < $height) {\n $to_scale = 1;\n $ratio = $height / $height_orig;\n }\n // if both bigger => scale\n else if ($height_orig > $height && $width_orig > $width) {\n $to_scale = 1;\n $ratio_dest = $width / $height;\n $ratio_orig = $width_orig / $height_orig;\n if ($ratio_dest > $ratio_orig)\n $ratio = $width / $width_orig;\n else\n $ratio = $height / $height_orig;\n }\n // one equal one bigger\n else if ( ($width == $width_orig && $height_orig > $height) || ($height == $height_orig && $width_orig > $width) )\n $to_crop = 1;\n // some problem...\n else\n echo \"ALARM\";\n\n // we need to zoom to get the right size\n if ($to_scale == 1) {\n $new_width = $width_orig * $ratio;\n $new_height = $height_orig * $ratio;\n $image_scaled = imagecreatetruecolor($new_width, $new_height);\n // scaling!\n imagecopyresampled($image_scaled, $image, 0, 0, 0, 0, $new_width, $new_height, $width_orig, $height_orig);\n $image = $image_scaled;\n\n if($new_width > $width || $new_height > $height)\n $to_crop = 1;\n }\n else {\n $new_width = $width_orig;\n $new_height = $height_orig;\n }\n\n // we need to crop the image\n if ($to_crop == 1) {\n $image_cropped = imagecreatetruecolor($width, $height);\n\n // find margins for images\n $margin_x = ($new_width - $width) / 2;\n $margin_y = ($new_height - $height) / 2;\n\n // cropping!\n imagecopy($image_cropped, $image, 0, 0, $margin_x, $margin_y, $width, $height);\n $image = $image_cropped;\n }\n\n // Save image\n imagejpeg($image, $img_filename, 95);\n }\n\n // Return image URL\n return Wordless::join_paths(Wordless::theme_temp_path(), basename($img_filename));\n }", "function img_resize( $tmpname, $size, $save_dir, $save_name )\r\n {\r\n $save_dir .= ( substr($save_dir,-1) != \"/\") ? \"/\" : \"\";\r\n $gis = GetImageSize($tmpname);\r\n $type = $gis[2];\r\n switch($type)\r\n {\r\n case \"1\": $imorig = imagecreatefromgif($tmpname); break;\r\n case \"2\": $imorig = imagecreatefromjpeg($tmpname);break;\r\n case \"3\": $imorig = imagecreatefrompng($tmpname); break;\r\n default: $imorig = imagecreatefromjpeg($tmpname);\r\n }\r\n\r\n $x = imageSX($imorig);\r\n $y = imageSY($imorig);\r\n if($gis[0] <= $size)\r\n {\r\n $av = $x;\r\n $ah = $y;\r\n }\r\n else\r\n {\r\n $yc = $y*1.3333333;\r\n $d = $x>$yc?$x:$yc;\r\n $c = $d>$size ? $size/$d : $size;\r\n $av = $x*$c; \r\n $ah = $y*$c; \r\n } \r\n $im = imagecreate($av, $ah);\r\n $im = imagecreatetruecolor($av,$ah);\r\n if (imagecopyresampled($im,$imorig , 0,0,0,0,$av,$ah,$x,$y))\r\n if (imagejpeg($im, $save_dir.$save_name))\r\n\t\t return true;\r\n else\r\n return false;\r\n }", "public function resize()\n\t{\n\t\t$protocol = ($this->image_library === 'gd2') ? 'image_process_gd' : 'image_process_'.$this->image_library;\n\t\treturn $this->$protocol('resize');\n\t}", "function image_resize()\n\t{\n\t\t$protocol = 'image_process_'.$this->resize_protocol;\n\t\t\n\t\tif (substr($protocol, -3) == 'gd2')\n\t\t{\n\t\t\t$protocol = 'image_process_gd';\n\t\t}\n\t\t\n\t\treturn $this->$protocol('resize');\n\t}", "public function resize_fit(IImageInformation $src, $width, $height);", "function imgResize($filename, $newWidth, $newHeight, $dir_out){\n\t\n\t// изменение размера изображения\n\n\t// 1 создадим новое изображение из файла\n\t$scr = imagecreatefromjpeg($filename); // или $imagePath\n\t\n\t// 2 создадим новое полноцветное изображение нужного размера\n\t$newImg = imagecreatetruecolor($newWidth, $newHeight);\n\n\t// 3 определим размер исходного изображения для 4 пункта\n\t$size = getimagesize($filename);\n\n\t// 4 копирует прямоугольную часть одного изображения на другое изображение, интерполируя значения пикселов таким образом, чтобы уменьшение размера изображения не уменьшало его чёткости\n\timagecopyresampled($newImg, $scr, 0, 0, 0, 0, $newWidth, $newHeight, $size[0], $size[1]);\n\n\t// 5 запишем изображение в файл по нужному пути\n\timagejpeg($newImg, $dir_out);\n\n\timagedestroy($scr);\n\timagedestroy($newImg);\t\t\n\t\n}", "function image_resize($filename){\n\t\t$width = 1000;\n\t\t$height = 500;\n\t\t$save_file_location = $filename;\n\t\t// File type\n\t\t//header('Content-Type: image/jpg');\n\t\t$source_properties = getimagesize($filename);\n\t\t$image_type = $source_properties[2];\n\n\t\t// Get new dimensions\n\t\tlist($width_orig, $height_orig) = getimagesize($filename);\n\n\t\t$ratio_orig = $width_orig/$height_orig;\n\t\tif ($width/$height > $ratio_orig) {\n\t\t\t$width = $height*$ratio_orig;\n\t\t} else {\n\t\t\t$height = $width/$ratio_orig;\n\t\t}\n\t\t// Resampling the image \n\t\t$image_p = imagecreatetruecolor($width, $height);\n\t\tif( $image_type == IMAGETYPE_JPEG ) {\n\t\t\t$image = imagecreatefromjpeg($filename);\n\t\t}else if($image_type == IMAGETYPE_GIF){\n\t\t\t$image = imagecreatefromgif($filename);\n\t\t}else if($image_type == IMAGETYPE_PNG){\n\t\t\t$image = imagecreatefrompng($filename);\n\t\t}\n\t\t$finalIMG = imagecopyresampled($image_p, $image, 0, 0, 0, 0,\n\t\t$width, $height, $width_orig, $height_orig);\n\t\t// Display of output image\n\n\t\tif( $image_type == IMAGETYPE_JPEG ) {\n\t\t\timagejpeg($image_p, $save_file_location);\n\t\t}else if($image_type == IMAGETYPE_GIF){\n\t\t\timagegif($image_p, $save_file_location);\n\t\t}else if($image_type == IMAGETYPE_PNG){\n\t\t\t$imagepng = imagepng($image_p, $save_file_location);\n\t\t}\n\t}", "function resizeImage($input,$output,$wid,$hei,$auto=false,$quality=80) {\n\n\t// File and new size\n\t//the original image has 800x600\n\t$filename = $input;\n\t//the resize will be a percent of the original size\n\t$percent = 0.5;\n\n\t// Get new sizes\n\tlist($width, $height) = getimagesize($filename);\n\t$newwidth = $wid;//$width * $percent;\n\t$newheight = $hei;//$height * $percent;\n\tif($auto) {\n\t\tif($width>$height) {\n\t\t\t$newheight=$wid*0.75;\n\t\t} else if($height>$width) {\n\t\t\t$newwidth=$hei*0.75;\n\t\t}\n\t}\n\n\t// Load\n\t$thumb = imagecreatetruecolor($newwidth, $newheight);\n\t$source = imagecreatefromjpeg($filename);\n\n\t// Resize\n\timagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);\n\n\t// Output and free memory\n\t//the resized image will be 400x300\n\timagejpeg($thumb,$output,$quality);\n\timagedestroy($thumb);\n}", "private function resize() {\n\t\tswitch($this->type) {\n\t\t\tcase 'image/jpeg':\n\t\t\t\t$originalImage = imagecreatefromjpeg($this->tempName);\n\t\t\tbreak;\n\t\t\tcase 'image/png':\n\t\t\t\t$originalImage = imagecreatefrompng($this->tempName);\n\t\t\tbreak;\n\t\t\tcase 'image/gif':\n\t\t\t\t$originalImage = imagecreatefromgif($this->tempName);\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tdie('FILE CANNOT BE RESIZED');\n\t\t\tbreak;\n\t\t}\n\n\t\t// Determine new height\n\t\t$this->newHeight = ($this->height / $this->width) * $this->newWidth;\n\n\t\t// Create new image\n\t\t$this->newImage = imagecreatetruecolor($this->newWidth, $this->newHeight);\n\n\t\t// Resample original image into new image\n\t\timagecopyresampled($this->newImage, $originalImage, 0, 0, 0, 0, $this->newWidth, $this->newHeight, $this->width, $this->height);\n\n\t\t// Switch based on image being resized\n\t\tswitch($this->type) {\n\t\t\tcase 'image/jpeg':\n\t\t\t\t// Source, Dest, Quality 0 to 100\n\t\t\t\timagejpeg($this->newImage, $this->destinationFolder.'/'.$this->newName, 80);\n\t\t\tbreak;\n\t\t\tcase 'image/png':\n\t\t\t\t// Source, Dest, Quality 0 (no compression) to 9\n\t\t\t\timagepng($this->newImage, $this->destinationFolder.'/'.$this->newName, 0);\n\t\t\tbreak;\n\t\t\tcase 'image/gif':\n\t\t\t\timagegif($this->newImage, $this->destinationFolder.'/'.$this->newName);\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tdie('YOUR FILE CANNOT BE RESIZED');\n\t\t\tbreak;\n\t\t}\n\n\t\t// DESTROY NEW IMAGE TO SAVE SERVER SPACE\n\t\timagedestroy($this->newImage);\n\t\timagedestroy($originalImage);\n\n\t\t// SUCCESSFULLY UPLOADED\n\t\t$this->result = true;\n\t\t$this->message = 'Image uploaded and resized successfully';\n\t}", "private function doImageResize($img){\n\t\t//Determine the new dimensions\n\t\t$d=$this->getNewDims($img);\n\t\t\n\t\t//Determine which function to use\n\t\t$funcs=$this->getImageFunctions($img);\n\t\t\n\t\t//Determine the image type\n\t\t$src_img=$funcs[0]($img);\n\t\t\n\t\t//Determine the new image size\n\t\t$new_img=imagecreatetruecolor($d[0], $d[1]);\n\t\t\n\t\tif(imagecopyresampled\n\t\t\t\t($new_img, $src_img, 0, 0, 0, 0, $d[0],$d[1] , $d[2], $d[3])){\n\t\t\timagedestroy($src_img);\n\t\t\t//check if the new image has the same file type as the original one\n\t\t\tif($new_img && $funcs[1]($new_img,$img)){\n\t\t\t\timagedestroy($new_img);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tthrow new Exception('Failed to save the new image!');\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse{\n\t\t\tthrow new Exception(\"Could not resample the image!\");\n\t\t}\n\t\t\n\t}", "function imageresize($img,$target=\"\",$width=0,$height=0,$percent=0)\n{\n if (strpos($img,\".jpg\") !== false or strpos($img,\".jpeg\") !== false){\n\t $image = ImageCreateFromJpeg($img);\n\t $extension = \".jpg\";\n } elseif (strpos($img,\".png\") !== false) {\n\t $image = ImageCreateFromPng($img);\n\t $extension = \".png\";\n } elseif (strpos($img,\".gif\") !== false) {\n\t $image = ImageCreateFromGif($img);\n\t $extension = \".gif\";\n }elseif(getfiletype($img)=='bmp'){\n\t\t$image = ImageCreateFromwbmp($img);\n\t\t$extension = '.bmp';\n }\n\n $size = getimagesize ($img);\n\n // calculate missing values\n if ($width and !$height) {\n\t $height = ($size[1] / $size[0]) * $width;\n } elseif (!$width and $height) {\n\t $width = ($size[0] / $size[1]) * $height;\n } elseif ($percent) {\n\t $width = $size[0] / 100 * $percent;\n\t $height = $size[1] / 100 * $percent;\n } elseif (!$width and !$height and !$percent) {\n\t $width = 100; // here you can enter a standard value for actions where no arguments are given\n\t $height = ($size[1] / $size[0]) * $width;\n }\n\n $thumb = imagecreatetruecolor ($width, $height);\n\n if (function_exists(\"imageCopyResampled\"))\n {\n\t if (!@ImageCopyResampled($thumb, $image, 0, 0, 0, 0, $width, $height, $size[0], $size[1])) {\n\t\t ImageCopyResized($thumb, $image, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);\n\t }\n\t} else {\n\t ImageCopyResized($thumb, $image, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);\n\t}\n\n //ImageCopyResampleBicubic ($thumb, $image, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);\n\n if (!$target) {\n\t $target = \"temp\".$extension;\n }\n\n $return = true;\n\n switch ($extension) {\n\t case \".jpeg\":\n\t case \".jpg\": {\n\t\t imagejpeg($thumb, $target, 100);\n\t break;\n\t }\n\t case \".gif\": {\n\t\t imagegif($thumb, $target);\n\t break;\n\t }\n\t case \".png\": {\n\t\t imagepng($thumb, $target);\n\t break;\n\t }\n\t case \".bmp\": {\n\t\t imagewbmp($thumb,$target);\n\t }\n\t default: {\n\t\t $return = false;\n\t }\n }\n\n // report the success (or fail) of the action\n return $return;\n}", "function resizeImage($image,$width,$height,$scale) {\n\t\t\t\tlist($imagewidth, $imageheight, $imageType) = getimagesize($image);\n\t\t\t\t$imageType = image_type_to_mime_type($imageType);\n\t\t\t\t$newImageWidth = ceil($width * $scale);\n\t\t\t\t$newImageHeight = ceil($height * $scale);\n\t\t\t\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\t\t\t\tswitch($imageType) {\n\t\t\t\t\tcase \"image/gif\":\n\t\t\t\t\t\t$source=imagecreatefromgif($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/pjpeg\":\n\t\t\t\t\tcase \"image/jpeg\":\n\t\t\t\t\tcase \"image/jpg\":\n\t\t\t\t\t\t$source=imagecreatefromjpeg($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/png\":\n\t\t\t\t\tcase \"image/x-png\":\n\t\t\t\t\t\t$source=imagecreatefrompng($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\timagecopyresampled($newImage,$source,0,0,0,0,$newImageWidth,$newImageHeight,$width,$height);\n\t\t\t\n\t\t\t\tswitch($imageType) {\n\t\t\t\t\tcase \"image/gif\":\n\t\t\t\t\t\timagegif($newImage,$image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/pjpeg\":\n\t\t\t\t\tcase \"image/jpeg\":\n\t\t\t\t\tcase \"image/jpg\":\n\t\t\t\t\t\timagejpeg($newImage,$image,90);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/png\":\n\t\t\t\t\tcase \"image/x-png\":\n\t\t\t\t\t\timagepng($newImage,$image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\n\t\t\t\tchmod($image, 0777);\n\t\t\t\treturn $image;\n\t\t\t}", "function resize( $jpg ) {\n\t$im = @imagecreatefromjpeg( $jpg );\n\t$filename = $jpg;\n\t$percent = 0.5;\n\tlist( $width, $height ) = getimagesize( $filename );\n\tif ( $uploader_name == \"c_master_imgs\" ):\n\t\t$new_width = $width;\n\t$new_height = $height;\n\telse :\n\t\tif ( $width > 699 ): $new_width = 699;\n\t$percent = 699 / $width;\n\t$new_height = $height * $percent;\n\telse :\n\t\t$new_width = $width;\n\t$new_height = $height;\n\tendif;\n\tendif; // end if measter images do not resize\n\t//if ( $new_height>600){ $new_height = 600; }\n\t$im = imagecreatetruecolor( $new_width, $new_height );\n\t$image = imagecreatefromjpeg( $filename );\n\timagecopyresampled( $im, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height );\n\t@imagejpeg( $im, $jpg, 80 );\n\t@imagedestroy( $im );\n}", "function resizeImage($image,$width,$height,$scale) {\n\tlist($imagewidth, $imageheight, $imageType) = getimagesize($image);\n\t$imageType = image_type_to_mime_type($imageType);\n\t$newImageWidth = ceil($width * $scale);\n\t$newImageHeight = ceil($height * $scale);\n\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\tswitch($imageType) {\n\t\tcase \"image/gif\":\n\t\t\t$source=imagecreatefromgif($image); \n\t\t\tbreak;\n\t case \"image/pjpeg\":\n\t\tcase \"image/jpeg\":\n\t\tcase \"image/jpg\":\n\t\t\t$source=imagecreatefromjpeg($image); \n\t\t\tbreak;\n\t case \"image/png\":\n\t\tcase \"image/x-png\":\n\t\t\t$source=imagecreatefrompng($image); \n\t\t\tbreak;\n \t}\n\timagecopyresampled($newImage,$source,0,0,0,0,$newImageWidth,$newImageHeight,$width,$height);\n\t\n\tswitch($imageType) {\n\t\tcase \"image/gif\":\n\t \t\timagegif($newImage,$image); \n\t\t\tbreak;\n \tcase \"image/pjpeg\":\n\t\tcase \"image/jpeg\":\n\t\tcase \"image/jpg\":\n\t \t\timagejpeg($newImage,$image,90); \n\t\t\tbreak;\n\t\tcase \"image/png\":\n\t\tcase \"image/x-png\":\n\t\t\timagepng($newImage,$image); \n\t\t\tbreak;\n }\n\t\n\tchmod($image, 0777);\n\treturn $image;\n}", "function image_resize ( $args ) { /*\r\n\t\t * Changelog\r\n\t\t *\r\n\t\t * Version 3, July 20, 2007\r\n\t\t * - Cleaned\r\n\t\t *\r\n\t\t * Version 2, August 12, 2006\r\n\t\t * - Changed it to use $args\r\n\t\t */\r\n\t\t\r\n\t\t// Set default variables\r\n\t\t$image = $width_old = $height_old = $width_new = $height_new = $canvas_width = $canvas_height = $canvas_size = null;\r\n\t\t\r\n\t\t$x_old = $y_old = $x_new = $y_new = 0;\r\n\t\t\r\n\t\t// Exract user\r\n\t\textract($args);\r\n\t\t\r\n\t\t// Read image\r\n\t\t$image = image_read($image,false);\r\n\t\tif ( empty($image) ) { // error\r\n\t\t\ttrigger_error('no image was specified', E_USER_WARNING);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// Check new dimensions\r\n\t\tif ( empty($width_new) || empty($height_new) ) { // error\r\n\t\t\ttrigger_error('Desired/new dimensions not found', E_USER_WARNING);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// Do old dimensions\r\n\t\tif ( empty($width_old) && empty($height_old) ) { // Get the old dimensions from the image\r\n\t\t\t$width_old = imagesx($image);\r\n\t\t\t$height_old = imagesy($image);\r\n\t\t}\r\n\t\t\r\n\t\t// Do canvas dimensions\r\n\t\tif ( empty($canvas_width) && empty($canvas_height) ) { // Set default\r\n\t\t\t$canvas_width = $width_new;\r\n\t\t\t$canvas_height = $height_new;\r\n\t\t}\r\n\t\t\r\n\t\t// Let's force integer values\r\n\t\t$width_old = intval($width_old);\r\n\t\t$height_old = intval($height_old);\r\n\t\t$width_new = intval($width_new);\r\n\t\t$height_new = intval($height_new);\r\n\t\t$canvas_width = intval($canvas_width);\r\n\t\t$canvas_height = intval($canvas_height);\r\n\t\t\r\n\t\t// Create the new image\r\n\t\t$image_new = imagecreatetruecolor($canvas_width, $canvas_height);\r\n\t\t\r\n\t\t// Resample the image\r\n\t\t$image_result = imagecopyresampled(\r\n\t\t\t/* the new image */\r\n\t\t\t$image_new,\r\n\t\t\t/* the old image to update */\r\n\t\t\t$image,\r\n\t\t\t/* the new positions */\r\n\t\t\t$x_new, $y_new,\r\n\t\t\t/* the old positions */\r\n\t\t\t$x_old, $y_old,\r\n\t\t\t/* the new dimensions */\r\n\t\t\t$width_new, $height_new,\r\n\t\t\t/* the old dimensions */\r\n\t\t\t$width_old, $height_old);\r\n\t\t\r\n\t\t// Check\r\n\t\tif ( !$image_result ) { // ERROR\r\n\t\t\ttrigger_error('the image failed to resample', E_USER_WARNING);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// return\r\n\t\treturn $image_new;\r\n\t}", "function imageResize($file, $dest, $height, $width, $thumb = FALSE) {\n\tglobal $ighMaxHeight, $ighMaxWidth, $ighThumbHeight, $ighThumbWidth;\n\n\tif (strstr(@mime_content_type($file), \"png\"))\n\t\t$oldImage = imagecreatefrompng($file);\n\telseif (strstr(@mime_content_type($file), \"jpeg\"))\n\t\t$oldImage = imagecreatefromjpeg($file);\n\telseif (strstr(@mime_content_type($file), \"gif\"))\n\t\t$oldImage = imagecreatefromgif($file);\n\telse\n\t\tdie (\"oh shit\");\n\n\t$base_img = $oldImage;\n $img_width = imagesx($base_img);\n $img_height = imagesy($base_img);\n\n $thumb_height = $height;\n $thumb_width = $width;\n\n // Work out which way it needs to be resized\n $img_width_per = $thumb_width / $img_width;\n $img_height_per = $thumb_height / $img_height;\n \n if ($img_width_per <= $img_height_per) {\n $thumb_height = intval($img_height * $img_width_per); \n }\n else {\n $thumb_width = intval($img_width * $img_height_per);\n }\n\n\tif ($thumb) {\n\t\t$thumb_width = $width;\t\t// 120\n\t\t$thumb_height = $height*3/4;\t// 120 * 3 / 4 = 90\n\t}\n\n // Create the new thumbnail image\n $thumb_img = ImageCreateTrueColor($thumb_width, $thumb_height); \n\n\tif ($thumb) {\t// Do the Square from the Centre thing.\n\t\tImageCopyResampled($thumb_img, $base_img, 0, 0, \n\t\t\t\t($img_width/2)-($thumb_width/2), ($img_height/2)-($thumb_height/2), \n\t\t\t\t$thumb_width, $thumb_height, $thumb_width, $thumb_height);\t\t\t\n\t} else {\t// standard image to image resize.\n\t\tImageCopyResampled($thumb_img, $base_img, 0, 0, 0, 0, \n\t\t\t\t$thumb_width, $thumb_height, $img_width, $img_height);\n\t}\n\n\t// using jpegs!\n\timagejpeg($thumb_img, $dest);\n\timagedestroy($base_img);\n\timagedestroy($thumb_img);\n}", "function spc_resizeImage( $file, $thumbpath, $max_side , $fixfor = NULL ) {\n\n\tif ( file_exists( $file ) ) {\n\t\t$type = getimagesize( $file );\n\n\t\tif (!function_exists( 'imagegif' ) && $type[2] == 1 ) {\n\t\t\t$error = __( 'Filetype not supported. Thumbnail not created.' );\n\t\t}\n\t\telseif (!function_exists( 'imagejpeg' ) && $type[2] == 2 ) {\n\t\t\t$error = __( 'Filetype not supported. Thumbnail not created.' );\n\t\t}\n\t\telseif (!function_exists( 'imagepng' ) && $type[2] == 3 ) {\n\t\t\t$error = __( 'Filetype not supported. Thumbnail not created.' );\n\t\t} else {\n\n\t\t\t// create the initial copy from the original file\n\t\t\tif ( $type[2] == 1 ) {\n\t\t\t\t$image = imagecreatefromgif( $file );\n\t\t\t}\n\t\t\telseif ( $type[2] == 2 ) {\n\t\t\t\t$image = imagecreatefromjpeg( $file );\n\t\t\t}\n\t\t\telseif ( $type[2] == 3 ) {\n\t\t\t\t$image = imagecreatefrompng( $file );\n\t\t\t}\n\n\t\t\tif ( function_exists( 'imageantialias' ))\n\t\t\t\timageantialias( $image, TRUE );\n\n\t\t\t$image_attr = getimagesize( $file );\n\n\t\t\t// figure out the longest side\n if($fixfor){\n \t if($fixfor == 'width'){\n \t \t$image_width = $image_attr[0];\n\t\t\t\t$image_height = $image_attr[1];\n\t\t\t\t$image_new_width = $max_side;\n\n\t\t\t\t$image_ratio = $image_width / $image_new_width;\n\t\t\t\t$image_new_height = $image_height / $image_ratio;\n \t }elseif($fixfor == 'height'){\n \t $image_width = $image_attr[0];\n\t\t\t\t$image_height = $image_attr[1];\n\t\t\t\t$image_new_height = $max_side;\n\n\t\t\t\t$image_ratio = $image_height / $image_new_height;\n\t\t\t\t$image_new_width = $image_width / $image_ratio;\t\n \t }\n }else{\n\t\t\tif ( $image_attr[0] > $image_attr[1] ) {\n\t\t\t\t$image_width = $image_attr[0];\n\t\t\t\t$image_height = $image_attr[1];\n\t\t\t\t$image_new_width = $max_side;\n\n\t\t\t\t$image_ratio = $image_width / $image_new_width;\n\t\t\t\t$image_new_height = $image_height / $image_ratio;\n\t\t\t\t//width is > height\n\t\t\t} else {\n\t\t\t\t$image_width = $image_attr[0];\n\t\t\t\t$image_height = $image_attr[1];\n\t\t\t\t$image_new_height = $max_side;\n\n\t\t\t\t$image_ratio = $image_height / $image_new_height;\n\t\t\t\t$image_new_width = $image_width / $image_ratio;\n\t\t\t\t//height > width\n\t\t\t}\n }\t\n\n\t\t\t$thumbnail = imagecreatetruecolor( $image_new_width, $image_new_height);\n\t\t\t@ imagecopyresampled( $thumbnail, $image, 0, 0, 0, 0, $image_new_width, $image_new_height, $image_attr[0], $image_attr[1] );\n\n\t\t\t// move the thumbnail to its final destination\n\t\t\tif ( $type[2] == 1 ) {\n\t\t\t\tif (!imagegif( $thumbnail, $thumbpath ) ) {\n\t\t\t\t\t$error = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ( $type[2] == 2 ) {\n\t\t\t\tif (!imagejpeg( $thumbnail, $thumbpath ) ) {\n\t\t\t\t\t$error = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ( $type[2] == 3 ) {\n\t\t\t\tif (!imagepng( $thumbnail, $thumbpath ) ) {\n\t\t\t\t\t$error = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\t$error = 0;\n\t}\n\n\tif (!empty ( $error ) ) {\n\t\treturn $error;\n\t} else {\n\t\treturn $thumbpath;\n\t}\n}", "function resize($image,$x,$y=NULL,$wm=NULL,$wml='br'){\n if(!file_exists($image)){\n return false;\n }\n $images = array();\n if($wm !== '' && $wm !== NULL && file_exists($wm)){\n $images['wmimg'] = $wm;\n }\n $images['img'] = $image;\n foreach($images as $key=>$value){\n $type = substr($value,strrpos($value,'.'));\n if(stristr($type,'i')){\n $$key = imagecreatefromgif($value);\n }\n if(stristr($type,'j')){\n $$key = imagecreatefromjpeg($value);\n }\n if(stristr($type,'n')){\n $$key = imagecreatefrompng($value);\n }\n }\n $size = array();\n if($y === '' || $y === NULL){\n $size['x'] = imageSX($img);\n $size['y'] = imageSY($img);\n if($size['x'] >= $size['y']){\n $size['dest_x'] = $x;\n $size['dest_y'] = ceil($size['y'] * ($x / $size['x']));\n }else{\n $size['dest_y'] = $x;\n $size['dest_x'] = ceil($size['x'] * ($x / $size['y']));\n }\n $dest = imageCreatetruecolor($size['dest_x'],$size['dest_y']);\n }else{\n $dest = imagecreatetrueColor($x,$y);\n $size['x'] = imageSX($img);\n $size['y'] = imageSY($img);\n $size['dest_x'] = $x;\n $size['dest_y'] = $y;\n }\n imagecopyresized($dest, $img, 0, 0, 0, 0, $size['dest_x'], $size['dest_y'], $size['x'], $size['y']);\n if(isset($wmimg)){\n $size['wmx'] = imageSX($wmimg);\n $size['wmy'] = imageSY($wmimg);\n $size['wmh'] = strtolower($wml{0}) === 'b' ? ($size['dest_y'] - $size['wmy'] - 0) : 0;\n $size['wmw'] = strtolower($wml{1}) === 'r' ? ($size['dest_x'] - $size['wmx'] - 0) : 0;\n imagecopy($dest, $wmimg, $size['wmw'], $size['wmh'], 0, 0, $size['wmx'], $size['wmy']);\n imagedestroy($wmimg);\n }\n imagedestroy($img);\n return $dest;\n }", "function redimensionarImagen($origin,$destino,$newWidth,$newHeight,$jpgQuality=100)\n{\n // texto con el valor correcto height=\"yyy\" width=\"xxx\"\n $datos=getimagesize($origin);\n \n // comprobamos que la imagen sea superior a los tamaños de la nueva imagen\n if($datos[0]>$newWidth || $datos[1]>$newHeight)\n {\n \n // creamos una nueva imagen desde el original dependiendo del tipo\n if($datos[2]==1)\n $img=imagecreatefromgif($origin);\n if($datos[2]==2)\n $img=imagecreatefromjpeg($origin);\n if($datos[2]==3)\n $img=imagecreatefrompng($origin);\n \n // Redimensionamos proporcionalmente\n if(rad2deg(atan($datos[0]/$datos[1]))>rad2deg(atan($newWidth/$newHeight)))\n {\n $anchura=$newWidth;\n $altura=round(($datos[1]*$newWidth)/$datos[0]);\n }else{\n $altura=$newHeight;\n $anchura=round(($datos[0]*$newHeight)/$datos[1]);\n }\n \n // creamos la imagen nueva\n $newImage = imagecreatetruecolor($anchura,$altura);\n \n // redimensiona la imagen original copiandola en la imagen\n imagecopyresampled($newImage, $img, 0, 0, 0, 0, $anchura, $altura, $datos[0], $datos[1]);\n \n // guardar la nueva imagen redimensionada donde indicia $destino\n if($datos[2]==1)\n imagegif($newImage,$destino);\n if($datos[2]==2)\n imagejpeg($newImage,$destino,$jpgQuality);\n if($datos[2]==3)\n imagepng($newImage,$destino);\n \n // eliminamos la imagen temporal\n imagedestroy($newImage);\n \n return true;\n }\n return false;\n}", "protected function resize()\n {\n $width = $this->width;\n $height = $this->height;\n $orig_width = imagesx($this->image);\n $orig_height = imagesy($this->image);\n \n // Determine new image dimensions\n if($this->mode === \"crop\"){ // Crop image\n \n $max_width = $crop_width = $width;\n $max_height = $crop_height = $height;\n \n $x_ratio = @($max_width / $orig_width);\n $y_ratio = @($max_height / $orig_height);\n \n if($orig_width > $orig_height){ // Original is wide\n $height = $max_height;\n $width = ceil($y_ratio * $orig_width);\n \n } elseif($orig_height > $orig_width){ // Original is tall\n $width = $max_width;\n $height = ceil($x_ratio * $orig_height);\n \n } else { // Original is square\n $this->mode = \"fit\";\n \n return $this->resize();\n }\n \n // Adjust if the crop width is less than the requested width to avoid black lines\n if($width < $crop_width){\n $width = $max_width;\n $height = ceil($x_ratio * $orig_height);\n }\n \n } elseif($this->mode === \"fit\"){ // Fits the image according to aspect ratio to within max height and width\n $max_width = $width;\n $max_height = $height;\n \n $x_ratio = @($max_width / $orig_width);\n $y_ratio = @($max_height / $orig_height);\n \n if( ($orig_width <= $max_width) && ($orig_height <= $max_height) ){ // Image is smaller than max height and width so don't resize\n $tn_width = $orig_width;\n $tn_height = $orig_height;\n \n } elseif(($x_ratio * $orig_height) < $max_height){ // Wider rather than taller\n $tn_height = ceil($x_ratio * $orig_height);\n $tn_width = $max_width;\n \n } else { // Taller rather than wider\n $tn_width = ceil($y_ratio * $orig_width);\n $tn_height = $max_height;\n }\n \n $width = $tn_width;\n $height = $tn_height;\n \n } elseif($this->mode === \"fit-x\"){ // Sets the width to the max width and the height according to aspect ratio (will stretch if too small)\n $height = @round($orig_height * $width / $orig_width);\n \n if($orig_height <= $height){ // Don't stretch if smaller\n $width = $orig_width;\n $height = $orig_height;\n }\n \n } elseif($this->mode === \"fit-y\"){ // Sets the height to the max height and the width according to aspect ratio (will stretch if too small)\n $width = @round($orig_width * $height / $orig_height);\n \n if($orig_width <= $width){ // Don't stretch if smaller\n $width = $orig_width;\n $height = $orig_height;\n }\n } else {\n throw new \\Exception('Invalid mode: ' . $this->mode);\n }\n \n\n // Resize\n $this->temp = imagecreatetruecolor($width, $height);\n \n // Preserve transparency if a png\n if($this->image_info['mime'] == 'image/png'){\n imagealphablending($this->temp, false);\n imagesavealpha($this->temp, true);\n }\n \n imagecopyresampled($this->temp, $this->image, 0, 0, 0, 0, $width, $height, $orig_width, $orig_height);\n $this->sync();\n \n \n // Cropping?\n if($this->mode === \"crop\"){ \n $orig_width = imagesx($this->image);\n $orig_height = imagesy($this->image);\n \n $x_mid = $orig_width/2; // horizontal middle\n $y_mid = $orig_height/2; // vertical middle\n \n $this->temp = imagecreatetruecolor($crop_width, $crop_height);\n \n // Preserve transparency if a png\n if($this->image_info['mime'] == 'image/png'){\n imagealphablending($this->temp, false);\n imagesavealpha($this->temp, true);\n }\n\n imagecopyresampled($this->temp, $this->image, 0, 0, ($x_mid-($crop_width/2)), ($y_mid-($crop_height/2)), $crop_width, $crop_height, $crop_width, $crop_height);\n $this->sync();\n }\n }", "public static function resize(){\n\n}", "function resize_img($dir_in, $dir_out, $imedat='defaultname.jpg', $max=500,$new) {\r\n\r\n $img = $dir_in . '/' . $imedat;\r\n $extension = array_pop(explode('.', $imedat));\r\n $fileExt = strtolower(end(explode('.',$imedat)));\r\n $imedat = $new.$fileExt;\r\n switch ($extension){\r\n \r\n case 'jpg':\r\n case 'jpeg':\r\n $image = ImageCreateFromJPEG($img);\r\n break;\r\n \r\n case 'png':\r\n $image = ImageCreateFromPNG($img);\r\n break;\r\n \r\n default:\r\n $image = false;\r\n }\r\n\r\n\r\nif(!$image){\r\n // not valid img stop processing\r\n return false; \r\n}\r\n\r\n $vis = imagesy($image);\r\n $sir = imagesx($image);\r\n\r\n if(($vis < $max) && ($sir < $max)) {\r\n $nvis=$vis; $nsir=$sir;\r\n } else {\r\n if($vis > $sir) { $nvis=$max; $nsir=($sir*$max)/$vis;}\r\n elseif($vis < $sir) { $nvis=($max*$vis)/$sir; $nsir=$max;}\r\n else { $nvis=$max; $nsir=$max;}\r\n }\r\n\r\n $out = ImageCreateTrueColor($nsir,$nvis);\r\n ImageCopyResampled($out, $image, 0, 0, 0, 0, $nsir, $nvis, $sir, $vis);\r\n\r\n switch ($extension){\r\n \r\n case 'jpg':\r\n case 'jpeg':\r\n imageinterlace($out ,1);\r\n ImageJPEG($out, $dir_out . '/' . $imedat, 75);\r\n break;\r\n \r\n case 'png':\r\n ImagePNG($out, $dir_out . '/' . $imedat);\r\n break;\r\n \r\n default:\r\n $out = false;\r\n }\r\n\r\n if(!$out){\r\n return false;\r\n }\r\n \r\nImageDestroy($image);\r\nImageDestroy($out);\r\n\r\nreturn true;\r\n}", "function sharpen_resized_jpeg_images($resized_file) {\r\n $image = wp_load_image($resized_file); \r\n if(!is_resource($image))\r\n return new WP_Error('error_loading_image', $image, $file); \r\n $size = @getimagesize($resized_file);\r\n if(!$size)\r\n return new WP_Error('invalid_image', __('Could not read image size'), $file); \r\n list($orig_w, $orig_h, $orig_type) = $size; \r\n switch($orig_type) {\r\n case IMAGETYPE_JPEG:\r\n $matrix = array(\r\n array(-1, -1, -1),\r\n array(-1, 16, -1),\r\n array(-1, -1, -1),\r\n ); \r\n $divisor = array_sum(array_map('array_sum', $matrix));\r\n $offset = 0; \r\n imageconvolution($image, $matrix, $divisor, $offset);\r\n imagejpeg($image, $resized_file,apply_filters('jpeg_quality', 90, 'edit_image'));\r\n break;\r\n case IMAGETYPE_PNG:\r\n return $resized_file;\r\n case IMAGETYPE_GIF:\r\n return $resized_file;\r\n } \r\n return $resized_file;\r\n}", "function resize($image_name, $size, $folder_name) {\n $file_extension = getFileExtension($image_name);\n switch ($file_extension) {\n case 'jpg':\n case 'jpeg':\n $image_src = imagecreatefromjpeg($folder_name . '/' . $image_name);\n break;\n case 'png':\n $image_src = imagecreatefrompng($folder_name . '/' . $image_name);\n break;\n case 'gif':\n $image_src = imagecreatefromgif($folder_name . '/' . $image_name);\n break;\n }\n $true_width = imagesx($image_src);\n $true_height = imagesy($image_src);\n\n $width = $size;\n $height = ($width / $true_width) * $true_height;\n\n $image_des = imagecreatetruecolor($width, $height);\n\n imagecopyresampled($image_des, $image_src, 0, 0, 0, 0, $width, $height, $true_width, $true_height);\n\n switch ($file_extension) {\n case 'jpg':\n case 'jpeg':\n imagejpeg($image_des, $folder_name . '/' . $image_name, 100);\n break;\n case 'png':\n imagepng($image_des, $folder_name . '/' . $image_name, 8);\n break;\n case 'gif':\n imagegif($image_des, $folder_name . '/' . $image_name, 100);\n break;\n }\n return $image_des;\n}", "function resizeImage($image,$width,$height,$scale,$stype) {\n\t$newImageWidth = ceil($width * $scale);\n\t$newImageHeight = ceil($height * $scale);\n\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\tswitch($stype) {\n case 'gif':\n $source = imagecreatefromgif($image);\n break;\n case 'jpg':\n $source = imagecreatefromjpeg($image);\n break;\n case 'jpeg':\n $source = imagecreatefromjpeg($image);\n break;\n case 'png':\n $source = imagecreatefrompng($image);\n break;\n }\n\timagecopyresampled($newImage, $source,0,0,0,0, $newImageWidth, $newImageHeight, $width, $height);\n\timagejpeg($newImage,$image,90);\n\tchmod($image, 0777);\n\treturn $image;\n}", "function imgResize($file_ori,$UploadPath,$Resize=1,$imgx=130,$imgy=150,$clean=0,$postFix=\"\") {\n\t\t$dest_filename='';\n\t\t$handle = new upload($file_ori);\n\t\t$img_proper=getimagesize($file_ori['tmp_name']);\n\t\tif ($handle->uploaded) {\n\t\t\tif($img_proper[0]>$imgx && $img_proper[1]>$imgy && $Resize==1)\t{\n\t\t\t\t$handle->image_x = $imgx;\n\t\t\t\t$handle->image_y = $imgy;\n\t\t\t\t$handle->image_resize = true;\n\t\t\t\t$handle->image_ratio_y = true;\n\t\t\t\t$handle->image_ratio_x = true;\n\t\t\t\t$handle->dir_auto_create = true;\n\t\t\t\t$handle->dir_auto_chmod = true;\n\t\t\t\t$handle->dir_chmod = 0777;\n\t\t\t} else if($img_proper[0]>$imgx && $img_proper[1]<$imgy && $Resize==1)\t{\n\t\t\t\t$handle->image_x = $imgx;\n\t\t\t\t$handle->image_resize = true;\n\t\t\t\t$handle->image_ratio_y = true;\n\t\t\t\t$handle->dir_auto_create = true;\n\t\t\t\t$handle->dir_auto_chmod = true;\n\t\t\t\t$handle->dir_chmod = 0777;\n\t\t\t} else if($img_proper[0]<$imgx && $img_proper[1]>$imgy && $Resize==1)\t{\n\t\t\t\t$handle->image_y = $imgy;\n\t\t\t\t$handle->image_resize = true;\n\t\t\t\t$handle->image_ratio_x = true;\n\t\t\t\t$handle->dir_auto_create = true;\n\t\t\t\t$handle->dir_auto_chmod = true;\n\t\t\t\t$handle->dir_chmod = 0777;\n\t\t\t}\n\t\t\t$handle->file_name_body_add = $postFix;\n\t\t\t$handle->process($UploadPath);\n\t\t\tif ($handle->processed) {\n\t\t\t\t$dest_filename=$handle->file_dst_name;\n\t\t\t\tif($clean==1)\n\t\t\t\t\t$handle->clean();\n\t\t\t} else\n\t\t\t\t$dest_filename='';\n\t\t}\n\t\treturn $dest_filename;\n\t}", "protected function scaleImages() {}", "function _resizeImageGD1($src_file, $dest_file, $new_size, $imgobj) {\r\n if ($imgobj->_size == null) {\r\n return false;\r\n }\r\n // GD1 can only handle JPG & PNG images\r\n if ($imgobj->_type !== \"jpg\" && $imgobj->_type !== \"jpeg\" && $imgobj->_type !== \"png\") {\r\n return false;\r\n }\r\n // height/width\r\n $ratio = max($imgobj->_size[0], $imgobj->_size[1]) / $new_size;\r\n $ratio = max($ratio, 1.0);\r\n $destWidth = (int)($imgobj->_size[0] / $ratio);\r\n $destHeight = (int)($imgobj->_size[1] / $ratio);\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n $src_img = imagecreatefromjpeg($src_file);\r\n } else {\r\n $src_img = imagecreatefrompng($src_file);\r\n }\r\n if (!$src_img) {\r\n return false;\r\n }\r\n $dst_img = imagecreate($destWidth, $destHeight);\r\n imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $destWidth, (int)$destHeight, $imgobj->_size[0], $imgobj->_size[1]);\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n imagejpeg($dst_img, $dest_file, $this->_JPEG_quality);\r\n } else {\r\n imagepng($dst_img, $dest_file);\r\n }\r\n imagedestroy($src_img);\r\n imagedestroy($dst_img);\r\n return true; \r\n }", "private function resizeImage($i,$source)\n\t{\n\t\t$mime = $this->mimeType($source);\n \n\t\t$t = imagecreatetruecolor(8, 8);\n\t\t\n\t\t$source = $this->createImage($source);\n\t\t\n\t\timagecopyresized($t, $source, 0, 0, 0, 0, 8, 8, $mime[0], $mime[1]);\n\t\t\n\t\treturn $t;\n\t}", "function image_resize_dimensions ( $args ) {\r\n\t\t/*\r\n\t\t * Changelog\r\n\t\t *\r\n\t\t * v8.1, November 11, 2009\r\n\t\t * - Now uses trigger_error instead of outputting errors to screen\r\n\t\t *\r\n\t\t * v8, December 02, 2007\r\n\t\t * - Cleaned by using math instead of logic\r\n\t\t * - Restructured the code\r\n\t\t * - Re-organised variable names\r\n\t\t *\r\n\t\t * v7, 20/07/2007\r\n\t\t * - Cleaned\r\n\t\t *\r\n\t\t * v6,\r\n\t\t * - Added cropping\r\n\t\t *\r\n\t\t * v5, 12/08/2006\r\n\t\t * - Changed to use args\r\n\t\t */\r\n\t\t\r\n\t\t/*\r\n\t\tThe 'exact' resize mode, will resize things to the exact limit.\r\n\t\tIf a width or height is 0, the appropriate value will be calculated by ratio\r\n\t\tResults with a 800x600 limit:\r\n\t\t\t*x*\t\t\t->\t800x600\r\n\t\tResults with a 0x600 limit:\r\n\t\t\t1280x1024\t->\t750x600\r\n\t\t\t1900x1200\t->\t950x600\r\n\t\t\t96x48\t\t->\t1200x600\r\n\t\t\t1000x500\t->\t1200x600\r\n\t\tResults with a 800x0 limit:\r\n\t\t\t1280x1024\t->\t800x640\r\n\t\t\t1900x1200\t->\t800x505\r\n\t\t\t96x48\t\t->\t800x400\r\n\t\t\t1000x500\t->\t800x400\r\n\t\t*/\r\n\t\t\r\n\t\t/*\r\n\t\tThe 'area' resize mode, will resize things to fit within the area.\r\n\t\tIf a width or height is 0, the appropriate value will be calculated by ratio\r\n\t\tResults with a 800x600 limit:\r\n\t\t\t1280x1024\t->\t750x600\r\n\t\t\t1900x1200\t->\t950x600\t-> 800x505\r\n\t\t\t96x48\t\t->\t96x48\t\tno change\r\n\t\t\t1000x500\t->\t800x400 = '800x'.(800/100)*500\r\n\t\tResults with a 0x600 limit:\r\n\t\t\t1280x1024\t->\t750x600\r\n\t\t\t1900x1200\t->\t950x600\r\n\t\t\t96x48\t\t->\t96x48\t\tno change\r\n\t\t\t1000x500\t->\t1000x500\tno change\r\n\t\tResults with a 800x0 limit:\r\n\t\t\t1280x1024\t->\t800x640\r\n\t\t\t1900x1200\t->\t950x600\t->\t800x505\r\n\t\t\t96x48\t\t->\t96x48\t\tno change\r\n\t\t\t1000x500\t->\t800x400\t= '800x'.(800/1000)*500\r\n\t\t*/\r\n\t\t\r\n\t\t// ---------\r\n\t\t$image = $x_original = $y_original = $x_old = $y_old = $resize_mode = $width_original = $width_old = $width_desired = $width_new = $height_original = $height_old = $height_desired = $height_new = null;\r\n\t\textract($args);\r\n\t\t\r\n\t\t// ---------\r\n\t\tif ( is_null($width_original) && !is_null($width_old) ) {\r\n\t\t\t$width_original = $width_old;\r\n\t\t\t$width_old = null;\r\n\t\t}\r\n\t\tif ( is_null($height_original) && !is_null($height_old) ) {\r\n\t\t\t$height_original = $height_old;\r\n\t\t\t$height_old = null;\r\n\t\t}\r\n\t\t\r\n\t\t//\r\n\t\tif ( is_null($width_original) && is_null($height_original) && !is_null($image) ) { // Get from image\r\n\t\t\t$image = image_read($image);\r\n\t\t\t$width_original = imagesx($image);\r\n\t\t\t$height_original = imagesy($image);\r\n\t\t}\r\n\t\t\r\n\t\t//\r\n\t\tif ( empty($width_original) || empty($height_original) ) { //\r\n\t\t\ttrigger_error('no original dimensions specified', E_USER_WARNING);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// ---------\r\n\t\tif ( is_null($width_desired) && !is_null($width_new) ) {\r\n\t\t\t$width_desired = $width_new;\r\n\t\t\t$width_new = null;\r\n\t\t}\r\n\t\tif ( is_null($height_desired) && !is_null($height_new) ) {\r\n\t\t\t$height_desired = $height_new;\r\n\t\t\t$height_new = null;\r\n\t\t}\r\n\t\t\r\n\t\t//\r\n\t\tif ( is_null($width_desired) || is_null($height_desired) ) { // Don't do any resizing\r\n\t\t\ttrigger_error('no desired dimensions specified', E_USER_NOTICE);\r\n\t\t\t// return array( 'width' => $width_original, 'height' => $height_original );\r\n\t\t}\r\n\t\t\r\n\t\t// ---------\r\n\t\tif ( is_null($resize_mode) ) {\r\n\t\t\t$resize_mode = 'area';\r\n\t\t} elseif ( $resize_mode === 'none' ) { // Don't do any resizing\r\n\t\t\ttrigger_error('$resize_mode === \\'none\\'', E_USER_NOTICE);\r\n\t\t\t// return array( 'width' => $width_original, 'height' => $height_original );\r\n\t\t} elseif ( !in_array($resize_mode, array('area', 'crop', 'exact', true)) ) { //\r\n\t\t\ttrigger_error('Passed $resize_mode is not valid: ' . var_export(compact('resize_mode'), true), E_USER_WARNING);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// ---------\r\n\t\tif ( is_null($x_original) && !is_null($x_old) ) {\r\n\t\t\t$x_original = $x_old;\r\n\t\t\tunset($x_old);\r\n\t\t}\r\n\t\tif ( is_null($y_original) && !is_null($y_old) ) {\r\n\t\t\t$y_original = $y_old;\r\n\t\t\tunset($y_old);\r\n\t\t}\r\n\t\tif ( is_null($x_original) )\r\n\t\t\t$x_original = 0;\r\n\t\tif ( is_null($y_original) )\r\n\t\t\t$y_original = 0;\r\n\t\t\t\r\n\t\t// ---------\r\n\t\t// Let's force integer values\r\n\t\t$width_original = intval($width_original);\r\n\t\t$height_original = intval($height_original);\r\n\t\t$width_desired = intval($width_desired);\r\n\t\t$height_desired = intval($height_desired);\r\n\t\t\r\n\t\t// ---------\r\n\t\t// Set proportions\r\n\t\tif ( $height_original !== 0 )\r\n\t\t\t$proportion_wh = $width_original / $height_original;\r\n\t\tif ( $width_original !== 0 )\r\n\t\t\t$proportion_hw = $height_original / $width_original;\r\n\t\t\r\n\t\tif ( $height_desired !== 0 )\r\n\t\t\t$proportion_wh_desired = $width_desired / $height_desired;\r\n\t\tif ( $width_desired !== 0 )\r\n\t\t\t$proportion_hw_desired = $height_desired / $width_desired;\r\n\t\t\t\r\n\t\t// ---------\r\n\t\t// Set cutoms\r\n\t\t$x_new = $x_original;\r\n\t\t$y_new = $y_original;\r\n\t\t$canvas_width = $canvas_height = null;\r\n\t\t\r\n\t\t// ---------\r\n\t\t$width_new = $width_original;\r\n\t\t$height_new = $height_original;\r\n\t\t\r\n\t\t// ---------\r\n\t\t// Do resize\r\n\t\tif ( $height_desired === 0 && $width_desired === 0 ) {\r\n\t\t\t// Nothing to do\r\n\t\t} elseif ( $height_desired === 0 && $width_desired !== 0 ) {\r\n\t\t\t// We don't care about the height\r\n\t\t\t$width_new = $width_desired;\r\n\t\t\tif ( $resize_mode !== 'exact' ) {\r\n\t\t\t\t// h = w*(h/w)\r\n\t\t\t\t$height_new = $width_desired * $proportion_hw;\r\n\t\t\t}\r\n\t\t} elseif ( $height_desired !== 0 && $width_desired === 0 ) {\r\n\t\t\t// We don't care about the width\r\n\t\t\tif ( $resize_mode !== 'exact' ) {\r\n\t\t\t\t // w = h*(w/h)\r\n\t\t\t\t$width_new = $height_desired * $proportion_wh;\r\n\t\t\t}\r\n\t\t\t$height_new = $height_desired;\r\n\t\t} else {\r\n\t\t\t// We care about both\r\n\r\n\t\t\tif ( $resize_mode === 'exact' || /* no upscaling */ ($width_original <= $width_desired && $height_original <= $height_desired) ) { // Nothing to do\r\n\t\t\t} elseif ( $resize_mode === 'area' ) { // Proportion to fit inside\r\n\t\t\t\t\r\n\r\n\t\t\t\t// Pick which option\r\n\t\t\t\tif ( $proportion_wh <= $proportion_wh_desired ) { // Option 1: wh\r\n\t\t\t\t\t// Height would of overflowed\r\n\t\t\t\t\t$width_new = $height_desired * $proportion_wh; // w = h*(w/h)\r\n\t\t\t\t\t$height_new = $height_desired;\r\n\t\t\t\t} else // if ( $proportion_hw <= $proportion_hw_desired )\r\n{ // Option 2: hw\r\n\t\t\t\t\t// Width would of overflowed\r\n\t\t\t\t\t$width_new = $width_desired;\r\n\t\t\t\t\t$height_new = $width_desired * $proportion_hw; // h = w*(h/w)\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t} elseif ( $resize_mode === 'crop' ) { // Proportion to occupy\r\n\t\t\t\t\r\n\r\n\t\t\t\t// Pick which option\r\n\t\t\t\tif ( $proportion_wh <= $proportion_wh_desired ) { // Option 2: hw\r\n\t\t\t\t\t// Height will overflow\r\n\t\t\t\t\t$width_new = $width_desired;\r\n\t\t\t\t\t$height_new = $width_desired * $proportion_hw; // h = w*(h/w)\r\n\t\t\t\t\t// Set custom\r\n\t\t\t\t\t$y_new = -($height_new - $height_desired) / 2;\r\n\t\t\t\t} else // if ( $proportion_hw <= $proportion_hw_desired )\r\n{ // Option 1: hw\r\n\t\t\t\t\t// Width will overflow\r\n\t\t\t\t\t$width_new = $height_desired * $proportion_wh; // w = h*(w/h)\r\n\t\t\t\t\t$height_new = $height_desired;\r\n\t\t\t\t\t// Set custom\r\n\t\t\t\t\t$x_new = -($width_new - $width_desired) / 2;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// Set canvas\r\n\t\t\t\t$canvas_width = $width_desired;\r\n\t\t\t\t$canvas_height = $height_desired;\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t\t// ---------\r\n\t\t// Set custom if they have not been set already\r\n\t\tif ( $canvas_width === null )\r\n\t\t\t$canvas_width = $width_new;\r\n\t\tif ( $canvas_height === null )\r\n\t\t\t$canvas_height = $height_new;\r\n\t\t\t\r\n\t\t// ---------\r\n\t\t// Compat\r\n\t\t$width_old = $width_original;\r\n\t\t$height_old = $height_original;\r\n\t\t$x_old = $x_original;\r\n\t\t$y_old = $y_original;\r\n\t\t\r\n\t\t// ---------\r\n\t\t// Return\r\n\t\t$return = compact('width_original', 'height_original', 'width_old', 'height_old', 'width_desired', 'height_desired', 'width_new', 'height_new', 'canvas_width', 'canvas_height', 'x_original', 'y_original', 'x_old', 'y_old', 'x_new', 'y_new');\r\n\t\t// echo '<--'; var_dump($return); echo '-->';\r\n\t\treturn $return;\r\n\t}", "function resize($width,$height)\n {\n $new_image = imagecreatetruecolor($width, $height);\n imagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight());\n $this->image = $new_image; \n }", "function resizeImage($fileName,$maxWidth,$maxHight,$originalFileSufix=\"\")\n{\n $limitedext = array(\".gif\",\".jpg\",\".png\",\".jpeg\");\n\n //check the file's extension\n $ext = strrchr($fileName,'.');\n $ext = strtolower($ext);\n\n //uh-oh! the file extension is not allowed!\n if (!in_array($ext,$limitedext)) {\n exit();\n }\n\n if($ext== \".jpeg\" || $ext == \".jpg\"){\n $new_img = imagecreatefromjpeg($fileName);\n }elseif($ext == \".png\" ){\n $new_img = imagecreatefrompng($fileName);\n }elseif($ext == \".gif\"){\n $new_img = imagecreatefromgif($fileName);\n }\n\n //list the width and height and keep the height ratio.\n list($width, $height) = getimagesize($fileName);\n\n //calculate the image ratio\n $imgratio=$width/$height;\n $newwidth = $width;\n $newheight = $height;\n\n //Image format -\n if ($imgratio>1){\n if ($width>$maxWidth) {\n $newwidth = $maxWidth;\n $newheight = $maxWidth/$imgratio;\n }\n //image format |\n }else{\n if ($height>$maxHight) {\n $newheight = $maxHight;\n $newwidth = $maxHight*$imgratio;\n }\n }\n\n //function for resize image.\n $resized_img = imagecreatetruecolor($newwidth,$newheight);\n\n //the resizing is going on here!\n imagecopyresized($resized_img, $new_img, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);\n\n //finally, save the image\n if ($originalFileSufix!=\"\") {\n $path_parts=pathinfo($fileName);\n rename($fileName,$path_parts[\"dirname\"].DIRECTORY_SEPARATOR.$path_parts[\"filename\"].\"_\".$originalFileSufix.\".\".$path_parts[\"extension\"]);\n }\n ImageJpeg ($resized_img,$fileName,80);\n\n ImageDestroy ($resized_img);\n ImageDestroy ($new_img);\n}", "function resize_image($path, $filename, $maxwidth, $maxheight, $quality=75, $type = \"small_\", $new_path = \"\")\n{\n $filename = DIRECTORY_SEPARATOR.basename($filename);\n $sExtension = substr($filename, (strrpos($filename, \".\") + 1));\n $sExtension = strtolower($sExtension);\n\n // check ton tai thu muc khong\n if (!file_exists($path.$type))\n {\n @mkdir($path.$type, 0777, true);\n chmod($path.$type, 0777);\n }\n // Get new dimensions\n $size = getimagesize($path . $filename);\n $width = $size[0];\n $height = $size[1];\n if($width != 0 && $height !=0)\n {\n if($maxwidth / $width > $maxheight / $height) $percent = $maxheight / $height;\n else $percent = $maxwidth / $width;\n }\n\n $new_width\t= $width * $percent;\n $new_height\t= $height * $percent;\n\n // Resample\n $image_p = imagecreatetruecolor($new_width, $new_height);\n //check extension file for create\n switch($size['mime'])\n {\n case 'image/gif':\n $image = imagecreatefromgif($path . $filename);\n break;\n case 'image/jpeg' :\n case 'image/pjpeg' :\n $image = imagecreatefromjpeg($path . $filename);\n break;\n case 'image/png':\n $image = imagecreatefrompng($path . $filename);\n break;\n }\n //Copy and resize part of an image with resampling\n imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);\n\n // Output\n // check new_path, nếu new_path tồn tại sẽ save ra đó, thay path = new_path\n if($new_path != \"\")\n {\n $path = $new_path;\n if (!file_exists($path.$type))\n {\n @mkdir($path.$type, 0777, true);\n chmod($path.$type, 0777);\n }\n }\n\n switch($sExtension)\n {\n case \"gif\":\n imagegif($image_p, $path . $type . $filename);\n break;\n case $sExtension == \"jpg\" || $sExtension == \"jpe\" || $sExtension == \"jpeg\":\n imagejpeg($image_p, $path . $type . $filename, $quality);\n break;\n case \"png\":\n imagepng($image_p, $path . $type . $filename);\n break;\n }\n imagedestroy($image_p);\n}", "function resize_image($filename)\n {\n $img_source = 'assets/images/products/'. $filename;\n $img_target = 'assets/images/thumb/';\n\n // image lib settings\n $config = array(\n 'image_library' => 'gd2',\n 'source_image' => $img_source,\n 'new_image' => $img_target,\n 'maintain_ratio' => FALSE,\n 'width' => 128,\n 'height' => 128\n );\n // load image library\n $this->load->library('image_lib', $config);\n\n // resize image\n if(!$this->image_lib->resize())\n echo $this->image_lib->display_errors();\n $this->image_lib->clear();\n }", "function resize( $width, $height ) \r\n\t{\r\n //\t\t$new_image = imagecreatetruecolor($width, $height);\r\n //\t\t\r\n //\t\t imagesavealpha($new_image, true);\r\n //\t\t $trans_colour = imagecolorallocatealpha($new_image, 255, 255, 255, 256);\r\n //\t\t imagefill($new_image, 0, 0, $trans_colour);\r\n //\t\t header(\"Content-type: image/png\");\r\n //\t\t imagepng($new_image);\r\n //\t\t\t\t\r\n //\t\timagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight());\r\n //\t\t\r\n //\t\timagefill($new_image, 0, 0, $trans_colour);\r\n //\t\t\r\n //\t\t$this->image = $new_image;\r\n\t\t\r\n\t\t/****************/\r\n\t\t\r\n \t$image_resized = imagecreatetruecolor( $width, $height );\r\n \r\n if ( ($this->type == IMAGETYPE_GIF) || ($this->type == IMAGETYPE_PNG) ) \r\n {\r\n $transparency_index = imagecolortransparent($this->image);\r\n \r\n // If we have a specific transparent color\r\n if ($transparency_index >= 0) \r\n {\r\n // Get the original image's transparent color's RGB values\r\n $transparent_color = imagecolorsforindex($this->image, $transparency_index);\r\n \r\n // Allocate the same color in the new image resource\r\n $transparency_index = imagecolorallocate($image_resized, $transparent_color['red'], $transparent_color['green'], $transparent_color['blue']);\r\n \r\n // Completely fill the background of the new image with allocated color.\r\n imagefill($image_resized, 0, 0, $transparency_index);\r\n \r\n // Set the background color for new image to transparent\r\n imagecolortransparent($image_resized, $transparency_index);\r\n }\r\n elseif ($this->type == IMAGETYPE_PNG) \r\n {\r\n // Always make a transparent background color for PNGs that don't have one allocated already\r\n\r\n // Turn off transparency blending (temporarily)\r\n imagealphablending($image_resized, false);\r\n \r\n // Create a new transparent color for image\r\n $color = imagecolorallocatealpha($image_resized, 0, 0, 0, 127);\r\n \r\n // Completely fill the background of the new image with allocated color.\r\n imagefill($image_resized, 0, 0, $color);\r\n \r\n // Restore transparency blending\r\n imagesavealpha($image_resized, true);\r\n }\r\n }\r\n\r\n imagecopyresampled( $image_resized, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight() );\r\n \r\n $this->image = $image_resized;\r\n\t}", "public function sizeImg($width, $height, $crop = true);", "function funcs_imageResize(&$width, &$height, $target, $bywidth = null) {\n\tif ($width<=$target && $height<=$target){\n\t\treturn;\n\t}\n\t//takes the larger size of the width and height and applies the \n\t//formula accordingly...this is so this script will work \n\t//dynamically with any size image \n\tif (is_null($bywidth)){\n\t\tif ($width > $height) { \n\t\t\t$percentage = ($target / $width); \n\t\t} else { \n\t\t\t$percentage = ($target / $height); \n\t\t}\n\t}else{\n\t\tif ($bywidth){\n\t\t\t$percentage = ($target / $width);\n\t\t\t//if height would increase as a result\n\t\t\tif ($height < round($height * $percentage)){\n\t\t\t\treturn;\n\t\t\t} \n\t\t}else{\n\t\t\t$percentage = ($target / $height); \n\t\t\t//if width would increase as a result\n\t\t\tif ($width < round($width * $percentage)){\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t} \n\t//gets the new value and applies the percentage, then rounds the value \n\t$width = round($width * $percentage); \n\t$height = round($height * $percentage); \n}", "function resizer($image_file_name,$desc_location=null,$new_width=null,$new_height=null,$min_size=null,$show_image=true)\n\t{\n\t list($width, $height) = @getimagesize($image_file_name);\n\t if (empty($width) or empty($height)) {return false;}\n\n\t if (!is_null($min_size)) {\n\t if (is_null($min_size)) {$min_size=$new_width;}\n\t if (is_null($min_size)) {$min_size=$new_height;}\n\n\t if ($width>$height) {$new_height=$min_size;$new_width=null;}\n\t else {$new_width=$min_size;$new_height=null;}\n\t }\n\n\t// $my_new_height=$new_height;\n\t if (is_null($new_height) and !is_null($new_width))\n\t { $my_new_height=round($height*$new_width/$width);$my_new_width=$new_width; }\n\t elseif (!is_null($new_height))\n\t { $my_new_width=round($width*$new_height/$height);$my_new_height=$new_height; }\n\t//echo \"$my_new_width, $my_new_height <br/>\";\n\t $image_resized = imagecreatetruecolor($my_new_width, $my_new_height);\n\t $image = imagecreatefromjpeg($image_file_name);\n\t imagecopyresampled($image_resized, $image, 0, 0, 0, 0, $my_new_width, $my_new_height, $width, $height);\n\n\t //--(BEGIN)-->save , show or send image pointer as result\n\t if (!is_null($desc_location))\n\t imagejpeg($image_resized, $desc_location,100);\n\t elseif ($show_image==true)\n\t imagejpeg($image_resized);\n\t return $image_resized;\n\t //--(END)-->save , show or send image pointer as result\n\t}", "function imageResize($imageResourceId=null,$width=null,$height=null, $targetWidth=null, $targetHeight=null) {\n\n// $targetWidth =300;\n// $targetHeight =260;\n// dd($imageResourceId,$width,$height, $targetWidth, $targetHeight);\n\n $targetLayer=imagecreatetruecolor($targetWidth,$targetHeight);\n imagecopyresampled($targetLayer,$imageResourceId,0,0,0,0,$targetWidth,$targetHeight, $width,$height );\n// imagecopyresized($targetLayer,$imageResourceId,0,0,0,0, $width,$height,$targetWidth,$targetHeight);\n\n return $targetLayer;\n }", "function resize( $w = 0, $h = 0 )\n\t{\n\t\tif( $w == 0 || $h == 0 )\n\t\t\treturn FALSE;\n\t\t\n\t\t//get the size of the current image\n\t\t$oldsize = $this->size();\n\t\t\n\t\t//create a target canvas\n\t\t$new_im = imagecreatetruecolor ( $w, $h );\n\t\n\t\t//copy and resize image to new canvas\n\t\timagecopyresampled( $new_im, $this->im, 0, 0, 0, 0, $w, $h, $oldsize->w, $oldsize->h );\n\t\t\n\t\t//delete the old image handle\n\t\timagedestroy( $this->im );\n\t\t\n\t\t//set the new image as the current handle\n\t\t$this->im = $new_im;\n\t}", "function imgResizeHeight($file_ori,$UploadPath,$Resize=1,$imgx=130,$imgy=150,$clean=0) {\n\t\t$dest_filename='';\n\t\t$handle = new upload($file_ori);\n\t\t$img_proper=getimagesize($file_ori['tmp_name']);\n\t\t\n\t\tif ($handle->uploaded) {\n\t\t\t//$handle->image_x = $imgx;\n\t\t\t$handle->image_y = $imgy;\n\t\t\t$handle->image_resize = true;\n\t\t\t$handle->image_ratio_x = true;\n\t\t}\n\t\t$handle->process($UploadPath);\n\t\tif ($handle->processed) {\n\t\t\t$dest_filename=$handle->file_dst_name;\n\t\t\tif($clean==1)\n\t\t\t\t$handle->clean();\n\t\t} else\n\t\t\t$dest_filename='';\n\t\treturn $dest_filename;\n\t}", "function imageResize($width, $height, $target){\n //formula accordingly...this is so this script will work\n //dynamically with any size image\n\n if ($width > $height) {\n $percentage = ($target / $width);\n } else {\n $percentage = ($target / $height);\n }\n\n //gets the new value and applies the percentage, then rounds the value\n $width = round($width * $percentage);\n $height = round($height * $percentage);\n\n //returns the new sizes in html image tag format...this is so you\n //\tcan plug this function inside an image tag and just get the\n\n return \"width=\".$width.\" height=\".$height.\"\";\n\n }", "function resize($iNewWidth, $iNewHeight)\n\t{\n\t\tif (!$this->ImageStream) {\n\t\t\t$this->printError('image not loaded');\n\t\t}\n\n\t\tif (function_exists(\"imagecopyresampled\")) {\n\t\t\t$ResizedImageStream = imagecreatetruecolor($iNewWidth, $iNewHeight);\n\t\t\timagecopyresampled($ResizedImageStream, $this->ImageStream, 0, 0, 0, 0, $iNewWidth, $iNewHeight, $this->width, $this->height);\n\t\t} else {\n\t\t\t$ResizedImageStream = imagecreate($iNewWidth, $iNewHeight);\n\t\t\timagecopyresized($ResizedImageStream, $this->ImageStream, 0, 0, 0, 0, $iNewWidth, $iNewHeight, $this->width, $this->height);\n\t\t}\n\n\t\t$this->ImageStream = $ResizedImageStream;\n\t\t$this->width = $iNewWidth;\n\t\t$this->height = $iNewHeight;\n\t\t$this->setImageOrientation();\n\t}", "function resize( $width, $height ) {\n $new_image = imagecreatetruecolor( $width, $height );\n if ( $this->mimetype == 'image/gif' || $this->mimetype == 'image/png' ) {\n $current_transparent = imagecolortransparent( $this->image );\n if ( $current_transparent != -1 ) {\n $transparent_color = imagecolorsforindex( $this->image, $current_transparent );\n $current_transparent = imagecolorallocate( $new_image, $transparent_color['red'], $transparent_color['green'], $transparent_color['blue'] );\n imagefill( $new_image, 0, 0, $current_transparent );\n imagecolortransparent( $new_image, $current_transparent );\n } elseif ( $this->mimetype == 'image/png' ) {\n imagealphablending( $new_image, false );\n $color = imagecolorallocatealpha( $new_image, 0, 0, 0, 127 );\n imagefill( $new_image, 0, 0, $color );\n imagesavealpha( $new_image, true );\n }\n }\n imagecopyresampled( $new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->width, $this->height );\n $this->image = $new_image;\n return $this;\n }", "private function resizeWithScaleExact($width, $height, $scale) {\n\t\t//$new_height = (int)($this->info['height'] * $scale);\n\t\t$new_width = $width * $scale;\n\t\t$new_height = $height * $scale;\n\t\t$xpos = 0;//(int)(($width - $new_width) / 2);\n\t\t$ypos = 0;//(int)(($height - $new_height) / 2);\n\n if (isset($this->info['mime']) && $this->info['mime'] == 'image/gif' && $this->isAnimated) {\n $this->imagick = new Imagick($this->file);\n $this->imagick = $this->imagick->coalesceImages();\n foreach ($this->imagick as $frame) {\n $frame->thumbnailImage($new_width, $new_height);\n $frame->setImagePage($new_width, $new_height, 0, 0);\n }\n } else {\n $image_old = $this->image;\n $this->image = imagecreatetruecolor($width, $height);\n $bcg = $this->backgroundColor;\n\n if (isset($this->info['mime']) && $this->info['mime'] == 'image/png') {\n imagealphablending($this->image, false);\n imagesavealpha($this->image, true);\n $background = imagecolorallocatealpha($this->image, $bcg[0], $bcg[1], $bcg[2], 127);\n imagecolortransparent($this->image, $background);\n } else {\n $background = imagecolorallocate($this->image, $bcg[0], $bcg[1], $bcg[2]);\n }\n\n imagefilledrectangle($this->image, 0, 0, $width, $height, $background);\n imagecopyresampled($this->image, $image_old, $xpos, $ypos, 0, 0, $new_width, $new_height, $this->info['width'], $this->info['height']);\n imagedestroy($image_old);\n }\n\n\t\t$this->info['width'] = $width;\n\t\t$this->info['height'] = $height;\n }", "function resize_image($src_file, $dest_file, $new_size, $method, $thumb_use)\r\n{\r\n global $CONFIG, $ERROR;\r\n global $lang_errors;\r\n\r\n $imginfo = getimagesize($src_file);\r\n if ($imginfo == null)\r\n return false;\r\n // GD can only handle JPG & PNG images\r\n if ($imginfo[2] != GIS_JPG && $imginfo[2] != GIS_PNG && ($method == 'gd1' || $method == 'gd2')) {\r\n $ERROR = $lang_errors['gd_file_type_err'];\r\n return false;\r\n }\r\n // height/width\r\n $srcWidth = $imginfo[0];\r\n $srcHeight = $imginfo[1];\r\n if ($thumb_use == 'ht') {\r\n $ratio = $srcHeight / $new_size;\r\n } elseif ($thumb_use == 'wd') {\r\n $ratio = $srcWidth / $new_size;\r\n } else {\r\n $ratio = max($srcWidth, $srcHeight) / $new_size;\r\n }\r\n $ratio = max($ratio, 1.0);\r\n $destWidth = (int)($srcWidth / $ratio);\r\n $destHeight = (int)($srcHeight / $ratio);\r\n // Method for thumbnails creation\r\n switch ($method) {\r\n case \"im\" :\r\n if (preg_match(\"#[A-Z]:|\\\\\\\\#Ai\", __FILE__)) {\r\n // get the basedir, remove '/include'\r\n $cur_dir = substr(dirname(__FILE__), 0, -8);\r\n $src_file = '\"' . $cur_dir . '\\\\' . strtr($src_file, '/', '\\\\') . '\"';\r\n $im_dest_file = str_replace('%', '%%', ('\"' . $cur_dir . '\\\\' . strtr($dest_file, '/', '\\\\') . '\"'));\r\n } else {\r\n $src_file = escapeshellarg($src_file);\r\n $im_dest_file = str_replace('%', '%%', escapeshellarg($dest_file));\r\n }\r\n\r\n $output = array();\r\n /*\r\n * Hack for working with ImageMagick on WIndows even if IM is installed in C:\\Program Files.\r\n * By Aditya Mooley <[email protected]>\r\n */\r\n if (eregi(\"win\",$_ENV['OS'])) {\r\n $cmd = \"\\\"\".str_replace(\"\\\\\",\"/\", $CONFIG['impath']).\"convert\\\" -quality {$CONFIG['jpeg_qual']} {$CONFIG['im_options']} -geometry {$destWidth}x{$destHeight} \".str_replace(\"\\\\\",\"/\" ,$src_file ).\" \".str_replace(\"\\\\\",\"/\" ,$im_dest_file );\r\n exec (\"\\\"$cmd\\\"\", $output, $retval);\r\n } else {\r\n $cmd = \"{$CONFIG['impath']}convert -quality {$CONFIG['jpeg_qual']} {$CONFIG['im_options']} -geometry {$destWidth}x{$destHeight} $src_file $im_dest_file\";\r\n exec ($cmd, $output, $retval);\r\n }\r\n\r\n\r\n if ($retval) {\r\n $ERROR = \"Error executing ImageMagick - Return value: $retval\";\r\n if ($CONFIG['debug_mode']) {\r\n // Re-execute the command with the backtit operator in order to get all outputs\r\n // will not work is safe mode is enabled\r\n $output = `$cmd 2>&1`;\r\n $ERROR .= \"<br /><br /><div align=\\\"left\\\">Cmd line : <br /><font size=\\\"2\\\">\" . nl2br(htmlspecialchars($cmd)) . \"</font></div>\";\r\n $ERROR .= \"<br /><br /><div align=\\\"left\\\">The convert program said:<br /><font size=\\\"2\\\">\";\r\n $ERROR .= nl2br(htmlspecialchars($output));\r\n $ERROR .= \"</font></div>\";\r\n }\r\n @unlink($dest_file);\r\n return false;\r\n }\r\n break;\r\n\r\n case \"gd1\" :\r\n if (!function_exists('imagecreatefromjpeg')) {\r\n cpg_die(CRITICAL_ERROR, 'PHP running on your server does not support the GD image library, check with your webhost if ImageMagick is installed', __FILE__, __LINE__);\r\n }\r\n if ($imginfo[2] == GIS_JPG)\r\n $src_img = imagecreatefromjpeg($src_file);\r\n else\r\n $src_img = imagecreatefrompng($src_file);\r\n if (!$src_img) {\r\n $ERROR = $lang_errors['invalid_image'];\r\n return false;\r\n }\r\n $dst_img = imagecreate($destWidth, $destHeight);\r\n imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $destWidth, (int)$destHeight, $srcWidth, $srcHeight);\r\n imagejpeg($dst_img, $dest_file, $CONFIG['jpeg_qual']);\r\n imagedestroy($src_img);\r\n imagedestroy($dst_img);\r\n break;\r\n\r\n case \"gd2\" :\r\n if (!function_exists('imagecreatefromjpeg')) {\r\n cpg_die(CRITICAL_ERROR, 'PHP running on your server does not support the GD image library, check with your webhost if ImageMagick is installed', __FILE__, __LINE__);\r\n }\r\n if (!function_exists('imagecreatetruecolor')) {\r\n cpg_die(CRITICAL_ERROR, 'PHP running on your server does not support GD version 2.x, please switch to GD version 1.x on the config page', __FILE__, __LINE__);\r\n }\r\n if ($imginfo[2] == GIS_JPG)\r\n $src_img = imagecreatefromjpeg($src_file);\r\n else\r\n $src_img = imagecreatefrompng($src_file);\r\n if (!$src_img) {\r\n $ERROR = $lang_errors['invalid_image'];\r\n return false;\r\n }\r\n $dst_img = imagecreatetruecolor($destWidth, $destHeight);\r\n imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $destWidth, (int)$destHeight, $srcWidth, $srcHeight);\r\n imagejpeg($dst_img, $dest_file, $CONFIG['jpeg_qual']);\r\n imagedestroy($src_img);\r\n imagedestroy($dst_img);\r\n break;\r\n }\r\n // Set mode of uploaded picture\r\n chmod($dest_file, octdec($CONFIG['default_file_mode']));\r\n // We check that the image is valid\r\n $imginfo = getimagesize($dest_file);\r\n if ($imginfo == null) {\r\n $ERROR = $lang_errors['resize_failed'];\r\n @unlink($dest_file);\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n}", "public function resizeImage()\n {\n \treturn view('resizeImage');\n }", "function resize($width, $height){\n\n $new_image = imagecreatetruecolor($width, $height);\n\n imagecolortransparent($new_image, imagecolorallocate($new_image, 0, 0, 0));\n imagealphablending($new_image, false);\n imagesavealpha($new_image, true);\n\n imagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->get_width(), $this->get_height());\n $this->image = $new_image;\n\n //reset sizes\n $this->width = $width;\n $this->height = $height;\n\n return true;\n }", "function resize_square($size){\n\n //container for new image\n $new_image = imagecreatetruecolor($size, $size);\n\n\n if($this->width > $this->height){\n $this->resize_by_height($size);\n\n imagecolortransparent($new_image, imagecolorallocate($new_image, 0, 0, 0));\n imagealphablending($new_image, false);\n imagesavealpha($new_image, true);\n imagecopy($new_image, $this->image, 0, 0, ($this->get_width() - $size) / 2, 0, $size, $size);\n }else{\n $this->resize_by_width($size);\n\n imagecolortransparent($new_image, imagecolorallocate($new_image, 0, 0, 0));\n imagealphablending($new_image, false);\n imagesavealpha($new_image, true);\n imagecopy($new_image, $this->image, 0, 0, 0, ($this->get_height() - $size) / 2, $size, $size);\n }\n\n $this->image = $new_image;\n\n //reset sizes\n $this->width = $size;\n $this->height = $size;\n\n return true;\n }", "function image_resize_dimensions($orig_w, $orig_h, $dest_w, $dest_h, $crop = \\false)\n {\n }", "function resizeImage($old_image_path, $new_image_path, $max_width, $max_height) {\r\n \r\n // Get image type\r\n $image_info = getimagesize($old_image_path);\r\n $image_type = $image_info[2];\r\n \r\n // Set up the function names\r\n switch ($image_type) {\r\n case IMAGETYPE_JPEG:\r\n $image_from_file = 'imagecreatefromjpeg';\r\n $image_to_file = 'imagejpeg';\r\n break;\r\n case IMAGETYPE_GIF:\r\n $image_from_file = 'imagecreatefromgif';\r\n $image_to_file = 'imagegif';\r\n break;\r\n case IMAGETYPE_PNG:\r\n $image_from_file = 'imagecreatefrompng';\r\n $image_to_file = 'imagepng';\r\n break;\r\n default:\r\n return;\r\n } // ends the swith\r\n \r\n // Get the old image and its height and width\r\n $old_image = $image_from_file($old_image_path);\r\n $old_width = imagesx($old_image);\r\n $old_height = imagesy($old_image);\r\n \r\n // Calculate height and width ratios\r\n $width_ratio = $old_width / $max_width;\r\n $height_ratio = $old_height / $max_height;\r\n \r\n // If image is larger than specified ratio, create the new image\r\n if ($width_ratio > 1 || $height_ratio > 1) {\r\n \r\n // Calculate height and width for the new image\r\n $ratio = max($width_ratio, $height_ratio);\r\n $new_height = round($old_height / $ratio);\r\n $new_width = round($old_width / $ratio);\r\n \r\n // Create the new image\r\n $new_image = imagecreatetruecolor($new_width, $new_height);\r\n \r\n // Set transparency according to image type\r\n if ($image_type == IMAGETYPE_GIF) {\r\n $alpha = imagecolorallocatealpha($new_image, 0, 0, 0, 127);\r\n imagecolortransparent($new_image, $alpha);\r\n }\r\n \r\n if ($image_type == IMAGETYPE_PNG || $image_type == IMAGETYPE_GIF) {\r\n imagealphablending($new_image, false);\r\n imagesavealpha($new_image, true);\r\n }\r\n \r\n // Copy old image to new image - this resizes the image\r\n $new_x = 0;\r\n $new_y = 0;\r\n $old_x = 0;\r\n $old_y = 0;\r\n imagecopyresampled($new_image, $old_image, $new_x, $new_y, $old_x, $old_y, $new_width, $new_height, $old_width, $old_height);\r\n \r\n // Write the new image to a new file\r\n $image_to_file($new_image, $new_image_path);\r\n // Free any memory associated with the new image\r\n imagedestroy($new_image);\r\n } else {\r\n // Write the old image to a new file\r\n $image_to_file($old_image, $new_image_path);\r\n }\r\n // Free any memory associated with the old image\r\n imagedestroy($old_image);\r\n }", "public function image_resize()\n {\n $url = $this->input->get('pic');\n $width = $this->input->get('width');\n $height = $this->input->get('height');\n $bgcolor = $this->input->get('color');\n $type = $this->input->get('type');\n $loc = $this->input->get('loc');\n if (empty($type)) {\n $type = 'fit'; // fit, fill\n }\n if (empty($loc)) {\n $loc = 'Center'; // NorthWest, North, NorthEast, West, Center, East, SouthWest, South, SouthEast\n }\n $strict = FALSE;\n if (substr($width, -1) == \"*\" && substr($height, -1) == \"*\") {\n $width = substr($width, 0, -1);\n $height = substr($height, 0, -1);\n $strict = TRUE;\n }\n\n// $bgcolor = (trim($bgcolor) == \"\") ? \"FFFFFF\" : $bgcolor;\n// $props = array(\n// 'picture' => $url,\n// 'resize_width' => $width,\n// 'resize_height' => $height,\n// 'bg_color' => $bgcolor\n// );\n//\n// $this->load->library('Image_resize', $props);\n// $this->skip_template_view();\n\n $dest_folder = APPPATH . 'cache' . DS . 'temp' . DS;\n $this->general->createFolder($dest_folder);\n\n $pic = trim($url);\n $pic = base64_decode($pic);\n $pic = str_replace(\" \", \"%20\", $pic);\n $url = $pic;\n $url = str_replace(\" \", \"%20\", $url);\n $props = array(\n 'picture' => $url,\n 'resize_width' => $width,\n 'resize_height' => $height,\n 'bg_color' => $bgcolor\n );\n $md5_url = md5($url . serialize($props));\n $tmp_path = $tmp_file = $dest_folder . $md5_url;\n\n if (strpos($url, $this->config->item('site_url')) === FALSE && strpos($url, 's3.amazonaws') === FALSE) {\n $this->output->set_status_header(400);\n exit;\n }\n \n if (!is_file($tmp_path)) {\n $image_data = file_get_contents($url);\n if ($image_data == FALSE) {\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);\n curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);\n curl_setopt($curl, CURLOPT_TIMEOUT, 600);\n curl_setopt($curl, CURLOPT_COOKIEJAR, \"cookie.txt\");\n curl_setopt($curl, CURLOPT_COOKIEFILE, \"cookie.txt\");\n curl_setopt($curl, CURLOPT_FOLLOWLOCATION, TRUE);\n curl_setopt($curl, CURLOPT_VERBOSE, TRUE);\n //curl_setopt($curl, CURLOPT_HEADER, TRUE);\n $image_data = curl_exec($curl);\n\n if ($image_data == FALSE) {\n \t\n $httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n if ($httpCode != 200) {\n $this->output->set_status_header($httpCode);\n exit;\n }\n }\n curl_close($curl);\n// $headers = parse_response_header($http_response_header);\n// if ($headers['reponse_code'] != 200) {\n// $this->output->set_status_header($headers['reponse_code']);\n// exit;\n// }\n }\n $handle = fopen($tmp_path, 'w+');\n fwrite($handle, $image_data);\n fclose($handle);\n\n $img_info = getimagesize($tmp_path);\n $img_ext = end(explode(\"/\", $img_info['mime']));\n if ($img_ext == 'jpeg' || $img_ext == \"pjpeg\") {\n $img_ext = 'jpg';\n }\n if ($strict == TRUE && $img_info[0] < $width && $img_info[1] < $height) {\n $tmp_file = $tmp_path;\n } else {\n\n $this->load->library('image_lib');\n\n $image_process_tool = $this->config->item('imageprocesstool');\n $config['image_library'] = $image_process_tool;\n if ($image_process_tool == \"imagemagick\") {\n $config['library_path'] = $this->config->item('imagemagickinstalldir');\n }\n// if ($img_ext == \"jpg\") {\n// $png_convert = $this->image_lib->convet_jpg_png($tmp_path, $tmp_path . \".png\", $config['library_path']);\n// if ($png_convert) {\n// unlink($tmp_path);\n// rename($tmp_path . \".png\", $tmp_path);\n// }\n// }\n\n if ($type == 'fill') {\n $img_info = getimagesize($tmp_path);\n $org_width = $img_info[0];\n $org_height = $img_info[1];\n\n $width_ratio = $width / $org_width;\n $height_ratio = $height / $org_height;\n if ($width_ratio > $height_ratio) {\n $resize_width = $org_width * $width_ratio;\n $resize_height = $org_height * $width_ratio;\n } else {\n $resize_width = $org_width * $height_ratio;\n $resize_height = $org_height * $height_ratio;\n }\n\n $crop_width = $width;\n $crop_height = $height;\n\n $width = $resize_width;\n $height = $resize_height;\n }\n\n $config['source_image'] = $tmp_path;\n $config['width'] = $width;\n $config['height'] = $height;\n $config['gravity'] = $loc; //center/West/East\n $config['bgcolor'] = (trim($bgcolor) != \"\") ? trim($bgcolor) : $this->config->item('imageresizebgcolor');\n $this->image_lib->initialize($config);\n $this->image_lib->resize();\n\n if ($type == 'fill') {\n $config['source_image'] = $tmp_path;\n $config['width'] = $crop_width;\n $config['height'] = $crop_height;\n $config['gravity'] = 'center';\n $config['maintain_ratio'] = FALSE;\n\n $this->image_lib->initialize($config);\n $this->image_lib->crop();\n }\n }\n }\n\n $this->image_display($tmp_file);\n }", "function resizeImage ( $sourcePathFilename, $extension, $destinationPath, $maxWidth, $maxHeight ) {\n $result = '';\n debug_log ( __FILE__, __LINE__, $sourcePathFilename );\n debug_log ( __FILE__, __LINE__, $extension );\n\n if ( $sourcePathFilename != '' && $extension != '' ) {\n if ( in_array ( $extension, array ( 'jpg', 'jpeg', 'png', 'gif' ) ) ) {\n switch ( $extension ) {\n case 'jpg':\n $imageOldData = imagecreatefromjpeg ( $sourcePathFilename );\n break;\n\n case 'jpeg':\n $imageOldData = imagecreatefromjpeg ( $sourcePathFilename );\n break;\n\n case 'png':\n $imageOldData = imagecreatefrompng ( $sourcePathFilename );\n break;\n\n case 'gif':\n $imageOldData = imagecreatefromgif ( $sourcePathFilename );\n break;\n\n default:\n $imageOldData = imagecreatefromjpeg ( $sourcePathFilename );\n }\n\n $imageOldWidth = imagesx ( $imageOldData );\n $imageOldHeight = imagesy ( $imageOldData );\n\n $imageScale = min ( $maxWidth / $imageOldWidth, $maxHeight / $imageOldHeight );\n\n $imageNewWidth = ceil ( $imageScale * $imageOldWidth );\n $imageNewHeight = ceil ( $imageScale * $imageOldHeight );\n\n $imageNewData = imagecreatetruecolor ( $imageNewWidth, $imageNewHeight );\n\n $colorWhite = imagecolorallocate ( $imageNewData, 255, 255, 255 );\n imagefill ( $imageNewData, 0, 0, $colorWhite );\n\n imagecopyresampled ( $imageNewData, $imageOldData, 0, 0, 0, 0, $imageNewWidth, $imageNewHeight, $imageOldWidth, $imageOldHeight );\n\n ob_start ();\n imagejpeg ( $imageNewData, NULL, 100 );\n $imageNewDataString = ob_get_clean ();\n\n $imageNewFilename = hash ( 'sha256', $imageNewDataString ) . uniqid () . '.jpg';\n\n $imageNewPathFilename = $destinationPath . $imageNewFilename;\n\n if ( file_put_contents ( $imageNewPathFilename, $imageNewDataString ) !== false )\n {\n $result = $imageNewFilename;\n }\n\n imagedestroy ( $imageNewData );\n imagedestroy ( $imageOldData );\n }\n }\n\n return $result;\n}", "public function reseize($path, $source, $width, $height, $nama_ori){\n \t//$source = sumber gambar yang akan di reseize\n $config['image_library'] = 'gd2';\n $config['source_image'] = $source;\n $config['new_image'] = $path.$width.'_'.$nama_ori;\n $config['overwrite'] = TRUE;\n $config['create_thumb'] = false;\n $config['width'] = $width;\n if($height>0){\n \t$config['maintain_ratio'] = false;\n \t$config['height'] = $height;\n }else{\n \t$config['maintain_ratio'] = true;\n }\n\n $this->image_lib->initialize($config);\n\n $this->image_lib->resize();\n $this->image_lib->clear();\n }", "function imageResize($width, $height, $target) {\t\n\tif ($width > $height) { \n\t\t$percentage = ($target / $width); \n\t} else { \n\t\t$percentage = ($target / $height); \n\t} \n\n\t//gets the new value and applies the percentage, then rounds the value \n\t$width = round($width * $percentage); \n\t$height = round($height * $percentage); \n\n\t//returns the new sizes in html image tag format...this is so you \n\t//can plug this function inside an image tag and just get the \n\treturn \"width=\\\"$width\\\" height=\\\"$height\\\"\"; \n\t}", "function imagethumb( $image_src , $image_dest = NULL , $max_size = 500, $expand = FALSE, $square = FALSE )\n{\n\tif( !file_exists($image_src) ) return FALSE;\n\n\t// Récupère les infos de l'image\n\t$fileinfo = getimagesize($image_src);\n\n\techo \"file infos :\".$fileinfo[0].\"---\".$fileinfo[1];\n\t\n\tif( !$fileinfo ) return FALSE;\n\n\t$width = $fileinfo[0];\n\t$height = $fileinfo[1];\n\n\n\t$type_mime = $fileinfo['mime'];\n\n\n\t$type = str_replace('image/', '', $type_mime);\n\n\t//echo \"\\ntype_mime --> \".$type;\n\n\tif( !$expand && max($width, $height)<=$max_size && (!$square || ($square && $width==$height) ) )\n\t{\n\t\t// L'image est plus petite que max_size\n\t\tif($image_dest)\n\t\t{\n\t\t\treturn copy($image_src, $image_dest);\n\t\t}\n\t\telse\n\t\t{\n\t\t\theader('Content-Type: '. $type_mime);\n\t\t\treturn (boolean) readfile($image_src);\n\t\t}\n\t}\n\n\t// Calcule les nouvelles dimensions\n\t$ratio = $width / $height;\n\n\tif( $square )\n\t{\n\t\t$new_width = $new_height = $max_size;\n\n\t\tif( $ratio > 1 )\n\t\t{\n\t\t\t// Paysage\n\t\t\t$src_y = 0;\n\t\t\t$src_x = round( ($width - $height) / 2 );\n\n\t\t\t$src_w = $src_h = $height;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Portrait\n\t\t\t$src_x = 0;\n\t\t\t$src_y = round( ($height - $width) / 2 );\n\n\t\t\t$src_w = $src_h = $width;\n\t\t}\n\t}\n\telse\n\t{\n\t\t$src_x = $src_y = 0;\n\t\t$src_w = $width;\n\t\t$src_h = $height;\n\n\t\tif ( $ratio > 1 )\n\t\t{\n\t\t\t// Paysage\n\t\t\t$new_width = $max_size;\n\t\t\t$new_height = round( $max_size / $ratio );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Portrait\n\t\t\t$new_height = $max_size;\n\t\t\t$new_width = round( $max_size * $ratio );\n\t\t}\n\t}\n\n\t// Ouvre l'image originale\n\t$func = 'imagecreatefrom' . $type;\n\tif( !function_exists($func) ) return FALSE;\n\n\t$image_src = $func($image_src);\n\t$new_image = imagecreatetruecolor($new_width,$new_height);\n\n\t// Gestion de la transparence pour les png\n\tif( $type=='png' )\n\t{\n\t\timagealphablending($new_image,false);\n\t\tif( function_exists('imagesavealpha') )\n\t\t\timagesavealpha($new_image,true);\n\t}\n\n\t// Gestion de la transparence pour les gif\n\telseif( $type=='gif' && imagecolortransparent($image_src)>=0 )\n\t{\n\t\t$transparent_index = imagecolortransparent($image_src);\n\t\t$transparent_color = imagecolorsforindex($image_src, $transparent_index);\n\t\t$transparent_index = imagecolorallocate($new_image, $transparent_color['red'], $transparent_color['green'], $transparent_color['blue']);\n\t\timagefill($new_image, 0, 0, $transparent_index);\n\t\timagecolortransparent($new_image, $transparent_index);\n\t}\n\n\t// Redimensionnement de l'image\n\timagecopyresampled(\n\t\t$new_image, $image_src,\n\t\t0, 0, $src_x, $src_y,\n\t\t$new_width, $new_height, $src_w, $src_h\n\t);\n\n\t// Enregistrement de l'image\n\t$func = 'image'. $type;\n\tif($image_dest)\n\t{\n\t\t$func($new_image, $image_dest);\n\t}\n\telse\n\t{\n\t\theader('Content-Type: '. $type_mime);\n\t\t$func($new_image);\n\t}\n\n\t// Libération de la mémoire\n\timagedestroy($new_image); \n\n\treturn TRUE;\n}", "function resizeThumbnailImage($thumb_image_name, $image, $width, $height, $start_width, $start_height, $scale){\n\t\tlist($imagewidth, $imageheight, $imageType) = getimagesize($image);\n\t\t$imageType = image_type_to_mime_type($imageType);\n\t\t\n\t\t$newImageWidth = ceil($width * $scale);\n\t\t$newImageHeight = ceil($height * $scale);\n\t\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\t\tswitch($imageType) {\n\t\t\tcase \"image/gif\":\n\t\t\t\t$source=imagecreatefromgif($image); \n\t\t\t\tbreak;\n\t\t\tcase \"image/pjpeg\":\n\t\t\tcase \"image/jpeg\":\n\t\t\tcase \"image/jpg\":\n\t\t\t\t$source=imagecreatefromjpeg($image); \n\t\t\t\tbreak;\n\t\t\tcase \"image/png\":\n\t\t\tcase \"image/x-png\":\n\t\t\t\t$source=imagecreatefrompng($image); \n\t\t\t\tbreak;\n\t\t}\n\t\timagecopyresampled($newImage,$source,0,0,$start_width,$start_height,$newImageWidth,$newImageHeight,$width,$height);\n\t\tswitch($imageType) {\n\t\t\tcase \"image/gif\":\n\t\t\t\timagegif($newImage,$thumb_image_name); \n\t\t\t\tbreak;\n\t\t\tcase \"image/pjpeg\":\n\t\t\tcase \"image/jpeg\":\n\t\t\tcase \"image/jpg\":\n\t\t\t\timagejpeg($newImage,$thumb_image_name,90); \n\t\t\t\tbreak;\n\t\t\tcase \"image/png\":\n\t\t\tcase \"image/x-png\":\n\t\t\t\timagepng($newImage,$thumb_image_name); \n\t\t\t\tbreak;\n\t\t}\n\t\tchmod($thumb_image_name, 0777);\n\t\treturn $thumb_image_name;\n\t}", "function resizeImage($sourceImage, $targetImage, $maxWidth, $maxHeight, $quality = 80) {\n echo 'sourceImage ';\n echo $sourceImage;\n echo ' targetImage ';\n echo $targetImage;\n // Obtain image from given source file.\n\tif (!$image = @imagecreatefromjpeg($sourceImage)) {\n\t\techo 'false';\n return false;\n }\n\techo ' pre list ';\n // Get dimensions of source image.\n list($origWidth, $origHeight) = getimagesize($sourceImage);\n\n if ($maxWidth == 0) {\n $maxWidth = $origWidth;\n }\n\n if ($maxHeight == 0) {\n $maxHeight = $origHeight;\n }\n\n // Calculate ratio of desired maximum sizes and original sizes.\n $widthRatio = $maxWidth / $origWidth;\n $heightRatio = $maxHeight / $origHeight;\n\n // Ratio used for calculating new image dimensions.\n $ratio = min($widthRatio, $heightRatio);\n\n // Calculate new image dimensions.\n $newWidth = (int)$origWidth * $ratio;\n $newHeight = (int)$origHeight * $ratio;\n\techo 'pre true color ';\n // Create final image with new dimensions.\n\t$newImage = imagecreatetruecolor($newWidth, $newHeight);\n\techo 'post true color ';\n\n // $image = str_replace(' ','_',$image);\n\n\timagecopyresampled($newImage, $image, 0, 0, 0, 0, $newWidth, $newHeight, $origWidth, $origHeight);\n\techo 'post resampled ';\n\n // CREATE PROGRESSIVE IMG INSTANCE\n // $imageProg = imagecreatefromjpeg($image);\n // imageinterlace($imageProg, true);\n // echo 'post progressive';\n\n\timagejpeg($newImage, $targetImage, $quality);\n // imagejpeg($imageProg, $targetImage, $quality);\n\techo 'post imagejpeg ';\n\n // FREE UP MEMORY\n imagedestroy($image);\n imagedestroy($newImage);\n // imagedestroy($imageProg);\n\n return true;\n}", "function _resizeImageGD2($src_file, $dest_file, $new_size, $imgobj) {\r\n if ($imgobj->_size == null) {\r\n return false;\r\n }\r\n // GD can only handle JPG, PNG & GIF images\r\n if ($imgobj->_type !== \"jpg\" && $imgobj->_type !== \"jpeg\" && $imgobj->_type !== \"png\" && $imgobj->_type !== \"gif\") {\r\n return false;\r\n }\r\n if ($imgobj->_type == \"gif\" && !function_exists(\"imagecreatefromgif\")) {\r\n \treturn false;\r\n }\r\n \r\n // height/width\r\n $ratio = max($imgobj->_size[0], $imgobj->_size[1]) / $new_size;\r\n $ratio = max($ratio, 1.0);\r\n $destWidth = (int)($imgobj->_size[0] / $ratio);\r\n $destHeight = (int)($imgobj->_size[1] / $ratio);\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n $src_img = @imagecreatefromjpeg($src_file);\r\n $dst_img = imagecreatetruecolor($destWidth, $destHeight);\r\n } else if ($imgobj->_type == \"png\") {\r\n $src_img = @imagecreatefrompng($src_file);\r\n $dst_img = imagecreatetruecolor($destWidth, $destHeight);\r\n \t\t\t$img_white = imagecolorallocate($dst_img, 255, 255, 255); // set background to white\r\n\t\t\t$img_return = @imagefill($dst_img, 0, 0, $img_white);\r\n } else {\r\n \t$src_img = @imagecreatefromgif($src_file);\r\n \t$dst_img = imagecreatetruecolor($destWidth,$destHeight);\r\n\t\t\t$img_white = imagecolorallocate($dst_img, 255, 255, 255); // set background to white\r\n\t\t\t$img_return = @imagefill($dst_img, 0, 0, $img_white);\r\n }\r\n if (!$src_img) {\r\n return false;\r\n }\r\n imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $destWidth, $destHeight, $imgobj->_size[0], $imgobj->_size[1]);\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n imagejpeg($dst_img, $dest_file, $this->_JPEG_quality);\r\n } else if ($imgobj->_type == \"png\") {\r\n imagepng($dst_img, $dest_file);\r\n } else {\r\n \timagegif($dst_img, $dest_file);\r\n }\r\n imagedestroy($src_img);\r\n imagedestroy($dst_img);\r\n return true;\r\n }", "function resizeImage($src_file, $dest_file, $new_size=100, $resize_aspect=\"sq\", $quality=\"80\")\n\t{\n\t\t$imginfo = getimagesize($src_file);\n\t\t\n\t\tif ($imginfo == null) {\n\t\treturn false;\n\t\t}\t \n\t\t\n\t\t// GD2 can only handle JPG, PNG & GIF images\n\t\tif (!$imginfo[2] > 0 && $imginfo[2] <= 3 ) {\n\t\t return false;\n\t\t}\n\t\t\n\t\t// height/width\n\t\t$srcWidth = $imginfo[0];\n\t\t$srcHeight = $imginfo[1];\n\t\t//$resize_aspect = \"sq\";\n\t\tif ($resize_aspect == 'ht') {\n\t\t $ratio = $srcHeight / $new_size;\n\t\t} elseif ($resize_aspect == 'wd') {\n\t\t $ratio = $srcWidth / $new_size;\n\t\t} elseif ($resize_aspect == 'sq') {\n\t\t $ratio = min($srcWidth, $srcHeight) / $new_size;\n\t\t} else {\n\t\t $ratio = max($srcWidth, $srcHeight) / $new_size;\n\t\t}\n\t\t\n\t\t/**\n\t\t* Initialize variables\n\t\t*/\n\t\t$clipX = 0;\n\t\t$clipY = 0;\n\t\t\n\t\t$ratio = max($ratio, 1.0);\n\t\tif ($resize_aspect == 'sq'){\n\t\t$destWidth = (int)(min($srcWidth,$srcHeight) / $ratio);\n\t\t$destHeight = (int)(min($srcWidth,$srcHeight) / $ratio);\n\t\tif($srcHeight > $srcWidth){\n\t\t$clipX = 0;\n\t\t$clipY = ((int)($srcHeight - $srcWidth)/2);\n\t\t$srcHeight = $srcWidth;\n\t\t}elseif($srcWidth > $srcHeight){\n\t\t$clipX = ((int)($srcWidth - $srcHeight)/2);\n\t\t$clipY = 0;\n\t\t$srcWidth = $srcHeight;\n\t\t}\n\t\t}else{\n\t\t$destWidth = (int)($srcWidth / $ratio);\n\t\t$destHeight = (int)($srcHeight / $ratio);\n\t\t}\n\t\t\n\t\tif (!function_exists('imagecreatefromjpeg')) {\n\t\t echo 'PHP running on your server does not support the GD image library, check with your webhost if ImageMagick is installed';\n\t\t exit;\n\t\t}\n\t\tif (!function_exists('imagecreatetruecolor')) {\n\t\t echo 'PHP running on your server does not support GD version 2.x, please switch to GD version 1.x on the admin page';\n\t\t exit;\n\t\t}\n\t\t\n\t\tif ($imginfo[2] == 1 )\n\t\t $src_img = imagecreatefromgif($src_file);\n\t\telseif ($imginfo[2] == 2)\n\t\t $src_img = imagecreatefromjpeg($src_file);\n\t\telse\n\t\t $src_img = imagecreatefrompng($src_file);\n\t\tif (!$src_img){\n\t\t return false;\n\t\t}\n\t\tif ($imginfo[2] == 1 ) {\n\t\t$dst_img = imagecreate($destWidth, $destHeight);\n\t\t} else {\n\t\t$dst_img = imagecreatetruecolor($destWidth, $destHeight);\n\t\t}\n\t\t\n\t\timagecopyresampled($dst_img, $src_img, 0, 0, $clipX, $clipY, (int)$destWidth, (int)$destHeight, $srcWidth, $srcHeight);\n\t\timagejpeg($dst_img, $dest_file, $quality);\n\t\timagedestroy($src_img);\n\t\timagedestroy($dst_img);\n\t\t\n\t\t// We check that the image is valid\n\t\t$imginfo = getimagesize($dest_file);\n\t\tif ($imginfo == null) {\n\t\t\t@unlink($dest_file);\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "public function resizeTo($width, $height, $resizeOption = 'default') {\n switch (strtolower($resizeOption)) {\n case 'exact':\n $this->resizeWidth = $width;\n $this->resizeHeight = $height;\n break;\n case 'maxwidth':\n $this->resizeWidth = $width;\n $this->resizeHeight = $this->resizeHeightByWidth($width);\n break;\n case 'maxheight':\n $this->resizeWidth = $this->resizeWidthByHeight($height);\n $this->resizeHeight = $height;\n break;\n case 'proportionally':\n $ratio_orig = $this->origWidth / $this->origHeight;\n $this->resizeWidth = $width;\n $this->resizeHeight = $height;\n if ($width / $height > $ratio_orig)\n $this->resizeWidth = $height * $ratio_orig;\n else\n $this->resizeHeight = $width / $ratio_orig;\n break;\n default:\n if ($this->origWidth > $width || $this->origHeight > $height) {\n if ($this->origWidth > $this->origHeight) {\n $this->resizeHeight = $this->resizeHeightByWidth($width);\n $this->resizeWidth = $width;\n } else if ($this->origWidth < $this->origHeight) {\n $this->resizeWidth = $this->resizeWidthByHeight($height);\n $this->resizeHeight = $height;\n } else {\n $this->resizeWidth = $width;\n $this->resizeHeight = $height;\n }\n } else {\n $this->resizeWidth = $width;\n $this->resizeHeight = $height;\n }\n break;\n }\n\n $this->newImage = imagecreatetruecolor($this->resizeWidth, $this->resizeHeight);\n if ($this->ext == \"image/gif\" || $this->ext == \"image/png\") {\n imagealphablending($this->newImage, false);\n imagesavealpha($this->newImage, true);\n $transparent = imagecolorallocatealpha($this->newImage, 255, 255, 255, 127);\n imagefilledrectangle($this->newImage, 0, 0, $this->resizeWidth, $this->resizeHeight, $transparent);\n }\n imagecopyresampled($this->newImage, $this->image, 0, 0, 0, 0, $this->resizeWidth, $this->resizeHeight, $this->origWidth, $this->origHeight);\n }", "function _process_image($data){\n\t\t\n\t\t// Largest side dimensions for small and large thumbnails\n\t\t$px_sm = 320;\n\t\t$px_lg = 640;\n\t\t\n\t\t// Generate new base name for this image\n\t\t$new_name = uniqid(TRUE);\n\t\t\n\t\t// Initialise array for resizing errors\n\t\t$this->resize_errors = array();\n\t\t\n\t\t// Array to hold the new dimensions\n\t\t$dimensions = array();\n\t\t\n\t\t// Work out the dimensions of the image based on longest side, or set both to same if equal\n\t\tif ($data['image_width'] > $data['image_height']){\n\t\t\t$dimensions['sm']['w'] = $px_sm;\n\t\t\t$dimensions['lg']['w'] = $px_lg;\n\t\t\t$dimensions['sm']['h'] = $data['image_height'] * ($px_sm / $data['image_width']);\n\t\t\t$dimensions['lg']['h'] = $data['image_height'] * ($px_lg / $data['image_width']);\n\t\t} elseif($data['image_width'] < $data['image_height']){\n\t\t\t$dimensions['sm']['w'] = $data['image_width'] * ($px_sm / $data['image_height']);\n\t\t\t$dimensions['lg']['w'] = $data['image_width'] * ($px_lg / $data['image_height']);\n\t\t\t$dimensions['sm']['h'] = $px_sm;\n\t\t\t$dimensions['lg']['h'] = $px_lg;\n\t\t} elseif ($data['image_width'] == $data['image_height']){\n\t\t\t$dimensions['sm']['w'] = $px_sm;\n\t\t\t$dimensions['lg']['w'] = $px_lg;\n\t\t\t$dimensions['sm']['h'] = $px_sm;\n\t\t\t$dimensions['lg']['h'] = $px_lg;\n\t\t}\n\t\t\n\t\t// Global resize vars\n\t\t$config['image_library'] = 'gd2';\n\t\t$config['source_image']\t= $data['full_path'];\n\t\t$config['create_thumb'] = FALSE;\n\t\t$config['maintain_ratio'] = TRUE;\n\t\t$config['quality'] = 100;\n\t\t$this->load->library('image_lib', $config);\n\t\t\n\t\t// Create small image\n\t\t$config['width'] = $dimensions['sm']['w'];\n\t\t$config['height'] = $dimensions['sm']['h'];\n\t\t$config['new_image'] = sprintf('%s/%s.sm%s', realpath('web/upload/'), $new_name, $data['file_ext']);\n\t\t$this->image_lib->initialize($config);\n\t\t$result_sm = $this->image_lib->resize();\n\t\tif($result_sm == FALSE){\n\t\t\tarray_push($this->resize_errors, $this->image_lib->display_errors());\n\t\t}\n\t\t\n\t\t// Create larger image\n\t\t$config['width'] = $dimensions['lg']['w'];\n\t\t$config['height'] = $dimensions['lg']['h'];\n\t\t$config['new_image'] = sprintf('%s/%s.lg%s', realpath('web/upload/'), $new_name, $data['file_ext']);\n\t\t$this->image_lib->initialize($config);\n\t\t$result_lg = $this->image_lib->resize();\n\t\tif($result_lg == FALSE){\n\t\t\tarray_push($this->resize_errors, $this->image_lib->display_errors());\n\t\t}\n\t\t\n\t\t// Delete the original source file now we're finished with it\n\t\t@unlink($data['full_path']);\n\t\t\n\t\t// Finished resizing functions - test for errors and return\n\t\tif($this->resize_errors == NULL){\n\t\t\t// No errors encountered - delete original image\n\t\t\t$name = sprintf('%s.#%s', $new_name, $data['file_ext']);\n\t\t\treturn $name;\n\t\t} else {\n\t\t\t// One or more errors occured when resizing the images\n\t\t\t$this->lasterr = 'Failed to resize the images.';\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t}", "function resizeThumbnailImage($thumb_image_name, $image, $width, $height, $start_width, $start_height, $scale){\n\tlist($imagewidth, $imageheight, $imageType) = getimagesize($image);\n\t$imageType = image_type_to_mime_type($imageType);\n\t\n\t$newImageWidth = ceil($width * $scale);\n\t$newImageHeight = ceil($height * $scale);\n\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\tswitch($imageType) {\n\t\tcase \"image/gif\":\n\t\t\t$source=imagecreatefromgif($image); \n\t\t\tbreak;\n\t case \"image/pjpeg\":\n\t\tcase \"image/jpeg\":\n\t\tcase \"image/jpg\":\n\t\t\t$source=imagecreatefromjpeg($image); \n\t\t\tbreak;\n\t case \"image/png\":\n\t\tcase \"image/x-png\":\n\t\t\t$source=imagecreatefrompng($image); \n\t\t\tbreak;\n \t}\n\timagecopyresampled($newImage,$source,0,0,$start_width,$start_height,$newImageWidth,$newImageHeight,$width,$height);\n\tswitch($imageType) {\n\t\tcase \"image/gif\":\n\t \t\timagegif($newImage,$thumb_image_name); \n\t\t\tbreak;\n \tcase \"image/pjpeg\":\n\t\tcase \"image/jpeg\":\n\t\tcase \"image/jpg\":\n\t \t\timagejpeg($newImage,$thumb_image_name,90); \n\t\t\tbreak;\n\t\tcase \"image/png\":\n\t\tcase \"image/x-png\":\n\t\t\timagepng($newImage,$thumb_image_name); \n\t\t\tbreak;\n }\n\tchmod($thumb_image_name, 0777);\n\treturn $thumb_image_name;\n}", "function resizeImage($image,$width,$height) {\n\t$newImageWidth = $width;\n\t$newImageHeight = $height;\n\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\t$source = imagecreatefromjpeg($image);\n\timagecopyresampled($newImage,$source,0,0,0,0,$newImageWidth,$newImageHeight,$width,$height);\n\timagejpeg($newImage,$image,90);\n\tchmod($image, 0777);\n\treturn $image;\n}", "function funcs_resizeImageFile($file,$newWidth,$newHeight,$oldWidth,$oldHeight,$destination = null,$quality = 75){\n\t//create a new pallete for both source and destination\n\t$dest = imagecreatetruecolor($newWidth, $newHeight);\n\tif (preg_match('/\\.gif$/',$file)){\n\t\t$source = imagecreatefromgif($file);\n\t}else{\n\t\t//assume jpeg since we only allow jpeg and gif\n\t\t$source = imagecreatefromjpeg($file);\n\t}\n\t//copy the source pallete onto destination pallete\n\timagecopyresampled($dest,$source,0,0,0,0, $newWidth, $newHeight, $oldWidth,$oldHeight);\n\t//save file\n\tif (preg_match('/\\.gif$/',$file)){\n\t\timagegif($dest,((is_null($destination))?$file:$destination));\n\t}else{\n\t\timagejpeg($dest,((is_null($destination))?$file:$destination),$quality);\n\t}\n}", "public function ImageResize($file_resize_width, $file_resize_height){\r\n $this->proc_filewidth=$file_resize_width;\r\n $this->proc_fileheight=$file_resize_height;\r\n }", "function smart_resize_image($file, $width = 0, $height = 0, $proportional = false, $output = \"file\", $delete_original = true, $use_linux_commands = false){\n\t\tif(($height <= 0) && ($width <= 0)){\n\t\t\treturn(false);\n\t\t}\n\t\t$info = getimagesize($file); // Paramètres par défaut de l'image\n\t\t$image = \"\";\n\t\t$final_width = 0;\n\t\t$final_height = 0;\n\t\tlist($width_old,$height_old) = $info;\n\t\t$trop_petite = false;\n\t\tif(($height > 0) && ($height > $height_old)){\n\t\t\t$trop_petite = true;\n\t\t}\n\t\tif(($width > 0) && ( $width > $width_old)){\n\t\t\t$trop_petite = true;\n\t\t}else{\n\t\t\t$trop_petite = false;\n\t\t}\n\t\tif($trop_petite){\n\t\t\treturn(false);\n\t\t}\n\t\tif($proportional){ // Calculer la proportionnalité\n\t\t\tif($width == 0){\n\t\t\t\t$factor = $height / $height_old;\n\t\t\t}elseif($height == 0){\n\t\t\t\t$factor = $width / $width_old;\n\t\t\t}else{\n\t\t\t\t$factor = min($width / $width_old,$height / $height_old);\n\t\t\t}\n\t\t\t$final_width = round($width_old * $factor);\n\t\t\t$final_height = round($height_old * $factor);\n\t\t}else{\n\t\t\t$final_width = ($width <= 0) ? $width_old : $width;\n\t\t\t$final_height = ($height <= 0) ? $height_old : $height;\n\t\t}\n\t\tswitch($info[2]){ // Charger l'image en mémoire en fonction du format\n\t\t\tcase IMAGETYPE_GIF:\n\t\t\t\t$image = imagecreatefromgif($file); break;\n\t\t\tcase IMAGETYPE_JPEG:\n\t\t\t\t$image = imagecreatefromjpeg($file); break;\n\t\t\tcase IMAGETYPE_PNG:\n\t\t\t\t$image = imagecreatefrompng($file); break;\n\t\t\tdefault:\n\t\t\t\treturn(false);\n\t\t}\n\t\t$image_resized = imagecreatetruecolor($final_width, $final_height); // Transparence pour les gif et les png\n\t\tif(($info[2] == IMAGETYPE_GIF) || ($info[2] == IMAGETYPE_PNG)){\n\t\t\t$transparency = imagecolortransparent($image);\n\t\t\tif($transparency >= 0){\n\t\t\t\t$transparent_color = imagecolorsforindex($image,$trnprt_indx);\n\t\t\t\t$transparency = imagecolorallocate($image_resized,$trnprt_color[\"red\"],$trnprt_color[\"green\"],$trnprt_color[\"blue\"]);\n\t\t\t\timagefill($image_resized,0,0,$transparency);\n\t\t\t\timagecolortransparent($image_resized,$transparency);\n\t\t\t}elseif($info[2] == IMAGETYPE_PNG){\n\t\t\t\timagealphablending($image_resized,false);\n\t\t\t\t$color = imagecolorallocatealpha($image_resized,0,0,0,127);\n\t\t\t\timagefill($image_resized,0,0,$color);\n\t\t\t\timagesavealpha($image_resized,true);\n\t\t\t}\n\t\t}\n\t\timagecopyresampled($image_resized,$image,0,0,0,0,$final_width,$final_height,$width_old,$height_old);\n\t\tif($delete_original){ // Suppression de l'image d'origine éventuelle\n\t\t\tif($use_linux_commands){\n\t\t\t\texec(\"rm \".$file);\n\t\t\t}else{\n\t\t\t\t@unlink($file);\n\t\t\t}\n\t\t}\n\t\tswitch(strtolower($output)){\n\t\t\tcase \"browser\": // Envoyer l'image par http avec son type MIME\n\t\t\t\t$mime = image_type_to_mime_type($info[2]); header(\"Content-type: $mime\"); $output = NULL; break;\n\t\t\tcase \"file\": // Ecraser l'image donnée (cas défaut)\n\t\t\t\t$output = $file; break;\n\t\t\tcase \"return\": // Retourner les infos de l'image redimensionnée en conservant celles de l'image d'origine\n\t\t\t\treturn($image_resized); break;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t\tswitch($info[2]){ // Retourner l'image redimensionnée en fonction de son format\n\t\t\tcase IMAGETYPE_GIF:\n\t\t\t\timagegif($image_resized,$output); break;\n\t\t\tcase IMAGETYPE_JPEG:\n\t\t\t\timagejpeg($image_resized,$output); break;\n\t\t\tcase IMAGETYPE_PNG:\n\t\t\t\timagepng($image_resized,$output); break;\n\t\t\tdefault:\n\t\t\t\treturn(false);\n\t\t}\n\t\treturn(true);\n\t}", "function resizeThumbnailImage($thumb_image_name, $image, $width, $height, $start_width, $start_height, $scale){\n\t\t\t\tlist($imagewidth, $imageheight, $imageType) = getimagesize($image);\n\t\t\t\t$imageType = image_type_to_mime_type($imageType);\n\t\t\t\n\t\t\t\t$newImageWidth = ceil($width * $scale);\n\t\t\t\t$newImageHeight = ceil($height * $scale);\n\t\t\t\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\t\t\t\tswitch($imageType) {\n\t\t\t\t\tcase \"image/gif\":\n\t\t\t\t\t\t$source=imagecreatefromgif($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/pjpeg\":\n\t\t\t\t\tcase \"image/jpeg\":\n\t\t\t\t\tcase \"image/jpg\":\n\t\t\t\t\t\t$source=imagecreatefromjpeg($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/png\":\n\t\t\t\t\tcase \"image/x-png\":\n\t\t\t\t\t\t$source=imagecreatefrompng($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\timagecopyresampled($newImage,$source,0,0,$start_width,$start_height,$newImageWidth,$newImageHeight,$width,$height);\n\t\t\t\tswitch($imageType) {\n\t\t\t\t\tcase \"image/gif\":\n\t\t\t\t\t\timagegif($newImage,$thumb_image_name);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/pjpeg\":\n\t\t\t\t\tcase \"image/jpeg\":\n\t\t\t\t\tcase \"image/jpg\":\n\t\t\t\t\t\timagejpeg($newImage,$thumb_image_name,90);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/png\":\n\t\t\t\t\tcase \"image/x-png\":\n\t\t\t\t\t\timagepng($newImage,$thumb_image_name);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tchmod($thumb_image_name, 0777);\n\t\t\t\treturn $thumb_image_name;\n\t\t\t}", "public function resizeImage($file, $mime, $maxWidth=-1, $maxHeight=-1) {\n\t\tif ($maxWidth == -1 && $maxHeight == -1) {\n\t\t\treturn TRUE;\n\t\t}\n\n\t\t//rely on GD\n\t\tif (!function_exists('imagecreate')) { return; }\n/*\n\t\tif ($this->dataItem->mime == '') {\n\t\t\t$this->figureMime();\n\t\t} else {\n\t\t\t$this->mimeType = $this->dataItem->mime;\n\t\t}\n\n\t\t$tmpfname = tempnam('/tmp/', \"cgnimg_\");\n\t\t$si = fopen($tmpfname, \"w+b\");\n*/\n\n\t\tswitch ($mime) {\n\t\t\tcase 'image/png':\n\t\t\t$orig = imageCreateFromPng($file);\n\t\t\tbreak;\n\n\t\t\tcase 'image/jpeg':\n\t\t\tcase 'image/jpg':\n\t\t\t$orig = imageCreateFromJpeg($file);\n\t\t\tbreak;\n\n\t\t\tcase 'image/gif':\n\t\t\t$orig = imageCreateFromGif($file);\n\t\t\tbreak;\n\t\t}\n\t\tif (!$orig) { \n\t\t\treturn FALSE;\n\t\t}\n\n\t\t$width = imageSx($orig);\n\t\t$height = imageSy($orig);\n\t\tif ($width > $maxWidth) {\n\t\t\t//resize proportionately\n\t\t\t$ratio = $maxWidth / $width;\n\t\t\t$newwidth = $maxWidth;\n\t\t\t$newheight = $height * $ratio;\n\t\t} else {\n\t\t\t$newwidth = $width;\n\t\t\t$newheight = $height;\n\t\t}\n\n\t\t$thumbwidth = 50;\n\t\t$thumbheight = 50;\n\n\t\tif ($width > $thumbwidth) {\n\t\t\t//resize proportionately\n\t\t\t$ratio = $thumbwidth / $width;\n\t\t\t$new2width = $thumbwidth;\n\t\t\t$new2height = intval($height * $ratio);\n\t\t} else {\n\t\t\t//Check if image is really tall and thin.\n\t\t\t//Don't do this for the medium size image because \n\t\t\t// vertically tall images aren't a problem for most layouts.\n\t\t\tif ($height > $thumbheight) {\n\t\t\t\t$ratio = $thumbheight / $height;\n\t\t\t\t$new2height = $thumbheight;\n\t\t\t\t$new2width = intval($width * $ratio);\n\t\t\t} else {\n\t\t\t\t//use defaults, image is small enough \n\t\t\t\t$new2width = $width;\n\t\t\t\t$new2height = (int)$height;\n\t\t\t}\n\t\t}\n\t\t$webImage = imageCreateTrueColor($newwidth,$newheight);\n\t\tif (!$webImage) { die('no such handle');}\n\t\timageCopyResampled(\n\t\t\t$webImage, $orig,\n\t\t\t0, 0,\n\t\t\t0, 0,\n\t\t\t$newwidth, $newheight,\n\t\t\t$width, $height);\n\n\n\n\t\t$thmImage = imageCreateTrueColor($new2width,$new2height);\n\t\timageCopyResampled(\n\t\t\t$thmImage, $orig,\n\t\t\t0, 0,\n\t\t\t0, 0,\n\t\t\t$new2width, $new2height,\n\t\t\t$width, $height);\n\n/*\nheader('Content-type: image/png');\nimagePng($thmImage);\nexit();\n */\n\t\t$dir = dirname($file);\n\t\t$base = basename($file);\n\n//\t\tob_start(); // start a new output buffer\n\t\timagePng( $webImage, $dir.'/w'.$base.'.png', 6);\n\n//\t\t$this->dataItem->web_image = ob_get_contents();\n//\t\tob_end_clean(); // stop this output buffer\n\t\timageDestroy($webImage);\n\n//\t\tob_start(); // start a new output buffer\n\t\timagePng( $thmImage, $dir.'/t'.$base.'.png', 6 );\n//\t\t$this->dataItem->thm_image = ob_get_contents();\n//\t\tob_end_clean(); // stop this output buffer\n\t\timageDestroy($thmImage);\n\t}", "private function doImageResize($img)\n\t{\n\t\t// Determine the new dimensions:\n\t\t$d = $this->getNewDims($img);\n\n\t\t// Determine what functions to use:\n\t\t$funcs = $this->getImageFunctions($img);\n\n\t\t// Create the image resources for resampling:\n\t\t$src_img = $funcs[0]($img);\n\t\t$new_img = $this->imageCreateTransparent($d[0], $d[1]);\n\n\t\tif(imagecopyresampled(\n\t\t\t$new_img, $src_img, 0, 0, 0, 0, $d[0], $d[1], $d[2], $d[3]\n\t\t\t))\n\t\t\t{\n\t\t\t\timagedestroy($src_img);\n\t\t\t\tif($new_img && $funcs[1]($new_img, $img))\n\t\t\t\t{\n\t\t\t\t\timagedestroy($new_img);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthrow new Exception('Failed to save the new image!');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new Exception('Could not resample the image!');\n\t\t\t}\n\t}", "function media_upload_max_image_resize()\n {\n }", "function imgResizeHorW($file_ori,$UploadPath,$imgx=130,$imgy=150,$type='H',$clean=0) {\n\t\t$dest_filename='';\n\t\t\n\t\t$handle = new upload($file_ori);\n\t\t\n\t\t$img_proper=getimagesize($file_ori['tmp_name']);\n\t\t\n\t\tif ($handle->uploaded) {\n\t\t\tif($type=='W')\t{\n\t\t\t\t//$handle->image_x = $imgx;\n\t\t\t\t$handle->image_x = $imgx;\n\t\t\t\t$handle->image_resize = true;\n\t\t\t\t$handle->image_ratio_y = true;\n\t\t\t} else if($type=='H')\t{\n\t\t\t\t$handle->image_y = $imgy;\n\t\t\t\t$handle->image_resize = true;\n\t\t\t\t$handle->image_ratio_x = true;\n\t\t\t}\n\t\t}\n\t\t$handle->process($UploadPath);\n\t\tif ($handle->processed) {\n\t\t\t$dest_filename=$handle->file_dst_name;\n\t\t\tif($clean==1)\n\t\t\t\t$handle->clean();\n\t\t} else\n\t\t\t$dest_filename='';\n\t\treturn $dest_filename;\n\t}", "function _resizeImageIM($src_file, $dest_file, $new_size) {\r\n \t$retval = $output = null;\r\n $cmd = $this->_IM_path.\"convert -resize $new_size \\\"$src_file\\\" \\\"$dest_file\\\"\";\r\n exec($cmd, $output, $retval);\r\n if($retval) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }", "public function resizeImage($filepath) {\n if (is_file($filepath)) {\n \n $dir_name = $this->destinationDirectory;\n\n $drawable_dpi = array();\n $drawable_dpi['drawable-ldpi'] = 0.1875;\n $drawable_dpi['drawable-mdpi'] = 0.25;\n $drawable_dpi['drawable-hdpi'] = 0.375;\n $drawable_dpi['drawable-xhdpi'] = 0.5;\n $drawable_dpi['drawable-xxhdpi'] = 0.75;\n $drawable_dpi['drawable-xxxhdpi'] = 1.0;\n\n $mipmap_dpi = array();\n $mipmap_dpi['mipmap-ldpi'] = 0.1875;\n $mipmap_dpi['mipmap-mdpi'] = 0.25;\n $mipmap_dpi['mipmap-hdpi'] = 0.375;\n $mipmap_dpi['mipmap-xhdpi'] = 0.5;\n $mipmap_dpi['mipmap-xxhdpi'] = 0.75;\n $mipmap_dpi['mipmap-xxxhdpi'] = 1.0;\n\n $selected_dpi = array();\n if($this->folderCode == 0) {\n $selected_dpi = $drawable_dpi; \n }\n if($this->folderCode == 1) {\n $selected_dpi = $mipmap_dpi; \n }\n if($this->folderCode == 2) {\n $selected_dpi = array_merge($drawable_dpi, $mipmap_dpi); \n }\n\n\n // Content type\n $image_ext = \"png\";\n header('\"Content-Type: image/\"'.$image_ext);\n\n // Get new sizes\n $dir_path = $this->dirHelper($dir_name);\n $imageFileName = $this->extract_file_name($filepath);\n $final_dir_path = $dir_path.\"res/\"; \n if (!is_dir($final_dir_path)) {\n mkdir($final_dir_path);\n }\n foreach ($selected_dpi as $key => $value) {\n if (!is_dir($final_dir_path.$key)) {\n mkdir($final_dir_path.$key);\n }\n list($width, $height) = getimagesize($filepath);\n $newwidth = $width * $value;\n $newheight = $height * $value;\n\n // Load\n $thumb = imagecreatetruecolor($newwidth, $newheight);\n $source = imagecreatefrompng($filepath);\n\n // Resize\n imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);\n imagepng($thumb, $final_dir_path.$key.\"/\".$imageFileName);\n }\n echo \"<h1>$filepath has been resized into different sizes</h1>\";\n }\n elseif(!file_exists($filepath)) {\n echo \"<h1>Invalid File path</h1>\";\n }\n else {\n echo \"<h1>This is not a file</h1>\";\n }\n\n }", "function resize_png_image($img,$newWidth,$newHeight,$target){\r\n\t\t\t//$srcImage=imagecreatefrompng('D:\\Projects\\xampp\\htdocs\\wannaquiz\\watermarks\\linkedin2.png');\r\n $srcImage=imagecreatefrompng($img);\r\n\t\t\tif($srcImage==''){\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\t\t\t$srcWidth=imagesx($srcImage);\r\n\t\t\t$srcHeight=imagesy($srcImage);\r\n\t\t\t$percentage=(double)$newWidth/$srcWidth;\r\n\t\t\t$destHeight=round($srcHeight*$percentage)+1;\r\n\t\t\t$destWidth=round($srcWidth*$percentage)+1;\r\n\t\t\tif($destHeight > $newHeight){\r\n\t\t\t\t// if the width produces a height bigger than we want, calculate based on height\r\n\t\t\t\t$percentage=(double)$newHeight/$srcHeight;\r\n\t\t\t\t$destHeight=round($srcHeight*$percentage)+1;\r\n\t\t\t\t$destWidth=round($srcWidth*$percentage)+1;\r\n\t\t\t}\r\n\t\t\t$destImage=imagecreatetruecolor($destWidth-1,$destHeight-1);\r\n\t\t\tif(!imagealphablending($destImage,FALSE)){\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\t\t\tif(!imagesavealpha($destImage,TRUE)){\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\t\t\tif(!imagecopyresampled($destImage,$srcImage,0,0,0,0,$destWidth,$destHeight,$srcWidth,$srcHeight)){\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\t\t\tif(!imagepng($destImage,$target)){\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\t\t\timagedestroy($destImage);\r\n\t\t\timagedestroy($srcImage);\r\n\t\t\treturn TRUE;\r\n\t\t}", "function resizeImage($filename, $max_width, $max_height)\n{\n list($orig_width, $orig_height) = getimagesize($filename);\n\n $width = $orig_width;\n $height = $orig_height;\n\n # taller\n if ($max_height != 0 && $max_width != 0)\n {\n\t if ($height > $max_height) {\n\t\t $width = ($max_height / $height) * $width;\n\t\t $height = $max_height;\n\t }\n\n\t # wider\n\t if ($width > $max_width) {\n\t\t $height = ($max_width / $width) * $height;\n\t\t $width = $max_width;\n\t }\n }\n\n $image_p = imagecreatetruecolor($width, $height);\n\n $image = imagecreatefromjpeg($filename);\n\n imagecopyresampled($image_p, $image, 0, 0, 0, 0,\n $width, $height, $orig_width, $orig_height);\n\n return $image_p;\n}", "function image_scale($src_abspath, $dest_abspath, $aspect, $width, $strategy)\n{\n $im = new \\Imagick($src_abspath);\n $im = image_scale_im_obj($im, $aspect, $width, $strategy);\n return image_return_write($im, $dest_abspath);\n}", "protected function resizeImage($path)\n\t{\n\t\t$iP = &$this->uploader->imageProcessor;\n\t\t$iP->load($this->uploader->mediaService->getItem($path));\n\t\t$iP->resize_square(500);\n\t\t$iP->saveImage();\n }", "function ImageResize($w, $h, $from, $to, $upsample = false) {\n\t$im_infos = getimagesize($from);\n\t\n\tif ($im_infos)\n\t{\n\t\t//$mts[\"total\"][\"start\"] = microtime(true);\n\t\t$data = file_get_contents($from);\n\t\t//$mts[\"imagecreatefromjpeg\"][\"start\"] = microtime(true);\n\t\t$im = @imagecreatefromstring($data);\n\t\t\n\t\t/*switch ($im_infos[2])\n\t\t{\n\t\t\tcase IMAGETYPE_GIF :\t$im = @imagecreatefromgif($from); break;\n\t\t\tcase IMAGETYPE_JPEG :\t$im = @imagecreatefromjpeg($from); break;\n\t\t\tcase IMAGETYPE_PNG :\t$im = @imagecreatefrompng($from); break;\n\t\t\tdefault :\t\t\t\t$im = false; break;\n\t\t}*/\n\t\t//$mts[\"imagecreatefromjpeg\"][\"end\"] = microtime(true);\n\t\t\n\t\t$w_ratio = $im_infos[0] / $w;\t// Width Ratio\n\t\t$h_ratio = $im_infos[1] / $h;\t// Height Ratio\n\t\t\n\t\tif ($w_ratio > 1 || $h_ratio > 1)\n\t\t{\n\t\t\t// Image > max size -> resizing keeping the ratio\n\t\t\t$ratio = max($w_ratio, $h_ratio);\n\t\t\t\n\t\t\t$wd = floor($im_infos[0] / $ratio);\t// Width Destination\n\t\t\t$hd = floor($im_infos[1] / $ratio);\t// Height Destination\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($upsample)\n\t\t\t{\n\t\t\t\t// Upsampling the image\n\t\t\t\t$ratio = max($w_ratio, $h_ratio);\n\t\t\t\t\n\t\t\t\t$wd = floor($im_infos[0] / $ratio);\t// Width Destination\n\t\t\t\t$hd = floor($im_infos[1] / $ratio);\t// Height Destination\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// No upsample\n\t\t\t\t$wd = $im_infos[0];\n\t\t\t\t$hd = $im_infos[1];\n\t\t\t}\n\t\t}\n\t\t\n\t\t//$mts[\"imagecreatetruecolor\"][\"start\"] = microtime(true);\n\t\t$imd = imagecreatetruecolor($wd, $hd);\t// Image Destination\n\t\t//$mts[\"imagecreatetruecolor\"][\"end\"] = microtime(true);\n\t\t\n\t\t//$mts[\"imagecopyresampled\"][\"start\"] = microtime(true);\n\t\timagecopyresampled($imd, $im, 0, 0, 0, 0, $wd, $hd, $im_infos[0], $im_infos[1]);\n\t\t//$mts[\"imagecopyresampled\"][\"end\"] = microtime(true);\n\t\t\n\t\t//$mts[\"imagejpeg\"][\"start\"] = microtime(true);\n\t\timagejpeg($imd, $to);\n\t\t//$mts[\"imagejpeg\"][\"end\"] = microtime(true);\n\t\t\n\t\t//$mts[\"total\"][\"end\"] = microtime(true);\n\t\t\n\t\t//return $mts;\n\t\t/*\n\t\tswitch ($im_infos[2])\n\t\t{\n\t\t\tcase IMAGETYPE_GIF :\timagegif($imd, $to); break;\n\t\t\tcase IMAGETYPE_JPEG :\timagejpeg($imd, $to); break;\n\t\t\tcase IMAGETYPE_PNG :\timagepng($imd, $to); break;\n\t\t\tdefault : break;\n\t\t}\n\t\t*/\n\t}\n}", "public function image_size(){\n\t\t//add_image_size( 'thumb-owl', 205, 205, true );\n//\tadd_image_size( 'thumb-150', 150, 150, true);\n//\tadd_image_size( 'thumb-120', 120, 120, true);\n//\tadd_image_size( 'thumb-100', 100, 100, true );\n//\tadd_image_size( 'thumb-250', 250, 250, true );\n// // add_image_size( 'thumb-150', 150, 150, true ); //wordpress thumbail\n// add_image_size( 'thumb-60', 60, 60, true);\n//\t\t//add_image_size( 'thumb-editor', 500, 9999, true );\n//remove_image_size( 'thumb-editor');\n\t\t//remove_image_size('large');\n\t\t//remove_image_size('medium_large');\n\t}", "function processImage($dir, $filename)\n{\n // Set up the variables\n $dir = $dir . '/';\n\n // Set up the image path\n $image_path = $dir . $filename;\n\n // Set up the thumbnail image path\n $image_path_tn = $dir . makeThumbnailName($filename);\n\n // Create a thumbnail image that's a maximum of 200 pixels square\n resizeImage($image_path, $image_path_tn, 200, 200);\n\n // Resize original to a maximum of 500 pixels square\n resizeImage($image_path, $image_path, 500, 500);\n}", "public function ratioResize($file, $width=null, $height=null, $rename='') {\n\n $file = $this->uploadPath . $file;\n $imginfo = $this->getInfo($file);\n\n if ($rename == '')\n $newName = substr($imginfo['name'], 0, strrpos($imginfo['name'], '.')) . $this->thumbSuffix . '.' . $this->generatedType;\n else\n $newName = $rename . '.' . $this->generatedType;\n\n if ($width === null && $height === null) {\n return false;\n } elseif ($width !== null && $height === null) {\n $resizeWidth = $width;\n $resizeHeight = ($width / $imginfo['width']) * $imginfo['height'];\n } elseif ($width === null && $height !== null) {\n $resizeWidth = ($height / $imginfo['height']) * $imginfo['width'];\n $resizeHeight = $height;\n } else {\n\t\t\t\n\t\t\tif($imginfo['width'] < $width and $imginfo['height'] < $height) {\n\t\t\t\t$width = $imginfo['width'];\n\t\t\t\t$height = $imginfo['height'];\n\t\t\t}\n\t\t\t\n if ($imginfo['width'] > $imginfo['height']) {\n $resizeWidth = $width;\n $resizeHeight = ($width / $imginfo['width']) * $imginfo['height'];\n } else {\n $resizeWidth = ($height / $imginfo['height']) * $imginfo['width'];\n $resizeHeight = $height;\n }\n }\n\n //create image object based on the image file type, gif, jpeg or png\n $this->createImageObject($img, $imginfo['type'], $file);\n if (!$img)\n return false;\n\n if (function_exists('imagecreatetruecolor')) {\n $newImg = imagecreatetruecolor($resizeWidth, $resizeHeight);\n imagecopyresampled($newImg, $img, 0, 0, 0, 0, $resizeWidth, $resizeHeight, $imginfo['width'], $imginfo['height']);\n } else {\n $newImg = imagecreate($resizeWidth, $resizeHeight);\n imagecopyresampled($newImg, $img, ($width - $resizeWidth) / 2, ($height - $resizeHeight) / 2, 0, 0, $resizeWidth, $resizeHeight, $imginfo['width'], $imginfo['height']);\n }\n\n imagedestroy($img);\n\n if ($this->saveFile) {\n //delete if exist\n if (file_exists($this->processPath . $newName))\n unlink($this->processPath . $newName);\n $this->generateImage($newImg, $this->processPath . $newName);\n imagedestroy($newImg);\n return $this->processPath . $newName;\n }\n else {\n $this->generateImage($newImg);\n imagedestroy($newImg);\n }\n\n return true;\n }", "function resize($new_x = 0, $new_y = 0)\r\n {\r\n // 0 means keep original size\r\n $new_x = (0 == $new_x) ? $this->img_x : $this->_parse_size($new_x, $this->img_x);\r\n $new_y = (0 == $new_y) ? $this->img_y : $this->_parse_size($new_y, $this->img_y);\r\n // Now do the library specific resizing.\r\n return $this->_resize($new_x, $new_y);\r\n }", "function redimensionne_image($photo)\n{\n\t$info_image = getimagesize($photo);\n\t// largeur et hauteur de l'image d'origine\n\t$largeur = $info_image[0];\n\t$hauteur = $info_image[1];\n\t// largeur et/ou hauteur maximum à afficher\n\tif(basename($_SERVER['PHP_SELF'],\".php\") === \"trombi_impr\") {\n\t\t// si pour impression\n\t\t$taille_max_largeur = getSettingValue(\"l_max_imp_trombinoscopes\");\n\t\t$taille_max_hauteur = getSettingValue(\"h_max_imp_trombinoscopes\");\n\t} else {\n\t// si pour l'affichage écran\n\t\t$taille_max_largeur = getSettingValue(\"l_max_aff_trombinoscopes\");\n\t\t$taille_max_hauteur = getSettingValue(\"h_max_aff_trombinoscopes\");\n\t}\n\n\t// calcule le ratio de redimensionnement\n\t$ratio_l = $largeur / $taille_max_largeur;\n\t$ratio_h = $hauteur / $taille_max_hauteur;\n\t$ratio = ($ratio_l > $ratio_h)?$ratio_l:$ratio_h;\n\n\t// définit largeur et hauteur pour la nouvelle image\n\t$nouvelle_largeur = $largeur / $ratio;\n\t$nouvelle_hauteur = $hauteur / $ratio;\n\n\treturn array($nouvelle_largeur, $nouvelle_hauteur);\n}", "public function getImageResized()\n {\n return $this->performImageResize($this->Image());\n }", "function resizeImage($CurWidth, $CurHeight, $MaxSize, $DestFolder, $SrcImage, $Quality, $ImageType)\n{\n\t//Check Image size is not 0\n\tif($CurWidth <= 0 || $CurHeight <= 0) \n\t{\n\t\treturn false;\n\t}\n\t\n\t//Construct a proportional size of new image\n\t$ImageScale\t= min($MaxSize/$CurWidth, $MaxSize/$CurHeight); \n\t$NewWidth\t= ceil($ImageScale*$CurWidth);\n\t$NewHeight\t= ceil($ImageScale*$CurHeight);\n\t\n\tif($CurWidth < $NewWidth || $CurHeight < $NewHeight)\n\t{\n\t\t$NewWidth = $CurWidth;\n\t\t$NewHeight = $CurHeight;\n\t}\n\t$NewCanves \t= imagecreatetruecolor($NewWidth, $NewHeight);\n\t// Resize Image\n\tif(imagecopyresampled($NewCanves, $SrcImage, 0, 0, 0, 0, $NewWidth, $NewHeight, $CurWidth, $CurHeight))\n\t{\n\t\tswitch(strtolower($ImageType))\n\t\t{\n\t\t\tcase 'image/png':\n\t\t\t\timagepng($NewCanves, $DestFolder);\n\t\t\t\tbreak;\n\t\t\tcase 'image/gif':\n\t\t\t\timagegif($NewCanves, $DestFolder);\n\t\t\t\tbreak;\t\t\t\n\t\t\tcase 'image/jpeg':\n\t\t\tcase 'image/pjpeg':\n\t\t\t\timagejpeg($NewCanves, $DestFolder, $Quality);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\t\tif(is_resource($NewCanves))\n\t\t{ \n\t\t\timagedestroy($NewCanves); \n\t } \n\t\treturn true;\n\t}\n\n}", "private function resize($width,$height) {\n $newImage = imagecreatetruecolor($width, $height);\n imagealphablending($newImage, false);\n imagesavealpha($newImage, true);\n imagecopyresampled($newImage, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight());\n $this->image = $newImage;\n }", "function getImageResize($image, $width, $height = 0, $adds)\r\n {\r\n $imageinfo = getimagesize($image);\r\n if (!$imageinfo[0] and !$imageinfo[1]) {\r\n // TO DO***** copy file to server, get size, than delete...\r\n }\r\n $out['w'] = $imageinfo[0];\r\n $out['h'] = $imageinfo[1]; \r\n if ($height == 0) {\r\n $input_ratio = $imageinfo[0] / $imageinfo[1];\r\n $height = $width / $input_ratio;\r\n if ($imageinfo[0] < $width) {\r\n $width = $imageinfo[0];\r\n $height = $imageinfo[1];\r\n }\r\n }\r\n else {\r\n $input_ratio = $imageinfo[0] / $imageinfo[1];\r\n $ratio = $width / $height;\r\n if ($ratio < $input_ratio) {\r\n $height = $width / $input_ratio;\r\n }\r\n else {\r\n $width = $height * $input_ratio;\r\n }\r\n if (($imageinfo[0] < $width) && ($imageinfo[1] < $height)) {\r\n $width = $imageinfo[0];\r\n $height = $imageinfo[1];\r\n }\r\n }\r\n $attr = ' height=\"' . floor($height) . '\" width=\"' . floor($width) . '\"';\r\n return $this->imageHtmlCode($image, $adds, $attr);\r\n }", "function image_auto_resize($file_name){\t\n\t\t$config['image_library'] = 'gd2'; \n\t\t$config['source_image'] = './assets/img/profiles/'.$file_name; \n $config['create_thumb'] = FALSE; \n $config['maintain_ratio'] = FALSE; \n $config['quality'] = '60%'; \n $config['width'] = 250; \n $config['height'] = 250; \n $config['new_image'] = './assets/img/profiles/'.$file_name; \n $this->load->library('image_lib', $config); \n\t\t$this->image_lib->resize();\n\t\t$this->image_lib->clear();\n\t}", "function resizeImage($old_image_path, $new_image_path, $max_width, $max_height)\n{\n\n // Get image type\n $image_info = getimagesize($old_image_path);\n $image_type = $image_info[2];\n\n // Set up the function names\n switch ($image_type) {\n case IMAGETYPE_JPEG:\n $image_from_file = 'imagecreatefromjpeg';\n $image_to_file = 'imagejpeg';\n break;\n case IMAGETYPE_GIF:\n $image_from_file = 'imagecreatefromgif';\n $image_to_file = 'imagegif';\n break;\n case IMAGETYPE_PNG:\n $image_from_file = 'imagecreatefrompng';\n $image_to_file = 'imagepng';\n break;\n default:\n return;\n } // ends the swith\n\n // Get the old image and its height and width\n $old_image = $image_from_file($old_image_path);\n $old_width = imagesx($old_image);\n $old_height = imagesy($old_image);\n\n // Calculate height and width ratios\n $width_ratio = $old_width / $max_width;\n $height_ratio = $old_height / $max_height;\n\n // If image is larger than specified ratio, create the new image\n if ($width_ratio > 1 || $height_ratio > 1) {\n\n // Calculate height and width for the new image\n $ratio = max($width_ratio, $height_ratio);\n $new_height = round($old_height / $ratio);\n $new_width = round($old_width / $ratio);\n\n // Create the new image\n $new_image = imagecreatetruecolor($new_width, $new_height);\n\n // Set transparency according to image type\n if ($image_type == IMAGETYPE_GIF) {\n $alpha = imagecolorallocatealpha($new_image, 0, 0, 0, 127);\n imagecolortransparent($new_image, $alpha);\n }\n\n if ($image_type == IMAGETYPE_PNG || $image_type == IMAGETYPE_GIF) {\n imagealphablending($new_image, false);\n imagesavealpha($new_image, true);\n }\n\n // Copy old image to new image - this resizes the image\n $new_x = 0;\n $new_y = 0;\n $old_x = 0;\n $old_y = 0;\n imagecopyresampled($new_image, $old_image, $new_x, $new_y, $old_x, $old_y, $new_width, $new_height, $old_width, $old_height);\n\n // Write the new image to a new file\n $image_to_file($new_image, $new_image_path);\n // Free any memory associated with the new image\n imagedestroy($new_image);\n } else {\n // Write the old image to a new file\n $image_to_file($old_image, $new_image_path);\n }\n // Free any memory associated with the old image\n imagedestroy($old_image);\n}", "private function _resizeThumbnailImage($thumb_image_name, $image, $width, $height, $src_width, $src_height, $scale){\n\t\t$newImageWidth = ceil($width * $scale);\n\t\t$newImageHeight = ceil($height * $scale);\n\t\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\t\t$source = imagecreatefromjpeg($image);\n\t\timagecopyresampled($newImage,$source,0,0,0,0,$width,$height,$src_width,$src_height);\n\t\timagejpeg($newImage,$thumb_image_name,90);\n\t\tchmod($thumb_image_name, 0777);\n\t\t//return $thumb_image_name;\n\t}", "public function do_profile_resize_image($data){\n\t\t//Your Image\n\t\t$imgSrc = 'public/upload/img/profile/' . $data['file'];\n\n\t\t//getting the image dimensions\n\t\tlist($width, $height) = getimagesize($imgSrc);\n\n\t\t//saving the image into memory (for manipulation with GD Library)\n\t\tif ($data['type'] == \"jpeg\" || $data['type'] == \"jpg\")\n\t\t\t$myImage = imagecreatefromjpeg($imgSrc);\n\t\telse if ($data['type'] == \"png\")\n\t\t\t$myImage = imagecreatefrompng($imgSrc);\n\t\telse if ($data['type'] == \"gij\")\n\t\t\t$myImage = imagecreatefromgif($imgSrc);\n\n\t\t// calculating the part of the image to use for thumbnail\n\t\tif ($width > $height) {\n\t\t $y = 0;\n\t\t $x = ($width - $height) / 2;\n\t\t $smallestSide = $height;\n\t\t} else {\n\t\t $x = 0;\n\t\t $y = ($height - $width) / 2;\n\t\t $smallestSide = $width;\n\t\t}\n\n\t\t// copying the part into thumbnail\n\t\t$thumbSize = 300;\n\t\t$thumb = imagecreatetruecolor($thumbSize, $thumbSize);\n\t\timagecopyresampled($thumb, $myImage, 0, 0, $x, $y, $thumbSize, $thumbSize, $smallestSide, $smallestSide);\n\n\t\t//final output\n\t\t$thumbnail_path = 'public/upload/img/profile/thumbnail_' . $data['file'];\n\t\tif ($data['type'] == \"jpeg\" || $data['type'] == \"jpg\") {\n\t\t\timagejpeg($thumb, $thumbnail_path);\n\t\t}\n\t\telse if ($data['type'] == \"png\") {\n\t\t\timagepng($thumb, $thumbnail_path);\n\t\t}\n\t\telse if ($data['type'] == \"gif\") {\n\t\t\timagegif($thumb, $thumbnail_path);\n\t\t}\n\n\t}", "function imgResize_gallery($file_ori,$UploadPath,$Resize=1,$imgx=130,$imgy=150,$clean=0,$allowedFormat=array('image/*'),$Maxfilesize=2097152,$filename_body='')\t{\n\t\t$dest_filename='';\n\t\t\n\t\t$handle = new upload($file_ori);\n\t\t$handle->allowed = $allowedFormat;\n\t\t$handle->file_max_size = $Maxfilesize;\n\t\t$img_proper=getimagesize($file_ori['tmp_name']);\n\t\t\n\t\tif($filename_body!='')\n\t\t\t$handle->file_name_body_add = $filename_body;\n\t\t\n\t\tif ($handle->uploaded) {\n\t\t\tif((($img_proper[0]>$imgx && $img_proper[1]>$imgy) || ($img_proper[0]>$imgx && $img_proper[1]<$imgy)) && $Resize==1)\t{\n\t\t\t\t$handle->image_x = $imgx;\n\t\t\t\t$handle->image_resize = true;\n\t\t\t\t$handle->image_ratio_y = true;\n\t\t\t\t$handle->dir_auto_create = true;\n\t\t\t\t$handle->dir_auto_chmod = true;\n\t\t\t\t$handle->dir_chmod = 0777;\n\t\t\t} else if($img_proper[0]<$imgx && $img_proper[1]>$imgy && $Resize==1)\t{\n\t\t\t\t$handle->image_y = $imgy;\n\t\t\t\t$handle->image_resize = true;\n\t\t\t\t$handle->image_ratio_x = true;\n\t\t\t\t$handle->dir_auto_create = true;\n\t\t\t\t$handle->dir_auto_chmod = true;\n\t\t\t\t$handle->dir_chmod = 0777;\n\t\t\t}\n\t\t\t$handle->process($UploadPath);\n\t\t\tif ($handle->processed) {\n\t\t\t\t$dest_filename=$handle->file_dst_name;\n\t\t\t\tif($clean==1)\n\t\t\t\t\t$handle->clean();\n\t\t\t} else\n\t\t\t\t$dest_filename='';\n\t\t}\n\t\treturn $dest_filename;\n\t}", "private function resizeImage($filename, $width, $height)\n {\n $config['image_library'] = 'gd2';\n $config['create_thumb'] = TRUE;\n $config['maintain_ratio'] = TRUE;\n $config['width'] = $width;\n $config['height'] = $height;\n $config['source_image'] = $filename;\n $this->load->library('image_lib', $config);\n $this->image_lib->resize();\n }", "function reduce_image_size($dest_folder,$image_name,$files)\n{\n //REDUCE IMAGE RESOLUTION\n if($files)\n {\n //echo 123;exit;\n $dest = $dest_folder.$image_name;\n $width = 300;\n $height = 300;\n list($width_orig, $height_orig) = getimagesize($files);\n $ratio_orig = $width_orig/$height_orig;\n if ($width/$height > $ratio_orig)\n {\n $width = $height*$ratio_orig;\n }\n else\n {\n $height = $width/$ratio_orig;\n }\n $image_p = imagecreatetruecolor($width, $height);\n $image = imagecreatefromjpeg($files);\n imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);\n imagejpeg($image_p,$dest, 100);\n ImageDestroy ($image_p);\n }\n //END OF REDUCING IMAGE RESOLUTION\n}", "function imageresize($im, $width, $height) {\n list($w, $h) = [imagesx($im), imagesy($im)];\n $res = newTransparentImage($w + $width, $h + $height);\n imagecopy($res, $im, 0, 0, 0, 0, $w, $h);\n imagedestroy($im);\n return $res;\n}", "function cjpopups_resize_image($src, $width, $height = null, $crop = false, $single = false){\n\trequire_once(sprintf('%s/aq_resizer.php', cjpopups_item_path('helpers_dir')));\n\t$resized = aq_resize($src, $width, $height, $crop, $single);\n\tif(!empty($resized)){\n\t\treturn $resized;\n\t}else{\n\t\t$placeholder = 'http://placehold.it/'.$width.'x'.$height.'&text=No+Thumbnail';;\n\t\tif($single){\n\t\t\t$return = $placeholder;\n\t\t}else{\n\t\t\t$return[] = $placeholder;\n\t\t\t$return[] = $width;\n\t\t\t$return[] = $height;\n\t\t}\n\t\treturn $return;\n\t}\n}", "function make_thumb($img_name, $filename, $new_w, $new_h) {\n //get image extension.\n $ext = getExtension($img_name);\n //creates the new image using the appropriate function from gd library\n if (!strcmp(\"jpg\", $ext) || !strcmp(\"jpeg\", $ext))\n $src_img = imagecreatefromjpeg($img_name);\n\n if (!strcmp(\"png\", $ext))\n $src_img = imagecreatefrompng($img_name);\n\n //gets the dimmensions of the image\n $old_x = imageSX($src_img);\n $old_y = imageSY($src_img);\n\n // next we will calculate the new dimmensions for the thumbnail image\n // the next steps will be taken: \n // 1. calculate the ratio by dividing the old dimmensions with the new ones\n // 2. if the ratio for the width is higher, the width will remain the one define in WIDTH variable\n // and the height will be calculated so the image ratio will not change\n // 3. otherwise we will use the height ratio for the image\n // as a result, only one of the dimmensions will be from the fixed ones\n $ratio1 = $old_x / $new_w;\n $ratio2 = $old_y / $new_h;\n if ($ratio1 > $ratio2) {\n $thumb_w = $new_w;\n $thumb_h = $old_y / $ratio1;\n } else {\n $thumb_h = $new_h;\n $thumb_w = $old_x / $ratio2;\n }\n\n // we create a new image with the new dimmensions\n $dst_img = ImageCreateTrueColor($thumb_w, $thumb_h);\n\n // resize the big image to the new created one\n imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $thumb_w, $thumb_h, $old_x, $old_y);\n\n // output the created image to the file. Now we will have the thumbnail into the file named by $filename\n if (!strcmp(\"png\", $ext))\n imagepng($dst_img, $filename);\n else\n imagejpeg($dst_img, $filename);\n\n //destroys source and destination images. \n imagedestroy($dst_img);\n imagedestroy($src_img);\n}", "function scale_image($arg)\n\t{\n\t\t// max_width, max_height, cur_width, cur_height\n\t\t\n\t\t$ret = array(\n\t\t\t\t\t 'img_width' => $arg['cur_width'],\n\t\t\t\t\t 'img_height' => $arg['cur_height']\n\t\t\t\t\t);\n\t\t\n\t\tif ( $arg['cur_width'] > $arg['max_width'] )\n\t\t{\n\t\t\t$ret['img_width'] = $arg['max_width'];\n\t\t\t$ret['img_height'] = ceil( ( $arg['cur_height'] * ( ( $arg['max_width'] * 100 ) / $arg['cur_width'] ) ) / 100 );\n\t\t\t$arg['cur_height'] = $ret['img_height'];\n\t\t\t$arg['cur_width'] = $ret['img_width'];\n\t\t}\n\t\t\n\t\tif ( $arg['cur_height'] > $arg['max_height'] )\n\t\t{\n\t\t\t$ret['img_height'] = $arg['max_height'];\n\t\t\t$ret['img_width'] = ceil( ( $arg['cur_width'] * ( ( $arg['max_height'] * 100 ) / $arg['cur_height'] ) ) / 100 );\n\t\t}\n\t\t\n\t\treturn $ret;\n\t}", "function resizeImage($CurWidth,$CurHeight,$MaxSize,$DestFolder,$SrcImage,$Quality,$ImageType)\r\n{\r\n\t//Check Image size is not 0\r\n\tif($CurWidth <= 0 || $CurHeight <= 0) \r\n\t{\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\t//Construct a proportional size of new image\r\n\t$ImageScale \t= min($MaxSize/$CurWidth, $MaxSize/$CurHeight); \r\n\t$NewWidth \t\t\t= ceil($ImageScale*$CurWidth);\r\n\t$NewHeight \t\t\t= ceil($ImageScale*$CurHeight);\r\n\t$NewCanves \t\t\t= imagecreatetruecolor($NewWidth, $NewHeight);\r\n\t\r\n\t// Resize Image\r\n\tif(imagecopyresampled($NewCanves, $SrcImage,0, 0, 0, 0, $NewWidth, $NewHeight, $CurWidth, $CurHeight))\r\n\t{\r\n\t\tswitch(strtolower($ImageType))\r\n\t\t{\r\n\t\t\tcase 'image/png':\r\n\t\t\t\timagepng($NewCanves,$DestFolder);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'image/gif':\r\n\t\t\t\timagegif($NewCanves,$DestFolder);\r\n\t\t\t\tbreak;\t\t\t\r\n\t\t\tcase 'image/jpeg':\r\n\t\t\tcase 'image/pjpeg':\r\n\t\t\t\timagejpeg($NewCanves,$DestFolder,$Quality);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t//Destroy image, frees memory\t\r\n\tif(is_resource($NewCanves)) {imagedestroy($NewCanves);} \r\n\treturn true;\r\n\t}\r\n\r\n}" ]
[ "0.7590531", "0.74815714", "0.74593", "0.74389446", "0.7410614", "0.74066013", "0.7402347", "0.73394626", "0.7325788", "0.7319547", "0.7231638", "0.72155607", "0.7206152", "0.7201621", "0.71704966", "0.7141066", "0.7138999", "0.70990956", "0.7097601", "0.70827615", "0.7068724", "0.7064424", "0.70599926", "0.7052355", "0.70491636", "0.7040737", "0.7018445", "0.70124155", "0.7006555", "0.7003734", "0.7002346", "0.69997495", "0.69959056", "0.69863725", "0.697211", "0.6969032", "0.69651", "0.6927241", "0.6925297", "0.69182736", "0.6910349", "0.6898911", "0.6893367", "0.68877584", "0.68828493", "0.6881179", "0.68799406", "0.6876248", "0.68747", "0.6866345", "0.68651766", "0.6853311", "0.68398285", "0.6837949", "0.68323475", "0.68298393", "0.6810094", "0.68036395", "0.6797844", "0.6795997", "0.67947036", "0.67889416", "0.6771348", "0.6768734", "0.6764439", "0.67633754", "0.6759545", "0.67567027", "0.6752445", "0.6747027", "0.67446184", "0.6743973", "0.67413676", "0.674072", "0.67329025", "0.67206395", "0.6718599", "0.67053974", "0.67037106", "0.66980404", "0.66824996", "0.66776365", "0.6676283", "0.66750985", "0.6674369", "0.6672037", "0.6666926", "0.666316", "0.6659414", "0.6657829", "0.66572887", "0.6654993", "0.66480094", "0.6641083", "0.66387385", "0.6628717", "0.6618606", "0.6612906", "0.6610156", "0.66083944", "0.660732" ]
0.0
-1
Returns candle size in seconds
public function getCandleSize() { return $this->batchSize * $this->candleEmitter->getCandleSize(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSize()\n {\n $this->loadStats();\n return $this->stat['size'];\n }", "public function getSize()\n {\n return $this->getStat('size');\n }", "function getCurTrackLength(){\n\t}", "public function get_data_length() {\n return $this->duration;\n }", "public function getSize() {\n\t\t\treturn $this->getStats( 'bytes' );\n\t\t}", "public function getDurationSeconds()\n {\n return ($this->batch->getDuration($this->name, 'start') / 1000);\n }", "public function getDuration( StopwatchEvent $event ) {\n\t\treturn ( $event->getDuration() / 1000 );\n\t}", "public function getSize() {\r\n\t\treturn $this->app->filesystem->formatFilesize($this->get('size', 0));\r\n\t}", "protected static function candle_time_to_seconds($candle) {\n //Convert the timing of $candle from microseconds to seconds\n\t\t\t$candle->time = self::time_seconds($candle->time);\n\t\t\treturn $candle;\n\t\t}", "public function getTotalTenthOfSeconds(): float\n {\n return $this->getTotalMilliseconds() / 100;\n }", "public function getSize()\n {\n return $this->fileInfo['size'];\n }", "public function size()\n {\n return 100 - $this->eaten;\n }", "public function getSize()\n {\n return $this->fstat()[\"size\"];\n }", "public function getSize()\n {\n return $this->item['size'];\n }", "public function totalSize()\n {\n return cm_human_filesize($this->getItems()->sum('filesize'));\n }", "public function getTotalDuration(): float\r\n\t{\r\n\t\t$time = 0;\r\n\t\tforeach ($this->data as $command) {\r\n\t\t\t$time += $command['duration'];\r\n\t\t}\r\n\r\n\t\treturn $time;\r\n\t}", "public function downloadsize() {\n return $this->info['size_download'];\n }", "private function getDozingLength(): int\n {\n if ($this->fenceHeight < 1750) {\n return $this->sleepThreshold * $this->fenceHeight;\n }\n return -1;\n }", "private function getSize()\n {\n $this->seek($this->offset);\n\n return $this->readLong();\n }", "public function getSize()\n {\n return $this->file['size'];\n }", "public function size()\n {\n return $this->getPackage('FileStation')->size($this->path);\n }", "public function getTotalTime()\n {\n return $this->info->total_time * 1000;\n }", "public function downloadspeed() {\n return $this->info['speed_download'];\n }", "function wpfc_get_filesize( $url, $timeout = 10 ) {\n\t$headers = wp_get_http_headers( $url);\n $duration = isset( $headers['content-length'] ) ? (int) $headers['content-length'] : 0;\n\t\n\tif( $duration ) {\n\t\t\tsscanf( $duration , \"%d:%d:%d\" , $hours , $minutes , $seconds );\n\t\t\t\n\t\t\t$length = isset( $seconds ) ? $hours * 3600 + $minutes * 60 + $seconds : $hours * 60 + $minutes;\n\n\t\t\tif( ! $length ) {\n\t\t\t\t\t$length = (int) $duration;\n\t\t\t}\n\n\t\t\treturn $length;\n\t}\n\n\treturn 0;\t\n}", "public function getSize()\n {\n return $this->size;\n }", "public function getSize()\n {\n return $this->size;\n }", "public function getSize()\n {\n return $this->size;\n }", "public function getSize()\n {\n return $this->size;\n }", "public function getSize()\n {\n return $this->size;\n }", "public function getSize()\n {\n return $this->size;\n }", "public function getSize()\n {\n return $this->size;\n }", "public function getSize()\n {\n return $this->size;\n }", "public function seconds(): int {\n\t\treturn $this->duration;\n\t}", "public function getSize() {\n\n return $this->size;\n\t}", "public function getTenthOfSeconds(): int\n {\n return $this->getTotalTenthOfSeconds() % 10;\n }", "function getSize() {\n\t\treturn $this->data_array['filesize'];\n\t}", "public function getSize() {\n return $this->size;\n }", "public function getResponseDuration()\n\t{\n\t\treturn ($this->responseTime - $this->time) * 1000;\n\t}", "public function getSize()\n {\n return $this->length;\n }", "public static function totalDuration()\n {\n return microtime(true) - static::initialTime();\n }", "public function getDuration(): int\n {\n return $this->duration;\n }", "public function getSize() {\n return $this->_size;\n }", "public function getSize()\n {\n return $this->_Size;\n }", "public function getSize()\n {\n return $this->size;\n }", "public function getSize()\n {\n return $this->size;\n }", "public function getSize()\n {\n return $this->size;\n }", "public function getSize() {\n\n return $this->size;\n }", "public function getSize()\n\t{\n\t\treturn $this->size;\n\t}", "public function get_duration();", "public function getSize() {\n return (int) $this->_count;\n }", "public function count()\n {\n $count = $this->shutterstockQueryResult->count();\n return $count > 1000 ? 1000 : $count ;\n }", "public function getSize() {\r\n return $this->iSize;\r\n }", "function getSize() ;", "public function getSize() {\n\t \t return $this->size;\n\t }", "public function getSize()\n {\n return $this->size;\n }", "public function getSize()\n {\n return (int) $this->size;\n }", "public function getSize()\n {\n $size = null;\n\n if ($this->stream) {\n $stats = fstat($this->stream);\n $size = $stats['size'];\n }\n\n return $size;\n }", "public function get_size()\n\t{\n\t\treturn $this->area->get_size($this->path);\n\t}", "public function getDuration()\n {\n if (!isset($this->data['events']['__section__'])) {\n return $this->getData('duration', 0);\n }\n\n /** @var \\Symfony\\Component\\Stopwatch\\StopwatchEvent $event */\n $event = $this->data['events']['__section__'];\n\n return $event->getDuration();\n }", "public function getSize()\n {\n if ($this->isWrapped() || $this->isTemp()) {\n $wrapper_info = $this->getWrapperInfo();\n\n if (!in_array($wrapper_info['protocol'], static::$stat_able_protocols)) {\n return strlen($this->getRaw());\n }\n }\n\n // Just call our parent, otherwise\n return parent::getSize();\n }", "public function getSize() : int\n {\n return $this->size;\n }", "public function getSize() : int\n {\n return $this->size;\n }", "public function getSize() : int\n {\n return $this->size;\n }", "public function getSeekTime() : int {\r\n\r\n return (int) $this->getMain()->getDatabase()->get(\"seek_time\", [\"table\" => \"Games\", \"name\" => $this->getName()])->fetchArray()[0];\r\n\r\n }", "public function getSize()\n {\n return $this->fileStructure->size;\n }", "public function getSizeInMb()\n {\n return $this->sizeInMb;\n }", "public function getTotalDuration()\n {\n return $this->totalDuration;\n }", "public function getSizeInBytes()\n {\n return $this->_sizeInBytes;\n }", "function getTimeDuration();", "function getSize()\r\n\t{\r\n\t\treturn $this->size;\r\n\t}", "public function getTotalHundredthOfSeconds(): float\n {\n return $this->getTotalMilliseconds() / 10;\n }", "public function filesize()\n {\n $size =\n round(\n (filesize('/var/www/html/web'.$this->getSrc()) / 1000),\n 2\n );\n\n // Clear cache\n clearstatcache();\n // Return result\n return $size . ' Kb';\n }", "public function getDuration()\n {\n $this->initialRequest();\n if (isset($this->item['contentDetails']['duration'])) {\n\n $date = new \\DateInterval($this->item['contentDetails']['duration']);\n $ret = 0;\n $ret += (int)$date->format('%d') * 86400;\n $ret += (int)$date->format('%h') * 3600;\n $ret += (int)$date->format('%i') * 60;\n $ret += (int)$date->format('%s');\n return $ret;\n }\n else {\n $this->onApiBadInterpretation(\"contentDetails.duration not found\");\n }\n }", "public function getCurrentSize() : int{\n return $this->currentSize;\n }", "public function getTotalRawTime()\n {\n return floatval(\n round($this->start->diffInMinutes($this->end) / 60, 5)\n );\n }", "public function getSize() {\n return array_sum($this->quantities);\n }", "public function getTotalSeconds(): float\n {\n return $this->getTotalMilliseconds() / 1000;\n }", "public function uploadspeed() {\n return $this->info['speed_upload'];\n }", "public function getClothingSize()\n {\n return $this->clothingSize;\n }", "public function getSize() {}", "public function getSize() {}", "public function getSize() {}", "public function getSize() {}", "public function getSize() {}", "public function getSize() {}", "public function getSize(): int\n {\n return $this->size;\n }", "static function ms(){\r\n $dm = memory_get_usage() - self::$startmem;\r\n return self::memformat($dm);\r\n }", "public function getSizeForHuman()\n {\n return File::format_size($this->Size);\n }", "public function getDurationTime()\n {\n return $this->duration * 60 * 60;\n }", "public function getSize() \n {\n return $this->_size; \n }", "public function getDuration() {}", "public function total () {\n return $this->since($this->iniTmstmp);\n }", "public function secondsRemaining(): int\n {\n return $this->getTimeRemaining() / 1000;\n }", "public function getDuration()\n\t{\n\t\treturn $this->duration;\n\t}", "public function get60Volts()\n {\n return $this->getVolts()/4;\n }", "public function size()\n {\n return $this->size;\n }", "public function size()\n {\n return $this->size;\n }", "protected function getDiskAmount()\n\t{\n\t\treturn(count($this->getDiskDevs()));\n\t}", "public function getDuration(): float;", "public function getFileSize() {\n return $this->size;\n }" ]
[ "0.64940083", "0.6339471", "0.62674075", "0.6231503", "0.6113692", "0.6046349", "0.5996319", "0.59799594", "0.59674424", "0.5966862", "0.59661776", "0.59612256", "0.5940597", "0.59236133", "0.5919919", "0.5905351", "0.59031147", "0.58715326", "0.5859766", "0.5843896", "0.58437747", "0.58420885", "0.5814938", "0.5799488", "0.5777254", "0.5777254", "0.5777254", "0.5777254", "0.5777254", "0.5777254", "0.5777254", "0.5777254", "0.5774707", "0.5774009", "0.5773103", "0.5763657", "0.5751428", "0.57509226", "0.5746492", "0.57435393", "0.5741773", "0.5738769", "0.5732145", "0.5731395", "0.5731252", "0.5731252", "0.5730453", "0.5704239", "0.56907725", "0.5689702", "0.5678738", "0.5664313", "0.565849", "0.5656654", "0.5653647", "0.565005", "0.5647573", "0.56232417", "0.56208396", "0.56184846", "0.5617342", "0.5617342", "0.5617342", "0.56130475", "0.560896", "0.5603574", "0.5597445", "0.55935997", "0.558702", "0.5585802", "0.5585458", "0.55850905", "0.5572195", "0.5571052", "0.55574256", "0.55508256", "0.5548759", "0.5544308", "0.55372685", "0.55364907", "0.55364907", "0.55364907", "0.55364907", "0.5536014", "0.5535328", "0.5534721", "0.553022", "0.5524484", "0.5524065", "0.5522428", "0.5522293", "0.5521796", "0.55201346", "0.55161995", "0.5512367", "0.5510819", "0.5510819", "0.5503332", "0.550178", "0.5495903" ]
0.76472527
0
modify to match your type name
public function getSqlDeclaration(array $fieldDeclaration, AbstractPlatform $platform) { return $platform->getDoctrineTypeMapping('varchar[]'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function get_type() {\n\n\t}", "abstract public function register_type();", "abstract public function type();", "abstract public function type();", "function registerFieldType($name, $type);", "function register_field_type($class)\n {\n }", "abstract protected function get_typestring();", "abstract protected function getType();", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public function setup_types()\n {\n }", "function graphql_format_type_name($type_name)\n {\n }", "function getTypeConverter() ;", "function getType() ;", "function getType() ;", "function getType() ;", "public function type($type);", "public function get_type(){ return $this->_type;}", "abstract public function getType();", "abstract public function getType();", "abstract public function getType();", "abstract public function getType();", "abstract public function getType();", "abstract public function getType();", "function get_field_type($name)\n {\n }", "protected function getTypeParam()\n {\n }", "public abstract function type();", "public abstract function type();", "private function update_type($new_type) { \n\n\t\tif ($this->_update_item('type',$new_type,'50')) { \n\t\t\t$this->type = $new_type;\n\t\t}\n\n\t}", "abstract public function getTypeName(): string;", "public static function format_type_name($type_name)\n {\n }", "public function type() { }", "protected abstract function getType();", "function getType()\t { return $this->type;\t }", "protected function getTypes() {}", "public function type();", "public function type();", "public function type();", "public function type();", "public function get_type();", "public function meta_type();", "public function get_type(string $type_name)\n {\n }", "function register_field_type_info($info)\n {\n }", "abstract public function getTypeName();", "public function getType()\n\t{\n\n\t}", "public function getType()\n\t{\n\n\t}", "public function getType(){ }", "public function getType($name);", "abstract function typeAsString();", "abstract protected function get_typeid();", "public function getTypeNameAttribute();", "public function get_type()\n {\n }", "public function get_type()\n {\n }", "public function get_type()\n {\n }", "public function get_type()\n {\n }" ]
[ "0.6923668", "0.67577446", "0.66770947", "0.66770947", "0.6623386", "0.6590053", "0.65834266", "0.6577642", "0.6565159", "0.6565159", "0.6565159", "0.6565159", "0.6565159", "0.6565159", "0.6565159", "0.6565159", "0.6565159", "0.6565159", "0.6565159", "0.6565159", "0.6565159", "0.6565159", "0.6565159", "0.6565159", "0.6565159", "0.6565159", "0.6565159", "0.6565159", "0.6565159", "0.6565159", "0.6565159", "0.6565159", "0.6565159", "0.6565159", "0.6565159", "0.6565159", "0.6565159", "0.6565159", "0.6565159", "0.6565159", "0.6565159", "0.6565159", "0.6565159", "0.6565159", "0.6565159", "0.6565159", "0.6565159", "0.6565159", "0.6565159", "0.6565159", "0.6565159", "0.6565159", "0.6565159", "0.6565159", "0.6565159", "0.6565159", "0.6542777", "0.64759576", "0.64325976", "0.6412792", "0.6411966", "0.64113504", "0.63861835", "0.63804615", "0.63712585", "0.63712585", "0.63712585", "0.63712585", "0.63712585", "0.63712585", "0.6309505", "0.6301004", "0.62957436", "0.62957436", "0.62857807", "0.627371", "0.62496394", "0.6249397", "0.6232997", "0.6216764", "0.62005365", "0.6193514", "0.6193514", "0.6193514", "0.6193514", "0.61921215", "0.6148373", "0.6139939", "0.61331975", "0.6131129", "0.6129455", "0.6129455", "0.60999507", "0.6087419", "0.60873467", "0.6054705", "0.60546607", "0.6054313", "0.6054257", "0.6054257", "0.6052276" ]
0.0
-1
Get Detail Delivery Order by ID
public function GetDetailByID($delivery_order_detail_id) { return $this->deliveryOrderDetail::find($delivery_order_detail_id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getOrderDetails($id)\n {\n }", "public function getDetails($id){\n return $this->slc(\"*\", \"orders\", array(\"order_id\" => $id), TRUE)[0];\n }", "public function getDetailById($id)\r\n {\r\n $condition = [\r\n 'orderId' => $id\r\n ];\r\n return $this->getDetail($condition);\r\n }", "function getOrderDetails($id)\n {\n $dataService = new OrderDataService();\n\n return $dataService->getOrderDetails($id);\n }", "public function actionOrderDetail($id)\n {\n $order = Order::find()\n ->where(['id' => $id, 'customer_id' => $this->customer_id])\n ->andWhere(['<>', 'status_id', Order::STATUS_DRAFT])\n ->one();\n \n if ($order !== null) {\n return $order;\n }\n \n throw new NotFoundHttpException(\"Order transaction ({$id}) is not available.\");\n }", "public function show($id)\n {\n return Order::find($id);\n }", "public function show($id)\n {\n return Order::find($id);\n }", "public function getDetail($id)\n {\n $order = Orders::find($id);\n\n if(!empty($order)){\n\n $orderarray = $order->toArray();\n $order = $order->formatorder($orderarray);\n\n $order['user'] = user::where('_id',\"=\",$order['user'])->first(['name','email','mobile_number','status','created_at','address']);\n $order['user'] = $order['user']->toArray();\n\n $order['dateslug'] = date(\"F d, Y H:ia\",strtotime('+8 hours',strtotime($order['created_at'])));\n $order['status'] = 0;\n $order['timeslot']['dateslug'] = date(\"F d, Y\",$order['timeslot']['datekey']);\n return response($order,200);\n\n }\n\n return response(['success'=>false,\"message\"=>\"Order not found\"],400); \n \n }", "protected function detail($id)\n {\n return Show::make($id, new Order(), function (Show $show) {\n// $show->field('id');\n $show->field('order_no');\n $show->field('user_id')->as(function ($value) {\n $user = \\App\\Models\\User::where('user_id', $value)->first();\n return \"{$user->name}\";\n });\n $show->field('address', '收货地址')->as(function ($addresses) {\n return $addresses['address'] . \" \" . $addresses['zip'] . \" \" . $addresses['contact_name'] . \" \" . $addresses['contact_phone'];\n });\n $show->field('total_amount');\n// $show->field('remark');\n $show->field('paid_at');\n $show->field('payment_method');\n $show->field('payment_no');\n $show->field('refund_status')->as(function ($value) {\n return \\App\\Models\\Order::$refundStatusMap[$value];\n });\n $show->field('refund_no');\n// $show->field('closed');\n// $show->field('reviewed');\n $show->field('ship_status')->as(function ($value) {\n return \\App\\Models\\Order::$shipStatusMap[$value];\n });\n// $show->field('ship_data');\n// $show->field('extra');\n $show->field('created_at');\n// $show->field('updated_at');\n\n $show->disableDeleteButton();\n\n });\n }", "public function GetDetailByDOID($delivery_order_id)\n {\n $data = $this->deliveryOrderDetail::find($delivery_order_id)->get();\n if (!empty($data)) {\n return $data;\n } return null;\n }", "public function getOrder($id) {\n return Order::fetch($id);\n }", "public function show($id)\n {\n return OrderService::getOrderById($id);\n }", "public function show($id)\n {\n return Order::findOrFail($id);\n }", "public function getDeliveryOrder();", "public function details($id) {\n\n $order = Order::find($id);\n $delivery_status_id = (isset($order->delivery_status_id)) ? (int)$order->delivery_status_id : '';\n $delivery = $this->delivery_status($delivery_status_id);\n \n \\ViewHelper::setPageDetails('Storefronts | Order View', 'Order #' . $order->invoice_number, '');\n\n View::share('delivery_status', $delivery);\n View::share('order', $order);\n\n $delivery_modal_info = $this->delivery_status_modal_info($delivery_status_id);\n\n View::share('modals_info', $delivery_modal_info['info']);\n View::share('modals_btn', $delivery_modal_info['btn']);\n\n \treturn view('backoffice.orders.details');\n \n }", "public function get($id)\n {\n header('Access-Control-Allow-Origin: *'); \n $order = Order::find($id);\n \n return $order;\n }", "public static function getInfo( $id )\n {\n return OrderInfoGetter :: get( $id );\n }", "public function getOrder($id)\n {\n $db = new Mysqli();\n $db->connect('localhost', 'root', 111111, 'nn_pay');\n $data = $db->query(\"select * from nns_pay_order where nns_id = '{$id}' limit 1\");\n Register::set('nn_pay_db', $db);\n\n return $data[0];\n }", "public function getDetails($id, $order){\r\n $so = $this->soap->GetStandingOrderDetails($this->licence, $id, $order);\r\n return isset($so)? $so->orderdetails: array( 0 => array('ORDERNO' => -1));\r\n }", "public function get_order_by_id($id) {\n if(!$id) {\n throw new Exception('id should not be empty');\n }\n return $this->linkemperor_exec(null, null,\"/api/v2/customers/orders/$id.json\");\n }", "public function show($order_id)\n {\n //\n $obj = DB::table('orders')\n ->select('orders.id', 'registers.name as register','first_name', 'last_name', 'customer_type', \n 'delivery_address', 'balance', 'orders.total', 'discount', 'orders.sales_tax', 'orders.shipping',\n 'orders.status', 'orders.fulfillment', 'orders.created_at')\n ->join('transactions', 'orders.id', '=', 'transactions.order_id')\n ->join('registers', 'transactions.register_id', '=', 'registers.id')\n ->join('profile_patients', 'profile_patients.user_id', '=', 'orders.user_id')\n ->where('orders.id', $order_id)\n ->get();\n\n $order['order'] = $obj[0];\n $order['items'] = DB::table('order_items')\n ->select('qty', 'name', 'tax')\n ->join('products', 'products.id', '=', 'order_items.product_id')\n ->where('order_items.order_id', $order_id)\n ->get();\n return $order;\n }", "public function get_addon_delivery($id)\n {\n $this->db->select('this_delivery, product_code, description, unit_price');\n $this->db->from('sales_order_medication_deliveries');\n $this->db->where(['delivery_id' => $id]);\n $this->db->join('sales_order_medications', 'sales_order_medications.id = medication_order_item_id');\n $this->db->join('inventory_medications', 'inventory_medications.id = medication_id');\n return $this->db->get()->result_array();\n }", "function getDeliveryByOrderId($order_id) {\n\t\t\n\t\t$list = $this->getDeliveryListByOrderId($order_id);\n\t\t\n\t\t$delivery = $list[0];\n\t\t$delivery['value'] = $delivery['value_net'] + $delivery['vat'];\n\t\t\n\t\treturn $delivery;\n\t}", "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 getOrder(string $order_id): \\GDAX\\Types\\Response\\Authenticated\\Order;", "public function getOrderById_get($id_order = null) {\n \n $params = array();\n $params['limit'] = (is_numeric($this->input->get('limit'))) ? $this->input->get('limit') : null;\n $params['from'] = $this->input->get('from');\n $params['to'] = $this->input->get('to');\n $this->load->model('Order_model');\n $this->load->model('Order_State_Model');\n $this->load->model('Address_model');\n $orders = array();\n $order = $this->Order_model->getLongOrderByOrderId($id_order, $params);\n if (!empty($order)) {\n $order_state = $this->Order_State_Model->getOrderStateByIdOrder($id_order);\n \n foreach ($order as $key => $value) {\n $orders['reference'] = $value->reference;\n $orders['total_paid'] = (double)$value->total_paid;\n $orders['total_paid_tax_excl'] = (double)$value->total_paid_tax_excl;\n $orders['tva'] = (float)$value->total_paid - $value->total_paid_tax_excl;\n $orders['total_shipping'] = (float)$value->total_shipping;\n $orders['order_date'] = $value->date_add;\n $orders['order_state'] = $order_state;\n $orders['adress'] = array('address_delivery' => $this->Address_model->getAddressById($value->id_address_delivery), 'address_invoice' => $this->Address_model->getAddressById($value->id_address_invoice));\n if (!isset($orders[$value->id_order])) {\n $orders['commande'][] = array('product_name' => $value->product_name, 'product_quantity' => (int)$value->product_quantity, 'total_price_tax_incl' => $value->total_price_tax_incl, 'total_price_tax_incl' => $value->total_price_tax_incl, 'id_image' => (int)$value->id_image, 'img_link' => base_url() . 'index.php/api/image/id/' . $value->id_image);\n }\n }\n return $this->response($orders, 200);\n }\n return $this->response(array(null), 200);\n \n }", "function getDeliveryListByOrderId($order_id) {\n\t\tif (!is_numeric($order_id)) {\n\t\t\tmsg(\"ecommerce_delivery.getDeliveryListByOrderId(): order_id is not numeric\", 'error', 1);\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$list = $this->listing(\"order_id = $order_id\");\n\t\tforeach ($list as $key=>$val) {\n\t\t\t$list[$key]['carrier_detail'] = $this->getCarrierDetail($val['carrier_id']);\n\t\t}\n\t\treturn $list;\n\t}", "public function getOrderDetailId()\n {\n return $this->order_detail_id;\n }", "public function orderDetails($id)\n {\n //dd($id);\n $orderId = $id;\n $getProducts = Products::get(); //sidebar\n $getLineItemInfo = OrderLineItem::where('order_id', $id)->get(); //sidebar\n $getCustomerInfo = OrderCustomerDetails::where('order_id', $id)->get(); //sidebar\n return view('shopify-app::tool.order-detail',compact('getProducts','getLineItemInfo','getCustomerInfo', 'orderId'));\n }", "public function getOrderDelivery()\n {\n return $this->hasOne(Delivery::class, ['id' => 'order_delivery_id']);\n }", "public function actionDetail($id)\n\t{\n\t\t$model = $this->loadModel($id);\n\t\t$detail = new OrderDetail('search');\n\t\t$detail->orId = $id;\n\t\t$this->render('detail',array(\n\t\t\t'model'=>$model,'detail'=>$detail\n\t\t));\n\t}", "public function show($id)\n {\n $order=Order::find($id);\n\n if(is_null($order))\n {\n $response=array(\n 'status'=>0, \n 'msg'=>'Invalid Order ID',\n 'data'=>[]\n ); \n }\n else\n {\n $order_summary=array(\n 'table_code'=>Table::find($order->table_id)->code,\n 'sub_total'=>$order->sub_total,\n 'discount'=>$order->discount,\n 'vat'=>$order->vat,\n 'rounding_discount'=>$order->rounding_discount,\n 'net_total'=>$order->net_total,\n 'status'=>$order->status\n );\n\n $orderlines=array();\n foreach($order->menus as $menu)\n {\n if($menu->image!='')\n $image = asset('img/menus/'.$menu->image);\n else\n $image = null;\n\n $orderlines[]=array(\n 'menu_id'=>$menu->id,\n 'code'=>$menu->code,\n 'name'=>$menu->name,\n 'quantity'=>$menu->pivot->quantity,\n 'price'=>$menu->pivot->price,\n 'discount'=>$menu->pivot->discount,\n 'total'=>$menu->pivot->total,\n 'image'=>$image\n );\n }\n\n $response=array(\n 'status'=>1, \n 'msg'=>'Order Found!',\n 'data'=>['summary'=>$order_summary,'orderlines'=>$orderlines]\n );\n }\n\n return response()->json($response);\n }", "public function getOrderDetail()\n {\n return $this->orderDetail;\n }", "protected function detail($id)\n {\n $show = new Show(ScanRechargeOrder::findOrFail($id));\n\n $show->field('id', __('scan-recharge::order.id'));\n $show->field('scan_recharge_channel_id', __('scan-recharge::order.scan_recharge_channel_id'))\n ->as(function () {\n return $this->scan_recharge_channel->name ?? null;\n });\n $show->field('user_id', __('scan-recharge::order.user_id'))\n ->as(function () {\n return $this->user->username ?? null;\n });\n $show->field('amount', __('scan-recharge::order.amount'));\n $show->field('desc', __('scan-recharge::order.desc'));\n $show->field('reply', __('scan-recharge::order.reply'));\n $show->field('status', __('scan-recharge::order.status'))\n ->using(__('scan-recharge::order.status_value'));\n $show->field('created_at', __('admin.created_at'));\n $show->field('updated_at', __('admin.updated_at'));\n\n return $show;\n }", "public function order($id)\n {\n\n \t $order = DB::table('orders')\n \t \t\t\t->join('customers', 'orders.customer_id', 'customers.id')\n \t \t\t\t->where('orders.id', $id)\n \t \t\t\t->select('customers.name', 'customers.phone', 'customers.address', 'orders.*')\n \t \t\t\t->first();\n \t \treturn response()->json($order);\n }", "public function orderDetail($order_id){\n $data = $this->order->getOrderById($order_id);\n return view('dashboard.order-detail', ['data' => $data, 'list_status' => $this->order->list_status]);\n }", "public function getOrderById($id){\n $this->db->query(\"SELECT * FROM orders WHERE id = :id\");\n\n $this->db->bind(':id', $id);\n \n $row = $this->db->single();\n\n return $row;\n }", "public function getById($orderlineId);", "public function getOrderById($orderId)\n {\n }", "public function show(int $id)\n {\n $order = Order::find($id);\n\n if (null === $order) {\n return response()\n ->noContent();\n }\n\n return $order;\n }", "public function orderDetail($id)\n {\n //\n $total = 0;\n $order=Order::find($id);\n $order_details = DB::table('order_details')->where('order_id','=',$id)\n ->join('products', 'order_details.product_id', '=', 'products.id')\n ->join('prices', 'order_details.price_id', '=', 'prices.id')\n ->leftjoin('promotions','order_details.promotion_id','=','promotions.id')\n ->select('products.thumbnail','products.name', 'prices.price','order_details.quantity','promotions.discount')\n ->get();\n return view('orders.detail',compact('order_details','total'));\n }", "protected function detail($id)\n {\n $show = new Show(Order::findOrFail($id));\n\n\n\n return $show;\n }", "public function read($order_id) {\n\n global $user;\n\n //watchdog('musth_restws', 'W7D001 5DXS OrderResourceController start read (!i) (!p) ',\n // array('!i' => print_r($order_id, true),\n // '!p' => print_r('', true)),\n // WATCHDOG_DEBUG);\n\n $order_as_array = entity_load('commerce_order', array($order_id));\n $order = $order_as_array[$order_id];\n\n // The order total, which is in the field commerce_order_total, is calculated\n // automatically when the order is refreshed, which happens at least when we\n // call the line item api to get all the line items of an order\n\n // Refreshing the order in case any product changed its price or there are other\n // changes to take care of\n\n // Since we refresh the order here, there is no need to do it when we load\n // line items. Just call the order query api first and then the line item query api\n\n if ($order->status == 'cart')\n commerce_cart_order_refresh($order);\n\n $order_wrapper = entity_metadata_wrapper('commerce_order', $order);\n\n //watchdog('musth_restws', 'W7D001 71788 kkk OrderResourceController read (!i) (!p) ',\n // array('!i' => print_r('', true),\n // '!p' => print_r('', true)),\n // WATCHDOG_DEBUG);\n\n if (isset($order->commerce_customer_billing[LANGUAGE_NONE]))\n $customer_profile_id = $order->commerce_customer_billing[LANGUAGE_NONE][0]['profile_id'];\n else\n $customer_profile_id = 0;\n\n if ($user->uid) {\n // For logged-in users we can send back the email address\n\n $user_email = $order->mail;\n\n } else {\n // For anonymous users we can't\n\n $user_email = 'Cant send you the email address for privacy';\n }\n\n $order_to_return = new Order($order->order_id,\n $order->order_number,\n $order->uid,\n $user_email,\n $customer_profile_id,\n $order->status,\n $order_wrapper->commerce_order_total->amount->value(),\n $order_wrapper->commerce_order_total->currency_code->value(),\n $order->created,\n $order->changed\n );\n\n //watchdog('musth_restws', 'W7D001 7171 OrderResourceController read (!i) (!p) ',\n // array('!i' => print_r('', true),\n // '!p' => print_r('', true)),\n // WATCHDOG_DEBUG);\n\n // Sending back the Order object\n\n return $order_to_return;\n }", "public function getOrderById($order_id)\n {\n $client = $this->httpClientFactory->create();\n $client->setUri($this->chronos_url.\"orders/$order_id/detail/\");\n $client->setMethod(\\Zend_Http_Client::GET);\n $client->setHeaders([\n 'Content-Type: application/json', \n 'Accept: application/json',\n \"Authorization: Token $this->token\"\n ]);\n try {\n $response = $client->request();\n $body = $response->getBody();\n $string = json_decode(json_encode($body),true);\n $order_data=json_decode($string);\n \n return $order_data;\n } catch (\\Zend_Http_Client_Exception $e) {\n $this->logger->addInfo('Chronos order save helper', [\"Get order error\"=>$e->getMessage()]);\n return false;\n }\n }", "public function getOrderDetails($order_id){\n\t \n\t \t\t$this->db->select(\"CO.*, C.comp_name, CF.firm_name\");\n\t\t\t$this->db->from(\"client_orders AS CO\");\n\t\t\t$this->db->join(\"clients AS C\", \"C.comp_id = CO.comp_id\");\n\t\t\t$this->db->join(\"company_firms AS CF \", \"CF.firm_id = CO.invoice_firm \");\n\t\t\t$this->db->where(\"CO.order_id\",$order_id);\n\t\t\tif($this->session->userdata('userrole') == 'Sales'){\n\t\t\t\t$this->db->where(\"CO.uid\",$this->session->userdata('userid'));\n\t\t\t}\n\t\t\t$query_order_details = $this->db->get();\n\t\t\t\n\t\t\t//echo $this->db->last_query();die;\n\t\t\tif($query_order_details->num_rows()>0)\n\t\t\t{\n\t\t\t\treturn $query_order_details->result_array();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn array();\n\t\t\t}\n\t \n\t }", "function get ($id) {\n // PARAM $id : order ID\n\n $order = $this->fetch(\n \"SELECT * FROM `orders` WHERE `order_id`=?\", [$id]\n );\n $order['items'] = $this->fetch(\n \"SELECT * FROM `orders_items` LEFT JOIN `products` USING (`product_id`) WHERE `orders_items`.order_id=?\", \n [$id], \"product_id\"\n );\n return $order;\n }", "public function getOrderInfoById($orderId)\n {\n $ordersQuery = DB::table('orders')\n ->leftJoin(\n DB::raw('(SELECT locations.id, locations.full_address, locations.longitude, locations.latitude FROM locations) as location_destination'),\n 'location_destination.id',\n '=',\n 'orders.location_destination_id'\n )\n ->leftJoin(\n DB::raw('(SELECT locations.id, locations.full_address, locations.longitude, locations.latitude FROM locations) as location_arrival'),\n 'location_arrival.id',\n '=',\n 'orders.location_arrival_id'\n )\n ->leftJoin('vehicle', 'orders.vehicle_id', '=', 'vehicle.id')\n ->where([\n ['orders.id', '=', $orderId],\n ['orders.del_flag', '=', '0'],\n ['vehicle.del_flag', '=', '0']\n ]);\n $order = $ordersQuery->get([\n 'orders.id as order_id', 'order_code', 'orders.status as status',\n 'orders.ETD_date', 'orders.ETD_time', 'location_destination.full_address as location_destination', 'location_destination.longitude as location_destination_longitude', 'location_destination.latitude as location_destination_latitude',\n 'orders.ETA_date', 'orders.ETA_time', 'location_arrival.full_address as location_arrival', 'location_arrival.longitude as location_arrival_longitude', 'location_arrival.latitude as location_arrival_latitude',\n 'vehicle.latitude as current_latitude', 'vehicle.longitude as current_longitude', 'vehicle.current_location as current_location'\n ])->first();\n return $order;\n }", "public function getOrderForPrint($id) {\n\n // get the order data\n $order = $this->find('first', array(\n 'conditions' => array('Order.id' => $id),\n 'fields' => array(\n\t\t\t\t'created', \n\t\t\t\t'order_number', \n\t\t\t\t'order_reference', \n\t\t\t\t'total', \n\t\t\t\t'billing_company',\n 'billing_address', \n\t\t\t\t'billing_address2', \n\t\t\t\t'billing_city',\n 'billing_zip', \n\t\t\t\t'billing_state', \n\t\t\t\t'billing_country', \n\t\t\t\t'ship_date', \n\t\t\t\t'note', \n\t\t\t\t'user_customer_id'),\n 'contain' => array(\n 'User' => array(\n 'fields' => array(\n\t\t\t\t\t\t'first_name', \n\t\t\t\t\t\t'last_name', \n\t\t\t\t\t\t'username')\n ),\n 'Shipment' => array(\n 'fields' => array(\n 'first_name', \n\t\t\t\t\t\t'last_name', \n\t\t\t\t\t\t'company',\n 'email', \n\t\t\t\t\t\t'phone',\n 'address', \n\t\t\t\t\t\t'address2',\n 'city', \n\t\t\t\t\t\t'zip', \n\t\t\t\t\t\t'state', \n\t\t\t\t\t\t'country',\n 'carrier', \n\t\t\t\t\t\t'method', \n\t\t\t\t\t\t'billing'\n )\n ),\n 'OrderItem' => array(\n 'fields' => array('quantity', 'name',),\n 'Item' => array(\n 'fields' => array('item_code'),\n 'Location'\n )\n )\n )\n ));\n $customer_type = ClassRegistry::init('Customer')\n\t\t\t\t->field(\n\t\t\t\t\t\t'customer_type', \n\t\t\t\t\t\tarray('Customer.user_id' => $order['Order']['user_customer_id'] ));\n $items = $this->assemblePrintLineItems($order['OrderItem']);\n $firstPageLines = 500;\n $pg1 = array_slice($items, 0, $firstPageLines);\n if (count($items) > count($pg1)) {\n $chunk = array_chunk(array_slice($items, $firstPageLines, count($items)), 37);\n } else {\n $chunk = array();\n }\n\n // page the line item arrays\n // first\n $orderedBy = $this->User->discoverName($order['User']['id']);\n if(!empty($order['Order']['ship_date'])){\n $t = strtotime($order['Order']['ship_date']);\n } else {\n $t = time();\n }\n $data = array(\n 'reference' => array(\n 'labels' => array('Date', 'Order'),\n 'data' => array(date('m/d/y', $t), $order['Order']['order_number'])\n ),\n 'items' => $pg1,\n 'summary' => array(\n 'labels' => array('Ordered By', 'Reference', 'Carrier', 'Method', 'Billing'),\n 'data' => array(\n $orderedBy, // Ordered By\n $order['Order']['order_reference'],\t\t // Reference\n $order['Shipment'][0]['carrier'],\t\t // Carrier\n $order['Shipment'][0]['method'],\t // Method\n $order['Shipment'][0]['billing'],\t // Billing\n//\t\t\t\t\t$order['Order']['total']\t\t\t // Total\n )\n ),\n 'note' => $order['Order']['note'],\n 'headerRow' => array('#', 'Qty', 'Code', 'Name'),\n 'customer_type' => $customer_type,\n 'chunk' => $chunk,\n 'shipping' => array(\n \"{$order['Shipment'][0]['first_name']} {$order['Shipment'][0]['last_name']}\",\n $order['Shipment'][0]['company'],\n $order['Shipment'][0]['address'],\n $order['Shipment'][0]['address2'],\n \"{$order['Shipment'][0]['city']} {$order['Shipment'][0]['state']} {$order['Shipment'][0]['zip']} {$order['Shipment'][0]['country']}\"\n ),\n 'billing' => array(\n $order['Order']['billing_company'],\n $order['Order']['billing_address'],\n $order['Order']['billing_address2'],\n \"{$order['Order']['billing_city']} {$order['Order']['billing_state']} {$order['Order']['billing_zip']} {$order['Order']['billing_country']}\"\n )\n );\n return $data;\n }", "protected function detail($id)\n {\n $show = new Show(Order::findOrFail($id));\n\n $show->field('id', __('Id'));\n $show->field('no', __('No'));\n $show->field('user_id', __('User id'));\n $show->field('address', __('Address'));\n $show->field('total_amount', __('Total amount'));\n $show->field('remark', __('Remark'));\n $show->field('paid_at', __('Paid at'));\n $show->field('payment_method', __('Payment method'));\n $show->field('payment_no', __('Payment no'));\n $show->field('refund_status', __('Refund status'));\n $show->field('refund_no', __('Refund no'));\n $show->field('closed', __('Closed'));\n $show->field('reviewed', __('Reviewed'));\n $show->field('ship_status', __('Ship status'));\n $show->field('ship_data', __('Ship data'));\n $show->field('extra', __('Extra'));\n $show->field('created_at', __('Created at'));\n $show->field('updated_at', __('Updated at'));\n\n return $show;\n }", "public function getThisOrderCityOfDelivery($order_id){\n \n $criteria = new CDbCriteria();\n $criteria->select = '*';\n $criteria->condition='id=:id';\n $criteria->params = array(':id'=>$order_id);\n $order= Order::model()->find($criteria);\n \n return $order['delivery_city_id'];\n }", "function get_order_details_get()\n { \n $input = $this->get();\n \n if(!isset($input['id']) || $input['id'] == '') \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 $trip_data = $this->Common_model->getOrderDetails($input['id']);\n if($trip_data){\n $message = ['status' => TRUE,'message' => $this->lang->line('trip_details_found_success'),'data'=>$trip_data];\n $this->set_response($message, REST_Controller::HTTP_OK); // OK (200)\n }\n else{\n $message = ['status' => FALSE,'message' => $this->lang->line('trip_details_found_error')];\n $this->response($message, REST_Controller::HTTP_BAD_REQUEST); // BAD_REQUEST (400)\n }\n \n }\n }", "public function find(int $id): Order\n {\n return Order::find($id);\n }", "public function show($id)\n {\n //\n $this->AuthLoginCheck();\n $order = Order::find($id);\n $orders = Customer::find($order->customer_id)->order_one->toArray();\n $order_detail = Order::find($id)->order_detail->toArray();\n $customer = Customer::where('id',$order->id)->first();\n $shipping = Shipping::find($order->shipping_id);\n // echo '<pre>';\n // var_dump($customer);\n // echo '</pre>';\n \n return view('admin.manage.order_detail',compact('orders','order_detail','customer','shipping'));\n }", "public function show($id)\n\t{\n\n\t\t$order = Order::with('orderItem')->find($id);\n\t\n\t\treturn Response::json($order);\n\t}", "public function getDetail(int $id)\n {\n }", "protected function detail($id)\n {\n $show = new Show(Order::findOrFail($id));\n\n $show->field('id', __('Id'));\n $show->field('order_id', __('Order id'));\n $show->field('customer_id', __('Customer id'));\n $show->field('address_id', __('Address id'));\n $show->field('expected_delivery_date', __('Expected delivery date'));\n $show->field('expected_pickup_date', __('Expected pickup date'));\n $show->field('actual_delivery_date', __('Actual delivery date'));\n $show->field('total', __('Total'));\n $show->field('discount', __('Discount'));\n $show->field('sub_total', __('Sub total'));\n $show->field('promo_id', __('Promo id'));\n $show->field('collected_by', __('Collected by'));\n $show->field('delivered_by', __('Delivered by'));\n $show->field('payment_mode', __('Payment mode'));\n $show->field('payment_status', __('Payment status'));\n $show->field('items', __('Items'));\n $show->field('status', __('Status'));\n $show->field('created_at', __('Created at'));\n $show->field('updated_at', __('Updated at'));\n\n return $show;\n }", "public function show($id)\n {\n $cont = new RestController();\n $order = $cont->getRequest('Orders(' . $id . ')?$expand=OrderFieldValue($expand=OrderField),' .\n 'OrderProduct($expand=Product),OrderProductPackage($expand=ProductPackage($expand=Product),Products($expand=Product),Country),' .\n 'ClientAlias($expand=Contact,Country,Client($select=Id,CINumber,ClientManager_Id;$expand=ClientManager($select=FullName))),' .\n 'User($select=FullName,UserName),' .\n 'ApprovedBy($select=UserName),'.\n 'Invoice,Contracts($expand=Product($select=Name),User($select=FullName,UserName),Manager($select=FullName,UserName),Country($select=CountryCode))');\n if ($order instanceof View) {\n return $order;\n }\n if(!empty($order->OrderProductPackage)){\n //getting the addons products because we can't do it in the query\n foreach ($order->OrderProductPackage as $k => $val) {\n $product = $cont->getRequest(\"Products(\" . $val->ProductPackage->Product_Id . \")\");\n if (!$product instanceof View) {\n $order->OrderProductPackage[$k]->ProductPackage->Product = $product;\n }\n }\n }\n\n //get the contracts that came from this order\n $contractsResult = $cont->getRequest(\"Orders($id)/action.Contracts\".'?$expand=User($select=Id,FullName),Manager($select=Id,FullName),OriginalOrder($select=Id),Product($select=Name),Country($select=CountryCode)');\n if(!$contractsResult instanceof View){\n $order->Contract = $contractsResult->value;\n }else{\n $order->Contract = null;\n }\n if(!$this->isOwner($order)){\n return view('errors.denied');\n }\n //merge order products and order product packages , so we support both old and new orders\n $order->OrderProductPackage = array_merge($order->OrderProductPackage,$order->OrderProduct);\n $paymenTerms = $cont->getEnumProperties(['ContractTerms']);\n $paymenTerms = isset($paymenTerms['ContractTerms']) ? $paymenTerms['ContractTerms'] : [];\n\n //put the hashcode for a js\n JavaScriptFacade::put(['Hashcode' => $order->HashCode,'paymentTerms' => $paymenTerms]);\n //add the months corresponding to each OrderProduct payment term\n\n $contractTerms = $cont->getEnumProperties(['ContractTerms']);\n\n foreach ($order->OrderProduct as $k => $val) {\n $paymentTerms = array_search($val->PaymentTerms, $contractTerms['ContractTerms']);\n $order->OrderProduct[$k]->Months = $paymentTerms;\n }\n\n $clientManagers = UsersController::listByRoles(['Client Manager']);\n\n $order->OrderFieldValue = $this->groupOrderFieldValues($order->OrderFieldValue);\n return view('orders.show',compact('order', 'cont','clientManagers'));\n }", "public function order_details_data($order_id)\n\t{\t\n\t\t$CI =& get_instance();\n\t\t$CI->auth->check_admin_auth();\n\t\t$CI->load->library('Lorder');\n\t\t$content = $CI->lorder->order_details_data($order_id);\t\n\t\t$this->template->full_admin_html_view($content);\n\t}", "public function retrieve($id) {\n SCA::$logger->log(\"retrieve resource $id\");\n return $this->orders_service->retrieve($id);\n }", "public function getOrderById($id_order)\n {\n return $this->orderRepository->getOrderById($id_order);\n }", "public function getOrderByID($order_id)\n {\n $order = $this->db->prepare(<<<SQL\nSELECT orders.order_id, orders.order_date, orders.arrival_date, orders.student_number\nFROM orders\nWHERE orders.order_id = :order_id\nORDER BY orders.order_date;\nSQL\n );\n $order->execute(array(':order_id' => $order_id));\n return $order->fetch(\\PDO::FETCH_OBJ);\n }", "public function get_order( $order_id ) {\n\t\treturn $this->request( \"orders/{$order_id}\" );\n\t}", "function get_order_data_by_id($token,$id){\r\n\r\n $ch = curl_init(\"https://your-domain/index.php/rest/V1/orders/\".(int)$id);\r\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\"Content-Type: application/json; charset=utf-8\", \"Authorization: Bearer \" . $token));\r\n \r\n $result = curl_exec($ch);\r\n \r\n $order = json_decode($result);\r\n \r\n return $order;\r\n \r\n }", "public function show($id)\n {\n $orden = Order::where('id', $id)->with('suscription.car', 'suscription.plans', 'planTypeWash')->first();\n return response()->json(['detail-order' => $orden]);\n }", "public function getDeliveryOrderDetailById(Request $request)\n {\n $deliveryOrderDetail = $this->deliveryOrderDetail::find($request->delivery_order_id);\n if ($deliveryOrderDetail == null) {\n $return = array (\n 'code' => 404,\n 'error' => true,\n 'message' => 'Data Tidak Ditemukan',\n );\n }else{\n $return = array (\n 'code' => 200,\n 'success' => true,\n 'data' => $deliveryOrderDetail,\n 'message' => 'Data Ditemukan',\n );\n }\n return $return;\n }", "public function show($id)\n {\n // $user = auth()->user();\n $Order = Order::find($id);\n\n\n if (is_null($Order)) {\n return response()->json([\"message\" => \"Order not found\"], 404);\n }\n $One_Order = Order::where('id',$id)->get();\n\n return response()->json([\"message\" => \"Order retrievd successfully\", 'data' => $One_Order, ], 200); \n }", "public function getJSONDeliveryDetails_View($id)\n {\n sqlsrv_configure('WarningsReturnAsErrors', 0);\n $this->connDB = $this->load->database('dbATPIDeliver',true);\n $query = $this->connDB->query(\"EXECUTE [sp_DeliverDetails_Get] $id\");\n //$this->connDB->close();\n\n return $query;\n }", "protected function detail($id)\n {\n $show = new Show(TaskOrder::findOrFail($id));\n\n $show->id('ID');\n $show->eid('快递单号');\n $show->sname('客服名称');\n $show->store('快递网点');\n $show->etype('快递公司');\n $show->created_at('Created at');\n $show->updated_at('Updated at');\n\n return $show;\n }", "public function show($id)\n {\n $odetails = OrderDetails::where('order_id', $id)->get();\n $dish = Dish::where('dish_id', )\n }", "public function show($id)\n {\n $order = Order::find($id);\n $order_detail = Order_detail::where('order_id',$id)->get();\n return view('backend.order.detail',compact('order','order_detail')); \n }", "function findById($id)\n {\n $dataService = new OrderDataService();\n\n return $dataService->findById($id);\n }", "protected function detail($id)\n {\n $show = new Show(Order::findOrFail($id));\n\n $show->id('Id');\n $show->no('No');\n $show->user_id('User id');\n $show->address('Address');\n $show->total_amount('Total amount');\n $show->remark('Remark');\n $show->paid_at('Paid at');\n $show->payment_method('Payment method');\n $show->payment_no('Payment no');\n $show->refund_status('Refund status');\n $show->refund_no('Refund no');\n $show->closed('Closed');\n $show->reviewed('Reviewed');\n $show->ship_status('Ship status');\n $show->ship_data('Ship data');\n $show->extra('Extra');\n $show->created_at('Created at');\n $show->updated_at('Updated at');\n\n return $show;\n }", "public function getOrderDetailsByOrderId($orderId)\n {\n $sql = <<<'EOT'\nSELECT\n `d`.`id` AS `orderdetailsID`,\n `d`.`orderID` AS `orderID`,\n `d`.`ordernumber`,\n `d`.`articleID`,\n `d`.`articleordernumber`,\n `d`.`price` AS `price`,\n `d`.`quantity` AS `quantity`,\n `d`.`price`*`d`.`quantity` AS `invoice`,\n `d`.`name`,\n `d`.`status`,\n `d`.`shipped`,\n `d`.`shippedgroup`,\n `d`.`releasedate`,\n `d`.`modus`,\n `d`.`esdarticle`,\n `d`.`taxID`,\n `t`.`tax`,\n `d`.`tax_rate`,\n `d`.`esdarticle` AS `esd`\nFROM\n `s_order_details` AS `d`\nLEFT JOIN\n `s_core_tax` AS `t`\nON\n `t`.`id` = `d`.`taxID`\nWHERE\n `d`.`orderID` = :orderId\nORDER BY\n `orderdetailsID` ASC\nEOT;\n\n return $this->db->fetchAll($sql, ['orderId' => $orderId]);\n }", "static public function getOrderById($order_id) {\n $order = DB::table('orders')->where('id', $order_id)->get();\n return $order;\n }", "protected function detail($id)\n {\n $show = new Show(Order::findOrFail($id));\n\n $show->field('id', __('Id'));\n $show->field('currency', __('Currency'));\n $show->field('amount', __('Amount'));\n $show->field('state', __('State'));\n $show->field('game_id', __('Game id'));\n $show->field('user_id', __('User id'));\n $show->field('product_id', __('Product id'));\n $show->field('product_name', __('Product name'));\n $show->field('cp_order_id', __('Cp order id'));\n $show->field('callback_url', __('Callback url'));\n $show->field('callback_info', __('Callback info'));\n $show->field('created_at', __('Created at'));\n $show->field('updated_at', __('Updated at'));\n\n return $show;\n }", "public function testGetOrderDetailWithInvalidId(){\n \t \n \tPayU::$apiLogin = PayUTestUtil::API_LOGIN;\n \tPayU::$apiKey = PayUTestUtil::API_KEY;\n \t \n \tEnvironment::setReportsCustomUrl(PayUTestUtil::REPORTS_CUSTOM_URL);\n \n \t$parameters = array(\n \t\t\tPayUParameters::ORDER_ID => '123111123',\n \t);\n \t \n \t$response = PayUReports::getOrderDetail($parameters);\n }", "public function getDataId($id)\n {\n $order = ModelHotelOrders::find($id);\n return $order;\n }", "public function testGetOrderDetail(){\n \t\n \tPayU::$apiLogin = PayUTestUtil::API_LOGIN;\n \tPayU::$apiKey = PayUTestUtil::API_KEY;\n \t\n \tEnvironment::setReportsCustomUrl(PayUTestUtil::REPORTS_CUSTOM_URL);\n \t\n \n \t$authorizationResponse = PayUTestUtil::processTransaction(TransactionType::AUTHORIZATION_AND_CAPTURE, '*');\n \t\n \t$parameters = array(\n \t\t\tPayUParameters::ORDER_ID => $authorizationResponse->transactionResponse->orderId,\n \t);\n \t\n \t$response = PayUReports::getOrderDetail($parameters);\n \t\n \t$this->assertNotNull($response);\n \t$this->assertEquals($authorizationResponse->transactionResponse->orderId, $response->id);\n \t \n }", "public function getOrderDetails()\n {\n return Orders::getOrderdetails($this->getOrderId());\n }", "public function show($id)\n {\n //\n // // dd($id);\n // $data = ORDERDETAIL::find($id);\n\n // dd($data);\n // $data = ORDERDETAIL::find($id);\n $data = DB::table('orderdetail')->where('oid',$id)->first();\n\n return view('admin.Orderdetail',compact('data'));\n }", "public function getOrderByCustomerId_get($id = null) {\n $this->load->model('Order_model');\n $this->load->model('Address_model');\n $params = array();\n $params['limit'] = (is_numeric($this->input->get('limit'))) ? $this->input->get('limit') : null;\n $in_array = array(\"date_add\");\n $params['filter'] = (in_array($this->input->get('filter'), $in_array)) ? $this->input->get('filter') : null;\n switch ($this->input->get('detail')) {\n case 'long':\n $order = $this->Order_model->getLongOrderByCustomerId($id, $params);\n foreach ($order as $key => $value) {\n $value->img_link = base_url() . 'index.php/api/image/id/' . $value->id_image;\n }\n return $this->response(array($this->router->class => $order), 200);\n break;\n\n default:\n $data = $this->Order_model->getShortOrderByCustomerId($id, $params);\n foreach ($data as $key => $value) {\n $value->order_url = base_url() . \"index.php/api/order/id/$value->id_order/get\";\n }\n $b = array();\n $c = array();\n break;\n }\n \n return $this->response($data, 200);\n }", "public function order_details($id){\n $user = Auth::id(); \n $order = Order::where(['slug' => $id,'user_id' => $user])->first();\n if($order){\n return view('order-details', compact('order'));\n }\n return view('errors.404');\n }", "public function show($id)\n {\n $status = 1;\n $order = Order::find($id);\n if ($order == null) {\n $status = -1;\n $message = \"Cannot find this Order!\";\n }\n else {\n $message = \"Successful!\";\n return response()->json([\n 'status' => $status,\n 'message' => $message,\n 'data' => $order,\n ]);\n }\n return response()->json([\n 'status' => $status,\n 'message' => $message,\n ]);\n }", "public function getInfoPaymentByOrder($order_id)\n {\n $order = $this->_getOrder($order_id);\n $payment = $order->getPayment();\n $info_payments = [];\n $fields = [\n [\"field\" => \"cardholderName\", \"title\" => \"Card Holder Name: %1\"],\n [\"field\" => \"trunc_card\", \"title\" => \"Card Number: %1\"],\n [\"field\" => \"payment_method\", \"title\" => \"Payment Method: %1\"],\n [\"field\" => \"expiration_date\", \"title\" => \"Expiration Date: %1\"],\n [\"field\" => \"installments\", \"title\" => \"Installments: %1\"],\n [\"field\" => \"statement_descriptor\", \"title\" => \"Statement Descriptor: %1\"],\n [\"field\" => \"payment_id\", \"title\" => \"Payment id (Mercado Pago): %1\"],\n [\"field\" => \"status\", \"title\" => \"Payment Status: %1\"],\n [\"field\" => \"status_detail\", \"title\" => \"Payment Detail: %1\"],\n [\"field\" => \"activation_uri\", \"title\" => \"Generate Ticket\"],\n [\"field\" => \"payment_id_detail\", \"title\" => \"Mercado Pago Payment Id: %1\"],\n [\"field\" => \"id\", \"title\" => \"Collection Id: %1\"],\n ];\n\n foreach ($fields as $field) {\n if ($payment->getAdditionalInformation($field['field']) != \"\") {\n $text = __($field['title'], $payment->getAdditionalInformation($field['field']));\n $info_payments[$field['field']] = [\n \"text\" => $text,\n \"value\" => $payment->getAdditionalInformation($field['field'])\n ];\n }\n }\n\n if ($payment->getAdditionalInformation('payer_identification_type') != \"\") {\n $text = __($payment->getAdditionalInformation('payer_identification_type'));\n $info_payments[$payment->getAdditionalInformation('payer_identification_type')] = [\n \"text\" => $text . ': ' . $payment->getAdditionalInformation('payer_identification_number')\n ];\n }\n\n return $info_payments;\n }", "public function show($id)\n {\n $delivery = $this->deliveryRepository->find($id);\n\n if (empty($delivery)) {\n Flash::error('Delivery not found');\n\n return redirect(route('deliveries.index'));\n }\n\n $deliveryTransID = Delivery::where('id', $id)->pluck('ref_no');\n\n $products = DB::table('incoming_delivery_details')\n ->join('incoming_delivery', 'incoming_delivery_details.ref_no', '=', 'incoming_delivery.ref_no')\n ->join('product', 'incoming_delivery_details.product_id', '=', 'product.id')\n ->where('incoming_delivery_details.ref_no', '=', $deliveryTransID)\n ->select('incoming_delivery.id as delivery_id', 'incoming_delivery.ref_no as delivery_transno', 'incoming_delivery.transac_date as delivery_transdate', 'incoming_delivery.supplier_id as supplier', 'incoming_delivery.total_prod_costs as delivery_ttl_cost', 'incoming_delivery.remarks as delivery_remarks', 'incoming_delivery_details.id as dlvrydtl_id', 'incoming_delivery_details.ref_no as dlvrydtl_refno', 'incoming_delivery_details.product_id as dlvrydtl_prodid', 'incoming_delivery_details.quantity as dlvrydtl_prodqty', 'incoming_delivery_details.buying_price as dlvrydtl_prodprc', 'incoming_delivery_details.total_cost as dlvrydtl_prdttl', 'product.id as prod_id', 'product.sku_barcode_id as prod_barcode', 'product.name as prod_name', 'product.unit_type as prod_unit', 'product.price as prod_prc')\n ->get();\n\n return view('deliveries.show', compact('products'))\n ->with('delivery', $delivery);\n }", "protected function detail($id)\n {\n $show = new Show(BoxOrder::findOrFail($id));\n\n $show->panel()->tools(function ($tools) {\n $tools->disableEdit();\n });\n\n $show->id('ID');\n $show->sn('订单号');\n $show->total('奖励金')->as(function ($total) {\n return $total == 0 ? '奖励次数限制' : $total;\n });\n $show->created_at('投递时间');\n $show->image_proof('图片凭证')->image();\n\n $show->user('投递用户信息', function ($user) {\n /*禁用*/\n $user->panel()->tools(function ($tools) {\n $tools->disableList();\n $tools->disableEdit();\n $tools->disableDelete();\n });\n\n $user->field('id', 'ID');\n $user->field('avatar', '头像')->image('', 120);\n $user->field('name', '昵称');\n $user->field('gender', '性别');\n $user->field('phone', '手机号');\n $user->field('money', '奖励金');\n $user->field('frozen_money', '冻结金额');\n $user->field('total_client_order_money', '累计投递订单金额');\n $user->field('total_client_order_count', '累计投递订单次数');\n });\n\n\n return $show;\n }", "public function show($id)\n {\n $order_detail = DB::table('tpl_order')\n ->select(\n 'tpl_order.order_id',\n 'tpl_order.created_at',\n 'tpl_order.updated_at',\n 'tpl_order.status',\n 'tpl_order.note',\n 'users.id',\n 'users.lastName',\n 'users.firstName',\n 'users.username',\n 'users.phone',\n 'users.address',\n 'users.email',\n )\n ->join('users', 'users.id', '=', 'tpl_order.user_id')\n ->where('tpl_order.order_id', $id)->first();\n\n $order = DB::table('tpl_order')\n ->join('tpl_order_dt', 'tpl_order.order_id', '=', 'tpl_order_dt.order_id')\n ->join('tpl_product', 'tpl_order_dt.product_id', '=', 'tpl_product.product_id')\n ->where('tpl_order.order_id', $id)->get();\n\n\n return view('pages.server.order.show')\n ->with('order_detail', $order_detail)\n ->with('order', $order);\n }", "public function order_details() {\n return $this->belongsTo(OrderDetail::class, 'product_id', 'id');\n }", "public function show($id)\n {\n $result = $this->order->show($id);\n\n return (new JsonResource($result))->response();\n }", "public function get($id = null, $order = \"desc\") {\r\n $this->db->select()->from('fees_discounts');\r\n if ($id != null) {\r\n $this->db->where('id', $id);\r\n } else {\r\n\r\n $this->db->order_by('id ' . $order);\r\n }\r\n\t\t$this->db->where('school_id', $this->school_id);\r\n\t\t$query = $this->db->get();\r\n\t\t\r\n\t\tif ($id != null) {\r\n return $query->row_array();\r\n } else {\r\n return $query->result_array();\r\n }\r\n\t\t\r\n }", "public function view_order_details($order_id)\n\t{\n $log=new Log(\"OrderDetailsRCV.log\");\n $query = $this->db->query(\"SELECT oc_po_order.*,\".DB_PREFIX.\"user.firstname,\".DB_PREFIX.\"user.lastname\n\t\t\t\tFROM oc_po_order\n\t\t\t\t\tLEFT JOIN \".DB_PREFIX.\"user\n\t\t\t\t\t\tON \".DB_PREFIX.\"user.user_id = oc_po_order.user_id\n\t\t\t\t\t\t\tWHERE id = \" . $order_id . \" AND delete_bit = \" . 1);\n $log->write($query);\n $order_info = $query->row;\n\t\t//ON (oc_po_receive_details.product_id = oc_po_product.id)\n\t\t$query = $this->db->query(\"SELECT\n\t\toc_po_product.*,oc_po_receive_details.quantity as rd_quantity,oc_po_receive_details.price,oc_po_supplier.first_name,oc_po_supplier.last_name,oc_po_supplier.id as supplier_id,oc_po_receive_details.order_id\n\t\tFROM\n\t\t\toc_po_receive_details\n\t\tINNER JOIN oc_po_product \n\t\t\tON (oc_po_receive_details.order_id = oc_po_product.order_id)\n\t\tLEFT JOIN oc_po_supplier \n\t\t\tON (oc_po_receive_details.supplier_id = oc_po_supplier.id)\n\t\t\t\tWHERE (oc_po_receive_details.order_id =\".$order_id.\")\");\n $log->write($query);\n\tif($this->db->countAffected() > 0)\n\t{\n\t\t$products = $query->rows;\n\t\t$quantities = array();\n\t\t$all_quantities = array();\n\t\t$prices = array();\n\t\t$all_prices = array();\n\t\t$suppliers = array();\n\t\t$all_suppliers = array();\n\t\t$supplier_names = array();\n\t\t$all_supplier_names = array();\n\t\t$index = 0;\n\t\t$index1 = 0;\n\t\tfor($i =0; $i<count($products); $i++)\n\t\t{\n\t\t\tif($products[$i] != \"\")\n\t\t\t{\n\t\t\t\tfor($j = 0; $j<count($products); $j++)\n\t\t\t\t{\n\t\t\t\t\tif($products[$j] != \"\")\n\t\t\t\t\t{\n\t\t\t\t\t\tif($products[$i]['id'] == $products[$j]['id'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$quantities[$index] = $products[$j]['rd_quantity'];\n\t\t\t\t\t\t\t$supplier_names[$index] = $products[$j]['first_name'] .\" \". $products[$j]['last_name'];\n\t\t\t\t\t\t\t$suppliers[$index] = $products[$j]['supplier_id'];\n\t\t\t\t\t\t\t$prices[$index] = $products[$j]['price'];\n\t\t\t\t\t\t\tif($j!=$i)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$products[$j] = \"\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$index++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$index = 0;\n\t\t\t\t$all_quantities[$index1] = $quantities;\n\t\t\t\t$all_suppliers[$index1] = $suppliers;\n\t\t\t\t$all_prices[$index1] = $prices;\n\t\t\t\t$all_supplier_names[$index1] = $supplier_names;\n\t\t\t\tunset($quantities);\n\t\t\t\tunset($suppliers);\n\t\t\t\tunset($prices);\n\t\t\t\tunset($supplier_names);\n\t\t\t\t$quantities = array();\n\t\t\t\t$suppliers = array();\n\t\t\t\t$prices = array();\n\t\t\t\t$supplier_names = array();\n\t\t\t\t$index1++;\n\t\t\t}\n\t\t}\n\t\t$products = array_values(array_filter($products));\n\t\tfor($i = 0; $i<count($products); $i++)\n\t\t{\n\t\t\tunset($products[$i]['rd_quantity']);\n\t\t\tunset($products[$i]['first_name']);\n\t\t\tunset($products[$i]['last_name']);\n\t\t\t$products[$i]['quantities'] = $all_quantities[$i];\n\t\t\t$products[$i]['suppliers'] = $all_suppliers[$i];\n\t\t\t$products[$i]['prices'] = $all_prices[$i];\n\t\t\t$products[$i]['supplier_names'] = $all_supplier_names[$i];\n\t\t}\n\t}\n\telse\n\t{\n\t\t$query = $this->db->query(\"SELECT * FROM oc_po_product WHERE order_id = \" . $order_info['id']);\n\t\t$products = $query->rows;\n\t}\n\t\t$i = 0;\n\t\tforeach($products as $product)\n\t\t{\n\t\t\t$query = $this->db->query(\"SELECT * FROM oc_po_attribute_group WHERE product_id = \". $product['id']);\n\t\t\t$attribute_groups[$i] = $query->rows;\n\t\t\t$i++;\n\t\t}\n\t\t\n\t\t$i = 0;\n\t\tforeach($attribute_groups as $attribute_group)\n\t\t{\n\t\t\tfor($j = 0; $j<count($attribute_group);$j++)\n\t\t\t{\n\t\t\t\t$query = $this->db->query(\"SELECT * FROM oc_po_attribute_category WHERE attribute_group_id = \". $attribute_group[$j]['id']);\n\t\t\t\t$attribute_categories[$i] = $query->row;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\t\tfor($i=0;$i<count($products); $i++)\n\t\t{\n\t\t\tfor($j=0; $j<count($attribute_groups[$i]);$j++)\n\t\t\t{\n\t\t\t\t$products[$i]['attribute_groups'][$j] = $attribute_groups[$i][$j]['name'];\n\t\t\t}\n\t\t}\n\t\t$start_loop = 0;\n\t\t//$attribute_categories = array_values(array_filter($attribute_categories));\n\t\t//print_r($attribute_categories);\n\t\t//exit;\n\t\tfor($i=0; $i<count($products); $i++)\n\t\t{\n\t\t\tfor($j=$start_loop; $j<($start_loop + count($products[$i]['attribute_groups']));$j++)\n\t\t\t{\n\t\t\t\t$products[$i]['attribute_category'][$j] = $attribute_categories[$j]['name'];\n\t\t\t}\n\t\t\t$start_loop = $j;\n\t\t}\n\t\t$order_information['products'] = $products;\n\t\t$order_information['order_info'] = $order_info;\n\t\treturn $order_information;\n\t}", "function getOrderPurchaseDetails($order_id)\n\t\t{\n\t\t\t//get order details\n\t\t\t$orders = $this->_BLL_obj->manage_content->getValue_where('order_info', '*', 'order_id', $order_id);\n\t\t\t$user_id = $orders[0]['user_id'];\n\t\t\t//get product details from order id\n\t\t\t$order_details = $this->_BLL_obj->manage_content->getValue_where('product_inventory_info', '*', 'order_id', $order_id);\n\t\t\tif(!empty($order_details[0]))\n\t\t\t{\n\t\t\t\t//total_overridng fee distributed\n\t\t\t\t$dis_over = 0;\n\t\t\t\t$user_level = 0;\n\t\t\t\t\n\t\t\t\tforeach($order_details as $order)\n\t\t\t\t{\n\t\t\t\t\t/* code for distribute overriding fee */\n\t\t\t\t\t//get transaction id for overriding fee\n\t\t\t\t\t$over_id = uniqid('trans');\n\t\t\t\t\t//calling overriding fee function\n\t\t\t\t\t$distributed_overriding = $this->distributeOverridingFee($user_id, $order['price'], $dis_over, $user_level, $over_id,$order_id);\n\t\t\t\t\tif($distributed_overriding != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t//insert values to fee transaction info table\n\t\t\t\t\t\t$insert_over = $this->_BLL_obj->manage_content->insertValue('fee_transaction_info', array('transaction_id','order_id','product_id','fee_type'), array($over_id,$order_id,$order['product_id'],'OF'));\n\t\t\t\t\t\t//new system value\n\t\t\t\t\t\t$new_system_value = $this->getSystemMoneyValue() - $distributed_overriding;\n\t\t\t\t\t\t//insert distributed amount to system money info\n\t\t\t\t\t\t$insert_dist_amount = $this->_BLL_obj->manage_content->insertValue('system_money_info', array('specification','debit','system_balance'), array($over_id,$distributed_overriding,$new_system_value));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t/* code for personal commision calculation */\n\t\t\t\t\t//get transaction id for personal comm calculation\n\t\t\t\t\t$per_id = uniqid('trans');\n\t\t\t\t\t//calling personal commision function\n\t\t\t\t\t$per_comm = $this->calculatePersonalCommision($user_id, $order['price'], $per_id,$order_id);\n\t\t\t\t\t//checking for non empty personal commision\n\t\t\t\t\tif($per_comm != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t//insert values to fee transaction info table\n\t\t\t\t\t\t$insert_personal = $this->_BLL_obj->manage_content->insertValue('fee_transaction_info', array('transaction_id','order_id','product_id','fee_type'), array($per_id,$order_id,$order['product_id'],'PC'));\n\t\t\t\t\t\t//new system value\n\t\t\t\t\t\t$new_system_value_per = $this->getSystemMoneyValue() - $per_comm;\n\t\t\t\t\t\t//insert distributed amount to system money info\n\t\t\t\t\t\t$insert_per_amount = $this->_BLL_obj->manage_content->insertValue('system_money_info', array('specification','debit','system_balance'), array($per_id,$per_comm,$new_system_value_per));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t/* code for point value calculation */\n\t\t\t\t\t//get transaction id for point value distribution\n\t\t\t\t\t$pv_id = uniqid('trans');\n\t\t\t\t\t//get product details\n\t\t\t\t\t$product_details = $this->_BLL_obj->manage_content->getValue_where('product_info', '*', 'product_id', $order['product_id']);\n\t\t\t\t\t//total point value\n\t\t\t\t\t$total_pv = $product_details[0]['point_value'] * $order['quantity'];\n\t\t\t\t\t//insert values to fee transaction info table\n\t\t\t\t\t$insert_point = $this->_BLL_obj->manage_content->insertValue('fee_transaction_info', array('transaction_id','order_id','product_id','fee_type'), array($pv_id,$order_id,$order['product_id'],'PV'));\n\t\t\t\t\t//insert pv to system\n\t\t\t\t\t$system_pv = $this->insertSystemPV($pv_id, $total_pv);\n\t\t\t\t\t//calling point value distributive function\n\t\t\t\t\t$this->distributePointValue($user_id, $total_pv, $pv_id, $order_id);\n\t\t\t\t\t\n\t\t\t\t\t/* code for member level upgradation of user and their parent */\n\t\t\t\t\t//calling fucntion for it\n\t\t\t\t\t$this->checkingLevelOfUserAndParent($user_id);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function Get_Work_Order_Details($id)\n {\n $query=$this->db->query(\"SELECT * FROM work_order A INNER JOIN ibt_client B on A.Resource_Client_Icode = B.Client_Icode\n INNER JOIN ibt_workcategory D on A.Resource_Category_Icode = D.WorkCategory_Icode\n INNER JOIN ibt_work_type E on A.Resource_Work_Type_Icode = E.Work_Icode INNER JOIN ibt_contractcategory F on A.Resource_Contract_Type = F.Contracttype_Icode \n WHERE A.Work_Order_Icode ='$id' \");\n return $query->result_array();\n }", "public function show($id)\n {\n $order = Order::find($id);\n if ($order == null) {\n return response()->json([\n 'success' => false,\n 'message' => 'Data not found or not exist.',\n 'data' => $order,\n 'errors' => true\n ],404);\n }\n\n return response()->json([\n 'success' => true,\n 'message' => 'Single order data.',\n 'data' => $order,\n 'errors' => false\n ],200);\n\n }", "public function getInvoiceOrder();", "public function printOrder($id)\n {\n $order = Order::findOrFail($id);\n return view('user.admin.order.print-order',[\n 'order' => $order\n ]);\n }", "protected function searchOrderById($id)\n {\n return $this->_rootElement->find(sprintf($this->itemOrder, $id), Locator::SELECTOR_XPATH);\n }", "public function getorderitembyid($orderid){\n\t\t$this->db->where('OrdId', $orderid);\n\t\t$this->db->select('LintItemId,OrdId,ItemId,ItemName,ItemEdition,ItemAuther,ItemQuantity,ItemRetailPrice,ItemSellingPrice,ItemDiscount,ProductThumbImage,ProductLanguage');\n\t\t$this->db->from('tbl_order_lineitems');\n\t\t$this->db->join('tbl_products', 'tbl_products.ProductId = tbl_order_lineitems.ItemId', 'inner');\n\t\t$query=$this->db->get();\n\t\treturn $query->result();\n\t\t// $query=$this->db->get('tbl_order_lineitems');\n\t\t// return $query->result();\n\t}", "public function get_details($id)\n {\n $q=$this->db->where(['dist_id'=>$id])->get('distributor');\n\t\treturn $res=$q->result_array()[0];\t\n }", "public function getordersummerydetailsbyorderid($orderid){\n\t\t$this->db->where('tbl_order_summery.OrderId', $orderid);\n\t\t$query=$this->db->get('tbl_order_summery');\n\t\treturn $query->result();\n\t}" ]
[ "0.7886741", "0.76806414", "0.7613672", "0.7541203", "0.74304414", "0.7361409", "0.7361409", "0.7340672", "0.72644883", "0.721528", "0.7184562", "0.7168733", "0.71488214", "0.71124315", "0.70270896", "0.7017117", "0.7009739", "0.6971482", "0.6952839", "0.6930748", "0.69277656", "0.69273627", "0.6909778", "0.69085884", "0.69013166", "0.68805313", "0.6857867", "0.685314", "0.68235373", "0.6810432", "0.6801517", "0.6801262", "0.6799018", "0.67864287", "0.6779427", "0.6761477", "0.6754194", "0.6751059", "0.67491853", "0.67409027", "0.6716507", "0.66751826", "0.6662758", "0.6652783", "0.6650209", "0.6649107", "0.66376495", "0.65952414", "0.6590334", "0.658949", "0.6585771", "0.6583605", "0.6581062", "0.65764475", "0.657513", "0.6567882", "0.65639544", "0.65630174", "0.6540516", "0.653755", "0.6534934", "0.65321887", "0.6531224", "0.65210223", "0.65168095", "0.6510774", "0.6510587", "0.64888096", "0.6478836", "0.64669114", "0.64504695", "0.64446163", "0.643843", "0.64278615", "0.6425137", "0.6420579", "0.64142966", "0.6408145", "0.6404156", "0.6401176", "0.6378655", "0.6372123", "0.63646764", "0.63644415", "0.6363852", "0.63634145", "0.6355629", "0.63403696", "0.6338356", "0.6333113", "0.6332042", "0.6328273", "0.6314281", "0.62928295", "0.62865883", "0.6283943", "0.6278993", "0.62762576", "0.6274189", "0.6273694" ]
0.724831
9
Get Detail by Delivery Order ID
public function GetDetailByDOID($delivery_order_id) { $data = $this->deliveryOrderDetail::find($delivery_order_id)->get(); if (!empty($data)) { return $data; } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function GetDetailByID($delivery_order_detail_id)\n {\n return $this->deliveryOrderDetail::find($delivery_order_detail_id);\n }", "function getOrderDetails($id)\n {\n }", "public function getDetailById($id)\r\n {\r\n $condition = [\r\n 'orderId' => $id\r\n ];\r\n return $this->getDetail($condition);\r\n }", "public function getDetails($id){\n return $this->slc(\"*\", \"orders\", array(\"order_id\" => $id), TRUE)[0];\n }", "function getOrderDetails($id)\n {\n $dataService = new OrderDataService();\n\n return $dataService->getOrderDetails($id);\n }", "public function getDetail($id)\n {\n $order = Orders::find($id);\n\n if(!empty($order)){\n\n $orderarray = $order->toArray();\n $order = $order->formatorder($orderarray);\n\n $order['user'] = user::where('_id',\"=\",$order['user'])->first(['name','email','mobile_number','status','created_at','address']);\n $order['user'] = $order['user']->toArray();\n\n $order['dateslug'] = date(\"F d, Y H:ia\",strtotime('+8 hours',strtotime($order['created_at'])));\n $order['status'] = 0;\n $order['timeslot']['dateslug'] = date(\"F d, Y\",$order['timeslot']['datekey']);\n return response($order,200);\n\n }\n\n return response(['success'=>false,\"message\"=>\"Order not found\"],400); \n \n }", "public function details($id) {\n\n $order = Order::find($id);\n $delivery_status_id = (isset($order->delivery_status_id)) ? (int)$order->delivery_status_id : '';\n $delivery = $this->delivery_status($delivery_status_id);\n \n \\ViewHelper::setPageDetails('Storefronts | Order View', 'Order #' . $order->invoice_number, '');\n\n View::share('delivery_status', $delivery);\n View::share('order', $order);\n\n $delivery_modal_info = $this->delivery_status_modal_info($delivery_status_id);\n\n View::share('modals_info', $delivery_modal_info['info']);\n View::share('modals_btn', $delivery_modal_info['btn']);\n\n \treturn view('backoffice.orders.details');\n \n }", "public function getOrderDetailId()\n {\n return $this->order_detail_id;\n }", "public function actionOrderDetail($id)\n {\n $order = Order::find()\n ->where(['id' => $id, 'customer_id' => $this->customer_id])\n ->andWhere(['<>', 'status_id', Order::STATUS_DRAFT])\n ->one();\n \n if ($order !== null) {\n return $order;\n }\n \n throw new NotFoundHttpException(\"Order transaction ({$id}) is not available.\");\n }", "protected function detail($id)\n {\n return Show::make($id, new Order(), function (Show $show) {\n// $show->field('id');\n $show->field('order_no');\n $show->field('user_id')->as(function ($value) {\n $user = \\App\\Models\\User::where('user_id', $value)->first();\n return \"{$user->name}\";\n });\n $show->field('address', '收货地址')->as(function ($addresses) {\n return $addresses['address'] . \" \" . $addresses['zip'] . \" \" . $addresses['contact_name'] . \" \" . $addresses['contact_phone'];\n });\n $show->field('total_amount');\n// $show->field('remark');\n $show->field('paid_at');\n $show->field('payment_method');\n $show->field('payment_no');\n $show->field('refund_status')->as(function ($value) {\n return \\App\\Models\\Order::$refundStatusMap[$value];\n });\n $show->field('refund_no');\n// $show->field('closed');\n// $show->field('reviewed');\n $show->field('ship_status')->as(function ($value) {\n return \\App\\Models\\Order::$shipStatusMap[$value];\n });\n// $show->field('ship_data');\n// $show->field('extra');\n $show->field('created_at');\n// $show->field('updated_at');\n\n $show->disableDeleteButton();\n\n });\n }", "public function getOrderDelivery()\n {\n return $this->hasOne(Delivery::class, ['id' => 'order_delivery_id']);\n }", "function getDeliveryByOrderId($order_id) {\n\t\t\n\t\t$list = $this->getDeliveryListByOrderId($order_id);\n\t\t\n\t\t$delivery = $list[0];\n\t\t$delivery['value'] = $delivery['value_net'] + $delivery['vat'];\n\t\t\n\t\treturn $delivery;\n\t}", "public function orderDetail($order_id){\n $data = $this->order->getOrderById($order_id);\n return view('dashboard.order-detail', ['data' => $data, 'list_status' => $this->order->list_status]);\n }", "function getDeliveryListByOrderId($order_id) {\n\t\tif (!is_numeric($order_id)) {\n\t\t\tmsg(\"ecommerce_delivery.getDeliveryListByOrderId(): order_id is not numeric\", 'error', 1);\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$list = $this->listing(\"order_id = $order_id\");\n\t\tforeach ($list as $key=>$val) {\n\t\t\t$list[$key]['carrier_detail'] = $this->getCarrierDetail($val['carrier_id']);\n\t\t}\n\t\treturn $list;\n\t}", "public function getOrderDetail()\n {\n return $this->orderDetail;\n }", "public function getDetails($id, $order){\r\n $so = $this->soap->GetStandingOrderDetails($this->licence, $id, $order);\r\n return isset($so)? $so->orderdetails: array( 0 => array('ORDERNO' => -1));\r\n }", "public function getDeliveryOrder();", "public function get_addon_delivery($id)\n {\n $this->db->select('this_delivery, product_code, description, unit_price');\n $this->db->from('sales_order_medication_deliveries');\n $this->db->where(['delivery_id' => $id]);\n $this->db->join('sales_order_medications', 'sales_order_medications.id = medication_order_item_id');\n $this->db->join('inventory_medications', 'inventory_medications.id = medication_id');\n return $this->db->get()->result_array();\n }", "public function show($order_id)\n {\n //\n $obj = DB::table('orders')\n ->select('orders.id', 'registers.name as register','first_name', 'last_name', 'customer_type', \n 'delivery_address', 'balance', 'orders.total', 'discount', 'orders.sales_tax', 'orders.shipping',\n 'orders.status', 'orders.fulfillment', 'orders.created_at')\n ->join('transactions', 'orders.id', '=', 'transactions.order_id')\n ->join('registers', 'transactions.register_id', '=', 'registers.id')\n ->join('profile_patients', 'profile_patients.user_id', '=', 'orders.user_id')\n ->where('orders.id', $order_id)\n ->get();\n\n $order['order'] = $obj[0];\n $order['items'] = DB::table('order_items')\n ->select('qty', 'name', 'tax')\n ->join('products', 'products.id', '=', 'order_items.product_id')\n ->where('order_items.order_id', $order_id)\n ->get();\n return $order;\n }", "public static function getInfo( $id )\n {\n return OrderInfoGetter :: get( $id );\n }", "public function getOrderDetails($order_id){\n\t \n\t \t\t$this->db->select(\"CO.*, C.comp_name, CF.firm_name\");\n\t\t\t$this->db->from(\"client_orders AS CO\");\n\t\t\t$this->db->join(\"clients AS C\", \"C.comp_id = CO.comp_id\");\n\t\t\t$this->db->join(\"company_firms AS CF \", \"CF.firm_id = CO.invoice_firm \");\n\t\t\t$this->db->where(\"CO.order_id\",$order_id);\n\t\t\tif($this->session->userdata('userrole') == 'Sales'){\n\t\t\t\t$this->db->where(\"CO.uid\",$this->session->userdata('userid'));\n\t\t\t}\n\t\t\t$query_order_details = $this->db->get();\n\t\t\t\n\t\t\t//echo $this->db->last_query();die;\n\t\t\tif($query_order_details->num_rows()>0)\n\t\t\t{\n\t\t\t\treturn $query_order_details->result_array();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn array();\n\t\t\t}\n\t \n\t }", "public function getById($orderlineId);", "public function show($id)\n {\n return Order::find($id);\n }", "public function show($id)\n {\n return Order::find($id);\n }", "public function order_details_data($order_id)\n\t{\t\n\t\t$CI =& get_instance();\n\t\t$CI->auth->check_admin_auth();\n\t\t$CI->load->library('Lorder');\n\t\t$content = $CI->lorder->order_details_data($order_id);\t\n\t\t$this->template->full_admin_html_view($content);\n\t}", "public function getDeliveryOrderDetailById(Request $request)\n {\n $deliveryOrderDetail = $this->deliveryOrderDetail::find($request->delivery_order_id);\n if ($deliveryOrderDetail == null) {\n $return = array (\n 'code' => 404,\n 'error' => true,\n 'message' => 'Data Tidak Ditemukan',\n );\n }else{\n $return = array (\n 'code' => 200,\n 'success' => true,\n 'data' => $deliveryOrderDetail,\n 'message' => 'Data Ditemukan',\n );\n }\n return $return;\n }", "public function actionDetail($id)\n\t{\n\t\t$model = $this->loadModel($id);\n\t\t$detail = new OrderDetail('search');\n\t\t$detail->orId = $id;\n\t\t$this->render('detail',array(\n\t\t\t'model'=>$model,'detail'=>$detail\n\t\t));\n\t}", "public function getThisOrderCityOfDelivery($order_id){\n \n $criteria = new CDbCriteria();\n $criteria->select = '*';\n $criteria->condition='id=:id';\n $criteria->params = array(':id'=>$order_id);\n $order= Order::model()->find($criteria);\n \n return $order['delivery_city_id'];\n }", "public function show($id)\n {\n return Order::findOrFail($id);\n }", "public function getDetail(int $id)\n {\n }", "public function orderDetails($id)\n {\n //dd($id);\n $orderId = $id;\n $getProducts = Products::get(); //sidebar\n $getLineItemInfo = OrderLineItem::where('order_id', $id)->get(); //sidebar\n $getCustomerInfo = OrderCustomerDetails::where('order_id', $id)->get(); //sidebar\n return view('shopify-app::tool.order-detail',compact('getProducts','getLineItemInfo','getCustomerInfo', 'orderId'));\n }", "public function show($id)\n {\n $delivery = $this->deliveryRepository->find($id);\n\n if (empty($delivery)) {\n Flash::error('Delivery not found');\n\n return redirect(route('deliveries.index'));\n }\n\n $deliveryTransID = Delivery::where('id', $id)->pluck('ref_no');\n\n $products = DB::table('incoming_delivery_details')\n ->join('incoming_delivery', 'incoming_delivery_details.ref_no', '=', 'incoming_delivery.ref_no')\n ->join('product', 'incoming_delivery_details.product_id', '=', 'product.id')\n ->where('incoming_delivery_details.ref_no', '=', $deliveryTransID)\n ->select('incoming_delivery.id as delivery_id', 'incoming_delivery.ref_no as delivery_transno', 'incoming_delivery.transac_date as delivery_transdate', 'incoming_delivery.supplier_id as supplier', 'incoming_delivery.total_prod_costs as delivery_ttl_cost', 'incoming_delivery.remarks as delivery_remarks', 'incoming_delivery_details.id as dlvrydtl_id', 'incoming_delivery_details.ref_no as dlvrydtl_refno', 'incoming_delivery_details.product_id as dlvrydtl_prodid', 'incoming_delivery_details.quantity as dlvrydtl_prodqty', 'incoming_delivery_details.buying_price as dlvrydtl_prodprc', 'incoming_delivery_details.total_cost as dlvrydtl_prdttl', 'product.id as prod_id', 'product.sku_barcode_id as prod_barcode', 'product.name as prod_name', 'product.unit_type as prod_unit', 'product.price as prod_prc')\n ->get();\n\n return view('deliveries.show', compact('products'))\n ->with('delivery', $delivery);\n }", "protected function detail($id)\n {\n $show = new Show(ScanRechargeOrder::findOrFail($id));\n\n $show->field('id', __('scan-recharge::order.id'));\n $show->field('scan_recharge_channel_id', __('scan-recharge::order.scan_recharge_channel_id'))\n ->as(function () {\n return $this->scan_recharge_channel->name ?? null;\n });\n $show->field('user_id', __('scan-recharge::order.user_id'))\n ->as(function () {\n return $this->user->username ?? null;\n });\n $show->field('amount', __('scan-recharge::order.amount'));\n $show->field('desc', __('scan-recharge::order.desc'));\n $show->field('reply', __('scan-recharge::order.reply'));\n $show->field('status', __('scan-recharge::order.status'))\n ->using(__('scan-recharge::order.status_value'));\n $show->field('created_at', __('admin.created_at'));\n $show->field('updated_at', __('admin.updated_at'));\n\n return $show;\n }", "function get_order_details_get()\n { \n $input = $this->get();\n \n if(!isset($input['id']) || $input['id'] == '') \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 $trip_data = $this->Common_model->getOrderDetails($input['id']);\n if($trip_data){\n $message = ['status' => TRUE,'message' => $this->lang->line('trip_details_found_success'),'data'=>$trip_data];\n $this->set_response($message, REST_Controller::HTTP_OK); // OK (200)\n }\n else{\n $message = ['status' => FALSE,'message' => $this->lang->line('trip_details_found_error')];\n $this->response($message, REST_Controller::HTTP_BAD_REQUEST); // BAD_REQUEST (400)\n }\n \n }\n }", "public function show($id)\n {\n $order=Order::find($id);\n\n if(is_null($order))\n {\n $response=array(\n 'status'=>0, \n 'msg'=>'Invalid Order ID',\n 'data'=>[]\n ); \n }\n else\n {\n $order_summary=array(\n 'table_code'=>Table::find($order->table_id)->code,\n 'sub_total'=>$order->sub_total,\n 'discount'=>$order->discount,\n 'vat'=>$order->vat,\n 'rounding_discount'=>$order->rounding_discount,\n 'net_total'=>$order->net_total,\n 'status'=>$order->status\n );\n\n $orderlines=array();\n foreach($order->menus as $menu)\n {\n if($menu->image!='')\n $image = asset('img/menus/'.$menu->image);\n else\n $image = null;\n\n $orderlines[]=array(\n 'menu_id'=>$menu->id,\n 'code'=>$menu->code,\n 'name'=>$menu->name,\n 'quantity'=>$menu->pivot->quantity,\n 'price'=>$menu->pivot->price,\n 'discount'=>$menu->pivot->discount,\n 'total'=>$menu->pivot->total,\n 'image'=>$image\n );\n }\n\n $response=array(\n 'status'=>1, \n 'msg'=>'Order Found!',\n 'data'=>['summary'=>$order_summary,'orderlines'=>$orderlines]\n );\n }\n\n return response()->json($response);\n }", "protected function detail($id)\n {\n $show = new Show(Order::findOrFail($id));\n\n $show->field('id', __('Id'));\n $show->field('order_id', __('Order id'));\n $show->field('customer_id', __('Customer id'));\n $show->field('address_id', __('Address id'));\n $show->field('expected_delivery_date', __('Expected delivery date'));\n $show->field('expected_pickup_date', __('Expected pickup date'));\n $show->field('actual_delivery_date', __('Actual delivery date'));\n $show->field('total', __('Total'));\n $show->field('discount', __('Discount'));\n $show->field('sub_total', __('Sub total'));\n $show->field('promo_id', __('Promo id'));\n $show->field('collected_by', __('Collected by'));\n $show->field('delivered_by', __('Delivered by'));\n $show->field('payment_mode', __('Payment mode'));\n $show->field('payment_status', __('Payment status'));\n $show->field('items', __('Items'));\n $show->field('status', __('Status'));\n $show->field('created_at', __('Created at'));\n $show->field('updated_at', __('Updated at'));\n\n return $show;\n }", "protected function detail($id)\n {\n $show = new Show(Order::findOrFail($id));\n\n $show->field('id', __('Id'));\n $show->field('no', __('No'));\n $show->field('user_id', __('User id'));\n $show->field('address', __('Address'));\n $show->field('total_amount', __('Total amount'));\n $show->field('remark', __('Remark'));\n $show->field('paid_at', __('Paid at'));\n $show->field('payment_method', __('Payment method'));\n $show->field('payment_no', __('Payment no'));\n $show->field('refund_status', __('Refund status'));\n $show->field('refund_no', __('Refund no'));\n $show->field('closed', __('Closed'));\n $show->field('reviewed', __('Reviewed'));\n $show->field('ship_status', __('Ship status'));\n $show->field('ship_data', __('Ship data'));\n $show->field('extra', __('Extra'));\n $show->field('created_at', __('Created at'));\n $show->field('updated_at', __('Updated at'));\n\n return $show;\n }", "public function getInfoPaymentByOrder($order_id)\n {\n $order = $this->_getOrder($order_id);\n $payment = $order->getPayment();\n $info_payments = [];\n $fields = [\n [\"field\" => \"cardholderName\", \"title\" => \"Card Holder Name: %1\"],\n [\"field\" => \"trunc_card\", \"title\" => \"Card Number: %1\"],\n [\"field\" => \"payment_method\", \"title\" => \"Payment Method: %1\"],\n [\"field\" => \"expiration_date\", \"title\" => \"Expiration Date: %1\"],\n [\"field\" => \"installments\", \"title\" => \"Installments: %1\"],\n [\"field\" => \"statement_descriptor\", \"title\" => \"Statement Descriptor: %1\"],\n [\"field\" => \"payment_id\", \"title\" => \"Payment id (Mercado Pago): %1\"],\n [\"field\" => \"status\", \"title\" => \"Payment Status: %1\"],\n [\"field\" => \"status_detail\", \"title\" => \"Payment Detail: %1\"],\n [\"field\" => \"activation_uri\", \"title\" => \"Generate Ticket\"],\n [\"field\" => \"payment_id_detail\", \"title\" => \"Mercado Pago Payment Id: %1\"],\n [\"field\" => \"id\", \"title\" => \"Collection Id: %1\"],\n ];\n\n foreach ($fields as $field) {\n if ($payment->getAdditionalInformation($field['field']) != \"\") {\n $text = __($field['title'], $payment->getAdditionalInformation($field['field']));\n $info_payments[$field['field']] = [\n \"text\" => $text,\n \"value\" => $payment->getAdditionalInformation($field['field'])\n ];\n }\n }\n\n if ($payment->getAdditionalInformation('payer_identification_type') != \"\") {\n $text = __($payment->getAdditionalInformation('payer_identification_type'));\n $info_payments[$payment->getAdditionalInformation('payer_identification_type')] = [\n \"text\" => $text . ': ' . $payment->getAdditionalInformation('payer_identification_number')\n ];\n }\n\n return $info_payments;\n }", "protected function detail($id)\n {\n $show = new Show(Order::findOrFail($id));\n\n\n\n return $show;\n }", "public function get_details($id)\n {\n $q=$this->db->where(['dist_id'=>$id])->get('distributor');\n\t\treturn $res=$q->result_array()[0];\t\n }", "public function getOrder(string $order_id): \\GDAX\\Types\\Response\\Authenticated\\Order;", "public function orderDetail($id)\n {\n //\n $total = 0;\n $order=Order::find($id);\n $order_details = DB::table('order_details')->where('order_id','=',$id)\n ->join('products', 'order_details.product_id', '=', 'products.id')\n ->join('prices', 'order_details.price_id', '=', 'prices.id')\n ->leftjoin('promotions','order_details.promotion_id','=','promotions.id')\n ->select('products.thumbnail','products.name', 'prices.price','order_details.quantity','promotions.discount')\n ->get();\n return view('orders.detail',compact('order_details','total'));\n }", "public function show($id)\n\t{\n\t\t$delivery = Delivery::find($id);\n\t\treturn !$delivery? Response::json(\"Error\", 400) : $delivery;\n\t}", "public function show($id)\n {\n $odetails = OrderDetails::where('order_id', $id)->get();\n $dish = Dish::where('dish_id', )\n }", "public function view_order_details($order_id)\n\t{\n $log=new Log(\"OrderDetailsRCV.log\");\n $query = $this->db->query(\"SELECT oc_po_order.*,\".DB_PREFIX.\"user.firstname,\".DB_PREFIX.\"user.lastname\n\t\t\t\tFROM oc_po_order\n\t\t\t\t\tLEFT JOIN \".DB_PREFIX.\"user\n\t\t\t\t\t\tON \".DB_PREFIX.\"user.user_id = oc_po_order.user_id\n\t\t\t\t\t\t\tWHERE id = \" . $order_id . \" AND delete_bit = \" . 1);\n $log->write($query);\n $order_info = $query->row;\n\t\t//ON (oc_po_receive_details.product_id = oc_po_product.id)\n\t\t$query = $this->db->query(\"SELECT\n\t\toc_po_product.*,oc_po_receive_details.quantity as rd_quantity,oc_po_receive_details.price,oc_po_supplier.first_name,oc_po_supplier.last_name,oc_po_supplier.id as supplier_id,oc_po_receive_details.order_id\n\t\tFROM\n\t\t\toc_po_receive_details\n\t\tINNER JOIN oc_po_product \n\t\t\tON (oc_po_receive_details.order_id = oc_po_product.order_id)\n\t\tLEFT JOIN oc_po_supplier \n\t\t\tON (oc_po_receive_details.supplier_id = oc_po_supplier.id)\n\t\t\t\tWHERE (oc_po_receive_details.order_id =\".$order_id.\")\");\n $log->write($query);\n\tif($this->db->countAffected() > 0)\n\t{\n\t\t$products = $query->rows;\n\t\t$quantities = array();\n\t\t$all_quantities = array();\n\t\t$prices = array();\n\t\t$all_prices = array();\n\t\t$suppliers = array();\n\t\t$all_suppliers = array();\n\t\t$supplier_names = array();\n\t\t$all_supplier_names = array();\n\t\t$index = 0;\n\t\t$index1 = 0;\n\t\tfor($i =0; $i<count($products); $i++)\n\t\t{\n\t\t\tif($products[$i] != \"\")\n\t\t\t{\n\t\t\t\tfor($j = 0; $j<count($products); $j++)\n\t\t\t\t{\n\t\t\t\t\tif($products[$j] != \"\")\n\t\t\t\t\t{\n\t\t\t\t\t\tif($products[$i]['id'] == $products[$j]['id'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$quantities[$index] = $products[$j]['rd_quantity'];\n\t\t\t\t\t\t\t$supplier_names[$index] = $products[$j]['first_name'] .\" \". $products[$j]['last_name'];\n\t\t\t\t\t\t\t$suppliers[$index] = $products[$j]['supplier_id'];\n\t\t\t\t\t\t\t$prices[$index] = $products[$j]['price'];\n\t\t\t\t\t\t\tif($j!=$i)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$products[$j] = \"\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$index++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$index = 0;\n\t\t\t\t$all_quantities[$index1] = $quantities;\n\t\t\t\t$all_suppliers[$index1] = $suppliers;\n\t\t\t\t$all_prices[$index1] = $prices;\n\t\t\t\t$all_supplier_names[$index1] = $supplier_names;\n\t\t\t\tunset($quantities);\n\t\t\t\tunset($suppliers);\n\t\t\t\tunset($prices);\n\t\t\t\tunset($supplier_names);\n\t\t\t\t$quantities = array();\n\t\t\t\t$suppliers = array();\n\t\t\t\t$prices = array();\n\t\t\t\t$supplier_names = array();\n\t\t\t\t$index1++;\n\t\t\t}\n\t\t}\n\t\t$products = array_values(array_filter($products));\n\t\tfor($i = 0; $i<count($products); $i++)\n\t\t{\n\t\t\tunset($products[$i]['rd_quantity']);\n\t\t\tunset($products[$i]['first_name']);\n\t\t\tunset($products[$i]['last_name']);\n\t\t\t$products[$i]['quantities'] = $all_quantities[$i];\n\t\t\t$products[$i]['suppliers'] = $all_suppliers[$i];\n\t\t\t$products[$i]['prices'] = $all_prices[$i];\n\t\t\t$products[$i]['supplier_names'] = $all_supplier_names[$i];\n\t\t}\n\t}\n\telse\n\t{\n\t\t$query = $this->db->query(\"SELECT * FROM oc_po_product WHERE order_id = \" . $order_info['id']);\n\t\t$products = $query->rows;\n\t}\n\t\t$i = 0;\n\t\tforeach($products as $product)\n\t\t{\n\t\t\t$query = $this->db->query(\"SELECT * FROM oc_po_attribute_group WHERE product_id = \". $product['id']);\n\t\t\t$attribute_groups[$i] = $query->rows;\n\t\t\t$i++;\n\t\t}\n\t\t\n\t\t$i = 0;\n\t\tforeach($attribute_groups as $attribute_group)\n\t\t{\n\t\t\tfor($j = 0; $j<count($attribute_group);$j++)\n\t\t\t{\n\t\t\t\t$query = $this->db->query(\"SELECT * FROM oc_po_attribute_category WHERE attribute_group_id = \". $attribute_group[$j]['id']);\n\t\t\t\t$attribute_categories[$i] = $query->row;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\t\tfor($i=0;$i<count($products); $i++)\n\t\t{\n\t\t\tfor($j=0; $j<count($attribute_groups[$i]);$j++)\n\t\t\t{\n\t\t\t\t$products[$i]['attribute_groups'][$j] = $attribute_groups[$i][$j]['name'];\n\t\t\t}\n\t\t}\n\t\t$start_loop = 0;\n\t\t//$attribute_categories = array_values(array_filter($attribute_categories));\n\t\t//print_r($attribute_categories);\n\t\t//exit;\n\t\tfor($i=0; $i<count($products); $i++)\n\t\t{\n\t\t\tfor($j=$start_loop; $j<($start_loop + count($products[$i]['attribute_groups']));$j++)\n\t\t\t{\n\t\t\t\t$products[$i]['attribute_category'][$j] = $attribute_categories[$j]['name'];\n\t\t\t}\n\t\t\t$start_loop = $j;\n\t\t}\n\t\t$order_information['products'] = $products;\n\t\t$order_information['order_info'] = $order_info;\n\t\treturn $order_information;\n\t}", "public function getJSONDeliveryDetails_View($id)\n {\n sqlsrv_configure('WarningsReturnAsErrors', 0);\n $this->connDB = $this->load->database('dbATPIDeliver',true);\n $query = $this->connDB->query(\"EXECUTE [sp_DeliverDetails_Get] $id\");\n //$this->connDB->close();\n\n return $query;\n }", "public function testGetOrderDetail(){\n \t\n \tPayU::$apiLogin = PayUTestUtil::API_LOGIN;\n \tPayU::$apiKey = PayUTestUtil::API_KEY;\n \t\n \tEnvironment::setReportsCustomUrl(PayUTestUtil::REPORTS_CUSTOM_URL);\n \t\n \n \t$authorizationResponse = PayUTestUtil::processTransaction(TransactionType::AUTHORIZATION_AND_CAPTURE, '*');\n \t\n \t$parameters = array(\n \t\t\tPayUParameters::ORDER_ID => $authorizationResponse->transactionResponse->orderId,\n \t);\n \t\n \t$response = PayUReports::getOrderDetail($parameters);\n \t\n \t$this->assertNotNull($response);\n \t$this->assertEquals($authorizationResponse->transactionResponse->orderId, $response->id);\n \t \n }", "public function getOrderDetailsByOrderId($orderId)\n {\n $sql = <<<'EOT'\nSELECT\n `d`.`id` AS `orderdetailsID`,\n `d`.`orderID` AS `orderID`,\n `d`.`ordernumber`,\n `d`.`articleID`,\n `d`.`articleordernumber`,\n `d`.`price` AS `price`,\n `d`.`quantity` AS `quantity`,\n `d`.`price`*`d`.`quantity` AS `invoice`,\n `d`.`name`,\n `d`.`status`,\n `d`.`shipped`,\n `d`.`shippedgroup`,\n `d`.`releasedate`,\n `d`.`modus`,\n `d`.`esdarticle`,\n `d`.`taxID`,\n `t`.`tax`,\n `d`.`tax_rate`,\n `d`.`esdarticle` AS `esd`\nFROM\n `s_order_details` AS `d`\nLEFT JOIN\n `s_core_tax` AS `t`\nON\n `t`.`id` = `d`.`taxID`\nWHERE\n `d`.`orderID` = :orderId\nORDER BY\n `orderdetailsID` ASC\nEOT;\n\n return $this->db->fetchAll($sql, ['orderId' => $orderId]);\n }", "public function getOrderById($order_id)\n {\n $client = $this->httpClientFactory->create();\n $client->setUri($this->chronos_url.\"orders/$order_id/detail/\");\n $client->setMethod(\\Zend_Http_Client::GET);\n $client->setHeaders([\n 'Content-Type: application/json', \n 'Accept: application/json',\n \"Authorization: Token $this->token\"\n ]);\n try {\n $response = $client->request();\n $body = $response->getBody();\n $string = json_decode(json_encode($body),true);\n $order_data=json_decode($string);\n \n return $order_data;\n } catch (\\Zend_Http_Client_Exception $e) {\n $this->logger->addInfo('Chronos order save helper', [\"Get order error\"=>$e->getMessage()]);\n return false;\n }\n }", "public function testGetOrderDetailWithInvalidId(){\n \t \n \tPayU::$apiLogin = PayUTestUtil::API_LOGIN;\n \tPayU::$apiKey = PayUTestUtil::API_KEY;\n \t \n \tEnvironment::setReportsCustomUrl(PayUTestUtil::REPORTS_CUSTOM_URL);\n \n \t$parameters = array(\n \t\t\tPayUParameters::ORDER_ID => '123111123',\n \t);\n \t \n \t$response = PayUReports::getOrderDetail($parameters);\n }", "function getOrderPurchaseDetails($order_id)\n\t\t{\n\t\t\t//get order details\n\t\t\t$orders = $this->_BLL_obj->manage_content->getValue_where('order_info', '*', 'order_id', $order_id);\n\t\t\t$user_id = $orders[0]['user_id'];\n\t\t\t//get product details from order id\n\t\t\t$order_details = $this->_BLL_obj->manage_content->getValue_where('product_inventory_info', '*', 'order_id', $order_id);\n\t\t\tif(!empty($order_details[0]))\n\t\t\t{\n\t\t\t\t//total_overridng fee distributed\n\t\t\t\t$dis_over = 0;\n\t\t\t\t$user_level = 0;\n\t\t\t\t\n\t\t\t\tforeach($order_details as $order)\n\t\t\t\t{\n\t\t\t\t\t/* code for distribute overriding fee */\n\t\t\t\t\t//get transaction id for overriding fee\n\t\t\t\t\t$over_id = uniqid('trans');\n\t\t\t\t\t//calling overriding fee function\n\t\t\t\t\t$distributed_overriding = $this->distributeOverridingFee($user_id, $order['price'], $dis_over, $user_level, $over_id,$order_id);\n\t\t\t\t\tif($distributed_overriding != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t//insert values to fee transaction info table\n\t\t\t\t\t\t$insert_over = $this->_BLL_obj->manage_content->insertValue('fee_transaction_info', array('transaction_id','order_id','product_id','fee_type'), array($over_id,$order_id,$order['product_id'],'OF'));\n\t\t\t\t\t\t//new system value\n\t\t\t\t\t\t$new_system_value = $this->getSystemMoneyValue() - $distributed_overriding;\n\t\t\t\t\t\t//insert distributed amount to system money info\n\t\t\t\t\t\t$insert_dist_amount = $this->_BLL_obj->manage_content->insertValue('system_money_info', array('specification','debit','system_balance'), array($over_id,$distributed_overriding,$new_system_value));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t/* code for personal commision calculation */\n\t\t\t\t\t//get transaction id for personal comm calculation\n\t\t\t\t\t$per_id = uniqid('trans');\n\t\t\t\t\t//calling personal commision function\n\t\t\t\t\t$per_comm = $this->calculatePersonalCommision($user_id, $order['price'], $per_id,$order_id);\n\t\t\t\t\t//checking for non empty personal commision\n\t\t\t\t\tif($per_comm != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t//insert values to fee transaction info table\n\t\t\t\t\t\t$insert_personal = $this->_BLL_obj->manage_content->insertValue('fee_transaction_info', array('transaction_id','order_id','product_id','fee_type'), array($per_id,$order_id,$order['product_id'],'PC'));\n\t\t\t\t\t\t//new system value\n\t\t\t\t\t\t$new_system_value_per = $this->getSystemMoneyValue() - $per_comm;\n\t\t\t\t\t\t//insert distributed amount to system money info\n\t\t\t\t\t\t$insert_per_amount = $this->_BLL_obj->manage_content->insertValue('system_money_info', array('specification','debit','system_balance'), array($per_id,$per_comm,$new_system_value_per));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t/* code for point value calculation */\n\t\t\t\t\t//get transaction id for point value distribution\n\t\t\t\t\t$pv_id = uniqid('trans');\n\t\t\t\t\t//get product details\n\t\t\t\t\t$product_details = $this->_BLL_obj->manage_content->getValue_where('product_info', '*', 'product_id', $order['product_id']);\n\t\t\t\t\t//total point value\n\t\t\t\t\t$total_pv = $product_details[0]['point_value'] * $order['quantity'];\n\t\t\t\t\t//insert values to fee transaction info table\n\t\t\t\t\t$insert_point = $this->_BLL_obj->manage_content->insertValue('fee_transaction_info', array('transaction_id','order_id','product_id','fee_type'), array($pv_id,$order_id,$order['product_id'],'PV'));\n\t\t\t\t\t//insert pv to system\n\t\t\t\t\t$system_pv = $this->insertSystemPV($pv_id, $total_pv);\n\t\t\t\t\t//calling point value distributive function\n\t\t\t\t\t$this->distributePointValue($user_id, $total_pv, $pv_id, $order_id);\n\t\t\t\t\t\n\t\t\t\t\t/* code for member level upgradation of user and their parent */\n\t\t\t\t\t//calling fucntion for it\n\t\t\t\t\t$this->checkingLevelOfUserAndParent($user_id);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function getOrderInfoById($orderId)\n {\n $ordersQuery = DB::table('orders')\n ->leftJoin(\n DB::raw('(SELECT locations.id, locations.full_address, locations.longitude, locations.latitude FROM locations) as location_destination'),\n 'location_destination.id',\n '=',\n 'orders.location_destination_id'\n )\n ->leftJoin(\n DB::raw('(SELECT locations.id, locations.full_address, locations.longitude, locations.latitude FROM locations) as location_arrival'),\n 'location_arrival.id',\n '=',\n 'orders.location_arrival_id'\n )\n ->leftJoin('vehicle', 'orders.vehicle_id', '=', 'vehicle.id')\n ->where([\n ['orders.id', '=', $orderId],\n ['orders.del_flag', '=', '0'],\n ['vehicle.del_flag', '=', '0']\n ]);\n $order = $ordersQuery->get([\n 'orders.id as order_id', 'order_code', 'orders.status as status',\n 'orders.ETD_date', 'orders.ETD_time', 'location_destination.full_address as location_destination', 'location_destination.longitude as location_destination_longitude', 'location_destination.latitude as location_destination_latitude',\n 'orders.ETA_date', 'orders.ETA_time', 'location_arrival.full_address as location_arrival', 'location_arrival.longitude as location_arrival_longitude', 'location_arrival.latitude as location_arrival_latitude',\n 'vehicle.latitude as current_latitude', 'vehicle.longitude as current_longitude', 'vehicle.current_location as current_location'\n ])->first();\n return $order;\n }", "public function show($id)\n {\n //\n $this->AuthLoginCheck();\n $order = Order::find($id);\n $orders = Customer::find($order->customer_id)->order_one->toArray();\n $order_detail = Order::find($id)->order_detail->toArray();\n $customer = Customer::where('id',$order->id)->first();\n $shipping = Shipping::find($order->shipping_id);\n // echo '<pre>';\n // var_dump($customer);\n // echo '</pre>';\n \n return view('admin.manage.order_detail',compact('orders','order_detail','customer','shipping'));\n }", "private function getOrderDetails($order_id)\n {\n $order_id = ctype_digit($order_id) ? $order_id : null;\n if($order_id != null)\n {\n try\n {\n $this->db->openConnection();\n $connection = $this->db->getConnection();\n $statement = $connection->prepare(\"CALL GetOrderById(:order_id)\");\n $statement->bindParam(\":order_id\", $order_id, PDO::PARAM_INT|PDO::PARAM_INPUT_OUTPUT);\n if($statement->execute())\n {\n $this->result = $statement->fetchAll(PDO::FETCH_ASSOC);\n return true;\n }\n } catch (PDOException $ex)\n {\n $this->db->showError($ex, false);\n } finally\n {\n $this->db->closeConnection();\n }\n }\n }", "public function order_details($id){\n $user = Auth::id(); \n $order = Order::where(['slug' => $id,'user_id' => $user])->first();\n if($order){\n return view('order-details', compact('order'));\n }\n return view('errors.404');\n }", "public function read($order_id) {\n\n global $user;\n\n //watchdog('musth_restws', 'W7D001 5DXS OrderResourceController start read (!i) (!p) ',\n // array('!i' => print_r($order_id, true),\n // '!p' => print_r('', true)),\n // WATCHDOG_DEBUG);\n\n $order_as_array = entity_load('commerce_order', array($order_id));\n $order = $order_as_array[$order_id];\n\n // The order total, which is in the field commerce_order_total, is calculated\n // automatically when the order is refreshed, which happens at least when we\n // call the line item api to get all the line items of an order\n\n // Refreshing the order in case any product changed its price or there are other\n // changes to take care of\n\n // Since we refresh the order here, there is no need to do it when we load\n // line items. Just call the order query api first and then the line item query api\n\n if ($order->status == 'cart')\n commerce_cart_order_refresh($order);\n\n $order_wrapper = entity_metadata_wrapper('commerce_order', $order);\n\n //watchdog('musth_restws', 'W7D001 71788 kkk OrderResourceController read (!i) (!p) ',\n // array('!i' => print_r('', true),\n // '!p' => print_r('', true)),\n // WATCHDOG_DEBUG);\n\n if (isset($order->commerce_customer_billing[LANGUAGE_NONE]))\n $customer_profile_id = $order->commerce_customer_billing[LANGUAGE_NONE][0]['profile_id'];\n else\n $customer_profile_id = 0;\n\n if ($user->uid) {\n // For logged-in users we can send back the email address\n\n $user_email = $order->mail;\n\n } else {\n // For anonymous users we can't\n\n $user_email = 'Cant send you the email address for privacy';\n }\n\n $order_to_return = new Order($order->order_id,\n $order->order_number,\n $order->uid,\n $user_email,\n $customer_profile_id,\n $order->status,\n $order_wrapper->commerce_order_total->amount->value(),\n $order_wrapper->commerce_order_total->currency_code->value(),\n $order->created,\n $order->changed\n );\n\n //watchdog('musth_restws', 'W7D001 7171 OrderResourceController read (!i) (!p) ',\n // array('!i' => print_r('', true),\n // '!p' => print_r('', true)),\n // WATCHDOG_DEBUG);\n\n // Sending back the Order object\n\n return $order_to_return;\n }", "public function show($id)\n {\n return OrderService::getOrderById($id);\n }", "public function show($id)\n\t{\n\t\t$orderdelivery = Orderdelivery::findOrFail($id);\n\n\t\treturn View::make('orderdeliveries.show', compact('orderdelivery'));\n\t}", "public function getordersummerydetailsbyorderid($orderid){\n\t\t$this->db->where('tbl_order_summery.OrderId', $orderid);\n\t\t$query=$this->db->get('tbl_order_summery');\n\t\treturn $query->result();\n\t}", "protected function detail($id)\n {\n $show = new Show(Order::findOrFail($id));\n\n $show->id('Id');\n $show->no('No');\n $show->user_id('User id');\n $show->address('Address');\n $show->total_amount('Total amount');\n $show->remark('Remark');\n $show->paid_at('Paid at');\n $show->payment_method('Payment method');\n $show->payment_no('Payment no');\n $show->refund_status('Refund status');\n $show->refund_no('Refund no');\n $show->closed('Closed');\n $show->reviewed('Reviewed');\n $show->ship_status('Ship status');\n $show->ship_data('Ship data');\n $show->extra('Extra');\n $show->created_at('Created at');\n $show->updated_at('Updated at');\n\n return $show;\n }", "public function show($id)\n {\n // $user = auth()->user();\n $Order = Order::find($id);\n\n\n if (is_null($Order)) {\n return response()->json([\"message\" => \"Order not found\"], 404);\n }\n $One_Order = Order::where('id',$id)->get();\n\n return response()->json([\"message\" => \"Order retrievd successfully\", 'data' => $One_Order, ], 200); \n }", "public function getOrderById($orderId)\n {\n }", "public function show($id)\n {\n $order = Order::find($id);\n $order_detail = Order_detail::where('order_id',$id)->get();\n return view('backend.order.detail',compact('order','order_detail')); \n }", "public function get($id)\n {\n header('Access-Control-Allow-Origin: *'); \n $order = Order::find($id);\n \n return $order;\n }", "public function order_details() {\n return $this->belongsTo(OrderDetail::class, 'product_id', 'id');\n }", "protected function detail($id)\n {\n $show = new Show(TaskOrder::findOrFail($id));\n\n $show->id('ID');\n $show->eid('快递单号');\n $show->sname('客服名称');\n $show->store('快递网点');\n $show->etype('快递公司');\n $show->created_at('Created at');\n $show->updated_at('Updated at');\n\n return $show;\n }", "public function getDeliveryId()\n {\n return $this->deliveryId;\n }", "public function getDeliveryId()\n {\n return $this->deliveryId;\n }", "protected function detail($id)\n {\n $show = new Show(Order::findOrFail($id));\n\n $show->field('id', __('Id'));\n $show->field('currency', __('Currency'));\n $show->field('amount', __('Amount'));\n $show->field('state', __('State'));\n $show->field('game_id', __('Game id'));\n $show->field('user_id', __('User id'));\n $show->field('product_id', __('Product id'));\n $show->field('product_name', __('Product name'));\n $show->field('cp_order_id', __('Cp order id'));\n $show->field('callback_url', __('Callback url'));\n $show->field('callback_info', __('Callback info'));\n $show->field('created_at', __('Created at'));\n $show->field('updated_at', __('Updated at'));\n\n return $show;\n }", "public function get_order( $order_id ) {\n\t\treturn $this->request( \"orders/{$order_id}\" );\n\t}", "public function getIdDelivery()\n {\n return $this->idDelivery;\n }", "public function ItemOnDODetail($params)\n {\n return $this->deliveryOrderDetail::where($params)->first() == null ? true : $this->deliveryOrderDetail::where($params)->first(); \n }", "public function getOrderDetails()\n {\n return Orders::getOrderdetails($this->getOrderId());\n }", "public function show($id)\n {\n //\n // // dd($id);\n // $data = ORDERDETAIL::find($id);\n\n // dd($data);\n // $data = ORDERDETAIL::find($id);\n $data = DB::table('orderdetail')->where('oid',$id)->first();\n\n return view('admin.Orderdetail',compact('data'));\n }", "public function deliveryOrder()\n {\n return $this->belongsTo(DeliveryOrder::class);\n }", "protected function detail($id)\n {\n $show = new Show(BoxOrder::findOrFail($id));\n\n $show->panel()->tools(function ($tools) {\n $tools->disableEdit();\n });\n\n $show->id('ID');\n $show->sn('订单号');\n $show->total('奖励金')->as(function ($total) {\n return $total == 0 ? '奖励次数限制' : $total;\n });\n $show->created_at('投递时间');\n $show->image_proof('图片凭证')->image();\n\n $show->user('投递用户信息', function ($user) {\n /*禁用*/\n $user->panel()->tools(function ($tools) {\n $tools->disableList();\n $tools->disableEdit();\n $tools->disableDelete();\n });\n\n $user->field('id', 'ID');\n $user->field('avatar', '头像')->image('', 120);\n $user->field('name', '昵称');\n $user->field('gender', '性别');\n $user->field('phone', '手机号');\n $user->field('money', '奖励金');\n $user->field('frozen_money', '冻结金额');\n $user->field('total_client_order_money', '累计投递订单金额');\n $user->field('total_client_order_count', '累计投递订单次数');\n });\n\n\n return $show;\n }", "public function view_order_details_mo($order_id)\n\t{\n $log=new Log(\"OrderDetailsRcvMo.log\");\n\t\t$query = $this->db->query(\"SELECT oc_po_order.*,\".DB_PREFIX.\"user.firstname,\".DB_PREFIX.\"user.lastname\n\t\t\t\tFROM oc_po_order\n\t\t\t\t\tLEFT JOIN \".DB_PREFIX.\"user\n\t\t\t\t\t\tON \".DB_PREFIX.\"user.user_id = oc_po_order.user_id\n\t\t\t\t\t\t\tWHERE id = \" . $order_id . \" AND delete_bit = \" . 1);\n $log->write($query);\n\t\t$order_info = $query->row;\n\t\t//ON (oc_po_receive_details.product_id = oc_po_product.id)\n $allprod=\"SELECT\n\t\toc_po_product.*,oc_po_receive_details.quantity as rd_quantity,oc_po_receive_details.price,oc_po_supplier.first_name,oc_po_supplier.last_name,oc_po_supplier.id as supplier_id,oc_po_receive_details.order_id\n\t\tFROM\n\t\t\toc_po_receive_details\n\t\tINNER JOIN oc_po_product \n\t\t\tON (oc_po_receive_details.order_id = oc_po_product.order_id)\n\t\tLEFT JOIN oc_po_supplier \n\t\t\tON (oc_po_receive_details.supplier_id = oc_po_supplier.id)\n\t\t\t\tWHERE oc_po_product.item_status <> 0 AND (oc_po_receive_details.order_id =\".$order_id.\")\";\n\t\t$log->write($allprod);\n $query = $this->db->query($allprod);\n \n $log->write($query);\n\tif($this->db->countAffected() > 0)\n\t{\n\t\t$products = $query->rows;\n\t\t$quantities = array();\n\t\t$all_quantities = array();\n\t\t$prices = array();\n\t\t$all_prices = array();\n\t\t$suppliers = array();\n\t\t$all_suppliers = array();\n\t\t$supplier_names = array();\n\t\t$all_supplier_names = array();\n\t\t$index = 0;\n\t\t$index1 = 0;\n\t\tfor($i =0; $i<count($products); $i++)\n\t\t{\n\t\t\tif($products[$i] != \"\")\n\t\t\t{\n\t\t\t\tfor($j = 0; $j<count($products); $j++)\n\t\t\t\t{\n\t\t\t\t\tif($products[$j] != \"\")\n\t\t\t\t\t{\n\t\t\t\t\t\tif($products[$i]['id'] == $products[$j]['id'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$quantities[$index] = $products[$j]['rd_quantity'];\n\t\t\t\t\t\t\t$supplier_names[$index] = $products[$j]['first_name'] .\" \". $products[$j]['last_name'];\n\t\t\t\t\t\t\t$suppliers[$index] = $products[$j]['supplier_id'];\n\t\t\t\t\t\t\t$prices[$index] = $products[$j]['price'];\n\t\t\t\t\t\t\tif($j!=$i)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$products[$j] = \"\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$index++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$index = 0;\n\t\t\t\t$all_quantities[$index1] = $quantities;\n\t\t\t\t$all_suppliers[$index1] = $suppliers;\n\t\t\t\t$all_prices[$index1] = $prices;\n\t\t\t\t$all_supplier_names[$index1] = $supplier_names;\n\t\t\t\tunset($quantities);\n\t\t\t\tunset($suppliers);\n\t\t\t\tunset($prices);\n\t\t\t\tunset($supplier_names);\n\t\t\t\t$quantities = array();\n\t\t\t\t$suppliers = array();\n\t\t\t\t$prices = array();\n\t\t\t\t$supplier_names = array();\n\t\t\t\t$index1++;\n\t\t\t}\n\t\t}\n\t\t$products = array_values(array_filter($products));\n\t\tfor($i = 0; $i<count($products); $i++)\n\t\t{\n\t\t\tunset($products[$i]['rd_quantity']);\n\t\t\tunset($products[$i]['first_name']);\n\t\t\tunset($products[$i]['last_name']);\n\t\t\t$products[$i]['quantities'] = $all_quantities[$i];\n\t\t\t$products[$i]['suppliers'] = $all_suppliers[$i];\n\t\t\t$products[$i]['prices'] = $all_prices[$i];\n\t\t\t$products[$i]['supplier_names'] = $all_supplier_names[$i];\n\t\t}\n\t}\n\telse\n\t{\n\t\t$query = $this->db->query(\"SELECT * FROM oc_po_product WHERE order_id = \" . $order_info['id']);\n\t\t$products = $query->rows;\n\t}\n\t\t$i = 0;\n\t\tforeach($products as $product)\n\t\t{\n\t\t\t$query = $this->db->query(\"SELECT * FROM oc_po_attribute_group WHERE product_id = \". $product['id']);\n\t\t\t$attribute_groups[$i] = $query->rows;\n\t\t\t$i++;\n\t\t}\n\t\t\n\t\t$i = 0;\n\t\tforeach($attribute_groups as $attribute_group)\n\t\t{\n\t\t\tfor($j = 0; $j<count($attribute_group);$j++)\n\t\t\t{\n\t\t\t\t$query = $this->db->query(\"SELECT * FROM oc_po_attribute_category WHERE attribute_group_id = \". $attribute_group[$j]['id']);\n\t\t\t\t$attribute_categories[$i] = $query->row;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\t\tfor($i=0;$i<count($products); $i++)\n\t\t{\n\t\t\tfor($j=0; $j<count($attribute_groups[$i]);$j++)\n\t\t\t{\n\t\t\t\t$products[$i]['attribute_groups'][$j] = $attribute_groups[$i][$j]['name'];\n\t\t\t}\n\t\t}\n\t\t$start_loop = 0;\n\t\t//$attribute_categories = array_values(array_filter($attribute_categories));\n\t\t//print_r($attribute_categories);\n\t\t//exit;\n\t\tfor($i=0; $i<count($products); $i++)\n\t\t{\n\t\t\tfor($j=$start_loop; $j<($start_loop + count($products[$i]['attribute_groups']));$j++)\n\t\t\t{\n\t\t\t\t$products[$i]['attribute_category'][$j] = $attribute_categories[$j]['name'];\n\t\t\t}\n\t\t\t$start_loop = $j;\n\t\t}\n\t\t$order_information['products'] = $products;\n\t\t$order_information['order_info'] = $order_info;\n\t\treturn $order_information;\n\t}", "public function getDetail($id) {\n\t\treturn $this->getData('/objekt/detail/objekt_id/' . $id);\n\t}", "public function show($id)\n\t{\n\n\t\t$order = Order::with('orderItem')->find($id);\n\t\n\t\treturn Response::json($order);\n\t}", "public function show($id)\n {\n $orden = Order::where('id', $id)->with('suscription.car', 'suscription.plans', 'planTypeWash')->first();\n return response()->json(['detail-order' => $orden]);\n }", "public function getOrderDetails($ordid, $isDirect = false, $isCron = false)\n {\n // get order details based on query\n $sSql = \"SELECT so.id as ordid, so.ordernumber as ordernumber, so.ordertime as ordertime, so.paymentID as paymentid, so.dispatchID as dispatchid, sob.salutation as sal, sob.company, sob.department, CONCAT(sob.firstname, ' ', sob.lastname) as fullname, CONCAT(sob.street, ' ', sob.streetnumber) as streetinfo, sob.zipcode as zip, sob.city as city, scc.countryiso as country, su.email as email, spd.comment as shipping, scl.locale as language\";\n $sSql .= \" FROM s_order so\";\n $sSql .= \" JOIN s_order_shippingaddress sob ON so.id = sob.orderID\"; \n $sSql .= \" JOIN s_core_countries scc ON scc.id = sob.countryID\";\n $sSql .= \" JOIN s_user su ON su.id = so.userID\";\n $sSql .= \" JOIN s_premium_dispatch spd ON so.dispatchID = spd.id\";\n $sSql .= \" JOIN s_core_locales scl ON so.language = scl.id\";\n \n // cron?\n if ($isCron) {\n $sSql .= \" JOIN asign_orders aso ON so.id = aso.ordid\";\n }\n\n // if directly from Thank you page \n if ($isDirect) {\n $sSql .= \" WHERE so.ordernumber = '\" . $ordid . \"'\";\n } else {\n $sSql .= \" WHERE so.id = '\" . $ordid . \"'\";\n } \n\n // cron?\n if ($isCron) { \n $sSql .= \" AND aso.ycReference = 0\";\n }\n\n $aOrders = Shopware()->Db()->fetchRow($sSql);\n $orderId = $aOrders['ordid'];\n \n // get order article details\n $aOrders['orderarticles'] = Shopware()->Db()->fetchAll(\"SELECT `articleID`, `articleordernumber`, `name`, `quantity`, `ean` FROM `s_order_details` WHERE `orderID` = '\" . $orderId . \"' AND `articleID` <> 0\");\n\n return $aOrders;\n }", "public function getordershipmentdatabyorderid($orderid){\n\t\t$this->db->where('OrdId', $orderid);\n\t\t$query=$this->db->get('tbl_order_shipment');\n\t\treturn $query->result();\n\t}", "public function getorderitembyid($orderid){\n\t\t$this->db->where('OrdId', $orderid);\n\t\t$this->db->select('LintItemId,OrdId,ItemId,ItemName,ItemEdition,ItemAuther,ItemQuantity,ItemRetailPrice,ItemSellingPrice,ItemDiscount,ProductThumbImage,ProductLanguage');\n\t\t$this->db->from('tbl_order_lineitems');\n\t\t$this->db->join('tbl_products', 'tbl_products.ProductId = tbl_order_lineitems.ItemId', 'inner');\n\t\t$query=$this->db->get();\n\t\treturn $query->result();\n\t\t// $query=$this->db->get('tbl_order_lineitems');\n\t\t// return $query->result();\n\t}", "public function getOrderById_get($id_order = null) {\n \n $params = array();\n $params['limit'] = (is_numeric($this->input->get('limit'))) ? $this->input->get('limit') : null;\n $params['from'] = $this->input->get('from');\n $params['to'] = $this->input->get('to');\n $this->load->model('Order_model');\n $this->load->model('Order_State_Model');\n $this->load->model('Address_model');\n $orders = array();\n $order = $this->Order_model->getLongOrderByOrderId($id_order, $params);\n if (!empty($order)) {\n $order_state = $this->Order_State_Model->getOrderStateByIdOrder($id_order);\n \n foreach ($order as $key => $value) {\n $orders['reference'] = $value->reference;\n $orders['total_paid'] = (double)$value->total_paid;\n $orders['total_paid_tax_excl'] = (double)$value->total_paid_tax_excl;\n $orders['tva'] = (float)$value->total_paid - $value->total_paid_tax_excl;\n $orders['total_shipping'] = (float)$value->total_shipping;\n $orders['order_date'] = $value->date_add;\n $orders['order_state'] = $order_state;\n $orders['adress'] = array('address_delivery' => $this->Address_model->getAddressById($value->id_address_delivery), 'address_invoice' => $this->Address_model->getAddressById($value->id_address_invoice));\n if (!isset($orders[$value->id_order])) {\n $orders['commande'][] = array('product_name' => $value->product_name, 'product_quantity' => (int)$value->product_quantity, 'total_price_tax_incl' => $value->total_price_tax_incl, 'total_price_tax_incl' => $value->total_price_tax_incl, 'id_image' => (int)$value->id_image, 'img_link' => base_url() . 'index.php/api/image/id/' . $value->id_image);\n }\n }\n return $this->response($orders, 200);\n }\n return $this->response(array(null), 200);\n \n }", "public function getMyParcelDeliveryOptions($order_id)\r\n {\r\n $order_query = $this->db->query(\"SELECT delivery_options FROM `\" . DB_PREFIX . self::$table_name . \"` WHERE order_id = \" . (int)$order_id . \" LIMIT 1\");\r\n return $this->getValueFromQuery('delivery_options', $order_query);\r\n }", "public function show($id)\n {\n $this->checkPermission(\"mfp_procurement_actual_details_view_generated_receipt\");\n try {\n $item = $this->service->getOne($id);\n $item = ApiResource::make($item);\n return $this->respondWithSuccess($item);\n }catch(\\Exception $th){\n return $this->respondWithError($th);\n }\n }", "public function show(int $id)\n {\n $order = Order::find($id);\n\n if (null === $order) {\n return response()\n ->noContent();\n }\n\n return $order;\n }", "public function getOrderDetailLink($orderId) {\n \n }", "public function show($id)\n {\n $order_details = Order_detail::find($id);\n return view('admin.order.detail', compact('order_details'));\n }", "public function lstOrderDetail(){\n\t\t$Sql = \"SELECT \n\t\t\t\t\torder_detail_id,\n\t\t\t\t\torder_id,\n\t\t\t\t\tcustomer_id,\n\t\t\t\t\textra_feature_id,\n\t\t\t\t\tfeature_name,\n\t\t\t\t\tquantity,\n\t\t\t\t\tprice\n\t\t\t\tFROM\n\t\t\t\t\trs_tbl_order_details\n\t\t\t\tWHERE\n\t\t\t\t\t1=1\";\n\t\t\n\t\tif($this->isPropertySet(\"order_detail_id\", \"V\")){\n\t\t\t$Sql .= \" AND order_detail_id='\" . $this->getProperty(\"order_detail_id\") . \"'\";\n\t\t}\n\t\tif($this->isPropertySet(\"order_id\", \"V\")){\n\t\t\t$Sql .= \" AND order_id='\" . $this->getProperty(\"order_id\") . \"'\";\n\t\t}\n\t\tif($this->isPropertySet(\"customer_id\", \"V\")){\n\t\t\t$Sql .= \" AND customer_id=\" . $this->getProperty(\"customer_id\");\n\t\t}\n\t\tif($this->isPropertySet(\"extra_feature_id\", \"V\")){\n\t\t\t$Sql .= \" AND extra_feature_id='\" . $this->getProperty(\"extra_feature_id\") . \"'\";\n\t\t}\n\t\tif($this->isPropertySet(\"ORDERBY\", \"V\")){\n\t\t\t$Sql .= \" ORDER BY \" . $this->getProperty(\"ORDERBY\");\n\t\t}\n\t\t\n\t\tif($this->isPropertySet(\"limit\", \"V\"))\n\t\t\t$Sql .= $this->appendLimit($this->getProperty(\"limit\"));\n\t\treturn $this->dbQuery($Sql);\n\t}", "public function show($id)\n {\n $cont = new RestController();\n $order = $cont->getRequest('Orders(' . $id . ')?$expand=OrderFieldValue($expand=OrderField),' .\n 'OrderProduct($expand=Product),OrderProductPackage($expand=ProductPackage($expand=Product),Products($expand=Product),Country),' .\n 'ClientAlias($expand=Contact,Country,Client($select=Id,CINumber,ClientManager_Id;$expand=ClientManager($select=FullName))),' .\n 'User($select=FullName,UserName),' .\n 'ApprovedBy($select=UserName),'.\n 'Invoice,Contracts($expand=Product($select=Name),User($select=FullName,UserName),Manager($select=FullName,UserName),Country($select=CountryCode))');\n if ($order instanceof View) {\n return $order;\n }\n if(!empty($order->OrderProductPackage)){\n //getting the addons products because we can't do it in the query\n foreach ($order->OrderProductPackage as $k => $val) {\n $product = $cont->getRequest(\"Products(\" . $val->ProductPackage->Product_Id . \")\");\n if (!$product instanceof View) {\n $order->OrderProductPackage[$k]->ProductPackage->Product = $product;\n }\n }\n }\n\n //get the contracts that came from this order\n $contractsResult = $cont->getRequest(\"Orders($id)/action.Contracts\".'?$expand=User($select=Id,FullName),Manager($select=Id,FullName),OriginalOrder($select=Id),Product($select=Name),Country($select=CountryCode)');\n if(!$contractsResult instanceof View){\n $order->Contract = $contractsResult->value;\n }else{\n $order->Contract = null;\n }\n if(!$this->isOwner($order)){\n return view('errors.denied');\n }\n //merge order products and order product packages , so we support both old and new orders\n $order->OrderProductPackage = array_merge($order->OrderProductPackage,$order->OrderProduct);\n $paymenTerms = $cont->getEnumProperties(['ContractTerms']);\n $paymenTerms = isset($paymenTerms['ContractTerms']) ? $paymenTerms['ContractTerms'] : [];\n\n //put the hashcode for a js\n JavaScriptFacade::put(['Hashcode' => $order->HashCode,'paymentTerms' => $paymenTerms]);\n //add the months corresponding to each OrderProduct payment term\n\n $contractTerms = $cont->getEnumProperties(['ContractTerms']);\n\n foreach ($order->OrderProduct as $k => $val) {\n $paymentTerms = array_search($val->PaymentTerms, $contractTerms['ContractTerms']);\n $order->OrderProduct[$k]->Months = $paymentTerms;\n }\n\n $clientManagers = UsersController::listByRoles(['Client Manager']);\n\n $order->OrderFieldValue = $this->groupOrderFieldValues($order->OrderFieldValue);\n return view('orders.show',compact('order', 'cont','clientManagers'));\n }", "public function getDetail($id)\n {\n return $this->topologi->find($id);\n }", "public function show($order_id)\n {\n $order = $this->orderRepository->findById($order_id);\n\n return response()->json(['data' => $order,'status' => 'success']);\n }", "public function getDetails($id)\n {\n $invoice = Invoice::find($id);\n $invoice->load('lines');\n $invoice->load('user');\n $invoice->load('documentosReferencia');\n\n return $invoice;\n }", "public function getOrder($id) {\n return Order::fetch($id);\n }", "public function getOrderById($id){\n $this->db->query(\"SELECT * FROM orders WHERE id = :id\");\n\n $this->db->bind(':id', $id);\n \n $row = $this->db->single();\n\n return $row;\n }", "public function getOrderByID($order_id)\n {\n $order = $this->db->prepare(<<<SQL\nSELECT orders.order_id, orders.order_date, orders.arrival_date, orders.student_number\nFROM orders\nWHERE orders.order_id = :order_id\nORDER BY orders.order_date;\nSQL\n );\n $order->execute(array(':order_id' => $order_id));\n return $order->fetch(\\PDO::FETCH_OBJ);\n }", "public function show($orderId)\n {\n //\n\t\t\n\t\t//$orderDetails = OrderDetail::where('order_id' , $orderId)->get();\n\t\t//return view('order.order-detail' , compact('orderDetails'));\n }", "public function retrieve($id) {\n SCA::$logger->log(\"retrieve resource $id\");\n return $this->orders_service->retrieve($id);\n }", "static public function getOrderById($order_id) {\n $order = DB::table('orders')->where('id', $order_id)->get();\n return $order;\n }" ]
[ "0.79444367", "0.751664", "0.736198", "0.7341241", "0.7152315", "0.70616215", "0.70360786", "0.70189494", "0.695256", "0.69494134", "0.68958426", "0.6849994", "0.68210334", "0.6818957", "0.68023396", "0.6795044", "0.6790084", "0.67450345", "0.6723725", "0.67069304", "0.6681038", "0.66686386", "0.6664519", "0.6664519", "0.6653755", "0.6643118", "0.66429025", "0.66186774", "0.657284", "0.65445703", "0.65124345", "0.65039575", "0.6500739", "0.6484042", "0.64604086", "0.644696", "0.6436996", "0.6428861", "0.6426521", "0.64118654", "0.6407557", "0.6396016", "0.6392418", "0.6385821", "0.6384979", "0.63760203", "0.63742894", "0.6373876", "0.6359856", "0.63588846", "0.6351229", "0.6348533", "0.6336952", "0.6336061", "0.6334499", "0.6311076", "0.6304574", "0.6298027", "0.62953883", "0.62944627", "0.62789243", "0.62686396", "0.6266204", "0.6257916", "0.62572426", "0.62522286", "0.62468505", "0.62468505", "0.6236924", "0.62323356", "0.6231109", "0.62246424", "0.62102544", "0.61717355", "0.61522937", "0.61399597", "0.6129335", "0.60934484", "0.6093186", "0.60925865", "0.60829115", "0.6077977", "0.60737157", "0.60532814", "0.6047495", "0.6038866", "0.6035369", "0.6024703", "0.60179883", "0.6007531", "0.6004437", "0.6001916", "0.5991354", "0.59876525", "0.598499", "0.598163", "0.5978915", "0.5977833", "0.59772015", "0.59643984" ]
0.7882403
1
Check Item on Delivery Order Detail by Delivery Order ID & Item ID
public function CheckItemOnDODetail($params) { return $this->deliveryOrderDetail::where($params)->first() == null ? true : false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function ItemOnDODetail($params)\n {\n return $this->deliveryOrderDetail::where($params)->first() == null ? true : $this->deliveryOrderDetail::where($params)->first(); \n }", "public function check(OrderItemInterface $order_item, Context $context);", "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 checkOrderStatus($orderItem, $status){\n $statusCode = getOrderStatusCode($status);\n return $orderItem->status == $statusCode;\n}", "public function reorder_checkFoodItemAvailability($order_id){\n $food_items_and_qty = $this->model->getQtywithItemCount_reorder($order_id);\n // $this->debug($food_items_and_qty, $order_id);\n if($food_items_and_qty['status'] === \"success\"){\n\n foreach($food_items_and_qty['data'] as $item){\n if($item->Quantity >= $item->Current_count){\n return false;\n }\n }\n return true;\n }\n }", "public function show($orderItem)\n {\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 static function isExistsPaymentItem($id){\n //print_r($id);exit;\n $result = DB::table('payment_cost_item')\n ->where('fk_payment_id', '=', $id)\n ->get();\n return $result;\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}", "function check_manifesto_delivered($manifesto_id=0)\r\n\t{\r\n\t\tif($manifesto_id)\r\n\t\t{\r\n\t\t\t$manifesto_det=$this->db->query(\"select * from pnh_m_manifesto_sent_log where id=?\",$manifesto_id);\r\n\t\t\tif($manifesto_det->num_rows())\r\n\t\t\t{\r\n\t\t\t\t$manifesto_det=$manifesto_det->row_array();\r\n\t\t\t\t\r\n\t\t\t\t$transit_inv=$this->db->query(\"select invoice_no from pnh_invoice_transit_log where sent_log_id=? and status=3\",$manifesto_id)->result_array();\r\n\t\t\t\t\r\n\t\t\t\tif($transit_inv)\r\n\t\t\t\t{\r\n\t\t\t\t\t$t_inv_list=array();\r\n\t\t\t\t\tforeach($transit_inv as $tinv)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$t_inv_list[]=$tinv['invoice_no'];\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$m_inv=explode(',',$manifesto_det['sent_invoices']);\r\n\t\t\t\t\t\r\n\t\t\t\t\t$not_found=0;\r\n\t\t\t\t\tforeach($m_inv as $minv)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(in_array($minv, $t_inv_list))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t$not_found=1;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!$not_found)\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\telse \r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}", "public function getAbleToDeliver()\n {\n\n $data = Order::where('IsTakeOut',1)\n ->where('IsDelivery',1)\n ->where('Status',6)\n //->join('orderitem', 'orderitem.OrderID', '=', 'orders.OrderID')\n // ->join('store', 'store.StoreID', '=', 'orders.StoreID')\n // ->join('meal', 'meal.MealID', '=', 'orderitem.MealID')\n // ->leftJoin('orderitemflavor', 'orderitem.OrderItemID', '=', 'orderitemflavor.OrderItemID')\n // ->leftJoin('flavor', 'orderitemflavor.FlavorID', '=', 'flavor.FlavorID')\n // ->leftJoin('flavortype', 'flavortype.FlavorTypeID', '=', 'flavor.FlavorTypeID')\n // ->select('*', 'orders.Memo', 'orderitem.OrderItemID', 'orders.DateTime as OrderDate')\n // ->orderBy('orders.OrderID', 'desc')\n ->get();\n\n\n if ($data->isEmpty()) {\n return \\response(\"\", 204);\n }\n\n \n $collection = collect();\n $flavors = null;\n $flavorsPrice = 0;\n $temp = null;\n $count = 0;\n\n $orders = $data->groupBy('OrderID');\n\n foreach ($orders as $order) {\n $items = collect();\n $count = 0;\n\n $orderItems = $order->groupBy('OrderItemID');\n\n foreach ($orderItems as $orderItem) {\n if ($count >= 3) {\n break;\n }\n\n $flavors = collect();\n $flavorsPrice = 0;\n \n foreach ($orderItem as $orderItemFlavor) {\n if ($orderItemFlavor->FlavorTypeID == null) {\n break;\n }\n\n $flavors->push(\n collect([\n 'flavorType' => $orderItemFlavor->FlavorTypeName,\n 'flavor' => $orderItemFlavor->FlavorName,\n ])\n );\n\n $flavorsPrice += $orderItemFlavor->ExtraPrice;\n }\n\n\n $temp = $orderItem[0];\n\n $items->push(\n collect([\n 'id' => $temp->OrderItemID,\n 'name' => $temp->MealName,\n 'memo' => $temp->Memo,\n 'quantity' => $temp->Quantity,\n 'mealPrice' => $temp->MealPrice,\n 'flavors' => $flavors,\n 'amount' => $temp->MealPrice + $flavorsPrice,\n ])\n );\n\n ++$count;\n }\n\n $collection->push(\n collect([\n 'id' => $temp->OrderID,\n 'orderNumber' => $temp->OrderNumber,\n 'store' => $temp->StoreName,\n 'status' => $temp->Status,\n 'orderDate' => $temp->OrderDate,\n 'estimatedTime' => $temp->EstimatedTime,\n 'orderMemo' => $temp->Memo,\n 'orderPrice' => $temp->Price,\n 'isTakeOut' => $temp->IsTakeOut,\n 'isDelivery' => $temp->IsDelivery,\n 'orderItems' => $items,\n 'serviceFee' => $temp->ServiceFee,\n 'destination' => $temp->Destination,\n 'totalAmount' => $temp->TotalAmount\n ])\n );\n }\n /* return collect([\n 'id' => $temp->OrderID,\n 'orderNumber' => $temp->OrderNumber,\n 'store' => $temp->StoreName,\n 'status' => $temp->Status,\n 'orderDate' => $temp->OrderDate,\n 'estimatedTime' => $temp->EstimatedTime,\n 'orderMemo' => $temp->Memo,\n 'orderPrice' => $temp->Price,\n 'isTakeOut' => $temp->IsTakeOut,\n 'orderItems' => $items,\n 'isDelivery' => $temp->IsDelivery,\n 'destination' => $temp->Destination,\n 'totalAmount' => $temp->TotalAmount\n ]);*/\n\n return response()->json($collection);\n\n }", "function item_details($iid, $oid)\n\t{\n\t\t$q = $this->db\n\t\t\t->select('co.store_id as stid, co.drug_id as iid, co.supplier_id as suid, co.manufacturer_id as mid, co.unit_cost price, co.unit_savings, co.quantity as qtyPrev, co.date_time, lc.item_type')\n\t\t\t->from('ci_completedorders as co')\n\t\t\t->join('ci_listings_compiled as lc', 'co.drug_id = lc.drug_id')\n\t\t\t->where('co.drug_id', $iid)\n\t\t\t->where('co.order_id', $oid)\n\t\t\t->limit(1)\n\t\t\t->get();\n\t\t\t\n\t\t$r = $q->row();\n\t\t\t\n\t\tif ( $q->num_rows() === 0 )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$r->rx = ( $r->item_type == 1 ) ? false : true;\n\t\t\tunset($r->item_type);\n\t\t\t$r->date = strtotime($r->date_time);\n\t\t\tunset($r->date_time);\n\t\t\t\n\t\t\t$this->result_to_table('Queried item details: ', array($r));\n\t\t\t\n\t\t\treturn $r;\n\t\t}\n\t}", "function ciniki_sapos_hooks_invoiceItemDelete($ciniki, $tnid, $args) {\n\n if( !isset($args['invoice_id']) || $args['invoice_id'] == '' \n || !isset($args['object']) || $args['object'] == '' \n || !isset($args['object_id']) || $args['object_id'] == '' \n ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.3', 'msg'=>'No invoice or item specified.'));\n }\n\n //\n // Load the settings\n //\n $rc = ciniki_core_dbDetailsQueryDash($ciniki, 'ciniki_sapos_settings', 'tnid', $tnid, 'ciniki.sapos', 'settings', '');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $settings = isset($rc['settings'])?$rc['settings']:array();\n\n //\n // Get the details of the item\n //\n $strsql = \"SELECT id, uuid, invoice_id, object, object_id, quantity \"\n . \"FROM ciniki_sapos_invoice_items \"\n . \"WHERE invoice_id = '\" . ciniki_core_dbQuote($ciniki, $args['invoice_id']) . \"' \"\n . \"AND object = '\" . ciniki_core_dbQuote($ciniki, $args['object']) . \"' \"\n . \"AND object_id = '\" . ciniki_core_dbQuote($ciniki, $args['object_id']) . \"' \"\n . \"AND tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.sapos', 'item');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['item']) ) { \n // Item doesn't exist, return ok\n return array('stat'=>'ok');\n// return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.382', 'msg'=>'Unable to find invoice item'));\n }\n $item = $rc['item'];\n\n //\n // Check to make sure the invoice hasn't been paid\n //\n $strsql = \"SELECT id, uuid, status \"\n . \"FROM ciniki_sapos_invoices \"\n . \"WHERE ciniki_sapos_invoices.id = '\" . ciniki_core_dbQuote($ciniki, $item['invoice_id']) . \"' \"\n . \"AND ciniki_sapos_invoices.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.sapos', 'invoice');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['invoice']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.6', 'msg'=>'Invoice does not exist'));\n }\n $invoice = $rc['invoice'];\n\n //\n // Invoice has already been paid, we don't want to remove this item\n //\n if( $invoice['status'] >= 50 && (!isset($settings['rules-invoice-paid-change-items']) || $settings['rules-invoice-paid-change-items'] == 'no')) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.7', 'msg'=>'Invoice has been paid, unable to remove item'));\n }\n\n //\n // Check to make sure the item isn't part of a shipment\n //\n $strsql = \"SELECT id \"\n . \"FROM ciniki_sapos_shipment_items \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"AND item_id = '\" . ciniki_core_dbQuote($ciniki, $item['id']) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.sapos', 'item');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( $rc['num_rows'] > 0 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.8', 'msg'=>'Item is part of a shipment and cannot be removed.'));\n }\n\n //\n // Check for a callback for the item object\n //\n if( $item['object'] != '' && $item['object_id'] != '' ) {\n list($pkg,$mod,$obj) = explode('.', $item['object']);\n $rc = ciniki_core_loadMethod($ciniki, $pkg, $mod, 'sapos', 'itemDelete');\n if( $rc['stat'] == 'ok' ) {\n $fn = $rc['function_call'];\n $rc = $fn($ciniki, $tnid, $item['invoice_id'], $item);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n }\n }\n\n //\n // Remove the item\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectDelete');\n $rc = ciniki_core_objectDelete($ciniki, $tnid, 'ciniki.sapos.invoice_item', \n $item['id'], $item['uuid'], 0x04);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Check if invoice should be deleted when nothing in it\n //\n if( $invoice['status'] < 50 && isset($args['deleteinvoice']) && $args['deleteinvoice'] == 'yes' ) {\n $remove = 'yes';\n //\n // Check for invoice items\n //\n $strsql = \"SELECT COUNT(ciniki_sapos_invoice_items.id) \"\n . \"FROM ciniki_sapos_invoice_items \"\n . \"WHERE ciniki_sapos_invoice_items.invoice_id = '\" . ciniki_core_dbQuote($ciniki, $invoice['id']) . \"' \"\n . \"AND ciniki_sapos_invoice_items.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"AND ciniki_sapos_invoice_items.id <> '\" . ciniki_core_dbQuote($ciniki, $item['id']) . \"' \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbSingleCount');\n $rc = ciniki_core_dbSingleCount($ciniki, $strsql, 'ciniki.sapos', 'num_items');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['num_items']) || $rc['num_items'] != 0 ) {\n $remove = 'no';\n }\n //\n // Check for invoice shipments\n //\n $strsql = \"SELECT COUNT(ciniki_sapos_shipments.id) \"\n . \"FROM ciniki_sapos_shipments \"\n . \"WHERE ciniki_sapos_shipments.invoice_id = '\" . ciniki_core_dbQuote($ciniki, $invoice['id']) . \"' \"\n . \"AND ciniki_sapos_shipments.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"\";\n $rc = ciniki_core_dbSingleCount($ciniki, $strsql, 'ciniki.sapos', 'num_items');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['num_items']) || $rc['num_items'] != 0 ) {\n $remove = 'no';\n }\n //\n // Check for invoice transactions\n //\n $strsql = \"SELECT COUNT(ciniki_sapos_transactions.id) \"\n . \"FROM ciniki_sapos_transactions \"\n . \"WHERE ciniki_sapos_transactions.invoice_id = '\" . ciniki_core_dbQuote($ciniki, $invoice['id']) . \"' \"\n . \"AND ciniki_sapos_transactions.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"\";\n $rc = ciniki_core_dbSingleCount($ciniki, $strsql, 'ciniki.sapos', 'num_items');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['num_items']) || $rc['num_items'] != 0 ) {\n $remove = 'no';\n }\n\n if( $remove == 'yes' ) {\n //\n // Remove the invoice\n //\n $rc = ciniki_core_objectDelete($ciniki, $tnid, 'ciniki.sapos.invoice', $invoice['id'], $invoice['uuid'], 0x04);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.sapos');\n return $rc;\n }\n }\n }\n\n if( !isset($remove) || $remove != 'yes' ) {\n //\n // Update the invoice status\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'sapos', 'private', 'invoiceUpdateShippingTaxesTotal');\n $rc = ciniki_sapos_invoiceUpdateShippingTaxesTotal($ciniki, $tnid, $item['invoice_id']);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Update the invoice status\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'sapos', 'private', 'invoiceUpdateStatusBalance');\n $rc = ciniki_sapos_invoiceUpdateStatusBalance($ciniki, $tnid, $item['invoice_id']);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n }\n\n //\n // Update the last_change date in the tenant modules\n // Ignore the result, as we don't want to stop user updates if this fails.\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'updateModuleChangeDate');\n ciniki_tenants_updateModuleChangeDate($ciniki, $tnid, 'ciniki', 'sapos');\n\n return array('stat'=>'ok');\n}", "function wcfm_mark_as_recived() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderitemid'] ) ) {\r\n $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 $order_item_id = $_POST['orderitemid'];\r\n \r\n //$comment_id = $order->add_order_note( sprintf( __( 'Item(s) <b>%s</b> received by customer.', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ) ), '1');\r\n \r\n // Keep Tracking URL as Order Item Meta\r\n\t\t\t$sql = \"INSERT INTO {$wpdb->prefix}woocommerce_order_itemmeta\";\r\n\t\t\t$sql .= ' ( `meta_key`, `meta_value`, `order_item_id` )';\r\n\t\t\t$sql .= ' VALUES ( %s, %s, %s )';\r\n\t\t\t\r\n\t\t\t$confirm_message = __( 'YES', 'wc-frontend-manager-ultimate' );\r\n\t\r\n\t\t\t$wpdb->get_var( $wpdb->prepare( $sql, 'wcfm_mark_as_recived', $confirm_message, $order_item_id ) );\r\n\t\t\t\r\n\t\t\t$vendor_id = $WCFM->wcfm_vendor_support->wcfm_get_vendor_id_from_product( $product_id );\r\n\t\t\t\r\n\t\t\t// WCfM Marketplace Table Update\r\n\t\t\tif( $vendor_id && (wcfm_is_marketplace() == 'wcfmmarketplace') ) {\r\n\t\t\t\t$wpdb->query(\"UPDATE {$wpdb->prefix}wcfm_marketplace_orders SET shipping_status = 'completed' WHERE order_id = $order_id and vendor_id = $vendor_id and item_id = $order_item_id\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Notification\r\n\t\t\t$wcfm_messages = sprintf( __( 'Customer marked <b>%s</b> received.', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ) );\r\n\t\t\t$WCFM->wcfm_notification->wcfm_send_direct_message( -1, 0, 0, 1, $wcfm_messages, 'shipment_received' );\r\n\t\t\t\r\n\t\t\t// Vendor Notification\r\n\t\t\tif( $vendor_id ) {\r\n\t\t\t\t$WCFM->wcfm_notification->wcfm_send_direct_message( -2, $vendor_id, 0, 1, $wcfm_messages, 'shipment_received' );\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// WC Order Note\r\n\t\t\t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\r\n\t\t\tdo_action( 'wcfm_after_order_mark_received', $order_id, $order_item_id, $product_id );\r\n }\r\n die;\r\n\t}", "public function ItemPriceOnDODetail($params)\n {\n return $this->deliveryOrderDetail::where($params)->get() == null ? false : $this->deliveryOrderDetail::where($params)->pluck(); \n }", "public function checkIfOrderExist($orderId);", "function getOrderPurchaseDetails($order_id)\n\t\t{\n\t\t\t//get order details\n\t\t\t$orders = $this->_BLL_obj->manage_content->getValue_where('order_info', '*', 'order_id', $order_id);\n\t\t\t$user_id = $orders[0]['user_id'];\n\t\t\t//get product details from order id\n\t\t\t$order_details = $this->_BLL_obj->manage_content->getValue_where('product_inventory_info', '*', 'order_id', $order_id);\n\t\t\tif(!empty($order_details[0]))\n\t\t\t{\n\t\t\t\t//total_overridng fee distributed\n\t\t\t\t$dis_over = 0;\n\t\t\t\t$user_level = 0;\n\t\t\t\t\n\t\t\t\tforeach($order_details as $order)\n\t\t\t\t{\n\t\t\t\t\t/* code for distribute overriding fee */\n\t\t\t\t\t//get transaction id for overriding fee\n\t\t\t\t\t$over_id = uniqid('trans');\n\t\t\t\t\t//calling overriding fee function\n\t\t\t\t\t$distributed_overriding = $this->distributeOverridingFee($user_id, $order['price'], $dis_over, $user_level, $over_id,$order_id);\n\t\t\t\t\tif($distributed_overriding != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t//insert values to fee transaction info table\n\t\t\t\t\t\t$insert_over = $this->_BLL_obj->manage_content->insertValue('fee_transaction_info', array('transaction_id','order_id','product_id','fee_type'), array($over_id,$order_id,$order['product_id'],'OF'));\n\t\t\t\t\t\t//new system value\n\t\t\t\t\t\t$new_system_value = $this->getSystemMoneyValue() - $distributed_overriding;\n\t\t\t\t\t\t//insert distributed amount to system money info\n\t\t\t\t\t\t$insert_dist_amount = $this->_BLL_obj->manage_content->insertValue('system_money_info', array('specification','debit','system_balance'), array($over_id,$distributed_overriding,$new_system_value));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t/* code for personal commision calculation */\n\t\t\t\t\t//get transaction id for personal comm calculation\n\t\t\t\t\t$per_id = uniqid('trans');\n\t\t\t\t\t//calling personal commision function\n\t\t\t\t\t$per_comm = $this->calculatePersonalCommision($user_id, $order['price'], $per_id,$order_id);\n\t\t\t\t\t//checking for non empty personal commision\n\t\t\t\t\tif($per_comm != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t//insert values to fee transaction info table\n\t\t\t\t\t\t$insert_personal = $this->_BLL_obj->manage_content->insertValue('fee_transaction_info', array('transaction_id','order_id','product_id','fee_type'), array($per_id,$order_id,$order['product_id'],'PC'));\n\t\t\t\t\t\t//new system value\n\t\t\t\t\t\t$new_system_value_per = $this->getSystemMoneyValue() - $per_comm;\n\t\t\t\t\t\t//insert distributed amount to system money info\n\t\t\t\t\t\t$insert_per_amount = $this->_BLL_obj->manage_content->insertValue('system_money_info', array('specification','debit','system_balance'), array($per_id,$per_comm,$new_system_value_per));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t/* code for point value calculation */\n\t\t\t\t\t//get transaction id for point value distribution\n\t\t\t\t\t$pv_id = uniqid('trans');\n\t\t\t\t\t//get product details\n\t\t\t\t\t$product_details = $this->_BLL_obj->manage_content->getValue_where('product_info', '*', 'product_id', $order['product_id']);\n\t\t\t\t\t//total point value\n\t\t\t\t\t$total_pv = $product_details[0]['point_value'] * $order['quantity'];\n\t\t\t\t\t//insert values to fee transaction info table\n\t\t\t\t\t$insert_point = $this->_BLL_obj->manage_content->insertValue('fee_transaction_info', array('transaction_id','order_id','product_id','fee_type'), array($pv_id,$order_id,$order['product_id'],'PV'));\n\t\t\t\t\t//insert pv to system\n\t\t\t\t\t$system_pv = $this->insertSystemPV($pv_id, $total_pv);\n\t\t\t\t\t//calling point value distributive function\n\t\t\t\t\t$this->distributePointValue($user_id, $total_pv, $pv_id, $order_id);\n\t\t\t\t\t\n\t\t\t\t\t/* code for member level upgradation of user and their parent */\n\t\t\t\t\t//calling fucntion for it\n\t\t\t\t\t$this->checkingLevelOfUserAndParent($user_id);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function item($order)\n {\n return SiteMaintenanceItem::where('main_id', $this->id)->where('order', $order)->first();\n }", "public function show(TxShopDomainModelOrderItem $order)\n {\n //\n }", "public function check_order_id()\n {\n // return $NotifController->index();\n $order_id = $this->request->getVar('order_id');\n $typeSearch = $this->request->getVar('tos');\n switch ($typeSearch) {\n case 'hasil':\n return $this->cari_hasil($order_id);\n break;\n case 'registrasi_detail':\n return $this->cari_registrasi_detail($order_id);\n break;\n case 'reschedule':\n return $this->cari_reshcedule($order_id);\n break;\n default:\n # code...\n break;\n }\n }", "function wv_commission_get_order_item_record($oid) {\n\n global $wpdb;\n $sql_order_itemid = \"SELECT DISTINCT WOIM.order_item_id FROM `\" . $wpdb->prefix . \"woocommerce_order_items` AS WOI INNER JOIN `\" . $wpdb->prefix . \"woocommerce_order_itemmeta` AS WOIM ON WOI.order_item_id = WOIM.order_item_id WHERE WOI.order_item_type = 'line_item' AND WOI.order_id =$oid\";\n $arr_order_itemid = $wpdb->get_results($sql_order_itemid);\n\n if (count($arr_order_itemid) > 0) {\n $i = 1;\n foreach ($arr_order_itemid as $item) {\n\n $order_item_id = $item->order_item_id;\n $productid = $this->wv_commission_get_woo_orderitem_metavalue($order_item_id, '_product_id');\n //output HTML here.\n ?>\n <tr>\n <!-- \n In case of more than 1 item, order id should show only one times : use= rowspan :\n --> \n <?php if ($i == 1) { ?>\n <td rowSpan=\"<?php echo count($arr_order_itemid); ?>\" >#<?php echo $oid; ?></td>\n <?php } ++$i; ?>\n <!-- order date -->\n <td><?php echo get_post_time(\"dM,Y\", FALSE, $oid); ?></td>\n \n <!-- product id -->\n <td><?php echo get_the_title($productid); ?></td>\n \n <!-- vendor -->\n <td><?php echo $this->wv_get_username_by_userid(get_post_meta($oid, 'woo_order_vendor_id_' . $productid, TRUE)); ?></td>\n \n <!-- commission --> \n <td>\n <?php\n echo get_woocommerce_currency_symbol(). get_post_meta($oid, 'woo_order_commision_' . $productid, TRUE);\n ?>\n </td>\n \n <!-- Status -->\n <td>\n <?php \n //change status functionality\n $sts = $this->wv_get_commission_status($oid,$productid);\n $newsts= ($sts==1)?0:1;\n ?>\n <a title=\"Change Status\" href=\"<?php echo admin_url(\"admin.php?page=woo_vendors&tab=commission&action=sts&oid=$oid&pid=$productid&sts=$newsts\"); ?>\" onclick=\"return confirm('Are you sure want to change status ?');\">\n <?php \n echo $newsts= ($sts==1)?\"paid\":\"due\";;\n ?>\n </a> \n </td>\n \n <!-- Commission Date -->\n <td>\n <?php \n //get commission date\n echo $this->wv_get_commission_date($oid,$productid);\n ?> \n </td>\n </tr>\n <?php\n }\n }//end of the count.\n }", "function setOrderPaid($object) { \n /* you can itentify the item with $object->Item->ShopId */ \n}", "public function hasOrderid(){\n return $this->_has(8);\n }", "function processListingItem( $item, $order ) {\n\t\tglobal $wpdb;\n\n\t\t// abort if item data is invalid\n\t\tif ( ! isset( $item->ASIN ) && ! isset( $item->QuantityOrdered ) ) {\n\t\t\t$history_message = \"Error fetching order line items - request throttled?\";\n\t\t\t$history_details = array();\n\t\t\tself::addHistory( $order->AmazonOrderId, 'request_throttled', $history_message, $history_details );\n\t\t\treturn false;\n\t\t}\n\n\t\tdo_action( 'wpla_before_process_listing_item', $item, $order );\n\n\t\t$order_id = $order->AmazonOrderId;\n\t\t$asin = $item->ASIN;\n\t\t$sku = $item->SellerSKU;\n\t\t$quantity_purchased = $item->QuantityOrdered;\n\t\t\n\t\t// get listing item\n\t\t$lm = new WPLA_ListingsModel();\n\t\t$listing = $lm->getItemBySKU( $sku );\n\n\t\t// skip if this listing does not exist in WP-Lister\n\t\tif ( ! $listing ) {\n\t\t\t$history_message = \"Skipped unknown SKU {$sku} ({$asin})\";\n\t\t\t$history_details = array( 'sku' => $sku, 'asin' => $asin );\n\t\t\tself::addHistory( $order_id, 'skipped_item', $history_message, $history_details );\n\t\t\treturn true;\n\t\t}\n\n\n\t\t// handle FBA orders\n\t\tif ( $order->FulfillmentChannel == 'AFN' ) {\n\n\t\t\t// update quantity for FBA orders\n\t\t\t$fba_quantity = $listing->fba_quantity - $quantity_purchased;\n\t\t\t$quantity_sold = $listing->quantity_sold + $quantity_purchased;\n\n\t\t\t$wpdb->update( $wpdb->prefix.'amazon_listings', \n\t\t\t\tarray( \n\t\t\t\t\t'fba_quantity' => $fba_quantity,\n\t\t\t\t\t'quantity_sold' => $quantity_sold \n\t\t\t\t), \n\t\t\t\tarray( 'sku' => $sku ) \n\t\t\t);\n\n\t\t\t// add history record\n\t\t\t$history_message = \"FBA quantity reduced by $quantity_purchased for listing {$sku} ({$asin}) - FBA stock $fba_quantity ($quantity_sold sold)\";\n\t\t\t$history_details = array( 'fba_quantity' => $fba_quantity, 'sku' => $sku, 'asin' => $asin, 'qty_purchased' => $quantity_purchased, 'listing_id' => $listing->id );\n\t\t\tself::addHistory( $order_id, 'reduce_stock', $history_message, $history_details );\n\n\t\t} else {\n\n\t\t\t// update quantity for non-FBA orders\n\t\t\t$quantity_total = $listing->quantity - $quantity_purchased;\n\t\t\t$quantity_sold = $listing->quantity_sold + $quantity_purchased;\n\t\t\t$wpdb->update( $wpdb->prefix.'amazon_listings', \n\t\t\t\tarray( \n\t\t\t\t\t'quantity' => $quantity_total,\n\t\t\t\t\t'quantity_sold' => $quantity_sold \n\t\t\t\t), \n\t\t\t\tarray( 'sku' => $sku ) \n\t\t\t);\n\n\t\t\t// add history record\n\t\t\t$history_message = \"Quantity reduced by $quantity_purchased for listing {$sku} ({$asin}) - new stock: $quantity_total ($quantity_sold sold)\";\n\t\t\t$history_details = array( 'newstock' => $quantity_total, 'sku' => $sku, 'asin' => $asin, 'qty_purchased' => $quantity_purchased, 'listing_id' => $listing->id );\n\t\t\tself::addHistory( $order_id, 'reduce_stock', $history_message, $history_details );\n\n\t\t}\n\n\n\n\t\t// mark listing as sold when last item is sold\n\t\t// if ( $quantity_total == 0 ) {\n\t\t// \t$wpdb->update( $wpdb->prefix.'amazon_listings', \n\t\t// \t\tarray( 'status' => 'sold', 'date_finished' => $data['date_created'], ), \n\t\t// \t\tarray( 'sku' => $sku ) \n\t\t// \t);\n\t\t// \tWPLA()->logger->info( 'marked item '.$sku.' as SOLD ');\n\t\t// }\n\n\n\n\t\treturn true;\n\t}", "function processTippedStatus($item_details, $last_inserted_id)\r\n {\r\n $ItemUserConditions = array();\r\n $ItemUserConditions['ItemUser.is_canceled'] = 0;\r\n if ($item_details['Item']['is_pass_mail_sent']) {\r\n $ItemUserConditions['ItemUser.id'] = $last_inserted_id;\r\n }\r\n $item = $this->find('first', array(\r\n 'conditions' => array(\r\n 'Item.item_status_id' => ConstItemStatus::Tipped,\r\n 'Item.id' => $item_details['Item']['id']\r\n ) ,\r\n 'contain' => array(\r\n 'ItemUser' => array(\r\n 'User' => array(\r\n 'fields' => array(\r\n 'User.username',\r\n 'User.id',\r\n 'User.email',\r\n 'User.cim_profile_id'\r\n ) ,\r\n 'UserProfile' => array(\r\n 'fields' => array(\r\n 'UserProfile.first_name',\r\n 'UserProfile.last_name'\r\n ) ,\r\n ) ,\r\n ) ,\r\n 'ItemUserPass',\r\n 'PaypalDocaptureLog' => array(\r\n 'fields' => array(\r\n 'PaypalDocaptureLog.currency_id',\r\n 'PaypalDocaptureLog.converted_currency_id',\r\n 'PaypalDocaptureLog.original_amount',\r\n 'PaypalDocaptureLog.rate',\r\n 'PaypalDocaptureLog.authorizationid',\r\n 'PaypalDocaptureLog.dodirectpayment_amt',\r\n 'PaypalDocaptureLog.id',\r\n 'PaypalDocaptureLog.currencycode'\r\n )\r\n ) ,\r\n 'AuthorizenetDocaptureLog' => array(\r\n 'fields' => array(\r\n 'AuthorizenetDocaptureLog.currency_id',\r\n 'AuthorizenetDocaptureLog.converted_currency_id',\r\n 'AuthorizenetDocaptureLog.original_amount',\r\n 'AuthorizenetDocaptureLog.rate',\r\n 'AuthorizenetDocaptureLog.authorize_amt'\r\n )\r\n ) ,\r\n 'PaypalTransactionLog' => array(\r\n 'fields' => array(\r\n 'PaypalTransactionLog.currency_id',\r\n 'PaypalTransactionLog.converted_currency_id',\r\n 'PaypalTransactionLog.orginal_amount',\r\n 'PaypalTransactionLog.rate',\r\n 'PaypalTransactionLog.authorization_auth_exp',\r\n 'PaypalTransactionLog.authorization_auth_id',\r\n 'PaypalTransactionLog.authorization_auth_amount',\r\n 'PaypalTransactionLog.authorization_auth_status',\r\n 'PaypalTransactionLog.mc_currency',\r\n 'PaypalTransactionLog.mc_gross',\r\n 'PaypalTransactionLog.id'\r\n )\r\n ) ,\r\n 'conditions' => $ItemUserConditions,\r\n ) ,\r\n 'Merchant' => array(\r\n 'City' => array(\r\n 'fields' => array(\r\n 'City.id',\r\n 'City.name',\r\n 'City.slug',\r\n )\r\n ) ,\r\n 'State' => array(\r\n 'fields' => array(\r\n 'State.id',\r\n 'State.name'\r\n )\r\n ) ,\r\n 'Country' => array(\r\n 'fields' => array(\r\n 'Country.id',\r\n 'Country.name',\r\n 'Country.slug',\r\n )\r\n ) ,\r\n ) ,\r\n 'Attachment' => array(\r\n 'fields' => array(\r\n 'Attachment.id',\r\n 'Attachment.dir',\r\n 'Attachment.filename',\r\n 'Attachment.width',\r\n 'Attachment.height'\r\n )\r\n ) ,\r\n 'City' => array(\r\n 'fields' => array(\r\n 'City.id',\r\n 'City.name',\r\n 'City.slug',\r\n )\r\n ) ,\r\n ) ,\r\n 'recursive' => 3,\r\n ));\r\n //do capture for credit card\r\n if (!empty($item['ItemUser'])) {\r\n App::import('Core', 'ComponentCollection');\r\n $collection = new ComponentCollection();\r\n App::import('Component', 'Paypal');\r\n $this->Paypal = new PaypalComponent($collection);\r\n $paymentGateways = $this->User->Transaction->PaymentGateway->find('all', array(\r\n 'conditions' => array(\r\n 'PaymentGateway.id' => array(\r\n ConstPaymentGateways::CreditCard,\r\n ConstPaymentGateways::AuthorizeNet\r\n ) ,\r\n ) ,\r\n 'contain' => array(\r\n 'PaymentGatewaySetting' => array(\r\n 'fields' => array(\r\n 'PaymentGatewaySetting.key',\r\n 'PaymentGatewaySetting.test_mode_value',\r\n 'PaymentGatewaySetting.live_mode_value',\r\n ) ,\r\n ) ,\r\n ) ,\r\n 'recursive' => 1\r\n ));\r\n foreach($paymentGateways as $paymentGateway) {\r\n if ($paymentGateway['PaymentGateway']['id'] == ConstPaymentGateways::CreditCard) {\r\n if (!empty($paymentGateway['PaymentGatewaySetting'])) {\r\n foreach($paymentGateway['PaymentGatewaySetting'] as $paymentGatewaySetting) {\r\n if ($paymentGatewaySetting['key'] == 'directpay_API_UserName') {\r\n $paypal_sender_info['API_UserName'] = $paymentGateway['PaymentGateway']['is_test_mode'] ? $paymentGatewaySetting['test_mode_value'] : $paymentGatewaySetting['live_mode_value'];\r\n }\r\n if ($paymentGatewaySetting['key'] == 'directpay_API_Password') {\r\n $paypal_sender_info['API_Password'] = $paymentGateway['PaymentGateway']['is_test_mode'] ? $paymentGatewaySetting['test_mode_value'] : $paymentGatewaySetting['live_mode_value'];\r\n }\r\n if ($paymentGatewaySetting['key'] == 'directpay_API_Signature') {\r\n $paypal_sender_info['API_Signature'] = $paymentGateway['PaymentGateway']['is_test_mode'] ? $paymentGatewaySetting['test_mode_value'] : $paymentGatewaySetting['live_mode_value'];\r\n }\r\n $paypal_sender_info['is_testmode'] = $paymentGateway['PaymentGateway']['is_test_mode'];\r\n }\r\n }\r\n }\r\n if ($paymentGateway['PaymentGateway']['id'] == ConstPaymentGateways::AuthorizeNet) {\r\n if (!empty($paymentGateway['PaymentGatewaySetting'])) {\r\n foreach($paymentGateway['PaymentGatewaySetting'] as $paymentGatewaySetting) {\r\n if ($paymentGatewaySetting['key'] == 'authorize_net_api_key') {\r\n $authorize_sender_info['api_key'] = $paymentGateway['PaymentGateway']['is_test_mode'] ? $paymentGatewaySetting['test_mode_value'] : $paymentGatewaySetting['live_mode_value'];\r\n }\r\n if ($paymentGatewaySetting['key'] == 'authorize_net_trans_key') {\r\n $authorize_sender_info['trans_key'] = $paymentGateway['PaymentGateway']['is_test_mode'] ? $paymentGatewaySetting['test_mode_value'] : $paymentGatewaySetting['live_mode_value'];\r\n }\r\n }\r\n }\r\n $authorize_sender_info['is_test_mode'] = $paymentGateway['PaymentGateway']['is_test_mode'];\r\n }\r\n }\r\n $paidItemUsers = array();\r\n foreach($item['ItemUser'] as $ItemUser) {\r\n if (!$ItemUser['is_paid'] && $ItemUser['payment_gateway_id'] != ConstPaymentGateways::Wallet) {\r\n $payment_response = array();\r\n if ($ItemUser['payment_gateway_id'] == ConstPaymentGateways::AuthorizeNet) {\r\n $capture = 0;\r\n require_once (APP . 'vendors' . DS . 'CIM' . DS . 'AuthnetCIM.class.php');\r\n if ($authorize_sender_info['is_test_mode']) {\r\n $cim = new AuthnetCIM($authorize_sender_info['api_key'], $authorize_sender_info['trans_key'], true);\r\n } else {\r\n $cim = new AuthnetCIM($authorize_sender_info['api_key'], $authorize_sender_info['trans_key']);\r\n }\r\n $ItemUser['discount_amount'] = $this->_convertAuthorizeAmount($ItemUser['discount_amount'], $ItemUser['AuthorizenetDocaptureLog']['rate']);\r\n $cim->setParameter('amount', $ItemUser['discount_amount']);\r\n $cim->setParameter('refId', time());\r\n $cim->setParameter('customerProfileId', $ItemUser['User']['cim_profile_id']);\r\n $cim->setParameter('customerPaymentProfileId', $ItemUser['payment_profile_id']);\r\n $cim_transaction_type = 'profileTransAuthCapture';\r\n if (!empty($ItemUser['cim_approval_code'])) {\r\n $cim->setParameter('approvalCode', $ItemUser['cim_approval_code']);\r\n $cim_transaction_type = 'profileTransCaptureOnly';\r\n }\r\n $title = Configure::read('site.name') . ' - Item Bought';\r\n $description = 'Item Bought in ' . Configure::read('site.name');\r\n // CIM accept only 30 character in title\r\n if (strlen($title) > 30) {\r\n $title = substr($title, 0, 27) . '...';\r\n }\r\n $unit_amount = $ItemUser['discount_amount']/$ItemUser['quantity'];\r\n $cim->setLineItem($ItemUser['item_id'], $title, $description, $ItemUser['quantity'], $unit_amount);\r\n $cim->createCustomerProfileTransaction($cim_transaction_type);\r\n $response = $cim->getDirectResponse();\r\n $response_array = explode(',', $response);\r\n if ($cim->isSuccessful() && $response_array[0] == 1) {\r\n $capture = 1;\r\n }\r\n $data_authorize_docapture_log['AuthorizenetDocaptureLog']['item_user_id'] = $ItemUser['id'];\r\n $data_authorize_docapture_log['AuthorizenetDocaptureLog']['authorize_response_text'] = $cim->getResponseText();\r\n $data_authorize_docapture_log['AuthorizenetDocaptureLog']['authorize_authorization_code'] = $cim->getAuthCode();\r\n $data_authorize_docapture_log['AuthorizenetDocaptureLog']['authorize_avscode'] = $cim->getAVSResponse();\r\n $data_authorize_docapture_log['AuthorizenetDocaptureLog']['transactionid'] = $cim->getTransactionID();\r\n $data_authorize_docapture_log['AuthorizenetDocaptureLog']['authorize_amt'] = $response_array[9];\r\n $data_authorize_docapture_log['AuthorizenetDocaptureLog']['authorize_gateway_feeamt'] = $response[32];\r\n $data_authorize_docapture_log['AuthorizenetDocaptureLog']['authorize_cvv2match'] = $cim->getCVVResponse();\r\n $data_authorize_docapture_log['AuthorizenetDocaptureLog']['authorize_response'] = $response;\r\n if (!empty($capture)) {\r\n $data_authorize_docapture_log['AuthorizenetDocaptureLog']['payment_status'] = 'Completed';\r\n }\r\n $this->ItemUser->AuthorizenetDocaptureLog->save($data_authorize_docapture_log);\r\n } else {\r\n //doCapture process for credit card and paypal auth\r\n if ($ItemUser['payment_gateway_id'] == ConstPaymentGateways::CreditCard && !empty($ItemUser['PaypalDocaptureLog']['authorizationid'])) {\r\n $post_info['authorization_id'] = $ItemUser['PaypalDocaptureLog']['authorizationid'];\r\n $post_info['amount'] = $ItemUser['PaypalDocaptureLog']['dodirectpayment_amt'];\r\n $post_info['invoice_id'] = $ItemUser['PaypalDocaptureLog']['id'];\r\n $post_info['currency'] = $ItemUser['PaypalDocaptureLog']['currencycode'];\r\n } else if ($ItemUser['payment_gateway_id'] == ConstPaymentGateways::PayPalAuth && !empty($ItemUser['PaypalTransactionLog']['authorization_auth_id'])) {\r\n $post_info['authorization_id'] = $ItemUser['PaypalTransactionLog']['authorization_auth_id'];\r\n $post_info['amount'] = $ItemUser['PaypalTransactionLog']['authorization_auth_amount'];\r\n $post_info['invoice_id'] = $ItemUser['PaypalTransactionLog']['id'];\r\n $post_info['currency'] = $ItemUser['PaypalTransactionLog']['mc_currency'];\r\n }\r\n $post_info['CompleteCodeType'] = 'Complete';\r\n $post_info['note'] = __l('Item Payment');\r\n //call doCapture from paypal component\r\n $payment_response = $this->Paypal->doCapture($post_info, $paypal_sender_info);\r\n }\r\n if ((!empty($payment_response) && $payment_response['ACK'] == 'Success') || !empty($capture)) {\r\n //update PaypalDocaptureLog for credit card\r\n if ($ItemUser['payment_gateway_id'] == ConstPaymentGateways::CreditCard) {\r\n $data_paypal_docapture_log['PaypalDocaptureLog']['id'] = $ItemUser['PaypalDocaptureLog']['id'];\r\n foreach($payment_response as $key => $value) {\r\n if ($key != 'AUTHORIZATIONID' && $key != 'VERSION' && $key != 'CURRENCYCODE') {\r\n $data_paypal_docapture_log['PaypalDocaptureLog']['docapture_' . strtolower($key) ] = $value;\r\n }\r\n }\r\n $data_paypal_docapture_log['PaypalDocaptureLog']['docapture_response'] = serialize($payment_response);\r\n $data_paypal_docapture_log['PaypalDocaptureLog']['payment_status'] = 'Completed';\r\n $this->ItemUser->PaypalDocaptureLog->save($data_paypal_docapture_log);\r\n } else if ($ItemUser['payment_gateway_id'] == ConstPaymentGateways::PayPalAuth) {\r\n //update PaypalTransactionLog for PayPalAuth\r\n $data_paypal_capture_log['PaypalTransactionLog']['id'] = $ItemUser['PaypalTransactionLog']['id'];\r\n foreach($payment_response as $key => $value) {\r\n $data_paypal_capture_log['PaypalTransactionLog']['capture_' . strtolower($key) ] = $value;\r\n }\r\n $data_paypal_capture_log['PaypalTransactionLog']['capture_data'] = serialize($payment_response);\r\n $data_paypal_capture_log['PaypalTransactionLog']['error_no'] = '0';\r\n $data_paypal_capture_log['PaypalTransactionLog']['payment_status'] = 'Completed';\r\n $this->ItemUser->PaypalTransactionLog->save($data_paypal_capture_log);\r\n }\r\n // need to updatee item user record is_paid as 1\r\n $paidItemUsers[] = $ItemUser['id'];\r\n //add amount to wallet\r\n // coz of 'act like groupon' logic, amount updated from what actual taken, instead of updating item amount directly.\r\n if (!empty($ItemUser['PaypalTransactionLog']['orginal_amount'])) {\r\n $paid_amount = $ItemUser['PaypalTransactionLog']['orginal_amount'];\r\n } elseif (!empty($ItemUser['PaypalDocaptureLog']['original_amount'])) {\r\n $paid_amount = $ItemUser['PaypalDocaptureLog']['original_amount'];\r\n }\r\n $data['Transaction']['user_id'] = $ItemUser['user_id'];\r\n $data['Transaction']['foreign_id'] = ConstUserIds::Admin;\r\n $data['Transaction']['class'] = 'SecondUser';\r\n //$data['Transaction']['amount'] = $ItemUser['discount_amount'];\r\n $data['Transaction']['amount'] = $paid_amount;\r\n $data['Transaction']['transaction_type_id'] = ConstTransactionTypes::AddedToWallet;\r\n $data['Transaction']['payment_gateway_id'] = $ItemUser['payment_gateway_id'];\r\n $transaction_id = $this->User->Transaction->log($data);\r\n if (!empty($transaction_id)) {\r\n $this->User->updateAll(array(\r\n 'User.available_balance_amount' => 'User.available_balance_amount +' . $paid_amount\r\n ) , array(\r\n 'User.id' => $ItemUser['user_id']\r\n ));\r\n }\r\n //Buy item transaction\r\n $transaction['Transaction']['user_id'] = $ItemUser['user_id'];\r\n $transaction['Transaction']['foreign_id'] = $ItemUser['id'];\r\n $transaction['Transaction']['class'] = 'ItemUser';\r\n $transaction['Transaction']['amount'] = $paid_amount;\r\n $transaction['Transaction']['payment_gateway_id'] = $ItemUser['payment_gateway_id'];\r\n if (!empty($ItemUser['PaypalTransactionLog']['rate'])) {\r\n $transaction['Transaction']['currency_id'] = $ItemUser['PaypalTransactionLog']['currency_id'];\r\n $transaction['Transaction']['converted_currency_id'] = $ItemUser['PaypalTransactionLog']['converted_currency_id'];\r\n $transaction['Transaction']['converted_amount'] = $ItemUser['PaypalTransactionLog']['mc_gross'];\r\n $transaction['Transaction']['rate'] = $ItemUser['PaypalTransactionLog']['rate'];\r\n }\r\n if (!empty($ItemUser['PaypalDocaptureLog']['rate'])) {\r\n $transaction['Transaction']['currency_id'] = $ItemUser['PaypalDocaptureLog']['currency_id'];\r\n $transaction['Transaction']['converted_currency_id'] = $ItemUser['PaypalDocaptureLog']['converted_currency_id'];\r\n $transaction['Transaction']['converted_amount'] = $ItemUser['PaypalDocaptureLog']['dodirectpayment_amt'];\r\n $transaction['Transaction']['rate'] = $ItemUser['PaypalDocaptureLog']['rate'];\r\n }\r\n if (!empty($ItemUser['AuthorizenetDocaptureLog']['rate'])) {\r\n $transaction['Transaction']['currency_id'] = $ItemUser['AuthorizenetDocaptureLog']['currency_id'];\r\n $transaction['Transaction']['converted_currency_id'] = $ItemUser['AuthorizenetDocaptureLog']['converted_currency_id'];\r\n $transaction['Transaction']['converted_amount'] = $ItemUser['AuthorizenetDocaptureLog']['authorize_amt'];\r\n $transaction['Transaction']['rate'] = $ItemUser['AuthorizenetDocaptureLog']['rate'];\r\n }\r\n $transaction['Transaction']['transaction_type_id'] = (!empty($ItemUser['is_gift'])) ? ConstTransactionTypes::ItemGift : ConstTransactionTypes::BuyItem;\r\n $this->User->Transaction->log($transaction);\r\n //user update\r\n $this->User->updateAll(array(\r\n 'User.available_balance_amount' => 'User.available_balance_amount -' . $paid_amount\r\n ) , array(\r\n 'User.id' => $ItemUser['user_id']\r\n ));\r\n } else {\r\n //ack from paypal is not succes, so increasing payment_failed_count in items table\r\n $this->updateAll(array(\r\n 'Item.payment_failed_count' => 'Item.payment_failed_count +' . $ItemUser['quantity'],\r\n ) , array(\r\n 'Item.id' => $ItemUser['item_id']\r\n ));\r\n }\r\n }\r\n }\r\n if (!empty($paidItemUsers)) {\r\n //update is_paid field\r\n $this->ItemUser->updateAll(array(\r\n 'ItemUser.is_paid' => 1\r\n ) , array(\r\n 'ItemUser.id' => $paidItemUsers\r\n ));\r\n // paid user \"is_paid\" field update on $item array, bcoz this array pass the _sendPassMail.\r\n if (!empty($item['ItemUser'])) {\r\n foreach($item['ItemUser'] as &$item_user) {\r\n foreach($paidItemUsers as $paid) {\r\n if ($item_user['id'] == $paid) {\r\n $item_user['is_paid'] = 1;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n //do capture for credit card end\r\n //send pass mail to users when item tipped\r\n $this->_sendPassMail($item);\r\n if (!$item_details['Item']['is_pass_mail_sent']) {\r\n //update in items table as pass_mail_sent\r\n $this->updateAll(array(\r\n 'Item.is_pass_mail_sent' => 1\r\n ) , array(\r\n 'Item.id' => $item['Item']['id']\r\n ));\r\n }\r\n }", "public function checkShipment($items) {\n if (!is_array($items)) {\n return 0;\n }\n $arItems = array();\n $arStockItems = array();\n $orderItems = Mage::getModel('sales/order_item')\n ->getCollection()\n ->addFieldToFilter('item_id', array('in' => array_keys($items)));\n if ($orderItems->getSize()) {\n foreach ($orderItems as $orderItem) {\n $arItems[$orderItem->getId()] = $orderItem;\n $arStockItems[$orderItem->getProductId()] = $orderItem->getProductId();\n }\n }\n\n $stockItems = Mage::getModel('cataloginventory/stock_item')\n ->getCollection()\n ->addFieldToFilter('product_id', array('in' => array_keys($arStockItems)));\n if ($stockItems->getSize()) {\n foreach ($stockItems as $stockItem) {\n $arStockItems[$stockItem->getProductId()] = $stockItem;\n }\n }\n foreach ($items as $item_id => $qty) {\n $item = $arItems[$item_id];\n $stockItem = $arStockItems[$item->getProductId()];\n $manageStock = $stockItem->getManageStock();\n if ($stockItem->getUseConfigManageStock()) {\n $manageStock = Mage::getStoreConfig('cataloginventory/item_options/manage_stock', Mage::app()->getStore()->getStoreId());\n }\n if (!$manageStock) {\n continue;\n }\n if (in_array($item->getProductType(), array('configurable', 'bundle', 'grouped', 'virtual', 'downloadable')))\n continue;\n\n if ($this->selectWarehouseToShip($item->getProductId(), $qty) == 0) {\n return 0;\n };\n }\n return 1;\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}", "function itemExists(Array $args = array())\n {\n $itemid = isset($args['itemid']) ? $args['itemid'] : $this->object->itemid;\n\n // Make sure we have a primary field\n if (empty($this->object->primary)) throw new Exception(xarML('The object #(1) has no primary key', $this->object->name));\n\n $q = $this->object->dataquery;\n $primary = $this->object->properties[$this->object->primary]->source;\n $q->eq($primary, (int)$itemid);\n\n // Run it\n if (!$q->run()) throw new Exception(xarML('Query failed'));\n $result = $q->output();\n return !empty($result);\n \n }", "public function completeOrder($id,$userID) {\n $result = ['error' => true, 'message' => ''];\n $dataSource = $this->getDataSource();\n // ToDo : find model in associations, dont load it\n $WarehousePermission = ClassRegistry::init('WarehousePermission');\n $WarehouseLocationItem = ClassRegistry::init('WarehouseLocationItem');\n $WarehouseLocationAddress = ClassRegistry::init('WarehouseLocationAddress');\n\n try {\n $dataSource->begin();\n\n $order = $this->find('first',[\n 'conditions' => [\n 'WarehouseOrder.id' => $id\n ],\n 'contain' => [\n 'WarehouseOrderItem'\n ]\n ]);\n\n // check if the user has the permission to complete the order\n $warehousePermission = $WarehousePermission->find('first',[\n 'conditions' => [\n 'user_id' => $userID,\n 'warehouse_location_id' => $order['WarehouseOrder']['transfer_to']\n ]\n ]);\n\n if ( !$warehousePermission ) {\n $result['message'] = 'Nemate dozvolu da prihvatite ovu prenosnicu';\n\n return $result;\n }\n\n if ( $order['WarehouseOrder']['status'] === 'isporucen' ) {\n $result['message'] = 'Roba u prenosnici je vec primljena';\n\n return $result;\n }\n\n if ( $order['WarehouseOrder']['status'] !== 'spreman' ) {\n $result['message'] = 'Prenosnica nije odobrena od strane operatera predajnog magacina';\n\n return $result;\n }\n\n // for each item, if item doesnt exist in the location, create it\n // otherwise update it\n foreach ( $order['WarehouseOrderItem'] as $warehouseOrderItem ) {\n // $WarehouseLocationAddress->create();\n\n // check if the article exist at this address\n $address = $WarehouseLocationAddress->find('first',[\n 'conditions' => [\n 'item_id' => $warehouseOrderItem['item_id'],\n 'warehouse_address_id' => $warehouseOrderItem['warehouse_address_received_id']\n ]\n ]);\n\n // item is found \n if ( $address ) {\n $WarehouseLocationAddress->id = $address['WarehouseLocationAddress']['id'];\n\n $isSaved = $WarehouseLocationAddress->saveField(\n 'quantity',\n $address['WarehouseLocationAddress']['quantity'] + $warehouseOrderItem['quantity_issued']\n );\n\n if ( !$isSaved ) {\n $dataSource->rollback();\n\n $result['message'] = 'Doslo je do greske, pokusajte ponovo';\n\n return $result;\n }\n\n } else {\n $WarehouseLocationAddress->create();\n\n $isSaved = $WarehouseLocationAddress->save([\n 'WarehouseLocationAddress' => [\n 'item_id' => $warehouseOrderItem['item_id'],\n 'warehouse_address_id' => $warehouseOrderItem['warehouse_address_received_id'],\n 'quantity' => $warehouseOrderItem['quantity_issued']\n ]\n ]);\n\n if ( !$isSaved ) {\n $dataSource->rollback();\n\n $result['message'] = 'Doslo je do greske, pokusajte ponovo';\n\n return $result;\n }\n }\n\n $warehouseLocationItem = $WarehouseLocationItem->find('first',[\n 'conditions' => [\n 'item_id' => $warehouseOrderItem['item_id'],\n 'warehouse_location_id' => $order['WarehouseOrder']['transfer_from']\n ]\n ]);\n\n $WarehouseLocationItem->id = $warehouseLocationItem['WarehouseLocationItem']['id'];\n\n // add this to the avaible quantity\n $difference = $warehouseLocationItem['WarehouseLocationItem']['quantity_reserved'] - $warehouseOrderItem['quantity_issued'];\n $quantityAvaible = $warehouseLocationItem['WarehouseLocationItem']['quantity_available'] + $difference;\n\n $reservedQuantity = $warehouseOrderItem['quantity_issued'] > $warehouseOrderItem['quantity_wanted']\n ? $warehouseOrderItem['quantity_issued']\n : $warehouseOrderItem['quantity_wanted'];\n\n $WarehouseLocationItem->set([\n 'WarehouseLocationItem' => [\n 'id' => $warehouseLocationItem['WarehouseLocationItem']['id'],\n 'quantity_reserved' => $warehouseLocationItem['WarehouseLocationItem']['quantity_reserved'] - $reservedQuantity,\n 'quantity_available' => $quantityAvaible\n ]\n ]);\n\n if ( !$WarehouseLocationItem->save() ) {\n $dataSource->rollback();\n\n $result['message'] = 'Doslo je do greske, pokusajte ponovo';\n \n return $result;\n }\n\n // now create or update location items table with the new items\n // if found just update the quanity\n // if not make a new record\n $warehouseLocationItem = $WarehouseLocationItem->find('first',[\n 'conditions' => [\n 'item_id' => $warehouseOrderItem['item_id'],\n 'warehouse_location_id' => $order['WarehouseOrder']['transfer_to']\n ]\n ]);\n\n if ( $warehouseLocationItem ) {\n $WarehouseLocationItem->id = $warehouseLocationItem['WarehouseLocationItem']['id'];\n\n $isSaved = $WarehouseLocationAddress->saveField(\n 'quantity_available',\n $warehouseLocationItem['WarehouseLocationItem']['quantity_available'] + $warehouseOrderItem['quantity_issued']\n );\n\n if ( !$isSaved ) {\n $dataSource->rollback();\n\n $result['message'] = 'Doslo je do greske, pokusajte ponovo';\n \n return $result;\n }\n } else {\n $WarehouseLocationItem->create();\n\n $WarehouseLocationItem->set([\n 'WarehouseLocationItem' => [\n 'warehouse_location_id' => $order['WarehouseOrder']['transfer_to'],\n 'item_id' => $warehouseOrderItem['item_id'],\n 'quantity_available' => $warehouseOrderItem['quantity_issued']\n ]\n ]);\n\n if ( !$WarehouseLocationItem->save() ) {\n $dataSource->rollback();\n\n $result['message'] = 'Doslo je do greske, pokusajte ponovo';\n \n return $result;\n }\n }\n }\n\n //update the status of the order \n $this->id = $id;\n\n $this->set([\n 'WarehouseOrder' => [\n 'status' => 'isporucen',\n 'received_by' => $userID\n ]\n ]);\n\n if ( !$this->save() ) {\n $dataSource->rollback();\n\n $result['message'] = 'Doslo je do greske, pokusajte ponovo';\n\n return $result;\n }\n\n $dataSource->commit();\n\n $result['error'] = false;\n\n return $result;\n\n } catch(Exception $e) {\n $dataSource->rollback();\n\n $result['message'] = 'Doslo je do greske, pokusajte ponovo';\n\n return $result;\n }\n }", "public function itemissuedetails(){\n\t$sel='ii_id,ii_itemid,ii_mtid,ii_name,ii_qty,ii_desc,ii_staffpfno,ii_staffname,ii_dept,ii_receivername,ii_creatordate';\n\t$whorder='ii_mtid asc,ii_itemid asc';\n\t$data['result'] = $this->picomodel->get_orderlistspficemore('items_issued',$sel,'',$whorder);\n $this->logger->write_logmessage(\"view\",\" View Item List setting\", \"Item List setting details...\");\n\t$this->logger->write_dblogmessage(\"view\",\" View Item List setting\", \"Item List setting details...\");\n $this->load->view('itemaction/displayissueitem',$data);\n }", "public function update_items($order_id, $update, $act = 'update')\n {\n\n $order_info = $this->get($order_id);\n if ($order_info == FALSE)\n return FALSE;\n\n $found_item = FALSE;\n $item_string = '';\n $place = 0;\n\n // Process items already on the order.\n foreach ($order_info['items'] as $item) {\n if ($item['hash'] == $update['item_hash']) {\n $found_item = TRUE;\n $quantity = ($act == 'update') ? ($item['quantity'] + $update['quantity']) : ($update['quantity']);\n } else {\n $quantity = $item['quantity'];\n }\n\n if ($quantity > 0) {\n if ($place++ !== 0) $item_string .= \":\";\n\n $item_string .= $item['hash'] . \"-\" . $quantity . \"-\" . $update['fx'].\"-\".$update['price'];\n }\n }\n // If we haven't encountered the item on the list, add it now.\n if ($found_item == FALSE) {\n if ($update['quantity'] > 0)\n $item_string .= ((strlen($item_string)>0)?':':'') . $update['item_hash'] . \"-\" . $update['quantity'] . \"-\". $update['fx'].\"-\".$update['price'];\n }\n\n // Delete order if the item_string is empty.\n if (empty($item_string)) {\n $this->delete($order_id);\n return TRUE;\n }\n\n $order = array('items' => $item_string,\n 'price' => $this->calculate_price($item_string),\n 'time' => time());\n\n $this->db->where('id', $order_id)\n ->where('progress', '0');\n return $this->db->update('orders', $order) == TRUE;\n\n }", "public function initOrderDetail(&$orderItem, $item) {\n $payMethod = array('pm_id' => '',\n 'title' => $item['payment_method'],\n 'description' => '');\n\n $orderItem = array('order_id' => $item['order_id'],\n 'display_id' => $item['order_id'], //show id\n 'uname' => $item['shipping_firstname'] . ' ' . $item['shipping_lastname'],\n 'currency' => $item['currency_code'],\n 'shipping_address' => array(),\n 'billing_address' => array(),\n 'payment_method' => $payMethod,\n 'shipping_insurance' => '',\n 'coupon' => $item['coupon_id'],\n 'order_status' => array(),\n 'last_status_id' => $item['order_status_id'], //get current status from history\n 'order_tax' => $item['fax'],\n 'order_date_start' => $item['date_added'],\n 'order_date_finish' => '',\n 'order_date_purchased' => $item['date_modified']);\n }", "public function view_order_details($order_id)\n\t{\n $log=new Log(\"OrderDetailsRCV.log\");\n $query = $this->db->query(\"SELECT oc_po_order.*,\".DB_PREFIX.\"user.firstname,\".DB_PREFIX.\"user.lastname\n\t\t\t\tFROM oc_po_order\n\t\t\t\t\tLEFT JOIN \".DB_PREFIX.\"user\n\t\t\t\t\t\tON \".DB_PREFIX.\"user.user_id = oc_po_order.user_id\n\t\t\t\t\t\t\tWHERE id = \" . $order_id . \" AND delete_bit = \" . 1);\n $log->write($query);\n $order_info = $query->row;\n\t\t//ON (oc_po_receive_details.product_id = oc_po_product.id)\n\t\t$query = $this->db->query(\"SELECT\n\t\toc_po_product.*,oc_po_receive_details.quantity as rd_quantity,oc_po_receive_details.price,oc_po_supplier.first_name,oc_po_supplier.last_name,oc_po_supplier.id as supplier_id,oc_po_receive_details.order_id\n\t\tFROM\n\t\t\toc_po_receive_details\n\t\tINNER JOIN oc_po_product \n\t\t\tON (oc_po_receive_details.order_id = oc_po_product.order_id)\n\t\tLEFT JOIN oc_po_supplier \n\t\t\tON (oc_po_receive_details.supplier_id = oc_po_supplier.id)\n\t\t\t\tWHERE (oc_po_receive_details.order_id =\".$order_id.\")\");\n $log->write($query);\n\tif($this->db->countAffected() > 0)\n\t{\n\t\t$products = $query->rows;\n\t\t$quantities = array();\n\t\t$all_quantities = array();\n\t\t$prices = array();\n\t\t$all_prices = array();\n\t\t$suppliers = array();\n\t\t$all_suppliers = array();\n\t\t$supplier_names = array();\n\t\t$all_supplier_names = array();\n\t\t$index = 0;\n\t\t$index1 = 0;\n\t\tfor($i =0; $i<count($products); $i++)\n\t\t{\n\t\t\tif($products[$i] != \"\")\n\t\t\t{\n\t\t\t\tfor($j = 0; $j<count($products); $j++)\n\t\t\t\t{\n\t\t\t\t\tif($products[$j] != \"\")\n\t\t\t\t\t{\n\t\t\t\t\t\tif($products[$i]['id'] == $products[$j]['id'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$quantities[$index] = $products[$j]['rd_quantity'];\n\t\t\t\t\t\t\t$supplier_names[$index] = $products[$j]['first_name'] .\" \". $products[$j]['last_name'];\n\t\t\t\t\t\t\t$suppliers[$index] = $products[$j]['supplier_id'];\n\t\t\t\t\t\t\t$prices[$index] = $products[$j]['price'];\n\t\t\t\t\t\t\tif($j!=$i)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$products[$j] = \"\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$index++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$index = 0;\n\t\t\t\t$all_quantities[$index1] = $quantities;\n\t\t\t\t$all_suppliers[$index1] = $suppliers;\n\t\t\t\t$all_prices[$index1] = $prices;\n\t\t\t\t$all_supplier_names[$index1] = $supplier_names;\n\t\t\t\tunset($quantities);\n\t\t\t\tunset($suppliers);\n\t\t\t\tunset($prices);\n\t\t\t\tunset($supplier_names);\n\t\t\t\t$quantities = array();\n\t\t\t\t$suppliers = array();\n\t\t\t\t$prices = array();\n\t\t\t\t$supplier_names = array();\n\t\t\t\t$index1++;\n\t\t\t}\n\t\t}\n\t\t$products = array_values(array_filter($products));\n\t\tfor($i = 0; $i<count($products); $i++)\n\t\t{\n\t\t\tunset($products[$i]['rd_quantity']);\n\t\t\tunset($products[$i]['first_name']);\n\t\t\tunset($products[$i]['last_name']);\n\t\t\t$products[$i]['quantities'] = $all_quantities[$i];\n\t\t\t$products[$i]['suppliers'] = $all_suppliers[$i];\n\t\t\t$products[$i]['prices'] = $all_prices[$i];\n\t\t\t$products[$i]['supplier_names'] = $all_supplier_names[$i];\n\t\t}\n\t}\n\telse\n\t{\n\t\t$query = $this->db->query(\"SELECT * FROM oc_po_product WHERE order_id = \" . $order_info['id']);\n\t\t$products = $query->rows;\n\t}\n\t\t$i = 0;\n\t\tforeach($products as $product)\n\t\t{\n\t\t\t$query = $this->db->query(\"SELECT * FROM oc_po_attribute_group WHERE product_id = \". $product['id']);\n\t\t\t$attribute_groups[$i] = $query->rows;\n\t\t\t$i++;\n\t\t}\n\t\t\n\t\t$i = 0;\n\t\tforeach($attribute_groups as $attribute_group)\n\t\t{\n\t\t\tfor($j = 0; $j<count($attribute_group);$j++)\n\t\t\t{\n\t\t\t\t$query = $this->db->query(\"SELECT * FROM oc_po_attribute_category WHERE attribute_group_id = \". $attribute_group[$j]['id']);\n\t\t\t\t$attribute_categories[$i] = $query->row;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\t\tfor($i=0;$i<count($products); $i++)\n\t\t{\n\t\t\tfor($j=0; $j<count($attribute_groups[$i]);$j++)\n\t\t\t{\n\t\t\t\t$products[$i]['attribute_groups'][$j] = $attribute_groups[$i][$j]['name'];\n\t\t\t}\n\t\t}\n\t\t$start_loop = 0;\n\t\t//$attribute_categories = array_values(array_filter($attribute_categories));\n\t\t//print_r($attribute_categories);\n\t\t//exit;\n\t\tfor($i=0; $i<count($products); $i++)\n\t\t{\n\t\t\tfor($j=$start_loop; $j<($start_loop + count($products[$i]['attribute_groups']));$j++)\n\t\t\t{\n\t\t\t\t$products[$i]['attribute_category'][$j] = $attribute_categories[$j]['name'];\n\t\t\t}\n\t\t\t$start_loop = $j;\n\t\t}\n\t\t$order_information['products'] = $products;\n\t\t$order_information['order_info'] = $order_info;\n\t\treturn $order_information;\n\t}", "public function detailGrNotApprove($item){\n /* buat query temporary untuk dijoinkan dengan ec_gr_status */\n $_tmp = array();\n foreach($item as $i){\n $_t = array();\n foreach($i as $_k => $_v){\n array_push($_t,$_v .' as '.$_k);\n }\n array_push($_tmp,'select '.implode(',',$_t).' from dual');\n }\n $sql_tmp = implode(' union ',$_tmp);\n $sql = <<<SQL\n select EGS.*\n from EC_GR_STATUS EGS\n join ({$sql_tmp})TT\n on TT.GR_NO = EGS.GR_NO and TT.GR_YEAR = EGS.GR_YEAR and TT.GR_ITEM_NO = EGS.GR_ITEM_NO\n where EGS.STATUS = 0\nSQL;\n //log_message('ERROR',$sql);\n return $this->db->query($sql)->result_array();\n }", "function show_estimated_ship_date_new_subscription_orders_email( $order ) { \n $item = array_pop( $order->get_items() );\n if ( $order->status == 'processing' && $item['name'] != 'Try or Gift' ) {\n echo '<h2>Estimated Shipment Date</h2>';\n echo '<p>Your package ships by: <strong>' . new_orders_next_subscription_ship_date( $order->order_date ) . '</strong>.</p>';\n }\n}", "function getMembershipPurchaseDetails($order_id)\n\t\t{\n\t\t\t//get order details\n\t\t\t$order_details = $this->_BLL_obj->manage_content->getValue_where('membership_order_info', '*', 'membership_order_id', $order_id);\n\t\t\t$user_id = $order_details[0]['user_id'];\n\t\t\t//get user parent\n\t\t\t$user_mlm = $this->_BLL_obj->manage_content->getValue_where('user_mlm_info','*', 'user_id', $user_id);\n\t\t\tif(!empty($user_mlm[0]['parent_id']))\n\t\t\t{\n\t\t\t\t//get parent details\n\t\t\t\t$parent_mlm = $this->_BLL_obj->manage_content->getValueMultipleCondtn('user_mlm_info','*', array('id'), array($user_mlm[0]['parent_id']));\n\t\t\t\tif($parent_mlm[0]['member_level'] != 0)\n\t\t\t\t{\n\t\t\t\t\t//get transaction id for referral fee distribution\n\t\t\t\t\t$ref_id = uniqid('trans');\n\t\t\t\t\t//calling referral fee distribution function\n\t\t\t\t\t$ref_fee = $this->calculateReferralFee($parent_mlm[0]['user_id'], $order_details, $ref_id);\n\t\t\t\t\tif($ref_fee != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t//insert values to fee transaction info table\n\t\t\t\t\t\t$insert_referral = $this->_BLL_obj->manage_content->insertValue('fee_transaction_info', array('transaction_id','order_id','product_id','fee_type'), array($ref_id,$order_details[0]['membership_order_id'],$order_details[0]['membership_id'],'RF'));\n\t\t\t\t\t\t//new system value\n\t\t\t\t\t\t$new_system_value_per = $this->getSystemMoneyValue() - $ref_fee;\n\t\t\t\t\t\t//insert distributed amount to system money info\n\t\t\t\t\t\t$insert_per_amount = $this->_BLL_obj->manage_content->insertValue('system_money_info', array('specification','debit','system_balance'), array($ref_id,$ref_fee,$new_system_value_per));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}", "function wisataone_X1_is_order_exist($id_booking) {\n global $wpdb, $wisataone_X1_tblname;\n $wp_track_table = $wpdb->prefix . $wisataone_X1_tblname;\n\n $res = $wpdb->get_results(\n \"\n SELECT *\n FROM {$wp_track_table}\n WHERE {$wp_track_table}.id_order = {$id_booking}\n LIMIT 1\n \"\n );\n\n if ($res) {\n return $res[0];\n }\n\n return null;\n}", "public function view_order_details_mo($order_id)\n\t{\n $log=new Log(\"OrderDetailsRcvMo.log\");\n\t\t$query = $this->db->query(\"SELECT oc_po_order.*,\".DB_PREFIX.\"user.firstname,\".DB_PREFIX.\"user.lastname\n\t\t\t\tFROM oc_po_order\n\t\t\t\t\tLEFT JOIN \".DB_PREFIX.\"user\n\t\t\t\t\t\tON \".DB_PREFIX.\"user.user_id = oc_po_order.user_id\n\t\t\t\t\t\t\tWHERE id = \" . $order_id . \" AND delete_bit = \" . 1);\n $log->write($query);\n\t\t$order_info = $query->row;\n\t\t//ON (oc_po_receive_details.product_id = oc_po_product.id)\n $allprod=\"SELECT\n\t\toc_po_product.*,oc_po_receive_details.quantity as rd_quantity,oc_po_receive_details.price,oc_po_supplier.first_name,oc_po_supplier.last_name,oc_po_supplier.id as supplier_id,oc_po_receive_details.order_id\n\t\tFROM\n\t\t\toc_po_receive_details\n\t\tINNER JOIN oc_po_product \n\t\t\tON (oc_po_receive_details.order_id = oc_po_product.order_id)\n\t\tLEFT JOIN oc_po_supplier \n\t\t\tON (oc_po_receive_details.supplier_id = oc_po_supplier.id)\n\t\t\t\tWHERE oc_po_product.item_status <> 0 AND (oc_po_receive_details.order_id =\".$order_id.\")\";\n\t\t$log->write($allprod);\n $query = $this->db->query($allprod);\n \n $log->write($query);\n\tif($this->db->countAffected() > 0)\n\t{\n\t\t$products = $query->rows;\n\t\t$quantities = array();\n\t\t$all_quantities = array();\n\t\t$prices = array();\n\t\t$all_prices = array();\n\t\t$suppliers = array();\n\t\t$all_suppliers = array();\n\t\t$supplier_names = array();\n\t\t$all_supplier_names = array();\n\t\t$index = 0;\n\t\t$index1 = 0;\n\t\tfor($i =0; $i<count($products); $i++)\n\t\t{\n\t\t\tif($products[$i] != \"\")\n\t\t\t{\n\t\t\t\tfor($j = 0; $j<count($products); $j++)\n\t\t\t\t{\n\t\t\t\t\tif($products[$j] != \"\")\n\t\t\t\t\t{\n\t\t\t\t\t\tif($products[$i]['id'] == $products[$j]['id'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$quantities[$index] = $products[$j]['rd_quantity'];\n\t\t\t\t\t\t\t$supplier_names[$index] = $products[$j]['first_name'] .\" \". $products[$j]['last_name'];\n\t\t\t\t\t\t\t$suppliers[$index] = $products[$j]['supplier_id'];\n\t\t\t\t\t\t\t$prices[$index] = $products[$j]['price'];\n\t\t\t\t\t\t\tif($j!=$i)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$products[$j] = \"\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$index++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$index = 0;\n\t\t\t\t$all_quantities[$index1] = $quantities;\n\t\t\t\t$all_suppliers[$index1] = $suppliers;\n\t\t\t\t$all_prices[$index1] = $prices;\n\t\t\t\t$all_supplier_names[$index1] = $supplier_names;\n\t\t\t\tunset($quantities);\n\t\t\t\tunset($suppliers);\n\t\t\t\tunset($prices);\n\t\t\t\tunset($supplier_names);\n\t\t\t\t$quantities = array();\n\t\t\t\t$suppliers = array();\n\t\t\t\t$prices = array();\n\t\t\t\t$supplier_names = array();\n\t\t\t\t$index1++;\n\t\t\t}\n\t\t}\n\t\t$products = array_values(array_filter($products));\n\t\tfor($i = 0; $i<count($products); $i++)\n\t\t{\n\t\t\tunset($products[$i]['rd_quantity']);\n\t\t\tunset($products[$i]['first_name']);\n\t\t\tunset($products[$i]['last_name']);\n\t\t\t$products[$i]['quantities'] = $all_quantities[$i];\n\t\t\t$products[$i]['suppliers'] = $all_suppliers[$i];\n\t\t\t$products[$i]['prices'] = $all_prices[$i];\n\t\t\t$products[$i]['supplier_names'] = $all_supplier_names[$i];\n\t\t}\n\t}\n\telse\n\t{\n\t\t$query = $this->db->query(\"SELECT * FROM oc_po_product WHERE order_id = \" . $order_info['id']);\n\t\t$products = $query->rows;\n\t}\n\t\t$i = 0;\n\t\tforeach($products as $product)\n\t\t{\n\t\t\t$query = $this->db->query(\"SELECT * FROM oc_po_attribute_group WHERE product_id = \". $product['id']);\n\t\t\t$attribute_groups[$i] = $query->rows;\n\t\t\t$i++;\n\t\t}\n\t\t\n\t\t$i = 0;\n\t\tforeach($attribute_groups as $attribute_group)\n\t\t{\n\t\t\tfor($j = 0; $j<count($attribute_group);$j++)\n\t\t\t{\n\t\t\t\t$query = $this->db->query(\"SELECT * FROM oc_po_attribute_category WHERE attribute_group_id = \". $attribute_group[$j]['id']);\n\t\t\t\t$attribute_categories[$i] = $query->row;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\t\tfor($i=0;$i<count($products); $i++)\n\t\t{\n\t\t\tfor($j=0; $j<count($attribute_groups[$i]);$j++)\n\t\t\t{\n\t\t\t\t$products[$i]['attribute_groups'][$j] = $attribute_groups[$i][$j]['name'];\n\t\t\t}\n\t\t}\n\t\t$start_loop = 0;\n\t\t//$attribute_categories = array_values(array_filter($attribute_categories));\n\t\t//print_r($attribute_categories);\n\t\t//exit;\n\t\tfor($i=0; $i<count($products); $i++)\n\t\t{\n\t\t\tfor($j=$start_loop; $j<($start_loop + count($products[$i]['attribute_groups']));$j++)\n\t\t\t{\n\t\t\t\t$products[$i]['attribute_category'][$j] = $attribute_categories[$j]['name'];\n\t\t\t}\n\t\t\t$start_loop = $j;\n\t\t}\n\t\t$order_information['products'] = $products;\n\t\t$order_information['order_info'] = $order_info;\n\t\treturn $order_information;\n\t}", "public function gotItemCheck($id, $item)\n\t{\n\t\t$error = \"\";\n\t\t\n\t\tif ( !$id )\n\t\t{\n\t\t\t$error = str_replace( \"<%TYPE%>\", $this->lang->words['stock'], $this->lang->words['no_id'] );\n\t\t}\t\n\n\t\t#no item found by that ID? error!\n\t\tif ( !$error && !$item )\n\t\t{\n\t\t\t$error = str_replace( \"<%TYPE%>\", $this->lang->words['stock'], $this->lang->words['none_found_show'] );\t\t\n\t\t}\n\t\t\n\t\t#do I have permission to purchase this item? if not, error!\n\t\tif ( !$error && $item[ $this->abbreviation().'_use_perms'] && !$this->registry->permissions->check( 'open', $item ) )\n\t\t{\n\t\t\t$error = str_replace( \"<%TYPE%>\", $this->lang->words['stock'], $this->lang->words['no_perm_to_buy_it'] );\t\t\n\t\t}\n\n\t\t#item isn't enabled currently? error!\n\t\tif ( !$error && !$item[ $this->abbreviation().'_on'] )\n\t\t{\n\t\t\t$error = str_replace( \"<%ITEM%>\", $this->lang->words['stock'], $this->lang->words['item_disabled'] );\n\t\t}\t\t\n\t\t\n\t\treturn $error;\n\t}", "public function updateAfterInsertDeliveryItem($sale_type, $status, $sale_item, $sent_quantity)\n {\n if ($sale_type == 'booking') {\n if ($status != 'packing') {\n $get_item = $this->getSaleBookingItem($sale_item->product_id, $sale_item->sale_id);\n if (!$get_item) {\n throw new \\Exception(lang(\"not_get_data\"));\n }\n // $get_item = $this->db->get_where('sale_booking_items', ['product_id' => $sale_item->product_id, 'sale_id' => $sale_item->sale_id])->row();\n $qty_deliver = $get_item->quantity_delivering + $sent_quantity;\n $qty_booking = $get_item->quantity_booking - $sent_quantity;\n $qty_delivered = $get_item->quantity_delivered + $sent_quantity;\n\n $get_wh = $this->getWarehouseProductCompany($get_item->warehouse_id, $sale_item->product_id);\n $get_prod = $this->site->getProductByID($sale_item->product_id);\n\n $wh_book = (int) $get_wh->quantity_booking - (int) $sent_quantity;\n $prod_book = (int) $get_prod->quantity_booking - (int) $sent_quantity;\n\n if ($wh_book < 0 || $prod_book < 0) {\n throw new \\Exception(lang(\"error_insert_delivery_item\"));\n }\n\n if ($status == 'delivered') {\n $update_booking = [\n \"quantity_booking\" => $qty_booking,\n \"quantity_delivering\" => $qty_deliver,\n \"quantity_delivered\" => $qty_delivered\n ];\n } else {\n $update_booking = [\n \"quantity_booking\" => $qty_booking,\n \"quantity_delivering\" => $qty_deliver\n ];\n }\n if (!$this->db->update('sale_booking_items', $update_booking, ['product_id' => $sale_item->product_id, 'sale_id' => $sale_item->sale_id])) {\n throw new \\Exception(lang(\"failed_update_sale_booking_item\"));\n } else {\n if (!$this->db->update('warehouses_products', ['quantity_booking' => $wh_book], ['warehouse_id' => $get_item->warehouse_id, 'product_id' => $sale_item->product_id, 'company_id' => $this->session->userdata('company_id')])) {\n throw new \\Exception(lang(\"failed_update_stock\"));\n } else {\n if (!$this->db->update('products', ['quantity_booking' => $prod_book], ['id' => $sale_item->product_id])) {\n throw new \\Exception(lang(\"failed_update_stock_prod\"));\n }\n }\n }\n }\n if ($this->db->update('sale_items', [\"sent_quantity\" => $sale_item->sent_quantity + $sent_quantity], ['id' => $sale_item->id])) {\n return true;\n }\n } elseif ($sale_type == NULL) {\n if ($this->db->update('sale_items', [\"sent_quantity\" => $sale_item->sent_quantity + $sent_quantity], ['id' => $sale_item->id])) {\n return true;\n }\n }\n return false;\n }", "function setOrderSend($object) { \n /* you can itentify the item with $object->Item->ShopId */ \n}", "public function testGetOrderDetailWithInvalidId(){\n \t \n \tPayU::$apiLogin = PayUTestUtil::API_LOGIN;\n \tPayU::$apiKey = PayUTestUtil::API_KEY;\n \t \n \tEnvironment::setReportsCustomUrl(PayUTestUtil::REPORTS_CUSTOM_URL);\n \n \t$parameters = array(\n \t\t\tPayUParameters::ORDER_ID => '123111123',\n \t);\n \t \n \t$response = PayUReports::getOrderDetail($parameters);\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}", "public static function getItems($id)\n {\n try{\n return DB::table('order_items')\n ->select('order_id','item_id','quantity','price','confirmed AS accept')\n ->where('order_id',$id)\n ->get();\n }\n catch(QueryException $e){\n return false;\n } \n }", "public function getorderitembyid($orderid){\n\t\t$this->db->where('OrdId', $orderid);\n\t\t$this->db->select('LintItemId,OrdId,ItemId,ItemName,ItemEdition,ItemAuther,ItemQuantity,ItemRetailPrice,ItemSellingPrice,ItemDiscount,ProductThumbImage,ProductLanguage');\n\t\t$this->db->from('tbl_order_lineitems');\n\t\t$this->db->join('tbl_products', 'tbl_products.ProductId = tbl_order_lineitems.ItemId', 'inner');\n\t\t$query=$this->db->get();\n\t\treturn $query->result();\n\t\t// $query=$this->db->get('tbl_order_lineitems');\n\t\t// return $query->result();\n\t}", "public function hasItemdata(){\n return $this->_has(22);\n }", "public function getDeliveryOrder();", "public function GetDetailByDOID($delivery_order_id)\n {\n $data = $this->deliveryOrderDetail::find($delivery_order_id)->get();\n if (!empty($data)) {\n return $data;\n } return null;\n }", "public function orderItem($param) { \n if (!$this->aaa->has_right('openruth', 500))\n $res->orderItemError->_value = 'authentication_error';\n else {\n $targets = $this->config->get_value('ruth', 'ztargets');\n $agencyId = self::strip_agency($param->agencyId->_value);\n if ($tgt = $targets[$agencyId]) {\n // build order\n $ord = &$order->Reservation->_value;\n $ord->LibraryNo->_value = $agencyId;\n $ord->BorrowerTicketNo->_value = $param->userId->_value;\n $ord->DisposalNote->_value = $param->orderNote->_value;\n $ord->LastUseDate->_value = self::to_zruth_date($param->orderLastInterestDate->_value);\n $ord->ServiceCounter->_value = $param->agencyCounter->_value;\n $ord->Override->_value = (self::xs_true($param->agencyCounter->_value) ? 'Y' : 'N');\n $ord->Priority->_value = $param->orderPriority->_value;\n // ?????? $ord->DisposalType->_value = $param->xxxx->_value;\n $itemIds = &$param->orderItemId;\n if (is_array($itemIds))\n foreach ($itemIds as $oid) {\n $mrid->ID->_value = $oid->_value->itemId->_value;\n if (!$mrid->TitlePartNo->_value = $oid->_value->itemSerialPartId->_value)\n $mrid->TitlePartNo->_value = 0;\n $ord->MRIDS->_value->MRID[]->_value = $mrid;\n }\n else {\n $mrid->ID->_value = $itemIds->_value->itemId->_value;\n if (!$mrid->TitlePartNo->_value = $itemIds->_value->itemSerialPartId->_value)\n $mrid->TitlePartNo->_value = 0;\n $ord->MRIDS->_value->MRID->_value = $mrid;\n }\n $xml = '<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?'.'>' . utf8_decode($this->objconvert->obj2xml($order));\n \n//print_r($ord);\n//print_r($xml);\n \n $z = new z3950();\n $z->set_target($tgt['host']);\n $z->set_database($tgt['database'].'-ophelia');\n $z->set_authentication($tgt['authentication']);\n if ($tgt['proxy']) {\n $z->set_proxy($tgt['proxy']);\n }\n $xml_ret = $z->z3950_xml_update($xml, $tgt['timeout']);\n if ($z->get_errno() == 0 && $xml_ret['xmlUpdateDoc']) {\n $dom = new DomDocument();\n $dom->preserveWhiteSpace = false;\n if ($dom->loadXML($xml_ret['xmlUpdateDoc'])) {\n if ($err = &$dom->getElementsByTagName('ErrorResponse')->item(0)) {\n verbose::log(ERROR, __FUNCTION__ . ' (' . __LINE__ . ') errno: ' . $err->getAttribute('Err') . \n ' error: ' . $err->nodeValue);\n $res->orderItemError->_value = 'unspecified error, order not possible';\n } else {\n // order at least partly ok \n foreach ($dom->getElementsByTagName('MRID') as $mrid) {\n unset($ir);\n $ir->orderItemId->_value->itemId->_value = $mrid->getAttribute('Id');\n if ($mrid->getAttribute('Tp'))\n $ir->orderItemId->_value->itemSerialPartId->_value = $mrid->getAttribute('Tp');\n if (!$mrid->nodeValue)\n $ir->orderItemOk->_value = 'true';\n elseif (!($ir->orderItemError->_value = $this->errs[$mrid->nodeValue])) \n $ir->orderItemError->_value = 'unknown error: ' . $mrid->nodeValue;\n $res->orderItem[]->_value = $ir;\n }\n }\n }\n } else {\n self::log_z_error(__FUNCTION__, __LINE__, $agencyId, $z->get_errno(), $z->get_error_string());\n $res->orderItemError->_value = 'system error';\n }\n//echo \"\\n\";\n//print_r($xml_ret);\n//print_r(\"\\nError: \" . $z->get_errno());\n } else\n $res->orderItemError->_value = 'unknown agencyId';\n }\n\n $ret->orderItemResponse->_value = $res;\n //var_dump($param); var_dump($res); die();\n return $ret;\n }", "public function getOrderLineItems($orderID)\n {\n \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}", "public function GetDetailByID($delivery_order_detail_id)\n {\n return $this->deliveryOrderDetail::find($delivery_order_detail_id);\n }", "public function acceptOrder($id,$data) {\n $result = ['error' => true, 'message' => ''];\n $dataSource = $this->getDataSource();\n // ToDo : find model in associations, dont load it\n $WarehousePermission = ClassRegistry::init('WarehousePermission');\n $WarehouseLocationItem = ClassRegistry::init('WarehouseLocationItem');\n\n $dataSource->begin();\n\n try {\n // first check if the user has the permission to accept this order\n $order = $this->find('first',[\n 'recursive' => -1,\n 'conditions' => ['id' => $id]\n ]);\n\n if ( !$order ) {\n $result['message'] = 'Prenosnica nije nadjena';\n\n return $result;\n }\n\n $warehousePermission = $WarehousePermission->find('first',[\n 'conditions' => [\n 'user_id' => $data['User']['id'],\n 'warehouse_location_id' => $order['WarehouseOrder']['transfer_from']\n ]\n ]);\n\n if ( !$warehousePermission ) {\n $result['message'] = 'Nemate dozvolu da prihvatite ovu prenosnicu';\n\n return $result;\n }\n\n // try to update every order item with quantity issued\n // make sure quantity avaible is greater or equals to the quantity issued\n foreach ( $data['WarehouseOrderItem'] as $warehouseOrderItem ) {\n $item = $this->WarehouseOrderItem->Item->find('first',[\n 'recursive' => -1,\n 'conditions' => ['id' => $warehouseOrderItem['item_id']]\n ]);\n\n if ( !$item ) {\n $result['message'] = 'Doslo je do greske, artikal nije nadjen';\n\n return $result;\n }\n\n if ( !$warehouseOrderItem['quantity_issued'] ) {\n $result['message'] = 'Niste uneli kolicinu za proizvod ' . $item['Item']['name'];\n\n return $result;\n }\n\n // check if it's a number\n if ( !is_numeric($warehouseOrderItem['quantity_issued']) ) {\n $result['message'] = 'Niste uneli kolicinu za proizvod ' . $item['Item']['name'];\n\n return $result;\n }\n \n if ( $warehouseOrderItem['quantity_issued'] < 1 ) {\n $result['message'] = \"Kolicina za proizvod {$item['Item']['name']} mora biti veca od nule\";\n\n return $result;\n }\n\n // find the item in the warehouse\n $warehouseLocationItem = $WarehouseLocationItem->find('first',[\n 'recursive' => -1,\n 'conditions' => [\n 'WarehouseLocationItem.item_id' => $warehouseOrderItem['item_id'],\n 'WarehouseLocationItem.warehouse_location_id' => $order['WarehouseOrder']['transfer_from']\n ]\n ]);\n\n if ( !$warehouseLocationItem ) {\n $result['message'] = 'Doslo je do greske, artikal nije pronadjen';\n\n return $result;\n }\n\n // sum avaible and reserved quantity\n $avaibleSum = $warehouseLocationItem['WarehouseLocationItem']['quantity_available'] + $warehouseLocationItem['WarehouseLocationItem']['quantity_reserved'];\n\n if ( $avaibleSum < $warehouseOrderItem['quantity_issued'] ) {\n $quantityAvaible = $warehouseLocationItem['WarehouseLocationItem']['quantity_available'];\n\n $result['message'] = \"Raspoloziva kolicina za proizvod {$item['Item']['name']} je {$quantityAvaible}\";\n\n return $result;\n }\n \n // ok now update the quantity issued field\n $orderItem = $this->WarehouseOrderItem->find('first',[\n 'recursive' => -1,\n 'conditions' => [\n 'item_id' => $warehouseOrderItem['item_id'],\n 'warehouse_order_id' => $id\n ]\n ]);\n\n $this->WarehouseOrderItem->id = $orderItem['WarehouseOrderItem']['id'];\n $this->WarehouseOrderItem->saveField('quantity_issued',$warehouseOrderItem['quantity_issued']);\n }\n\n // change the order status to spreman, and issued by field\n $this->id = $id;\n\n $this->set($order['WarehouseOrder']['id']);\n $this->set('status','spreman');\n $this->set('issued_by',$data['User']['id']);\n\n $this->save();\n\n $dataSource->commit();\n\n $result['error'] = false;\n\n return $result;\n } catch(Exception $e) {\n $dataSource->rollback();\n\n $result['message'] = 'Doslo je do greske, pokusajte ponovo';\n \n return $result;\n }\n }", "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 order_details(){\n\t\t\t\n\t\t\t$this->input->post(NULL, TRUE); // returns all POST items with XSS filter\n\t\t\t\n\t\t\t//escaping the post values\n\t\t\t$pid = html_escape($this->input->post('id'));\n\t\t\t$id = preg_replace('#[^0-9]#i', '', $pid); // filter everything but numbers\n\t\t\t\n\t\t\t$detail = $this->db->select('*')->from('orders')->where('id',$id)->get()->row();\n\t\t\t\n\t\t\tif($detail){\n\t\t\t\t\n\t\t\t\t\t$data['id'] = $detail->id;\n\t\t\t\t\t\n\t\t\t\t\t$data['last_updated'] = date(\"F j, Y, g:i a\", strtotime($detail->last_updated));\n\t\t\t\t\t\n\t\t\t\t\t$data['order_date'] = date(\"F j, Y\", strtotime($detail->order_date));\n\t\t\t\t\t$numOfItems = '';\n\t\t\t\t\tif($detail->num_of_items == 1){\n\t\t\t\t\t\t$numOfItems = $detail->num_of_items.' item';\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$numOfItems = $detail->num_of_items.' items';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$data['headerTitle'] = 'Order: '.$detail->reference.' <span class=\"badge bg-green\" >'.$numOfItems.'</span>';\t\n\t\t\t\t\t\n\t\t\t\t\t$data['orderDate'] = '<i class=\"fa fa-calendar-o\" aria-hidden=\"true\"></i> '.date(\"F j, Y\", strtotime($detail->order_date));\n\t\t\t\t\t$data['reference'] = $detail->reference;\n\t\t\t\t\t$data['order_description'] = $detail->order_description;\n\t\t\t\t\t$data['total_price'] = number_format($detail->total_price, 2);\n\t\t\t\t\t$data['totalPrice'] = $detail->total_price;\n\t\t\t\t\t//$data['tax'] = $detail->tax;\n\t\t\t\t\t//$data['shipping_n_handling_fee'] = $detail->shipping_n_handling_fee;\n\t\t\t\t\t//$data['payment_gross'] = $detail->payment_gross;\n\t\t\t\t\t$data['num_of_items'] = $detail->num_of_items;\n\t\t\t\t\t$data['customer_email'] = $detail->customer_email;\n\t\t\t\t\t\n\t\t\t\t\t$user_array = $this->Users->get_user($detail->customer_email);\n\t\t\t\t\t\n\t\t\t\t\t$fullname = '';\n\t\t\t\t\tif($user_array){\n\t\t\t\t\t\tforeach($user_array as $user){\n\t\t\t\t\t\t\t$fullname = $user->first_name.' '.$user->last_name;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$data['customer'] = $fullname .' ('.$detail->customer_email.')';\n\t\t\t\t\t\n\t\t\t\t\t//SELECT CUSTOMER DROPDOWN\n\t\t\t\t\t\n\t\t\t\t\t$customer_options = '<option value=\"\" >Select User</option>';\n\t\t\t\t\t\t\t\n\t\t\t\t\t$this->db->from('users');\n\t\t\t\t\t$this->db->order_by('id');\n\t\t\t\t\t$result = $this->db->get();\n\t\t\t\t\tif($result->num_rows() > 0) {\n\t\t\t\t\t\tforeach($result->result_array() as $row){\n\t\t\t\t\t\t\t//AUTO SELECT DEFAULT\n\t\t\t\t\t\t\t$d = (strtolower($row['email_address']) == strtolower($detail->customer_email))?'selected':'';\n\t\t\t\t\t\t\t$customer_options .= '<option value=\"'.$row['email_address'].'\" '.$d.'>'.ucwords($row['first_name'].' '.$row['last_name']).' ('.$row['email_address'].')</option>';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$data['customer_options'] = $customer_options;\n\t\t\t\t\t//*********END SELECT DESTINATION COUNTRY DROPDOWN**********//\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t//GET PAYMENT STATUS FROM TRANSACTION DB\n\t\t\t\t\t$transaction_array = $this->Transactions->get_transaction($detail->reference);\n\t\t\t\t\t$payment_status = '';\n\t\t\t\t\t$edit_payment_status = '';\n\t\t\t\t\t$order_amount = '';\n\t\t\t\t\t$shipping_and_handling_costs = '';\n\t\t\t\t\t$total_amount = '';\n\t\t\t\t\t$transaction_id = '';\n\t\t\t\t\t\n\t\t\t\t\tif($transaction_array){\n\t\t\t\t\t\tforeach($transaction_array as $transaction){\n\t\t\t\t\t\t\t$transaction_id = $transaction->id;\n\t\t\t\t\t\t\t$payment_status = $transaction->status;\n\t\t\t\t\t\t\t$edit_payment_status = $transaction->status;\n\t\t\t\t\t\t\t$order_amount = $transaction->order_amount;\n\t\t\t\t\t\t\t$shipping_and_handling_costs = $transaction->shipping_and_handling_costs;\n\t\t\t\t\t\t\t$total_amount = $transaction->total_amount;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif($payment_status == '1'){\n\t\t\t\t\t\t$payment_status = '<span class=\"badge bg-green\">Paid</span>';\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$payment_status = '<span class=\"badge bg-yellow\">Pending</span>';\n\t\t\t\t\t}\n\t\t\t\t\t$data['payment_status'] = $payment_status;\n\t\t\t\t\t$data['edit_payment_status'] = $edit_payment_status;\n\t\t\t\t\t\n\t\t\t\t\t$data['transaction_id'] = $transaction_id;\n\t\t\t\t\t\n\t\t\t\t\t//SELECT PAYMENT STATUS DROPDOWN\n\t\t\t\t\t$payment_status_options = '<option value=\"\" >Select Payment Status</option>';\n\t\t\t\t\t\t\t\n\t\t\t\t\tfor($i=0; $i<=1; $i++){\n\t\t\t\t\t\t//AUTO SELECT DEFAULT\n\t\t\t\t\t\t$sel = ($i == $edit_payment_status) ? 'selected' : '';\n\t\t\t\t\t\t\n\t\t\t\t\t\t//READABLE DISPLAY\n\t\t\t\t\t\t$string = ($i == '0') ? 'Pending' : 'Paid';\n\t\t\t\t\t\t\n\t\t\t\t\t\t$payment_status_options .= '<option value=\"'.$i.'\" '.$sel.'>'.$string.'</option>';\n\t\t\t\t\t}\n\t\t\t\t\t$data['payment_status_options'] = $payment_status_options;\n\t\t\t\t\t//*********END SELECT PAYMENT STATUS DROPDOWN**********//\n\t\t\t\t\t\n\t\t\t\t\t//GET PAYMENT STATUS FROM TRANSACTION DB\n\t\t\t\t\t$payment_array = $this->Payments->get_payment($detail->reference);\n\t\t\t\t\t$payment_method = '';\n\t\t\t\t\t$payment_id = '';\n\t\t\t\t\tif($payment_array){\n\t\t\t\t\t\tforeach($payment_array as $payment){\n\t\t\t\t\t\t\t$payment_method = $payment->payment_method;\n\t\t\t\t\t\t\t$payment_id = $payment->id;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$data['payment_id'] = $payment_id;\n\t\t\t\t\t\n\t\t\t\t\t//VIEW\n\t\t\t\t\t$data['view_payment_method'] = 'Payment Method: '.$payment_method;\n\t\t\t\t\t\n\t\t\t\t\t//SELECT PAYMENT METHOD DROPDOWN\n\t\t\t\t\t$payment_method_options = '<option value=\"\" >Select Payment Method</option>';\n\t\t\t\t\t\t\t\n\t\t\t\t\t$this->db->from('payment_methods');\n\t\t\t\t\t$this->db->order_by('id');\n\t\t\t\t\t$result = $this->db->get();\n\t\t\t\t\tif($result->num_rows() > 0) {\n\t\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\t//AUTO SELECT DEFAULT\n\t\t\t\t\t\t\t$default = (strtolower($row['method_name']) == strtolower($payment_method))?'selected':'';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$payment_method_options .= '<option value=\"'.$row['method_name'].'\" '.$default.'>'.$row['method_name'].'</option>';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$data['payment_method_options'] = $payment_method_options;\n\t\t\t\t\t//*********END SELECT PAYMENT METHOD DROPDOWN**********//\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$data['order_amount'] = $order_amount;\n\t\t\t\t\t$data['shipping_and_handling_costs'] = $shipping_and_handling_costs;\n\t\t\t\t\t$data['total_amount'] = $total_amount;\n\t\t\t\t\t\n\t\t\t\t\t//GET SHIPPING STATUS FROM DB\n\t\t\t\t\t$shipping_array = $this->Shipping->get_shipping($detail->reference);\n\t\t\t\t\t$shipping_status = '';\n\t\t\t\t\t$edit_shipping_status = '';\n\t\t\t\t\t$shipping_id = '';\n\t\t\t\t\t$method = '';\n\t\t\t\t\t$shipping_fee = '';\n\t\t\t\t\t$tax = '';\n\t\t\t\t\t$origin_city = '';\n\t\t\t\t\t$origin_country = '';\n\t\t\t\t\t$destination_city = '';\n\t\t\t\t\t$destination_country = '';\n\t\t\t\t\t$customer_contact_phone = '';\n\t\t\t\t\t$estimated_delivery_date = '';\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif($shipping_array){\n\t\t\t\t\t\tforeach($shipping_array as $shipping){\n\t\t\t\t\t\t\t$shipping_id = $shipping->id;\n\t\t\t\t\t\t\t$shipping_status = $shipping->status;\n\t\t\t\t\t\t\t$edit_shipping_status = $shipping->status;\n\t\t\t\t\t\t\t$method = $shipping->shipping_method;\n\t\t\t\t\t\t\t$shipping_fee = $shipping->shipping_fee;\n\t\t\t\t\t\t\t$tax = $shipping->tax;\n\t\t\t\t\t\t\t$origin_city = $shipping->origin_city;\n\t\t\t\t\t\t\t$origin_country = $shipping->origin_country;\n\t\t\t\t\t\t\t$destination_city = $shipping->destination_city;\n\t\t\t\t\t\t\t$destination_country = $shipping->destination_country;\n\t\t\t\t\t\t\t$customer_contact_phone = $shipping->customer_contact_phone;\n\t\t\t\t\t\t\t$estimated_delivery_date = $shipping->estimated_delivery_date;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif($shipping_status == '1'){\n\t\t\t\t\t\t$shipping_status = '<span class=\"badge bg-green\">Shipped</span>';\n\t\t\t\t\t\t\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$shipping_status = '<span class=\"badge bg-yellow\">Pending</span>';\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$view_delivery_date = '';\n\t\t\t\t\t$edit_delivery_date = '';\n\t\t\t\t\tif($estimated_delivery_date == '0000-00-00 00:00:00'){\n\t\t\t\t\t\t$view_delivery_date = 'Not Set';\n\t\t\t\t\t\t$edit_delivery_date = '';\n\t\t\t\t\t\t\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$view_delivery_date = date(\"F j, Y g:i A\", strtotime($estimated_delivery_date));\n\t\t\t\t\t\t$edit_delivery_date = date(\"Y-m-d g:i A\", strtotime($estimated_delivery_date));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$data['delivery_date'] = $view_delivery_date;\n\t\t\t\t\t$data['edit_delivery_date'] = $edit_delivery_date;\n\t\t\t\t\t\n\t\t\t\t\t$data['edit_shipping_status'] = $edit_shipping_status;\n\t\t\t\t\t$data['shipping_status'] = $shipping_status;\n\t\t\t\t\t$data['shipping_fee'] = $shipping_fee;\n\t\t\t\t\t$data['tax'] = $tax;\n\t\t\t\t\t$data['shipping_id'] = $shipping_id; \n\t\t\t\t\t\t\n\t\t\t\t\t//SELECT SHIPPING METHODS DROPDOWN\n\t\t\t\t\t//$shipping_methods = '<div class=\"form-group\">';\n\t\t\t\t\t//$shipping_methods .= '<select name=\"shipping_method\" id=\"shipping_method\" class=\"form-control\">';\n\t\t\t\t\t\t\n\t\t\t\t\t$shipping_methods = '<option value=\"\" >Select Shipping Method</option>';\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t$this->db->from('shipping_methods');\n\t\t\t\t\t$this->db->order_by('id');\n\t\t\t\t\t$result = $this->db->get();\n\t\t\t\t\tif($result->num_rows() > 0) {\n\t\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\t$d = (strtolower($row['shipping_company']) == strtolower($method))?'selected':'';\n\t\t\t\t\t\n\t\t\t\t\t\t\t$shipping_methods .= '<option value=\"'.ucwords($row['id']).'\" '.$d.'>'.ucwords($row['shipping_company']).'</option>';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t//$shipping_methods .= '</select>';\n\t\t\t\t\t//$shipping_methods .= '</div>';\t\n\t\t\t\t\t$data['shipping_method_options'] = $shipping_methods;\n\t\t\t\t\t//*********END SELECT SHIPPING METHODS DROPDOWN**********//\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$data['origin_city'] = $origin_city;\n\t\t\t\t\t$data['origin_country'] = $origin_country;\n\t\t\t\t\t\t\n\t\t\t\t\t//SELECT ORIGIN COUNTRY DROPDOWN\n\t\t\t\t\t\n\t\t\t\t\t$origin_country_options = '<option value=\"\" >Select Origin Country</option>';\n\t\t\t\t\t\t\t\n\t\t\t\t\t$this->db->from('countries');\n\t\t\t\t\t$this->db->order_by('id');\n\t\t\t\t\t$result = $this->db->get();\n\t\t\t\t\tif($result->num_rows() > 0) {\n\t\t\t\t\t\tforeach($result->result_array() as $row){\n\t\t\t\t\t\t\t//AUTO SELECT DEFAULT\n\t\t\t\t\t\t\t$d = (strtolower($row['name']) == strtolower($origin_country))?'selected':'';\n\t\t\t\t\t\t\t$origin_country_options .= '<option value=\"'.$row['name'].'\" '.$d.'>'.ucwords($row['name']).'</option>';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$data['origin_country_options'] = $origin_country_options;\n\t\t\t\t\t//*********END SELECT DESTINATION COUNTRY DROPDOWN**********//\n\t\t\t\t\t\n\t\t\t\t\t$data['destination_city'] = $destination_city;\n\t\t\t\t\t$data['destination_country'] = $destination_country;\n\t\t\t\t\t\t\n\t\t\t\t\t//SELECT DESTINATION COUNTRY DROPDOWN\n\t\t\t\t\t\n\t\t\t\t\t$destination_country_options = '<option value=\"\" >Select Destination Country</option>';\n\t\t\t\t\t\t\t\n\t\t\t\t\t$this->db->from('countries');\n\t\t\t\t\t$this->db->order_by('id');\n\t\t\t\t\t$result = $this->db->get();\n\t\t\t\t\tif($result->num_rows() > 0) {\n\t\t\t\t\t\tforeach($result->result_array() as $row){\n\t\t\t\t\t\t\t//AUTO SELECT DEFAULT\n\t\t\t\t\t\t\t$d = (strtolower($row['name']) == strtolower($destination_country))?'selected':'';\n\t\t\t\t\t\t\t$destination_country_options .= '<option value=\"'.$row['name'].'\" '.$d.'>'.ucwords($row['name']).'</option>';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$data['destination_country_options'] = $destination_country_options;\n\t\t\t\t\t//*********END SELECT DESTINATION COUNTRY DROPDOWN**********//\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$data['customer_contact_phone'] = $customer_contact_phone;\n\t\t\t\t\t\n\t\t\t\t\t//SELECT SHIPPING STATUS DROPDOWN\n\t\t\t\t\t$shipping_status_options = '<option value=\"\" >Select Shipping Status</option>';\n\t\t\t\t\t\t\t\n\t\t\t\t\tfor($i=0; $i<=1; $i++){\n\t\t\t\t\t\t//AUTO SELECT DEFAULT\n\t\t\t\t\t\t$sel = ($i == $edit_shipping_status) ? 'selected' : '';\n\t\t\t\t\t\t\n\t\t\t\t\t\t//READABLE DISPLAY\n\t\t\t\t\t\t$status_string = ($i == '0') ? 'Pending' : 'Shipped';\n\t\t\t\t\t\t\n\t\t\t\t\t\t$shipping_status_options .= '<option value=\"'.$i.'\" '.$sel.'>'.$status_string.'</option>';\n\t\t\t\t\t}\n\t\t\t\t\t$data['shipping_status_options'] = $shipping_status_options;\n\t\t\t\t\t//*********END SELECT SHIPPING STATUS DROPDOWN**********//\n\t\t\t\t\t\n\t\t\t\t\t$data['model'] = 'orders';\n\t\t\t\t\t$data['success'] = true;\n\n\t\t\t}else {\n\t\t\t\t$data['success'] = false;\n\t\t\t}\n\t\t\techo json_encode($data);\n\t\t}", "function getOrderDetails($id)\n {\n }", "public function hasItemId(){\n return $this->_has(7);\n }", "public function testGetOrderDetail(){\n \t\n \tPayU::$apiLogin = PayUTestUtil::API_LOGIN;\n \tPayU::$apiKey = PayUTestUtil::API_KEY;\n \t\n \tEnvironment::setReportsCustomUrl(PayUTestUtil::REPORTS_CUSTOM_URL);\n \t\n \n \t$authorizationResponse = PayUTestUtil::processTransaction(TransactionType::AUTHORIZATION_AND_CAPTURE, '*');\n \t\n \t$parameters = array(\n \t\t\tPayUParameters::ORDER_ID => $authorizationResponse->transactionResponse->orderId,\n \t);\n \t\n \t$response = PayUReports::getOrderDetail($parameters);\n \t\n \t$this->assertNotNull($response);\n \t$this->assertEquals($authorizationResponse->transactionResponse->orderId, $response->id);\n \t \n }", "public static function verifyOrderItemUpdate($db,$table_prefix,$update_type,$order_id,$item_id,$update = [],&$error)\n {\n $error = '';\n \n $order = self::get($db,$table_prefix,'order',$order_id);\n if($order['status'] !== 'NEW') {\n $error .= 'Cannot update item as order status['.$order['status'].'] is not NEW ';\n }\n\n if($update_type !== 'INSERT') {\n $item = self::get($db,$table_prefix,'order_item',$item_id,'data_id');\n if($item == 0) {\n $error .= 'Order item ID['.$item_id.'] invalid';\n } else {\n \n } \n }\n \n\n if($error === '') return true; else return false;\n }", "public function taskCharged($order,$item)\n\t{\n\t\t// find price\n\t\t$price = MDealPrice::model()->findByPk($item->itemId);\n\t\t// find deal\n\t\t$deal = $price->deal;\n\t\t\n\t\t// send email if tipped\n\t\tif(wm()->get('deal.helper')->dealStatus($deal) == 'tipped')\n\t\t\tapp()->mailer->send($item->order->user, 'chargedEmail', array('deal' => $deal));\n\t}", "private function pick_order($_disbanded = FALSE, $_delivered = TRUE)\n {\n $_accepted = TRUE;\n $_initial_order = (string) \"Delivered\";\n \n $this->add_to_log(__FUNCTION__, 'Find matching order that has required states from fetched MMS order data');\n $this->add_to_log(__FUNCTION__, \"Disbanded: $_disbanded, Delivered: $_delivered\");\n \n // Fetch MMS order based on value for delivered\n if (! $_delivered && $_disbanded) {\n $_initial_order = \"Disbanded\";\n } else \n if (! $_delivered && ! $_disbanded) {\n \n $_initial_order = \"Accepted\";\n }\n \n $this->fetch_mms_order($_initial_order);\n \n if ($this->_mms_data && is_array($this->_mms_data)) {\n $_shipmentNo = (string) \"\";\n $_mms_data = $this->_mms_data;\n \n foreach ($_mms_data as $_key => $_value) {\n \n $this->add_to_log(__FUNCTION__, 'Checking instance of fetched MMS order to see if matches');\n \n $_found = FALSE;\n $_mms_accepted = (array) array();\n $_mms_disbanded = (array) array();\n $_mms_delivered = (array) array();\n $_mms_order = $_value;\n \n // Get shipment number from mms record data\n $_shipmentNo = $this->extract_shipment_no_from_string($_mms_order['payload']);\n \n // Verify shipmentNo has a value and is a string as expected\n if ($_shipmentNo && is_string($_shipmentNo)) {\n if ($_delivered && $_disbanded) {\n // Save delivered state of fetched MMS order\n $_mms_delivered = $_mms_order;\n \n $this->fetch_mms_order('Accepted', $_shipmentNo);\n \n if ($this->_mms_data && is_array($this->_mms_data)) {\n $_mms_accepted = $this->_mms_data[1];\n }\n \n $this->fetch_mms_order('Disbanded', $_shipmentNo);\n \n if ($this->_mms_data && is_array($this->_mms_data)) {\n $_mms_disbanded = $this->_mms_data[1];\n }\n \n if (($_mms_accepted && is_array($_mms_accepted)) && (($_mms_delivered && is_array($_mms_delivered))) && (($_mms_disbanded && is_array($_mms_disbanded)))) {\n // Verify shipment numbers for each state of the MMS order all match to the shipment number been looped for this instance\n $_accept_shipno = $this->extract_shipment_no_from_string($_mms_accepted['payload']);\n $_deliver_shipno = $this->extract_shipment_no_from_string($_mms_delivered['payload']);\n $_disband_shipno = $this->extract_shipment_no_from_string($_mms_disbanded['payload']);\n \n if ($_accept_shipno == $_shipmentNo && $_deliver_shipno == $_shipmentNo && $_disband_shipno == $_shipmentNo) {\n // Construct multidimensional array containing all mms order data states\n $_data = array(\n \"Accepted\" => $_mms_accepted,\n \"Disbanded\" => $_mms_disbanded,\n \"Delivered\" => $_mms_delivered\n );\n \n // Save the order\n if ($_data && is_array($_data) && is_array($_data['Accepted']) && is_array($_data['Disbanded']) && is_array($_data['Delivered'])) {\n // $_found = TRUE if order saves\n $_found = $this->save_order($_data, $_shipmentNo);\n }\n }\n }\n } else \n if ($_delivered && ! $_disbanded) {\n \n // Save delivered state of fetched MMS order\n $_mms_delivered = $_mms_order;\n \n $this->fetch_mms_order('Accepted', $_shipmentNo);\n \n if ($this->_mms_data && is_array($this->_mms_data)) {\n $_mms_accepted = $this->_mms_data[1];\n }\n \n if (($_mms_accepted && is_array($_mms_accepted)) && (($_mms_delivered && is_array($_mms_delivered)))) {\n // Verify shipment numbers for each state of the MMS order all match to the shipment number been looped for this instance\n $_accept_shipno = $this->extract_shipment_no_from_string($_mms_accepted['payload']);\n $_deliver_shipno = $this->extract_shipment_no_from_string($_mms_delivered['payload']);\n \n if ($_accept_shipno == $_shipmentNo && $_deliver_shipno == $_shipmentNo) {\n // Construct multidimensional array containing all mms order data states\n $_data = array(\n \"Accepted\" => $_mms_accepted,\n \"Delivered\" => $_mms_delivered\n );\n \n // Save the order\n if ($_data && is_array($_data) && is_array($_data['Accepted']) && is_array($_data['Delivered'])) {\n // $_found = TRUE if order saves\n $_found = $this->save_order($_data, $_shipmentNo);\n }\n }\n }\n } else \n if (! $_delivered && $_disbanded) {\n \n // Save delivered state of fetched MMS order\n $_mms_accepted = $_mms_order;\n \n $this->fetch_mms_order('Disbanded', $_shipmentNo);\n \n if ($this->_mms_data && is_array($this->_mms_data)) {\n $_mms_disbanded = $this->_mms_data[1];\n }\n \n if (($_mms_accepted && is_array($_mms_accepted)) && (($_mms_disbanded && is_array($_mms_disbanded)))) {\n // Verify shipment numbers for each state of the MMS order all match to the shipment number been looped for this instance\n $_accept_shipno = $this->extract_shipment_no_from_string($_mms_accepted['payload']);\n $_disband_shipno = $this->extract_shipment_no_from_string($_mms_disbanded['payload']);\n \n if ($_accept_shipno == $_shipmentNo && $_disband_shipno == $_shipmentNo) {\n // Construct multidimensional array containing all mms order data states\n $_data = array(\n \"Accepted\" => $_mms_accepted,\n \"Disbanded\" => $_mms_disbanded\n );\n \n // Save the order\n if ($_data && is_array($_data) && is_array($_data['Accepted']) && is_array($_data['Disbanded'])) {\n // $_found = TRUE if order saves\n $_found = $this->save_order($_data, $_shipmentNo);\n }\n }\n }\n }\n \n if ($_shipmentNo && is_string($_shipmentNo) && strlen($_shipmentNo) > 1) {\n $this->add_to_log(__FUNCTION__, \"Check if this order is already on Test: $_shipmentNo\");\n // If this expression is TRUE then MMS order already exists on Test and we need to continue finding another MMS order\n $_found = $this->is_order_on_test($_shipmentNo) ? FALSE : $_found;\n }\n \n if ($_found === TRUE) {\n $this->add_to_log(__FUNCTION__, \"Matching order found and not on test: shipmentNumber: $_shipmentNo\");\n // Break out of foreach because we have found a matching order\n break;\n }\n }\n }\n }\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}", "function show_estimated_ship_date_under_view_order_for_subscriptions( $order_id ) {\n $order = wc_get_order( $order_id );\n $item = array_pop( $order->get_items() );\n if ( $order->status == 'processing' && $item['name'] != 'Try or Gift' ) {\n echo '<h2>Estimated Shipment Date</h2>';\n echo '<p>Your package ships by: <strong>' . new_orders_next_subscription_ship_date( $order->order_date ) . '</strong>.</p>';\n }\n}", "function generate_order($order,$mysqli){\r\n\r\n $orders = get_items_database($mysqli);\r\n\r\n \r\n $level = ($order->extension_attributes->shipping_assignments);\r\n foreach($level as $i){\r\n $address = $i->shipping->address;\r\n \r\n $adr = $address->street[0];\r\n $postal = $address->postcode;\r\n $city = $address->city;\r\n \r\n }\r\n\r\n \r\n foreach($order->items as $i){ \r\n foreach ($orders as $e){\r\n if ($e[\"code\"] == $i->sku){\r\n //print_r($e[\"code\"] .\" \". $i->sku);\r\n \r\n $ITid = $e[\"item_id\"];\r\n $ITname = $i->name;\r\n $ITcode = $i->sku;\r\n $qty = $i->qty_ordered;\r\n $cena = $i->price_incl_tax;\r\n \r\n \r\n } \r\n }\r\n }\r\n\r\n\r\n\r\n $data = array(\r\n \"OrderId\" => $order->increment_id,\r\n \"ReceivedIssued\" => \"P\",\r\n \"Year\" => 0,\r\n \"Number\" => null,\r\n \"Date\" => date(\"Y-m-d H:i:s\"),\r\n \"Customer\" => array(\r\n \"ID\" => 8451445,\r\n \"Name\" => null,\r\n \"ResourceUrl\" => null\r\n ),\r\n \"CustomerName\" => $order->customer_firstname.\" \". $order->customer_lastname,\r\n \"CustomerAddress\" => $adr,\r\n \"CustomerPostalCode\" => $postal,\r\n \"CustomerCity\" => $city,\r\n\r\n \"CustomerCountry\" => array(\r\n \"ID\" => 192,\r\n \"Name\" => null,\r\n \"ResourceUrl\" => null\r\n ),\r\n \"CustomerCountryName\" => null,\r\n \"Analytic\" => null,\r\n \"DueDate\" => null,\r\n \"Reference\" => $order->entity_id,\r\n \"Currency\" => array(\r\n \"ID\" => 7,\r\n \"Name\" => null,\r\n \"ResourceUrl\" => null\r\n ),\r\n \"Notes\" => null,\r\n \"Document\" => null,\r\n \"DateConfirmed\" => null,\r\n \"DateCompleted\" => null,\r\n \"DateCanceled\" => null,\r\n \"Status\" => null,\r\n \"DescriptionAbove\" => null,\r\n \"DescriptionBelow\" => null,\r\n \"ReportTemplate\" => array(\r\n \"ID\" => null,\r\n \"Name\" => null,\r\n \"ResourceUrl\" => null\r\n ),\r\n\r\n \"OrderRows\" => [array(\r\n \"OrderRowId\" => null,\r\n \"Order\" => null,\r\n \"Item\" => array(\r\n \"ID\" => $ITid,\r\n \"Name\" => null,\r\n \"ResourceUrl\" => null,\r\n ),\r\n \"ItemName\" => $ITname,\r\n \"ItemCode\" => $ITcode,\r\n \"Description\" => null,\r\n \"Quantity\" => $qty,\r\n \"Price\" => $cena,\r\n \"UnitOfMeasurement\" => \"kos\",\r\n \"RecordDtModified\" => \"2020-01-07T12:20:00+02:00\",\r\n \"RowVersion\" => null,\r\n \"_links\" => null,\r\n ) ],\r\n\r\n \"RecordDtModified\" => date(\"Y-m-d H:i:s\"),\r\n \"RowVersion\" => null,\r\n \"_links\" => null\r\n\r\n );\r\n \r\n return $data;\r\n}", "public function is_digital_order($order_id) {\n\n\t\t$order = wc_get_order( $order_id );\n\n\t\tforeach ($order->get_items() as $item_id => $item_data) {\n\n\t\t\tif ($variation_id = $item_data->get_variation_id()) {\n\n\t\t\t\tif (get_post_meta($variation_id, '_virtual', true) != 'yes') {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t$product_id = $item_data->get_product_id();\n\n\t\t\t\tif (get_post_meta($product_id, '_virtual', true) != 'yes') {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn true;\n\n\t}", "private function insertOrdemItem($item, $orderID) {\n $ordemItem = new OrderItem();\n $ordemItem->orderID = $orderID;\n $ordemItem->ISBN = $item['ISBN'];\n $ordemItem->qty = $item['quantity'];\n $ordemItem->price = $item['price'];\n $ordemItem->save();\n }", "private function getOrderDetails($order_id)\n {\n $order_id = ctype_digit($order_id) ? $order_id : null;\n if($order_id != null)\n {\n try\n {\n $this->db->openConnection();\n $connection = $this->db->getConnection();\n $statement = $connection->prepare(\"CALL GetOrderById(:order_id)\");\n $statement->bindParam(\":order_id\", $order_id, PDO::PARAM_INT|PDO::PARAM_INPUT_OUTPUT);\n if($statement->execute())\n {\n $this->result = $statement->fetchAll(PDO::FETCH_ASSOC);\n return true;\n }\n } catch (PDOException $ex)\n {\n $this->db->showError($ex, false);\n } finally\n {\n $this->db->closeConnection();\n }\n }\n }", "public function ItemParams2( $observer )\n {\n $items=$observer->getItems();\n foreach($items as $item){\n ////Mage::log($item->getId());\n $quoteItems = $item->getQuote()->getAllVisibleItems();\n foreach ($quoteItems as $quoteItem) {\n ////Mage::log($quoteItem->getItemId());\n //Mage::log($quoteItem->getItemId());\n}\n}\n\n }", "function get_xrefitem($itemID, $custID = '', $vendorID = '', $debug = false) {\n\t\t$q = (new QueryBuilder())->table('itemsearch');\n\t\t$itemquery = (new QueryBuilder())->table('itemsearch');\n\t\t$itemquery->field('itemid');\n\t\t$itemquery->where('itemid', $itemID);\n\t\t$itemquery->where('origintype', ['I', 'L']); // ITEMID found by the ITEMID, or by short item lookup // NOTE USED at Stempf\n\n\t\tif (!empty($custID)) {\n\t\t\t$custquery = (new QueryBuilder())->table('itemsearch');\n\t\t\t$custquery->field('itemid');\n\t\t\t$custquery->where('itemid', $itemID);\n\t\t\t$custquery->where('origintype', 'C');\n\t\t\t$custquery->where('originID', $custID);\n\t\t\t$q->where(\n\t\t\t\t$q\n\t\t\t\t->orExpr()\n\t\t\t\t->where('itemid', 'in', $itemquery)\n\t\t\t\t->where('itemid', 'in', $custquery)\n\t\t\t);\n\t\t} elseif (!empty($vendorID)) {\n\t\t\t$vendquery = (new QueryBuilder())->table('itemsearch');\n\t\t\t$vendquery->field('itemid');\n\t\t\t$vendquery->where('itemid', $itemID);\n\t\t\t$vendquery-->where('origintype', 'V');\n\t\t\t$vendquery-->where('originID', $vendorID);\n\t\t\t$q->where(\n\t\t\t\t$q\n\t\t\t\t->orExpr()\n\t\t\t\t->where('itemid', 'in', $itemquery)\n\t\t\t\t->where('itemid', 'in', $vendquery)\n\t\t\t);\n\t\t} else {\n\t\t\t$q->where('itemid', $itemID);\n\t\t}\n\t\t$q->limit(1);\n\t\t$sql = DplusWire::wire('database')->prepare($q->render());\n\n\t\tif ($debug) {\n\t\t\treturn $q->generate_sqlquery($q->params);\n\t\t} else {\n\t\t\t$sql->execute($q->params);\n\t\t\t$sql->setFetchMode(PDO::FETCH_CLASS, 'XRefItem');\n\t\t\treturn $sql->fetch();\n\t\t}\n\t}", "public static function chkIfOrdDtlSubmnuDiscounted($order_id,$submnudish){\r \t\t$tmp_fnd=0;\r\t\t$order_items=tbl_order_details::readArray(array(ORD_DTL_ORDER_ID=>$order_id,ORD_DTL_SBMENU_DISH_ID=>$submnudish,ORDPROM_DISCOUNT_AMT=>0),$tmp_fnd,1,0);\r\t\t\r\t\tif($tmp_fnd>0)\r\t\t\treturn 1;\r\t\telse\r\t\t\treturn 0;\t\r }", "public function hasItemdata(){\n return $this->_has(6);\n }", "function print_order_detail($orderid){\n // product data in table\n\t$order_items = \"scart_purchdetail\"; // purchdetail table - order item info\n // retrieve command table order details\n\t$intorderid = intval($orderid); // => 23 mysql value in integer\n\t$cmdorder = \"select * from $order_items where orderid = $intorderid order by line_item asc;\";\n\t$result2 = mysql_query($cmdorder)\n or die (\"Query '$cmdorder' failed with error message: \\\"\" . mysql_error () . '\"');\n\t$num_rows2 = mysql_num_rows($result2);\n\t// $row_info = mysql_fetch_array($result2);\n\tif ( $num_rows2 >= 1 ) {\n\t // ========= start order items data records =========\n\t $row = 0; // line_item values\n\t while ($row_info = mysql_fetch_object($result2)) {\n\t\t $data[$row]['item'] = $row_info->line_item; // current row item number\n\t\t $data[$row]['qty'] = $row_info->order_quantity; // current row quantity\n\t\t $data[$row]['bookid'] = $row_info->bookid; // current row bookid\n\t\t $data[$row]['price'] = $row_info->order_price; // current row book price\n\t\t $row ++; // next line_item values\n\t }\n\t return $data; // return order details\n\t} else {\n\t print '<script type=\"text/javascript\">';\n\t print 'alert(\"query result mysql_errno is = '.mysql_errno($connID).' !\\nmysql_errormsg = '\n\t\t\t .mysql_error($connID).'\\nNo results found - Returning empty!\\n\")';\n\t print '</script>'; \n\t // exit(); \n\t return 0; // return failed order detail\n }\n}", "function getDeliveryListByOrderId($order_id) {\n\t\tif (!is_numeric($order_id)) {\n\t\t\tmsg(\"ecommerce_delivery.getDeliveryListByOrderId(): order_id is not numeric\", 'error', 1);\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$list = $this->listing(\"order_id = $order_id\");\n\t\tforeach ($list as $key=>$val) {\n\t\t\t$list[$key]['carrier_detail'] = $this->getCarrierDetail($val['carrier_id']);\n\t\t}\n\t\treturn $list;\n\t}", "function checkFoundOrdersForId($u_id)\n\t\t{\n\t\t\t$db = dbConnect::getInstance();\n \t\t $mysqli = $db->getConnection();\n\t\t\t$query = \" select * from check_tb where u_id = '\".$u_id.\"' \"; \n $res = $mysqli->query($query) or die (mysqli_error($mysqli));\n\t\t\tif(mysqli_num_rows($res) > 0)\n\t\t\t{\n\t\t\t\treturn true;\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public function details($id) {\n\n $order = Order::find($id);\n $delivery_status_id = (isset($order->delivery_status_id)) ? (int)$order->delivery_status_id : '';\n $delivery = $this->delivery_status($delivery_status_id);\n \n \\ViewHelper::setPageDetails('Storefronts | Order View', 'Order #' . $order->invoice_number, '');\n\n View::share('delivery_status', $delivery);\n View::share('order', $order);\n\n $delivery_modal_info = $this->delivery_status_modal_info($delivery_status_id);\n\n View::share('modals_info', $delivery_modal_info['info']);\n View::share('modals_btn', $delivery_modal_info['btn']);\n\n \treturn view('backoffice.orders.details');\n \n }", "public function isOrderOpen($order_id){\n \n $cmd =Yii::app()->db->createCommand();\n $cmd->select('COUNT(*)')\n ->from('order')\n ->where(\"id= $order_id and status='open'\");\n $result = $cmd->queryScalar();\n \n if($result > 0){\n return true;\n }else{\n return false;\n }\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 }", "function GetDetailPPHItemById($id){\n\n $data = $this->db\n ->select('form_bd_item_pph.id_form_bd_item_pph as id_item_pph,form_bd_item_pph.id_form_bd_item as id_item,form_bd_item_pph.*,form_bd_item.real_amount,form_bd_item.name as item_name')\n ->where('form_bd_item_pph.id_form_bd_item_pph',$id)\n ->join('form_bd_item','form_bd_item.id_form_bd_item=form_bd_item_pph.id_form_bd_item')\n ->get('form_bd_item_pph')\n ->row_array();\n return $data;\n }", "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}", "function checkorderstatus($ordid){\n $Ord=M('Balance');\n $isverified=$Ord->where('balanceno='.$ordid)->getField('isverified');\n if($isverified==1){\n return true;\n }else{\n return false;\n }\n}", "public function gotItemCheck($id, $item)\n\t{\n\t\t$error = \"\";\n\t\t\n\t\tif ( !$id )\n\t\t{\n\t\t\t$error = str_replace( \"<%TYPE%>\", $this->lang->words['loan'], $this->lang->words['no_id'] );\n\t\t}\t\n\n\t\t#no item found by that ID? error!\n\t\tif ( !$error && !$item )\n\t\t{\n\t\t\t$error = str_replace( \"<%TYPE%>\", $this->lang->words['loan'], $this->lang->words['none_found_show'] );\t\t\n\t\t}\n\t\t\n\t\t#do I have permission to purchase this item? if not, error!\n\t\tif ( !$error && $item[ $this->abbreviation().'_use_perms'] && !$this->registry->permissions->check( 'loans', $item ) )\n\t\t{\n\t\t\t$error = str_replace( \"<%TYPE%>\", $this->lang->words['loan'], $this->lang->words['no_perm_to_buy_it'] );\t\t\n\t\t}\n\n\t\t#item isn't enabled currently? error!\n\t\tif ( !$error && !$item['b_loans_on'] )\n\t\t{\n\t\t\t$error = str_replace( \"<%ITEM%>\", $this->lang->words['loan'], $this->lang->words['item_disabled'] );\n\t\t}\t\t\n\t\t\t\t\n\t\treturn $error;\n\t}", "function processItemStatus($item_id, $last_inserted_id)\r\n {\r\n $item = $this->find('first', array(\r\n 'conditions' => array(\r\n 'Item.item_status_id' => ConstItemStatus::Tipped,\r\n 'Item.id' => $item_id\r\n ) ,\r\n 'fields' => array(\r\n 'Item.is_pass_mail_sent',\r\n 'Item.max_limit',\r\n 'Item.item_user_count',\r\n 'Item.id'\r\n ) ,\r\n 'recursive' => -1,\r\n ));\r\n if (!empty($item)) {\r\n // - X Referral Methiod //\r\n if (Configure::read('referral.referral_enabled_option') == ConstReferralOption::XRefer) {\r\n $this->referalRefunding($item_id);\r\n }\r\n //handle tipped status\r\n $this->processTippedStatus($item, $last_inserted_id);\r\n //handle closed status if max user reached\r\n if (!empty($item['Item']['max_limit']) && $item['Item']['item_user_count'] >= $item['Item']['max_limit']) {\r\n $this->_closeItems(array(\r\n $item['Item']['id']\r\n ));\r\n }\r\n }\r\n }", "private function checkOrderExistById($orderid)\n {\n $collection = $this->orderCollectionFactory->create()\n ->addAttributeToSelect('*')\n ->addFieldToFilter('entity_id', $orderid);\n $data = $collection->getData();\n return $data;\n }", "public function getPendingFulfillment($orderObj) {\n try {\n $canInvoice = $orderObj->canInvoice(); // returns true for pending items\n $canShip = $orderObj->canShip(); // returns true for pending items\n \n // Return true if both invoice and shipment are false, i.e. No items to fulfill\n return (empty($canInvoice) && empty($canShip));\n } catch (\\Magento\\Framework\\Exception\\LocalizedException $le) {\n $this->_logger->error('Error getInvoicesOrShipmentsList : '.json_encode($le->getRawMessage()));\n } catch (\\Exception $ex) {\n $this->_logger->error('Error getInvoicesOrShipmentsList : '.$ex->getMessage());\n return false;\n } // end: try \n }", "public static function bogo_apply_disc($order_id,$promotion_id,$prmdisc_id,$prmdisc_bogo_sbmnu,$prmdisc_bogo_sbmnu_dish,$prmdisc_bogo_qty,$disc_amt_type,$disc_amt){\r \t//echo \"$order_id,$promotion_id,$prmdisc_id,$prmdisc_bogo_sbmnu,$prmdisc_bogo_sbmnu_dish,$prmdisc_bogo_qty,$disc_amt_type,$disc_amt\";\r\t\t//..Check if discount is with sub menu item is selected\r\t\tif(is_gt_zero_num($prmdisc_bogo_sbmnu_dish)){\r\t\t\t//..do nothing..because we already ahve submenudishid\r\t\t}else{\r\t\t //..Get all submenu dish ids from submenu..\r\t\t\t$rs_apl_disc_items= tbl_submenu_dishes::getSubMenuItems($prmdisc_bogo_sbmnu);\r\t\t\tif(is_not_empty($rs_apl_disc_items)){\r\t\t\t\t$prmdisc_bogo_sbmnu_dish=$rs_apl_disc_items;\r\t\t\t}else{\r\t\t\t\t$strOpMsg= \"No items found to apply discount\" ;\r\t\t\t\treturn 0;\r\t\t\t}\r\t\t}\t\t\r \t\t//...Check if the item is in the order detail\r\t\t$tmp_fnd=0;\r\t\t$ord_det_items=tbl_order_details::readArray(array(ORD_DTL_ORDER_ID=>$order_id,ORD_DTL_SBMENU_DISH_ID=>$prmdisc_bogo_sbmnu_dish,ORDPROM_DISCOUNT_AMT=>0),$tmp_fnd,1,0);\t\t\t\t\t\t\t\r\t\tif($tmp_fnd>0){\t\t \r\t\t\t//..item presents in order detail wihtout disocunt\r\t\t\t//..loop through the all the order items records\r\t\t\tforeach($ord_det_items as $order_itm){\r\t\t\t\t //..now check if the quantity >= disc qty\t\t\t\t\t \r\t\t\t\t if($order_itm[ORD_DTL_QUANTITY]>=$prmdisc_bogo_qty){\r\t\t\t\t \t //..Right item to apply discount\r\t\t\t\t\t //..Calculate discount amount\t\r\t\t\t\t\t$discount_amount=tbl_order_details::getDiscountAmnt($disc_amt_type,$disc_amt,$order_itm[ORD_DTL_PRICE]);\r\t\t\t\t\t//..Update the order detail with discount and promot\r\t\t\t\t\t$success=tbl_order_details::update_item_with_discount($order_itm[ORD_DTL_ID],$promotion_id,$prmdisc_id,$discount_amount);\t\r\t\t\t\t\t\t\t\t\t\t\t \r\t\t\t\t }\r\t\t\t}\r\t\t\tunset($ord_det_items);\t\r\t\t}else{\r\t\t\t$strOpMsg= \"Item not present in your order or alreday discounted\" ;\r\t\t}\t\r\t\treturn 1;\r }", "public function isOrderClosed($order_id){\n \n $cmd =Yii::app()->db->createCommand();\n $result = $cmd->update('order',\n array(\n 'status'=>'closed',\n \n ),\n (\"id=$order_id\"));\n \n if($result>0){\n return true;\n }else{\n return false;\n }\n }", "public function cart_checkFoodItemAvailability($cart_id){\n $food_items_and_qty = $this->model->getQtywithItemCount_cart($cart_id);\n //print_r($food_items_and_qty['data']);\n if($food_items_and_qty['status'] === \"success\"){\n\n foreach($food_items_and_qty['data'] as $item){\n if($item->Quantity > $item->Current_count){\n return ['status'=>'unavail', 'data'=>$item->FoodName];\n }\n }\n return ['status'=>'avail'];\n }\n }", "public function verify_order_id($orderID)\n {\n $client =$this->client();\n $response = $client->execute(new OrdersGetRequest($orderID));\n\n /**\n *Enable the following line to print complete response as JSON.\n */\n\n\n Log::debug( \\GuzzleHttp\\json_decode(\\GuzzleHttp\\json_encode($response, true),true) );\n\n\n// Logger::log( \\GuzzleHttp\\json_encode($response->result));\n Log::debug(\\GuzzleHttp\\json_encode($response->result, true));\n\n// Log::debug(\"Order ID: {$response->result->id}\\n\");\n// Log::error(\"Intent: {$response->result->intent}\\n\");\n\n $statusCode = $response->statusCode;\n $status = $response->result->status;\n $orderID = $response->result->id;\n $payerGivenName = $response->result->payer->name->given_name;\n $payerSurName = $response->result->payer->name->surname;\n $currency = $response->result->purchase_units[0]->amount->currency_code;\n $amount = $response->result->purchase_units[0]->amount->value;\n $payeeEmail = $response->result->purchase_units[0]->payee->email_address;\n $customID = $response->result->purchase_units[0]->custom_id;\n $paymentID = $response->result->purchase_units[0]->payments->captures[0]->id;\n\n Log::debug(\"Status Code: {$statusCode}\\n\");\n Log::debug(\"Status: {$status}\\n\");\n Log::debug(\"order id: {$orderID}\\n\");\n Log::debug(\"payer given name: {$payerGivenName}\\n\");\n Log::debug(\"payer sur name: {$payerSurName}\\n\");\n Log::debug(\"currency: {$currency}\\n\");\n Log::debug(\"amount: {$amount}\\n\");\n Log::debug(\"payee email: {$payeeEmail}\\n\");\n Log::debug(\"custom id: {$customID}\\n\");\n Log::debug(\"payment id: {$paymentID}\\n\");\n\n $paypalData = new PaypalData();\n $paypalData->status_code = $statusCode;\n $paypalData->status = $status;\n $paypalData->order_id = $orderID;\n $paypalData->payment_id = $paymentID;\n $paypalData->custom_id = $customID;\n $paypalData->payer_given_name = $payerGivenName;\n $paypalData->payer_sur_name = $payerSurName;\n $paypalData->currency = $currency;\n $paypalData->amount = $amount;\n $paypalData->payee_email = $payeeEmail;\n\n DB::transaction(function () use ($paypalData){\n\n if ($paypalData->saveOrFail()){\n\n $deposit = new Deposit();\n $deposit->user_id = $paypalData->custom_id;\n $deposit->amount = Forex::where('status',1)->orderBy('forex_id','desc')->first()->usd_rate()*($paypalData->amount);\n $deposit->channel = \"PAYPAL\";\n $deposit->confirmation_code = $paypalData->payment_id;\n\n if (is_null(Deposit::where('confirmation_code',$paypalData->payment_id)->first())){\n if ($deposit->saveOrFail()){\n $transaction = new Transaction();\n $transaction->user_id = $deposit->user_id;\n $transaction->type = \"CREDIT\";\n $transaction->ref_id = $deposit->id;\n\n if ($transaction->saveOrFail()){\n $currentBal = UserBalance::where('user_id', $transaction->user_id)->where('status',1)->orderBy('id', 'desc')->first();\n\n if (is_null($currentBal)){\n $oldBal = 0;\n }else{\n $oldBal = $currentBal->balance;\n }\n\n $userBalance = new UserBalance();\n $userBalance->user_id = $transaction->user_id;\n $userBalance->amount = $deposit->amount;\n $userBalance->balance = $deposit->amount + $oldBal;\n\n if ($userBalance->saveOrFail()){\n //notify customer\n auth()->user()->notify(new PaymentReceived($userBalance->amount, $userBalance->balance, \"PAYPAL\", $deposit->confirmation_code));\n }\n\n }\n\n }\n\n }\n }\n\n });\n\n }", "protected function findModel($order_id, $item_id, $shipping_id)\n{\nif (($model = CheckoutLink::findOne(['order_id' => $order_id, 'item_id' => $item_id, 'shipping_id' => $shipping_id])) !== null) {\nreturn $model;\n} else {\nthrow new NotFoundHttpException('The requested page does not exist.');\n}\n}", "function dsf_protx_decline_order($order_number){\n\nglobal $VoidURL, $AbortURL, $Verify, $ProtocolVersion;\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 declined 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 decline the item manually';\n\t\n\tmail_protx_problem($problem_text);\n\treturn 'invalid protx item';\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 declined 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 decline 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 // we must have a valid transaction item if we are here.\n \n // we therefore need to check our logs to see if the item has been previously charged.\n \n $check_history_query = dsf_db_query(\"select orders_id, orders_status_id from \" . DS_DB_SHOP . \".orders_status_history where orders_id='\" . $order_number . \"' and orders_status_id='90006'\");\n \n if (dsf_db_num_rows($check_history_query)==0){\n \t$TargetURL = $AbortURL; // never charged.\n\t$TxType = 'ABORT';\n }else{\n \t$TargetURL = $VoidURL; // has been charged\n\t$TxType = 'VOID';\n }\n \n \n \n $protx_items = dsf_db_fetch_array($protx_query);\n \n$VerifyServer = $Verify;\n\n\t$protx_user_account_number = MODULE_PAYMENT_PROTXCC_ID;\n\n// #########################\n\n\n\n\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' => $TxType,\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\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 = 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 voided / aborted witin protx.\n\n\n\t\t// update the orders status\n\t\t\t\t\t\t\n\t\t$sql_data_array = array('orders_status' => '50005');\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' => '50005', \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\t\n\t// log the reply.\n\t\t\n\t\t$write_notes = dsf_protx_shop_notes($order_number, $TxType . \" STATUS = OK\\n\");\n\n\t\treturn 'Complete';\n\t\tbreak;\n\t\n\t\n\t\n\t// all other cases except failed\n\tcase 'MALFORMED':\n\tcase 'INVALID':\n\tcase 'ERROR':\n\t\n\t$problem_text = 'Order number ' . $order_number . ' has been marked as ' . $TxType . ' 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, $TxType . \" STATUS = FAILED\\n\");\n\n\treturn 'Failed';\n\tbreak;\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 'error';\n}", "public function getOrderDetails($ordid, $isDirect = false, $isCron = false)\n {\n // get order details based on query\n $sSql = \"SELECT so.id as ordid, so.ordernumber as ordernumber, so.ordertime as ordertime, so.paymentID as paymentid, so.dispatchID as dispatchid, sob.salutation as sal, sob.company, sob.department, CONCAT(sob.firstname, ' ', sob.lastname) as fullname, CONCAT(sob.street, ' ', sob.streetnumber) as streetinfo, sob.zipcode as zip, sob.city as city, scc.countryiso as country, su.email as email, spd.comment as shipping, scl.locale as language\";\n $sSql .= \" FROM s_order so\";\n $sSql .= \" JOIN s_order_shippingaddress sob ON so.id = sob.orderID\"; \n $sSql .= \" JOIN s_core_countries scc ON scc.id = sob.countryID\";\n $sSql .= \" JOIN s_user su ON su.id = so.userID\";\n $sSql .= \" JOIN s_premium_dispatch spd ON so.dispatchID = spd.id\";\n $sSql .= \" JOIN s_core_locales scl ON so.language = scl.id\";\n \n // cron?\n if ($isCron) {\n $sSql .= \" JOIN asign_orders aso ON so.id = aso.ordid\";\n }\n\n // if directly from Thank you page \n if ($isDirect) {\n $sSql .= \" WHERE so.ordernumber = '\" . $ordid . \"'\";\n } else {\n $sSql .= \" WHERE so.id = '\" . $ordid . \"'\";\n } \n\n // cron?\n if ($isCron) { \n $sSql .= \" AND aso.ycReference = 0\";\n }\n\n $aOrders = Shopware()->Db()->fetchRow($sSql);\n $orderId = $aOrders['ordid'];\n \n // get order article details\n $aOrders['orderarticles'] = Shopware()->Db()->fetchAll(\"SELECT `articleID`, `articleordernumber`, `name`, `quantity`, `ean` FROM `s_order_details` WHERE `orderID` = '\" . $orderId . \"' AND `articleID` <> 0\");\n\n return $aOrders;\n }", "public function testSearchDelivery()\n {\n $this->loginAdmin(\"Shop Settings\", \"Shipping Cost Rules\");\n //search\n $this->changeAdminListLanguage('Deutsch');\n //fields have different names in PE and EE versions\n $this->type(\"where[oxdelivery][oxtitle]\", \"šÄßüл\");\n $this->clickAndWait(\"submitit\");\n $this->assertElementPresent(\"link=1 DE S&H šÄßüл\");\n $this->assertElementPresent(\"link=2 DE S&H šÄßüл\");\n $this->assertElementPresent(\"link=3 DE S&H šÄßüл\");\n $this->assertElementPresent(\"link=Test delivery category [DE] šÄßüл\");\n $this->assertElementPresent(\"link=Test delivery product [DE] šÄßüл\");\n $this->assertElementPresent(\"link=[last] DE S&H šÄßüл\");\n $this->assertEquals(\"šÄßüл\", $this->getValue(\"where[oxdelivery][oxtitle]\"));\n $this->type(\"where[oxdelivery][oxtitle]\", \"2 DE\");\n $this->clickAndWait(\"submitit\");\n $this->assertElementNotPresent(\"link=Test delivery category [DE] šÄßüл\");\n $this->assertElementNotPresent(\"link=Test delivery product [DE] šÄßüл\");\n $this->assertElementNotPresent(\"link=1 DE S&H šÄßüл\");\n $this->assertElementPresent(\"link=2 DE S&H šÄßüл\");\n $this->assertElementNotPresent(\"link=3 DE S&H šÄßüл\");\n $this->assertElementNotPresent(\"link=4 DE S&H šÄßüл\");\n $this->assertElementNotPresent(\"link=[last] DE S&H šÄßüл\");\n $this->changeAdminListLanguage('English');\n $this->assertElementNotPresent(\"//tr[@id='row.1']/td[1]\");\n $this->type(\"where[oxdelivery][oxtitle]\", \"EN\");\n $this->clickAndWait(\"submitit\");\n $this->assertElementPresent(\"link=[last] EN S&H šÄßüл\");\n $this->assertElementPresent(\"link=3 EN S&H šÄßüл\");\n $this->assertElementPresent(\"link=4 EN S&H šÄßüл\");\n $this->assertElementPresent(\"link=Test delivery category [EN] šÄßüл\");\n $this->assertElementPresent(\"link=Test delivery product [EN] šÄßüл\");\n $this->assertElementPresent(\"link=1 EN S&H šÄßüл\");\n $this->assertEquals(\"EN\", $this->getValue(\"where[oxdelivery][oxtitle]\"));\n $this->type(\"where[oxdelivery][oxtitle]\", \"4 EN\");\n $this->clickAndWait(\"submitit\");\n $this->assertElementNotPresent(\"link=Test delivery category [EN] šÄßüл\");\n $this->assertElementNotPresent(\"link=Test delivery product [EN] šÄßüл\");\n $this->assertElementNotPresent(\"link=[last] EN S&H šÄßüл\");\n $this->assertElementNotPresent(\"link=3 EN S&H šÄßüл\");\n $this->assertElementPresent(\"link=4 EN S&H šÄßüл\");\n $this->assertElementNotPresent(\"link=2 EN S&H šÄßüл\");\n $this->assertElementNotPresent(\"link=1 EN S&H šÄßüл\");\n $this->type(\"where[oxdelivery][oxtitle]\", \"NoName\");\n $this->clickAndWait(\"submitit\");\n $this->assertElementNotPresent(\"//tr[@id='row.1']/td[1]\");\n $this->changeAdminListLanguage('Deutsch');\n $this->assertElementNotPresent(\"//tr[@id='row.1']/td[1]\");\n $this->type(\"where[oxdelivery][oxtitle]\", \"\");\n $this->clickAndWait(\"submitit\");\n $this->assertElementPresent(\"//tr[@id='row.1']/td[1]\");\n }", "public function update($order, $item)\n {\n //echo $order;\n //echo $item;\n //$item = Request::json('item');\n $part = Request::json('part');\n $packs = Request::json('packs');\n \n \n //check if-match header\n $etag = Request::header('if-match');\n \n //compare the etags to determine if standing order was previously modified\n if($etag == null || $etag!== $this->standingOrders->getEtag($order)){\n return Error::show(1);\n }\n \n \n //move forward with the update\n $update = $this->standingOrders->changeItemDetails($order, $item, $part, $packs);\n \n if(isset($update)){\n return Response::json(array(\n 'message' => $update\n )); \n }\n else{\n return Response::json(array(\n 'error' => \"update could not be completed\"\n ));\n } \n }", "public function existing_order_details(){\n\t\t\t\n\t\t\t$this->input->post(NULL, TRUE); // returns all POST items with XSS filter\n\t\t\t\n\t\t\t//escaping the post values\n\t\t\t$reference = html_escape($this->input->post('reference'));\n\t\t\t//$reference = preg_replace('#[^0-9]#i', '', $reference); // filter everything but numbers\n\t\t\t$email = html_escape($this->input->post('email'));\n\t\t\t\n\t\t\t$detail = $this->db->select('*')->from('orders')->where('reference',$reference)->where('customer_email',$email)->get()->row();\n\t\t\t\n\t\t\tif($detail){\n\t\t\t\t\n\t\t\t\t\t$data['id'] = $detail->id;\n\t\t\t\t\t$data['headerTitle'] = $detail->reference;\t\t\t\n\t\t\t\t\t$data['reference'] = $detail->reference;\n\t\t\t\t\t$data['customer_email'] = $detail->customer_email;\n\t\t\t\t\t//$data['payment_status'] = $detail->payment_status;\n\t\t\t\t\t//$data['shipping_status'] = $detail->shipping_status;\n\t\t\t\t\t\n\t\t\t\t\t$users_array = $this->Users->get_user($detail->customer_email);\n\t\t\t\t\t$destination_city = '';\n\t\t\t\t\t$destination_country = '';\n\t\t\t\t\tif($users_array){\n\t\t\t\t\t\tforeach($users_array as $user){\n\n\t\t\t\t\t\t\t$destination_city = $user->city;\n\t\t\t\t\t\t\t$destination_country = $user->country;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$data['destination_city'] = $destination_city;\n\t\t\t\t\t$data['destination_country'] = $destination_country;\n\t\t\t\t\t//$data['order_date'] = date(\"F j, Y\", strtotime($detail->order_date));\n\t\t\t\t\t\n\t\t\t\t\t//GET TRANSACTION DETAILS\n\t\t\t\t\t$transaction_array = $this->Transactions->get_transaction($detail->reference);\n\t\t\t\t\t\n\t\t\t\t\t$total_amount = '';\n\t\t\t\t\tif($transaction_array){\n\t\t\t\t\t\tforeach($transaction_array as $transaction){\n\t\t\t\t\t\t\t$total_amount = $transaction->total_amount;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$data['total_amount'] = $total_amount;\n\t\t\t\t\t\n\t\t\t\t\t//$shipping_array = $this->Shipping->get_shipping($detail->reference);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$data['success'] = true;\n\n\t\t\t}else {\n\t\t\t\t$data['success'] = false;\n\t\t\t}\n\t\t\techo json_encode($data);\n\t\t}", "public function taskVoided($order,$item)\n\t{\n\t\t// find price\n\t\t$price = MDealPrice::model()->findByPk($item->itemId);\n\t\t// find deal\n\t\t$deal = $price->deal;\n\t\t\n\t\t// delete coupons\n\t\tMDealCoupon::model()->deleteAll('orderId=?',array($order->id));\n\t\t\n\t\t// update deal stats\n\t\t$deal->stats = $deal->stats?$deal->stats:wm()->get('deal.helper')->dealStats($deal->id);\n\t\t$deal->stats->bought = MDealCoupon::model()->count('dealId=?', array($deal->id));\n\t\t$deal->stats->save();\n\t\t\n\t\t// is this deal still tipped\n\t\twm()->get('deal.helper')->verifyTipped($deal);\n\t}", "public static function deliverItemUpdate($db,$table_prefix,$update_type,$deliver_id,$data_id,$update = [],&$error)\n {\n $error = '';\n $error_tmp = '';\n \n $deliver = self::get($db,$table_prefix,'deliver',$deliver_id);\n if($deliver['status'] !== 'NEW') {\n $error .= 'Cannot update item as deliver status['.$deliver['status'].'] is not NEW ';\n }\n \n //reverse original quantity\n if($error === '' and ($update_type === 'UPDATE' or $update_type === 'DELETE')) {\n $item = self::get($db,$table_prefix,'deliver_item',$data_id,'data_id');\n $quantity = $item['quantity'] * -1;\n\n self::updateStockDelivered($db,$table_prefix,$deliver['store_id'],$item['stock_id'],$quantity,$error_tmp);\n if($error_tmp !== '') {\n $error .= 'Could not reverse original quantity received. ';\n if(DEBUG) $error .= $error_tmp;\n }\n } \n\n //update new value if not a delete\n if($error === '' and ($update_type === 'UPDATE' or $update_type === 'INSERT')) {\n self::updateStockDelivered($db,$table_prefix,$deliver['store_id'],$update['stock_id'],$update['quantity'],$error_tmp);\n if($error_tmp !== '') {\n $error .= 'Could not update changed item stock. ';\n if(DEBUG) $error .= $error_tmp;\n } \n }\n \n\n if($error === '') return true; else return false;\n }", "function purchaseditem () {\n\t\t\t$this->layout = 'mobilelayout';\n\t\t\t$this->set('title_for_layout','- Settings');\n\t\t\tglobal $loguser;\n\t\t\t$userid = $loguser[0]['User']['id'];\n\t\t\tif(!$this->isauthenticated()){\n\t\t\t\t$this->redirect('/mobile/');\n\t\t\t}\n\t\t\t$itemModel = array();\n\t\t\n\t\t\t$this->loadModel('Orders');\n\t\t\t$this->loadModel('Order_items');\n\t\t\t$this->loadModel('Item');\n\t\t\t$this->loadModel('Forexrate');\n\t\t\t\n\t\t\t$forexrateModel = $this->Forexrate->find('all');\n\t\t\t$currencySymbol = array();\n\t\t\tforeach($forexrateModel as $forexrate){\n\t\t\t\t$cCode = $forexrate['Forexrate']['currency_code'];\n\t\t\t\t$cSymbol = $forexrate['Forexrate']['currency_symbol'];\n\t\t\t\t$currencySymbol[$cCode] = $cSymbol;\n\t\t\t}\n\t\t\n\t\t\t$ordersModel = $this->Orders->find('all',array('conditions'=>array('userid'=>$userid),'order'=>array('orderid'=>'desc')));\n\t\t\t$orderid = array();\n\t\t\tforeach ($ordersModel as $value) {\n\t\t\t\t$orderid[] = $value['Orders']['orderid'];\n\t\t\t}\n\t\t\tif(count($orderid) > 0) {\n\t\t\t\t$orderitemModel = $this->Order_items->find('all',array('conditions'=>array('orderid'=>$orderid)));\n\t\t\t\t$itemid = array();\n\t\t\t\tforeach ($orderitemModel as $value) {\n\t\t\t\t\t$orid = $value['Order_items']['orderid'];\n\t\t\t\t\tif (!isset($oritmkey[$orid])){\n\t\t\t\t\t\t$oritmkey[$orid] = 0;\n\t\t\t\t\t}\n\t\t\t\t\t$itemid[] = $value['Order_items']['itemid'];\n\t\t\t\t\t$orderitems[$orid][$oritmkey[$orid]]['itemname'] = $value['Order_items']['itemname'];\n\t\t\t\t\t$orderitems[$orid][$oritmkey[$orid]]['itemtotal'] = $value['Order_items']['itemprice'];\n\t\t\t\t\t$orderitems[$orid][$oritmkey[$orid]]['itemsunitprice'] = $value['Order_items']['itemunitprice'];\n\t\t\t\t\t$orderitems[$orid][$oritmkey[$orid]]['itemssize'] = $value['Order_items']['item_size'];\n\t\t\t\t\t$orderitems[$orid][$oritmkey[$orid]]['quantity'] = $value['Order_items']['itemquantity'];\n\t\t\t\t\t$oritmkey[$orid]++;\n\t\t\t\t}\n\t\t\t\t/* if (count($itemid) > 0) {\n\t\t\t\t\t$itemModel = $this->Item->find('all',array('conditions'=>array('Item.id'=>$itemid)));\n\t\t\t\t}\n\t\t\t\tforeach($itemModel as $item) {\n\t\t\t\t\t$itemArray[$item['Item']['id']] = $item['Item'];\n\t\t\t\t} */\n\t\t\t}\n\t\t\t$orderDetails = array();\n\t\t\tforeach ($ordersModel as $key => $orders){\n\t\t\t\t$orderid = $orders['Orders']['orderid'];\n\t\t\t\t$orderCurny = $orders['Orders']['currency'];\n\t\t\t\t$orderDetails[$key]['orderid'] = $orders['Orders']['orderid'];\n\t\t\t\t$orderDetails[$key]['price'] = $orders['Orders']['totalcost'];\n\t\t\t\t$orderDetails[$key]['saledate'] = $orders['Orders']['orderdate'];\n\t\t\t\t$orderDetails[$key]['status'] = $orders['Orders']['status'];\n\t\t\t\t$itemkey = 0;\n\t\t\t\tforeach ($orderitems[$orderid] as $orderkey => $orderitem) {\n\t\t\t\t\t//$itemTable = $itemArray[$orderitem];\n\t\t\t\t\t$orderDetails[$key]['orderitems'][$itemkey]['itemname'] = $orderitems[$orderid][$orderkey]['itemname'];\n\t\t\t\t\t$orderDetails[$key]['orderitems'][$itemkey]['quantity'] = $orderitems[$orderid][$orderkey]['quantity'];\n\t\t\t\t\t$orderDetails[$key]['orderitems'][$itemkey]['price'] = $orderitems[$orderid][$orderkey]['itemtotal'];\n\t\t\t\t\t$orderDetails[$key]['orderitems'][$itemkey]['unitprice'] = $orderitems[$orderid][$orderkey]['itemsunitprice'];\n\t\t\t\t\t$orderDetails[$key]['orderitems'][$itemkey]['size'] = $orderitems[$orderid][$orderkey]['itemssize'];\n\t\t\t\t\t$orderDetails[$key]['orderitems'][$itemkey]['cSymbol'] = $currencySymbol[$orderCurny];\n\t\t\t\t\t$itemkey++;\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\t//echo \"<pre>\";print_r($orderitems);die;\n\t\t\t$this->set('orderDetails',$orderDetails);\n\t\t\t\n\t\t}", "public function orderItemInfoallindia()\n {\n $user_id = $this->session->userdata('user_id');\n $this->db->where('user_id',$user_id);\n\n\n $this->db->order_by('id', 'DESC');\n $quer = $this->db->get('allindiaprodctorder');\n $user_dat=$quer->result_array();\n if($quer->num_rows() >= 1){\n $arr=Array();\n $arr2 = Array();\n\n\n\n \n $orderArr = Array();\n $itemarr2 = Array();\n for($j=0;$j<count($user_dat);$j++)\n {\n // $parts = explode(': ', $user_dat[$j]['item_id']);\n $items_id = $user_dat[$j]['item_id'];\n array_push($itemarr2,$user_dat[$j]['id']);\n \n for($i=0;$i<count($items_id);$i++)\n {\n\n $this->db->where('id',$user_dat[$j]['ship_addr_id']);\n $addrarr = $this->db->get('web_shippingaddr')->row_array();\n\n // print_r($items_id[$i]);\n // $ab= explode(':', $items_id[$i]);\n // print_r($ab[1]);\n $this->db->where('id', $user_dat[$j]['item_id']);\n $itemarr = $this->db->get('app_Items')->row_array();\n // print_r($itemarr);\n $array3=array(\n 'id' =>$itemarr['id'],\n 'item_name' =>$itemarr['item_name'],\n // 'item_id' =>$user_dat['item_id'],\n 'Item_code' =>$itemarr['Item_code'],\n 'Item_weight' =>$itemarr['Item_weight'],\n 'item_mrp' =>$itemarr['item_mrp'],\n 'item_image_path' =>$itemarr['item_image_path'],\n 'total_amount' =>$user_dat[$j]['total_amount'],\n 'app_oder_id' =>$user_dat[$j]['id'],\n 'status' =>$user_dat[$j]['status'],\n // 'order_quantity' =>$ab[1],\n 'order_quantity' =>$user_dat[$j]['quantity'],\n 'total_number' =>$itemarr2,\n 'name' =>$addrarr['name'],\n 'mobile' =>$addrarr['mobile'],\n 'email' =>$addrarr['email'],\n 'addresss' =>$addrarr['addresss'],\n 'pincode' =>$addrarr['pincode'],\n \n );\n\n array_push($orderArr, $array3);\n }\n\n \n }\n\n\n // print_r($orderArr);\n\n \n return $orderArr;\n }\n }", "public function deleteItem($existing,$inputData,$id){\n foreach ($existing as $existing_item) {\n $flag ='false';\n foreach ($inputData[\"itemList\"] as $p) {\n\n if($existing_item->item_id == $p[\"item_id\"])\n { \n $flag ='true';\n } \n } \n\n if($flag == 'false'){ \n $deleteItem = IssueStockItem::where(\"issue_stocks_id\",\"=\",$id)\n ->where(\"item_id\",\"=\", $existing_item->item_id)\n ->delete();\n $deleteItem = Stock::where(\"type_id\",\"=\",$id)\n ->where(\"type\",\"=\", 4)\n ->where(\"item_id\",\"=\", $existing_item->item_id)\n ->delete(); \n $item = Item::find($existing_item->item_id);\n $item->stock = $item->stock + $existing_item->quantity;\n $item->save();\n\n } } \n}", "protected function getOrderItem()\n\t{\n\t\t$search = $this->object->createSearch();\n\n\t\t$expr = [];\n\t\t$expr[] = $search->compare( '==', 'order.base.rebate', 14.50 );\n\t\t$expr[] = $search->compare( '==', 'order.base.sitecode', 'unittest' );\n\t\t$expr[] = $search->compare( '==', 'order.base.price', 53.50 );\n\t\t$expr[] = $search->compare( '==', 'order.base.editor', $this->editor );\n\t\t$search->setConditions( $search->combine( '&&', $expr ) );\n\t\t$results = $this->object->searchItems( $search );\n\n\t\tif( ( $item = reset( $results ) ) === false ) {\n\t\t\tthrow new \\RuntimeException( 'No order found' );\n\t\t}\n\n\t\treturn $item;\n\t}" ]
[ "0.68968153", "0.64061326", "0.6374184", "0.60655355", "0.6013902", "0.5968313", "0.5925072", "0.5893439", "0.58284354", "0.5711219", "0.56883526", "0.56671923", "0.5623058", "0.56164724", "0.5587327", "0.55288315", "0.552016", "0.5513494", "0.55067664", "0.5494386", "0.5479554", "0.5476652", "0.544681", "0.5443972", "0.5435907", "0.54301655", "0.542092", "0.53916436", "0.5387361", "0.53723294", "0.53720886", "0.53698", "0.53646874", "0.53568166", "0.53489125", "0.53189", "0.5294881", "0.5285704", "0.5284524", "0.5283347", "0.5276783", "0.52679735", "0.5267885", "0.52551925", "0.52367085", "0.5235829", "0.52325815", "0.5216745", "0.5206816", "0.52028537", "0.5195007", "0.5188259", "0.51641935", "0.51613533", "0.51592374", "0.5157444", "0.51570004", "0.5144528", "0.5142345", "0.5138295", "0.51306087", "0.5126382", "0.5123311", "0.51208234", "0.51053023", "0.51047045", "0.5083413", "0.5081992", "0.50800437", "0.5078695", "0.5074649", "0.50744206", "0.50737196", "0.50714064", "0.5070456", "0.506682", "0.5065068", "0.50602806", "0.50584984", "0.5055677", "0.50403893", "0.50395", "0.5038458", "0.5037215", "0.5033399", "0.5032303", "0.5028799", "0.50216943", "0.50180787", "0.5017507", "0.5015704", "0.50126064", "0.5006784", "0.5006577", "0.50060016", "0.5000545", "0.49940264", "0.4991392", "0.49906507", "0.498697" ]
0.69253075
0
Get Item On Delivery Order Detail by Delivery Order ID & Item ID
public function ItemOnDODetail($params) { return $this->deliveryOrderDetail::where($params)->first() == null ? true : $this->deliveryOrderDetail::where($params)->first(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function GetDetailByDOID($delivery_order_id)\n {\n $data = $this->deliveryOrderDetail::find($delivery_order_id)->get();\n if (!empty($data)) {\n return $data;\n } return null;\n }", "public function GetDetailByID($delivery_order_detail_id)\n {\n return $this->deliveryOrderDetail::find($delivery_order_detail_id);\n }", "public function item($order)\n {\n return SiteMaintenanceItem::where('main_id', $this->id)->where('order', $order)->first();\n }", "public function show($orderItem)\n {\n }", "public function getorderitembyid($orderid){\n\t\t$this->db->where('OrdId', $orderid);\n\t\t$this->db->select('LintItemId,OrdId,ItemId,ItemName,ItemEdition,ItemAuther,ItemQuantity,ItemRetailPrice,ItemSellingPrice,ItemDiscount,ProductThumbImage,ProductLanguage');\n\t\t$this->db->from('tbl_order_lineitems');\n\t\t$this->db->join('tbl_products', 'tbl_products.ProductId = tbl_order_lineitems.ItemId', 'inner');\n\t\t$query=$this->db->get();\n\t\treturn $query->result();\n\t\t// $query=$this->db->get('tbl_order_lineitems');\n\t\t// return $query->result();\n\t}", "public function getDeliveryOrder();", "function item_details($iid, $oid)\n\t{\n\t\t$q = $this->db\n\t\t\t->select('co.store_id as stid, co.drug_id as iid, co.supplier_id as suid, co.manufacturer_id as mid, co.unit_cost price, co.unit_savings, co.quantity as qtyPrev, co.date_time, lc.item_type')\n\t\t\t->from('ci_completedorders as co')\n\t\t\t->join('ci_listings_compiled as lc', 'co.drug_id = lc.drug_id')\n\t\t\t->where('co.drug_id', $iid)\n\t\t\t->where('co.order_id', $oid)\n\t\t\t->limit(1)\n\t\t\t->get();\n\t\t\t\n\t\t$r = $q->row();\n\t\t\t\n\t\tif ( $q->num_rows() === 0 )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$r->rx = ( $r->item_type == 1 ) ? false : true;\n\t\t\tunset($r->item_type);\n\t\t\t$r->date = strtotime($r->date_time);\n\t\t\tunset($r->date_time);\n\t\t\t\n\t\t\t$this->result_to_table('Queried item details: ', array($r));\n\t\t\t\n\t\t\treturn $r;\n\t\t}\n\t}", "function GetDetailPPHItemById($id){\n\n $data = $this->db\n ->select('form_bd_item_pph.id_form_bd_item_pph as id_item_pph,form_bd_item_pph.id_form_bd_item as id_item,form_bd_item_pph.*,form_bd_item.real_amount,form_bd_item.name as item_name')\n ->where('form_bd_item_pph.id_form_bd_item_pph',$id)\n ->join('form_bd_item','form_bd_item.id_form_bd_item=form_bd_item_pph.id_form_bd_item')\n ->get('form_bd_item_pph')\n ->row_array();\n return $data;\n }", "function getOrderDetails($id)\n {\n }", "public function get_addon_delivery($id)\n {\n $this->db->select('this_delivery, product_code, description, unit_price');\n $this->db->from('sales_order_medication_deliveries');\n $this->db->where(['delivery_id' => $id]);\n $this->db->join('sales_order_medications', 'sales_order_medications.id = medication_order_item_id');\n $this->db->join('inventory_medications', 'inventory_medications.id = medication_id');\n return $this->db->get()->result_array();\n }", "function getItemInfo($id){\n $item = $this->order_model->getItemById($id);\n if($item == NULL) return $item;\n\n // get provider information\n $providerinfo = $this->user_model->getUserInfoByid($item->provider);\n $item->provider_id = $providerinfo->userid;\n $item->provider_name = $providerinfo->username;\n\n // get ship man information\n $shipman_info = $this->user_model->getUserInfoByid($item->ship_man);\n $item->shipman_name = isset($shipman_info->username) ? $shipman_info->username : '';\n $item->shipman_phone = isset($shipman_info->contact_phone) ? $shipman_info->contact_phone : '';\n\n // get activity information\n $activity = $this->activity_model->getItemById($item->activity_ids);\n $activity->products = json_decode($item->product_info);\n $activity->cnt = $item->activity_cnts;\n // $activity->products = $this->activity_model->getProductsFromIds($activity->product_id, $activity->provider_id);\n\n $item->activity = $activity;\n\n return $item;\n }", "public function orderItem(): OrderItem\n {\n return $this->order_item;\n }", "public function item_details($item_id)\n {\n $url = preg_replace('/set/i', 'item:' . $item_id, $this->public_url);\n return $this->curl($url)->item;\n }", "public function ItemPriceOnDODetail($params)\n {\n return $this->deliveryOrderDetail::where($params)->get() == null ? false : $this->deliveryOrderDetail::where($params)->pluck(); \n }", "public function initOrderDetail(&$orderItem, $item) {\n $payMethod = array('pm_id' => '',\n 'title' => $item['payment_method'],\n 'description' => '');\n\n $orderItem = array('order_id' => $item['order_id'],\n 'display_id' => $item['order_id'], //show id\n 'uname' => $item['shipping_firstname'] . ' ' . $item['shipping_lastname'],\n 'currency' => $item['currency_code'],\n 'shipping_address' => array(),\n 'billing_address' => array(),\n 'payment_method' => $payMethod,\n 'shipping_insurance' => '',\n 'coupon' => $item['coupon_id'],\n 'order_status' => array(),\n 'last_status_id' => $item['order_status_id'], //get current status from history\n 'order_tax' => $item['fax'],\n 'order_date_start' => $item['date_added'],\n 'order_date_finish' => '',\n 'order_date_purchased' => $item['date_modified']);\n }", "function getDeliveryByOrderId($order_id) {\n\t\t\n\t\t$list = $this->getDeliveryListByOrderId($order_id);\n\t\t\n\t\t$delivery = $list[0];\n\t\t$delivery['value'] = $delivery['value_net'] + $delivery['vat'];\n\t\t\n\t\treturn $delivery;\n\t}", "public function getOrderDelivery()\n {\n return $this->hasOne(Delivery::class, ['id' => 'order_delivery_id']);\n }", "function getDeliveryListByOrderId($order_id) {\n\t\tif (!is_numeric($order_id)) {\n\t\t\tmsg(\"ecommerce_delivery.getDeliveryListByOrderId(): order_id is not numeric\", 'error', 1);\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$list = $this->listing(\"order_id = $order_id\");\n\t\tforeach ($list as $key=>$val) {\n\t\t\t$list[$key]['carrier_detail'] = $this->getCarrierDetail($val['carrier_id']);\n\t\t}\n\t\treturn $list;\n\t}", "function getOrderPurchaseDetails($order_id)\n\t\t{\n\t\t\t//get order details\n\t\t\t$orders = $this->_BLL_obj->manage_content->getValue_where('order_info', '*', 'order_id', $order_id);\n\t\t\t$user_id = $orders[0]['user_id'];\n\t\t\t//get product details from order id\n\t\t\t$order_details = $this->_BLL_obj->manage_content->getValue_where('product_inventory_info', '*', 'order_id', $order_id);\n\t\t\tif(!empty($order_details[0]))\n\t\t\t{\n\t\t\t\t//total_overridng fee distributed\n\t\t\t\t$dis_over = 0;\n\t\t\t\t$user_level = 0;\n\t\t\t\t\n\t\t\t\tforeach($order_details as $order)\n\t\t\t\t{\n\t\t\t\t\t/* code for distribute overriding fee */\n\t\t\t\t\t//get transaction id for overriding fee\n\t\t\t\t\t$over_id = uniqid('trans');\n\t\t\t\t\t//calling overriding fee function\n\t\t\t\t\t$distributed_overriding = $this->distributeOverridingFee($user_id, $order['price'], $dis_over, $user_level, $over_id,$order_id);\n\t\t\t\t\tif($distributed_overriding != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t//insert values to fee transaction info table\n\t\t\t\t\t\t$insert_over = $this->_BLL_obj->manage_content->insertValue('fee_transaction_info', array('transaction_id','order_id','product_id','fee_type'), array($over_id,$order_id,$order['product_id'],'OF'));\n\t\t\t\t\t\t//new system value\n\t\t\t\t\t\t$new_system_value = $this->getSystemMoneyValue() - $distributed_overriding;\n\t\t\t\t\t\t//insert distributed amount to system money info\n\t\t\t\t\t\t$insert_dist_amount = $this->_BLL_obj->manage_content->insertValue('system_money_info', array('specification','debit','system_balance'), array($over_id,$distributed_overriding,$new_system_value));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t/* code for personal commision calculation */\n\t\t\t\t\t//get transaction id for personal comm calculation\n\t\t\t\t\t$per_id = uniqid('trans');\n\t\t\t\t\t//calling personal commision function\n\t\t\t\t\t$per_comm = $this->calculatePersonalCommision($user_id, $order['price'], $per_id,$order_id);\n\t\t\t\t\t//checking for non empty personal commision\n\t\t\t\t\tif($per_comm != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t//insert values to fee transaction info table\n\t\t\t\t\t\t$insert_personal = $this->_BLL_obj->manage_content->insertValue('fee_transaction_info', array('transaction_id','order_id','product_id','fee_type'), array($per_id,$order_id,$order['product_id'],'PC'));\n\t\t\t\t\t\t//new system value\n\t\t\t\t\t\t$new_system_value_per = $this->getSystemMoneyValue() - $per_comm;\n\t\t\t\t\t\t//insert distributed amount to system money info\n\t\t\t\t\t\t$insert_per_amount = $this->_BLL_obj->manage_content->insertValue('system_money_info', array('specification','debit','system_balance'), array($per_id,$per_comm,$new_system_value_per));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t/* code for point value calculation */\n\t\t\t\t\t//get transaction id for point value distribution\n\t\t\t\t\t$pv_id = uniqid('trans');\n\t\t\t\t\t//get product details\n\t\t\t\t\t$product_details = $this->_BLL_obj->manage_content->getValue_where('product_info', '*', 'product_id', $order['product_id']);\n\t\t\t\t\t//total point value\n\t\t\t\t\t$total_pv = $product_details[0]['point_value'] * $order['quantity'];\n\t\t\t\t\t//insert values to fee transaction info table\n\t\t\t\t\t$insert_point = $this->_BLL_obj->manage_content->insertValue('fee_transaction_info', array('transaction_id','order_id','product_id','fee_type'), array($pv_id,$order_id,$order['product_id'],'PV'));\n\t\t\t\t\t//insert pv to system\n\t\t\t\t\t$system_pv = $this->insertSystemPV($pv_id, $total_pv);\n\t\t\t\t\t//calling point value distributive function\n\t\t\t\t\t$this->distributePointValue($user_id, $total_pv, $pv_id, $order_id);\n\t\t\t\t\t\n\t\t\t\t\t/* code for member level upgradation of user and their parent */\n\t\t\t\t\t//calling fucntion for it\n\t\t\t\t\t$this->checkingLevelOfUserAndParent($user_id);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function getDetailById($id)\r\n {\r\n $condition = [\r\n 'orderId' => $id\r\n ];\r\n return $this->getDetail($condition);\r\n }", "public function getOrderLineItems($orderID)\n {\n \n }", "public function show($order_id)\n {\n //\n $obj = DB::table('orders')\n ->select('orders.id', 'registers.name as register','first_name', 'last_name', 'customer_type', \n 'delivery_address', 'balance', 'orders.total', 'discount', 'orders.sales_tax', 'orders.shipping',\n 'orders.status', 'orders.fulfillment', 'orders.created_at')\n ->join('transactions', 'orders.id', '=', 'transactions.order_id')\n ->join('registers', 'transactions.register_id', '=', 'registers.id')\n ->join('profile_patients', 'profile_patients.user_id', '=', 'orders.user_id')\n ->where('orders.id', $order_id)\n ->get();\n\n $order['order'] = $obj[0];\n $order['items'] = DB::table('order_items')\n ->select('qty', 'name', 'tax')\n ->join('products', 'products.id', '=', 'order_items.product_id')\n ->where('order_items.order_id', $order_id)\n ->get();\n return $order;\n }", "public function itemissuedetails(){\n\t$sel='ii_id,ii_itemid,ii_mtid,ii_name,ii_qty,ii_desc,ii_staffpfno,ii_staffname,ii_dept,ii_receivername,ii_creatordate';\n\t$whorder='ii_mtid asc,ii_itemid asc';\n\t$data['result'] = $this->picomodel->get_orderlistspficemore('items_issued',$sel,'',$whorder);\n $this->logger->write_logmessage(\"view\",\" View Item List setting\", \"Item List setting details...\");\n\t$this->logger->write_dblogmessage(\"view\",\" View Item List setting\", \"Item List setting details...\");\n $this->load->view('itemaction/displayissueitem',$data);\n }", "public function getDetails($id){\n return $this->slc(\"*\", \"orders\", array(\"order_id\" => $id), TRUE)[0];\n }", "public function getById($orderlineId);", "public function getAbleToDeliver()\n {\n\n $data = Order::where('IsTakeOut',1)\n ->where('IsDelivery',1)\n ->where('Status',6)\n //->join('orderitem', 'orderitem.OrderID', '=', 'orders.OrderID')\n // ->join('store', 'store.StoreID', '=', 'orders.StoreID')\n // ->join('meal', 'meal.MealID', '=', 'orderitem.MealID')\n // ->leftJoin('orderitemflavor', 'orderitem.OrderItemID', '=', 'orderitemflavor.OrderItemID')\n // ->leftJoin('flavor', 'orderitemflavor.FlavorID', '=', 'flavor.FlavorID')\n // ->leftJoin('flavortype', 'flavortype.FlavorTypeID', '=', 'flavor.FlavorTypeID')\n // ->select('*', 'orders.Memo', 'orderitem.OrderItemID', 'orders.DateTime as OrderDate')\n // ->orderBy('orders.OrderID', 'desc')\n ->get();\n\n\n if ($data->isEmpty()) {\n return \\response(\"\", 204);\n }\n\n \n $collection = collect();\n $flavors = null;\n $flavorsPrice = 0;\n $temp = null;\n $count = 0;\n\n $orders = $data->groupBy('OrderID');\n\n foreach ($orders as $order) {\n $items = collect();\n $count = 0;\n\n $orderItems = $order->groupBy('OrderItemID');\n\n foreach ($orderItems as $orderItem) {\n if ($count >= 3) {\n break;\n }\n\n $flavors = collect();\n $flavorsPrice = 0;\n \n foreach ($orderItem as $orderItemFlavor) {\n if ($orderItemFlavor->FlavorTypeID == null) {\n break;\n }\n\n $flavors->push(\n collect([\n 'flavorType' => $orderItemFlavor->FlavorTypeName,\n 'flavor' => $orderItemFlavor->FlavorName,\n ])\n );\n\n $flavorsPrice += $orderItemFlavor->ExtraPrice;\n }\n\n\n $temp = $orderItem[0];\n\n $items->push(\n collect([\n 'id' => $temp->OrderItemID,\n 'name' => $temp->MealName,\n 'memo' => $temp->Memo,\n 'quantity' => $temp->Quantity,\n 'mealPrice' => $temp->MealPrice,\n 'flavors' => $flavors,\n 'amount' => $temp->MealPrice + $flavorsPrice,\n ])\n );\n\n ++$count;\n }\n\n $collection->push(\n collect([\n 'id' => $temp->OrderID,\n 'orderNumber' => $temp->OrderNumber,\n 'store' => $temp->StoreName,\n 'status' => $temp->Status,\n 'orderDate' => $temp->OrderDate,\n 'estimatedTime' => $temp->EstimatedTime,\n 'orderMemo' => $temp->Memo,\n 'orderPrice' => $temp->Price,\n 'isTakeOut' => $temp->IsTakeOut,\n 'isDelivery' => $temp->IsDelivery,\n 'orderItems' => $items,\n 'serviceFee' => $temp->ServiceFee,\n 'destination' => $temp->Destination,\n 'totalAmount' => $temp->TotalAmount\n ])\n );\n }\n /* return collect([\n 'id' => $temp->OrderID,\n 'orderNumber' => $temp->OrderNumber,\n 'store' => $temp->StoreName,\n 'status' => $temp->Status,\n 'orderDate' => $temp->OrderDate,\n 'estimatedTime' => $temp->EstimatedTime,\n 'orderMemo' => $temp->Memo,\n 'orderPrice' => $temp->Price,\n 'isTakeOut' => $temp->IsTakeOut,\n 'orderItems' => $items,\n 'isDelivery' => $temp->IsDelivery,\n 'destination' => $temp->Destination,\n 'totalAmount' => $temp->TotalAmount\n ]);*/\n\n return response()->json($collection);\n\n }", "public function getId()\n {\n return $this->source['order_item_id'];\n }", "public function show(TxShopDomainModelOrderItem $order)\n {\n //\n }", "public function CheckItemOnDODetail($params)\n {\n return $this->deliveryOrderDetail::where($params)->first() == null ? true : false; \n }", "protected function getOrderItem()\n\t{\n\t\t$search = $this->object->createSearch();\n\n\t\t$expr = [];\n\t\t$expr[] = $search->compare( '==', 'order.base.rebate', 14.50 );\n\t\t$expr[] = $search->compare( '==', 'order.base.sitecode', 'unittest' );\n\t\t$expr[] = $search->compare( '==', 'order.base.price', 53.50 );\n\t\t$expr[] = $search->compare( '==', 'order.base.editor', $this->editor );\n\t\t$search->setConditions( $search->combine( '&&', $expr ) );\n\t\t$results = $this->object->searchItems( $search );\n\n\t\tif( ( $item = reset( $results ) ) === false ) {\n\t\t\tthrow new \\RuntimeException( 'No order found' );\n\t\t}\n\n\t\treturn $item;\n\t}", "public function view_order_details($order_id)\n\t{\n $log=new Log(\"OrderDetailsRCV.log\");\n $query = $this->db->query(\"SELECT oc_po_order.*,\".DB_PREFIX.\"user.firstname,\".DB_PREFIX.\"user.lastname\n\t\t\t\tFROM oc_po_order\n\t\t\t\t\tLEFT JOIN \".DB_PREFIX.\"user\n\t\t\t\t\t\tON \".DB_PREFIX.\"user.user_id = oc_po_order.user_id\n\t\t\t\t\t\t\tWHERE id = \" . $order_id . \" AND delete_bit = \" . 1);\n $log->write($query);\n $order_info = $query->row;\n\t\t//ON (oc_po_receive_details.product_id = oc_po_product.id)\n\t\t$query = $this->db->query(\"SELECT\n\t\toc_po_product.*,oc_po_receive_details.quantity as rd_quantity,oc_po_receive_details.price,oc_po_supplier.first_name,oc_po_supplier.last_name,oc_po_supplier.id as supplier_id,oc_po_receive_details.order_id\n\t\tFROM\n\t\t\toc_po_receive_details\n\t\tINNER JOIN oc_po_product \n\t\t\tON (oc_po_receive_details.order_id = oc_po_product.order_id)\n\t\tLEFT JOIN oc_po_supplier \n\t\t\tON (oc_po_receive_details.supplier_id = oc_po_supplier.id)\n\t\t\t\tWHERE (oc_po_receive_details.order_id =\".$order_id.\")\");\n $log->write($query);\n\tif($this->db->countAffected() > 0)\n\t{\n\t\t$products = $query->rows;\n\t\t$quantities = array();\n\t\t$all_quantities = array();\n\t\t$prices = array();\n\t\t$all_prices = array();\n\t\t$suppliers = array();\n\t\t$all_suppliers = array();\n\t\t$supplier_names = array();\n\t\t$all_supplier_names = array();\n\t\t$index = 0;\n\t\t$index1 = 0;\n\t\tfor($i =0; $i<count($products); $i++)\n\t\t{\n\t\t\tif($products[$i] != \"\")\n\t\t\t{\n\t\t\t\tfor($j = 0; $j<count($products); $j++)\n\t\t\t\t{\n\t\t\t\t\tif($products[$j] != \"\")\n\t\t\t\t\t{\n\t\t\t\t\t\tif($products[$i]['id'] == $products[$j]['id'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$quantities[$index] = $products[$j]['rd_quantity'];\n\t\t\t\t\t\t\t$supplier_names[$index] = $products[$j]['first_name'] .\" \". $products[$j]['last_name'];\n\t\t\t\t\t\t\t$suppliers[$index] = $products[$j]['supplier_id'];\n\t\t\t\t\t\t\t$prices[$index] = $products[$j]['price'];\n\t\t\t\t\t\t\tif($j!=$i)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$products[$j] = \"\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$index++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$index = 0;\n\t\t\t\t$all_quantities[$index1] = $quantities;\n\t\t\t\t$all_suppliers[$index1] = $suppliers;\n\t\t\t\t$all_prices[$index1] = $prices;\n\t\t\t\t$all_supplier_names[$index1] = $supplier_names;\n\t\t\t\tunset($quantities);\n\t\t\t\tunset($suppliers);\n\t\t\t\tunset($prices);\n\t\t\t\tunset($supplier_names);\n\t\t\t\t$quantities = array();\n\t\t\t\t$suppliers = array();\n\t\t\t\t$prices = array();\n\t\t\t\t$supplier_names = array();\n\t\t\t\t$index1++;\n\t\t\t}\n\t\t}\n\t\t$products = array_values(array_filter($products));\n\t\tfor($i = 0; $i<count($products); $i++)\n\t\t{\n\t\t\tunset($products[$i]['rd_quantity']);\n\t\t\tunset($products[$i]['first_name']);\n\t\t\tunset($products[$i]['last_name']);\n\t\t\t$products[$i]['quantities'] = $all_quantities[$i];\n\t\t\t$products[$i]['suppliers'] = $all_suppliers[$i];\n\t\t\t$products[$i]['prices'] = $all_prices[$i];\n\t\t\t$products[$i]['supplier_names'] = $all_supplier_names[$i];\n\t\t}\n\t}\n\telse\n\t{\n\t\t$query = $this->db->query(\"SELECT * FROM oc_po_product WHERE order_id = \" . $order_info['id']);\n\t\t$products = $query->rows;\n\t}\n\t\t$i = 0;\n\t\tforeach($products as $product)\n\t\t{\n\t\t\t$query = $this->db->query(\"SELECT * FROM oc_po_attribute_group WHERE product_id = \". $product['id']);\n\t\t\t$attribute_groups[$i] = $query->rows;\n\t\t\t$i++;\n\t\t}\n\t\t\n\t\t$i = 0;\n\t\tforeach($attribute_groups as $attribute_group)\n\t\t{\n\t\t\tfor($j = 0; $j<count($attribute_group);$j++)\n\t\t\t{\n\t\t\t\t$query = $this->db->query(\"SELECT * FROM oc_po_attribute_category WHERE attribute_group_id = \". $attribute_group[$j]['id']);\n\t\t\t\t$attribute_categories[$i] = $query->row;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\t\tfor($i=0;$i<count($products); $i++)\n\t\t{\n\t\t\tfor($j=0; $j<count($attribute_groups[$i]);$j++)\n\t\t\t{\n\t\t\t\t$products[$i]['attribute_groups'][$j] = $attribute_groups[$i][$j]['name'];\n\t\t\t}\n\t\t}\n\t\t$start_loop = 0;\n\t\t//$attribute_categories = array_values(array_filter($attribute_categories));\n\t\t//print_r($attribute_categories);\n\t\t//exit;\n\t\tfor($i=0; $i<count($products); $i++)\n\t\t{\n\t\t\tfor($j=$start_loop; $j<($start_loop + count($products[$i]['attribute_groups']));$j++)\n\t\t\t{\n\t\t\t\t$products[$i]['attribute_category'][$j] = $attribute_categories[$j]['name'];\n\t\t\t}\n\t\t\t$start_loop = $j;\n\t\t}\n\t\t$order_information['products'] = $products;\n\t\t$order_information['order_info'] = $order_info;\n\t\treturn $order_information;\n\t}", "function wv_commission_get_order_item_record($oid) {\n\n global $wpdb;\n $sql_order_itemid = \"SELECT DISTINCT WOIM.order_item_id FROM `\" . $wpdb->prefix . \"woocommerce_order_items` AS WOI INNER JOIN `\" . $wpdb->prefix . \"woocommerce_order_itemmeta` AS WOIM ON WOI.order_item_id = WOIM.order_item_id WHERE WOI.order_item_type = 'line_item' AND WOI.order_id =$oid\";\n $arr_order_itemid = $wpdb->get_results($sql_order_itemid);\n\n if (count($arr_order_itemid) > 0) {\n $i = 1;\n foreach ($arr_order_itemid as $item) {\n\n $order_item_id = $item->order_item_id;\n $productid = $this->wv_commission_get_woo_orderitem_metavalue($order_item_id, '_product_id');\n //output HTML here.\n ?>\n <tr>\n <!-- \n In case of more than 1 item, order id should show only one times : use= rowspan :\n --> \n <?php if ($i == 1) { ?>\n <td rowSpan=\"<?php echo count($arr_order_itemid); ?>\" >#<?php echo $oid; ?></td>\n <?php } ++$i; ?>\n <!-- order date -->\n <td><?php echo get_post_time(\"dM,Y\", FALSE, $oid); ?></td>\n \n <!-- product id -->\n <td><?php echo get_the_title($productid); ?></td>\n \n <!-- vendor -->\n <td><?php echo $this->wv_get_username_by_userid(get_post_meta($oid, 'woo_order_vendor_id_' . $productid, TRUE)); ?></td>\n \n <!-- commission --> \n <td>\n <?php\n echo get_woocommerce_currency_symbol(). get_post_meta($oid, 'woo_order_commision_' . $productid, TRUE);\n ?>\n </td>\n \n <!-- Status -->\n <td>\n <?php \n //change status functionality\n $sts = $this->wv_get_commission_status($oid,$productid);\n $newsts= ($sts==1)?0:1;\n ?>\n <a title=\"Change Status\" href=\"<?php echo admin_url(\"admin.php?page=woo_vendors&tab=commission&action=sts&oid=$oid&pid=$productid&sts=$newsts\"); ?>\" onclick=\"return confirm('Are you sure want to change status ?');\">\n <?php \n echo $newsts= ($sts==1)?\"paid\":\"due\";;\n ?>\n </a> \n </td>\n \n <!-- Commission Date -->\n <td>\n <?php \n //get commission date\n echo $this->wv_get_commission_date($oid,$productid);\n ?> \n </td>\n </tr>\n <?php\n }\n }//end of the count.\n }", "function get_xrefitem($itemID, $custID = '', $vendorID = '', $debug = false) {\n\t\t$q = (new QueryBuilder())->table('itemsearch');\n\t\t$itemquery = (new QueryBuilder())->table('itemsearch');\n\t\t$itemquery->field('itemid');\n\t\t$itemquery->where('itemid', $itemID);\n\t\t$itemquery->where('origintype', ['I', 'L']); // ITEMID found by the ITEMID, or by short item lookup // NOTE USED at Stempf\n\n\t\tif (!empty($custID)) {\n\t\t\t$custquery = (new QueryBuilder())->table('itemsearch');\n\t\t\t$custquery->field('itemid');\n\t\t\t$custquery->where('itemid', $itemID);\n\t\t\t$custquery->where('origintype', 'C');\n\t\t\t$custquery->where('originID', $custID);\n\t\t\t$q->where(\n\t\t\t\t$q\n\t\t\t\t->orExpr()\n\t\t\t\t->where('itemid', 'in', $itemquery)\n\t\t\t\t->where('itemid', 'in', $custquery)\n\t\t\t);\n\t\t} elseif (!empty($vendorID)) {\n\t\t\t$vendquery = (new QueryBuilder())->table('itemsearch');\n\t\t\t$vendquery->field('itemid');\n\t\t\t$vendquery->where('itemid', $itemID);\n\t\t\t$vendquery-->where('origintype', 'V');\n\t\t\t$vendquery-->where('originID', $vendorID);\n\t\t\t$q->where(\n\t\t\t\t$q\n\t\t\t\t->orExpr()\n\t\t\t\t->where('itemid', 'in', $itemquery)\n\t\t\t\t->where('itemid', 'in', $vendquery)\n\t\t\t);\n\t\t} else {\n\t\t\t$q->where('itemid', $itemID);\n\t\t}\n\t\t$q->limit(1);\n\t\t$sql = DplusWire::wire('database')->prepare($q->render());\n\n\t\tif ($debug) {\n\t\t\treturn $q->generate_sqlquery($q->params);\n\t\t} else {\n\t\t\t$sql->execute($q->params);\n\t\t\t$sql->setFetchMode(PDO::FETCH_CLASS, 'XRefItem');\n\t\t\treturn $sql->fetch();\n\t\t}\n\t}", "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 getOrderDetailId()\n {\n return $this->order_detail_id;\n }", "function get ($id) {\n // PARAM $id : order ID\n\n $order = $this->fetch(\n \"SELECT * FROM `orders` WHERE `order_id`=?\", [$id]\n );\n $order['items'] = $this->fetch(\n \"SELECT * FROM `orders_items` LEFT JOIN `products` USING (`product_id`) WHERE `orders_items`.order_id=?\", \n [$id], \"product_id\"\n );\n return $order;\n }", "function GetDetailPPHItemByIdSOA($id){\n\n $data = $this->db\n ->select('form_soa_item_pph.id_form_soa_item_pph as id_item_pph,form_soa_item_pph.id_form_soa_item as id_item,form_soa_item_pph.*,form_soa_item.real_amount,form_soa_item.name as item_name')\n ->where('form_soa_item_pph.id_form_soa_item_pph',$id)\n ->join('form_soa_item','form_soa_item.id_form_soa_item=form_soa_item_pph.id_form_soa_item')\n ->get('form_soa_item_pph')\n ->row_array();\n return $data;\n }", "public function getDetail($id)\n {\n $order = Orders::find($id);\n\n if(!empty($order)){\n\n $orderarray = $order->toArray();\n $order = $order->formatorder($orderarray);\n\n $order['user'] = user::where('_id',\"=\",$order['user'])->first(['name','email','mobile_number','status','created_at','address']);\n $order['user'] = $order['user']->toArray();\n\n $order['dateslug'] = date(\"F d, Y H:ia\",strtotime('+8 hours',strtotime($order['created_at'])));\n $order['status'] = 0;\n $order['timeslot']['dateslug'] = date(\"F d, Y\",$order['timeslot']['datekey']);\n return response($order,200);\n\n }\n\n return response(['success'=>false,\"message\"=>\"Order not found\"],400); \n \n }", "public function show($id)\n {\n $delivery = $this->deliveryRepository->find($id);\n\n if (empty($delivery)) {\n Flash::error('Delivery not found');\n\n return redirect(route('deliveries.index'));\n }\n\n $deliveryTransID = Delivery::where('id', $id)->pluck('ref_no');\n\n $products = DB::table('incoming_delivery_details')\n ->join('incoming_delivery', 'incoming_delivery_details.ref_no', '=', 'incoming_delivery.ref_no')\n ->join('product', 'incoming_delivery_details.product_id', '=', 'product.id')\n ->where('incoming_delivery_details.ref_no', '=', $deliveryTransID)\n ->select('incoming_delivery.id as delivery_id', 'incoming_delivery.ref_no as delivery_transno', 'incoming_delivery.transac_date as delivery_transdate', 'incoming_delivery.supplier_id as supplier', 'incoming_delivery.total_prod_costs as delivery_ttl_cost', 'incoming_delivery.remarks as delivery_remarks', 'incoming_delivery_details.id as dlvrydtl_id', 'incoming_delivery_details.ref_no as dlvrydtl_refno', 'incoming_delivery_details.product_id as dlvrydtl_prodid', 'incoming_delivery_details.quantity as dlvrydtl_prodqty', 'incoming_delivery_details.buying_price as dlvrydtl_prodprc', 'incoming_delivery_details.total_cost as dlvrydtl_prdttl', 'product.id as prod_id', 'product.sku_barcode_id as prod_barcode', 'product.name as prod_name', 'product.unit_type as prod_unit', 'product.price as prod_prc')\n ->get();\n\n return view('deliveries.show', compact('products'))\n ->with('delivery', $delivery);\n }", "public function details($id) {\n\n $order = Order::find($id);\n $delivery_status_id = (isset($order->delivery_status_id)) ? (int)$order->delivery_status_id : '';\n $delivery = $this->delivery_status($delivery_status_id);\n \n \\ViewHelper::setPageDetails('Storefronts | Order View', 'Order #' . $order->invoice_number, '');\n\n View::share('delivery_status', $delivery);\n View::share('order', $order);\n\n $delivery_modal_info = $this->delivery_status_modal_info($delivery_status_id);\n\n View::share('modals_info', $delivery_modal_info['info']);\n View::share('modals_btn', $delivery_modal_info['btn']);\n\n \treturn view('backoffice.orders.details');\n \n }", "public function getItemDetails($id)\n\t{\n\t\t$apicall = $this->endPoint. \"?callname=GetSingleItem&version=515\"\n . \"&appid=eBay3e085-a78c-4080-ac24-a322315e506&ItemID=$id\"\n . \"&responseencoding=\" .RESPONSE_ENCODING\n . \"&IncludeSelector=ShippingCosts,Details\"; \n \n \t$this->xmlResponse = simplexml_load_file($apicall);\n \t\n \t//print_r($this->xmlResponse);\n\n\t\tif ($this->xmlResponse->Item->PictureURL) \n\t\t{\n \t$this->bigPicUrl = $this->xmlResponse->Item->PictureURL;\n } else \n {\n \t$this->bigPicUrl = \"img/pic.gif\";\n }\n\t}", "function print_order_detail($orderid){\n // product data in table\n\t$order_items = \"scart_purchdetail\"; // purchdetail table - order item info\n // retrieve command table order details\n\t$intorderid = intval($orderid); // => 23 mysql value in integer\n\t$cmdorder = \"select * from $order_items where orderid = $intorderid order by line_item asc;\";\n\t$result2 = mysql_query($cmdorder)\n or die (\"Query '$cmdorder' failed with error message: \\\"\" . mysql_error () . '\"');\n\t$num_rows2 = mysql_num_rows($result2);\n\t// $row_info = mysql_fetch_array($result2);\n\tif ( $num_rows2 >= 1 ) {\n\t // ========= start order items data records =========\n\t $row = 0; // line_item values\n\t while ($row_info = mysql_fetch_object($result2)) {\n\t\t $data[$row]['item'] = $row_info->line_item; // current row item number\n\t\t $data[$row]['qty'] = $row_info->order_quantity; // current row quantity\n\t\t $data[$row]['bookid'] = $row_info->bookid; // current row bookid\n\t\t $data[$row]['price'] = $row_info->order_price; // current row book price\n\t\t $row ++; // next line_item values\n\t }\n\t return $data; // return order details\n\t} else {\n\t print '<script type=\"text/javascript\">';\n\t print 'alert(\"query result mysql_errno is = '.mysql_errno($connID).' !\\nmysql_errormsg = '\n\t\t\t .mysql_error($connID).'\\nNo results found - Returning empty!\\n\")';\n\t print '</script>'; \n\t // exit(); \n\t return 0; // return failed order detail\n }\n}", "public function getOrderDetails($order_id){\n\t \n\t \t\t$this->db->select(\"CO.*, C.comp_name, CF.firm_name\");\n\t\t\t$this->db->from(\"client_orders AS CO\");\n\t\t\t$this->db->join(\"clients AS C\", \"C.comp_id = CO.comp_id\");\n\t\t\t$this->db->join(\"company_firms AS CF \", \"CF.firm_id = CO.invoice_firm \");\n\t\t\t$this->db->where(\"CO.order_id\",$order_id);\n\t\t\tif($this->session->userdata('userrole') == 'Sales'){\n\t\t\t\t$this->db->where(\"CO.uid\",$this->session->userdata('userid'));\n\t\t\t}\n\t\t\t$query_order_details = $this->db->get();\n\t\t\t\n\t\t\t//echo $this->db->last_query();die;\n\t\t\tif($query_order_details->num_rows()>0)\n\t\t\t{\n\t\t\t\treturn $query_order_details->result_array();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn array();\n\t\t\t}\n\t \n\t }", "public function get_order_items($order_id)\n\t{\n\t\t$this->db->select('product.product_name, product.product_thumb_name, order_item.*, vendor.vendor_store_name, vendor.vendor_id');\n\t\t$this->db->where('product.created_by = vendor.vendor_id AND product.product_id = order_item.product_id AND order_item.order_id = '.$order_id);\n\t\t$query = $this->db->get('order_item, product, vendor');\n\t\t\n\t\treturn $query;\n\t}", "public function getorderlineitem($orrderid){\n\t\t$this->db->where('OrdId', $orrderid);\n\t\t$query=$this->db->get('tbl_order_lineitems');\n\t\treturn $query->result();\n\t}", "public function getOrderDetail()\n {\n return $this->orderDetail;\n }", "public function view_order_details_mo($order_id)\n\t{\n $log=new Log(\"OrderDetailsRcvMo.log\");\n\t\t$query = $this->db->query(\"SELECT oc_po_order.*,\".DB_PREFIX.\"user.firstname,\".DB_PREFIX.\"user.lastname\n\t\t\t\tFROM oc_po_order\n\t\t\t\t\tLEFT JOIN \".DB_PREFIX.\"user\n\t\t\t\t\t\tON \".DB_PREFIX.\"user.user_id = oc_po_order.user_id\n\t\t\t\t\t\t\tWHERE id = \" . $order_id . \" AND delete_bit = \" . 1);\n $log->write($query);\n\t\t$order_info = $query->row;\n\t\t//ON (oc_po_receive_details.product_id = oc_po_product.id)\n $allprod=\"SELECT\n\t\toc_po_product.*,oc_po_receive_details.quantity as rd_quantity,oc_po_receive_details.price,oc_po_supplier.first_name,oc_po_supplier.last_name,oc_po_supplier.id as supplier_id,oc_po_receive_details.order_id\n\t\tFROM\n\t\t\toc_po_receive_details\n\t\tINNER JOIN oc_po_product \n\t\t\tON (oc_po_receive_details.order_id = oc_po_product.order_id)\n\t\tLEFT JOIN oc_po_supplier \n\t\t\tON (oc_po_receive_details.supplier_id = oc_po_supplier.id)\n\t\t\t\tWHERE oc_po_product.item_status <> 0 AND (oc_po_receive_details.order_id =\".$order_id.\")\";\n\t\t$log->write($allprod);\n $query = $this->db->query($allprod);\n \n $log->write($query);\n\tif($this->db->countAffected() > 0)\n\t{\n\t\t$products = $query->rows;\n\t\t$quantities = array();\n\t\t$all_quantities = array();\n\t\t$prices = array();\n\t\t$all_prices = array();\n\t\t$suppliers = array();\n\t\t$all_suppliers = array();\n\t\t$supplier_names = array();\n\t\t$all_supplier_names = array();\n\t\t$index = 0;\n\t\t$index1 = 0;\n\t\tfor($i =0; $i<count($products); $i++)\n\t\t{\n\t\t\tif($products[$i] != \"\")\n\t\t\t{\n\t\t\t\tfor($j = 0; $j<count($products); $j++)\n\t\t\t\t{\n\t\t\t\t\tif($products[$j] != \"\")\n\t\t\t\t\t{\n\t\t\t\t\t\tif($products[$i]['id'] == $products[$j]['id'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$quantities[$index] = $products[$j]['rd_quantity'];\n\t\t\t\t\t\t\t$supplier_names[$index] = $products[$j]['first_name'] .\" \". $products[$j]['last_name'];\n\t\t\t\t\t\t\t$suppliers[$index] = $products[$j]['supplier_id'];\n\t\t\t\t\t\t\t$prices[$index] = $products[$j]['price'];\n\t\t\t\t\t\t\tif($j!=$i)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$products[$j] = \"\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$index++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$index = 0;\n\t\t\t\t$all_quantities[$index1] = $quantities;\n\t\t\t\t$all_suppliers[$index1] = $suppliers;\n\t\t\t\t$all_prices[$index1] = $prices;\n\t\t\t\t$all_supplier_names[$index1] = $supplier_names;\n\t\t\t\tunset($quantities);\n\t\t\t\tunset($suppliers);\n\t\t\t\tunset($prices);\n\t\t\t\tunset($supplier_names);\n\t\t\t\t$quantities = array();\n\t\t\t\t$suppliers = array();\n\t\t\t\t$prices = array();\n\t\t\t\t$supplier_names = array();\n\t\t\t\t$index1++;\n\t\t\t}\n\t\t}\n\t\t$products = array_values(array_filter($products));\n\t\tfor($i = 0; $i<count($products); $i++)\n\t\t{\n\t\t\tunset($products[$i]['rd_quantity']);\n\t\t\tunset($products[$i]['first_name']);\n\t\t\tunset($products[$i]['last_name']);\n\t\t\t$products[$i]['quantities'] = $all_quantities[$i];\n\t\t\t$products[$i]['suppliers'] = $all_suppliers[$i];\n\t\t\t$products[$i]['prices'] = $all_prices[$i];\n\t\t\t$products[$i]['supplier_names'] = $all_supplier_names[$i];\n\t\t}\n\t}\n\telse\n\t{\n\t\t$query = $this->db->query(\"SELECT * FROM oc_po_product WHERE order_id = \" . $order_info['id']);\n\t\t$products = $query->rows;\n\t}\n\t\t$i = 0;\n\t\tforeach($products as $product)\n\t\t{\n\t\t\t$query = $this->db->query(\"SELECT * FROM oc_po_attribute_group WHERE product_id = \". $product['id']);\n\t\t\t$attribute_groups[$i] = $query->rows;\n\t\t\t$i++;\n\t\t}\n\t\t\n\t\t$i = 0;\n\t\tforeach($attribute_groups as $attribute_group)\n\t\t{\n\t\t\tfor($j = 0; $j<count($attribute_group);$j++)\n\t\t\t{\n\t\t\t\t$query = $this->db->query(\"SELECT * FROM oc_po_attribute_category WHERE attribute_group_id = \". $attribute_group[$j]['id']);\n\t\t\t\t$attribute_categories[$i] = $query->row;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\t\tfor($i=0;$i<count($products); $i++)\n\t\t{\n\t\t\tfor($j=0; $j<count($attribute_groups[$i]);$j++)\n\t\t\t{\n\t\t\t\t$products[$i]['attribute_groups'][$j] = $attribute_groups[$i][$j]['name'];\n\t\t\t}\n\t\t}\n\t\t$start_loop = 0;\n\t\t//$attribute_categories = array_values(array_filter($attribute_categories));\n\t\t//print_r($attribute_categories);\n\t\t//exit;\n\t\tfor($i=0; $i<count($products); $i++)\n\t\t{\n\t\t\tfor($j=$start_loop; $j<($start_loop + count($products[$i]['attribute_groups']));$j++)\n\t\t\t{\n\t\t\t\t$products[$i]['attribute_category'][$j] = $attribute_categories[$j]['name'];\n\t\t\t}\n\t\t\t$start_loop = $j;\n\t\t}\n\t\t$order_information['products'] = $products;\n\t\t$order_information['order_info'] = $order_info;\n\t\treturn $order_information;\n\t}", "function getiteminfo($sessionID, $itemID, $debug) {\n\t\t$sql = Processwire\\wire('database')->prepare(\"SELECT * FROM pricing WHERE sessionid = :sessionID AND itemid = :itemid LIMIT 1\");\n\t\t$switching = array(':sessionID' => $sessionID, ':itemid' => $itemID); $withquotes = array(true, true);\n\t\tif ($debug) {\n\t\t\treturn returnsqlquery($sql->queryString, $switching, $withquotes);\n\t\t} else {\n\t\t\t$sql->execute($switching);\n\t\t\treturn $sql->fetch(PDO::FETCH_ASSOC);\n\t\t}\n\t}", "function getOrderDetails($id)\n {\n $dataService = new OrderDataService();\n\n return $dataService->getOrderDetails($id);\n }", "function generate_order($order,$mysqli){\r\n\r\n $orders = get_items_database($mysqli);\r\n\r\n \r\n $level = ($order->extension_attributes->shipping_assignments);\r\n foreach($level as $i){\r\n $address = $i->shipping->address;\r\n \r\n $adr = $address->street[0];\r\n $postal = $address->postcode;\r\n $city = $address->city;\r\n \r\n }\r\n\r\n \r\n foreach($order->items as $i){ \r\n foreach ($orders as $e){\r\n if ($e[\"code\"] == $i->sku){\r\n //print_r($e[\"code\"] .\" \". $i->sku);\r\n \r\n $ITid = $e[\"item_id\"];\r\n $ITname = $i->name;\r\n $ITcode = $i->sku;\r\n $qty = $i->qty_ordered;\r\n $cena = $i->price_incl_tax;\r\n \r\n \r\n } \r\n }\r\n }\r\n\r\n\r\n\r\n $data = array(\r\n \"OrderId\" => $order->increment_id,\r\n \"ReceivedIssued\" => \"P\",\r\n \"Year\" => 0,\r\n \"Number\" => null,\r\n \"Date\" => date(\"Y-m-d H:i:s\"),\r\n \"Customer\" => array(\r\n \"ID\" => 8451445,\r\n \"Name\" => null,\r\n \"ResourceUrl\" => null\r\n ),\r\n \"CustomerName\" => $order->customer_firstname.\" \". $order->customer_lastname,\r\n \"CustomerAddress\" => $adr,\r\n \"CustomerPostalCode\" => $postal,\r\n \"CustomerCity\" => $city,\r\n\r\n \"CustomerCountry\" => array(\r\n \"ID\" => 192,\r\n \"Name\" => null,\r\n \"ResourceUrl\" => null\r\n ),\r\n \"CustomerCountryName\" => null,\r\n \"Analytic\" => null,\r\n \"DueDate\" => null,\r\n \"Reference\" => $order->entity_id,\r\n \"Currency\" => array(\r\n \"ID\" => 7,\r\n \"Name\" => null,\r\n \"ResourceUrl\" => null\r\n ),\r\n \"Notes\" => null,\r\n \"Document\" => null,\r\n \"DateConfirmed\" => null,\r\n \"DateCompleted\" => null,\r\n \"DateCanceled\" => null,\r\n \"Status\" => null,\r\n \"DescriptionAbove\" => null,\r\n \"DescriptionBelow\" => null,\r\n \"ReportTemplate\" => array(\r\n \"ID\" => null,\r\n \"Name\" => null,\r\n \"ResourceUrl\" => null\r\n ),\r\n\r\n \"OrderRows\" => [array(\r\n \"OrderRowId\" => null,\r\n \"Order\" => null,\r\n \"Item\" => array(\r\n \"ID\" => $ITid,\r\n \"Name\" => null,\r\n \"ResourceUrl\" => null,\r\n ),\r\n \"ItemName\" => $ITname,\r\n \"ItemCode\" => $ITcode,\r\n \"Description\" => null,\r\n \"Quantity\" => $qty,\r\n \"Price\" => $cena,\r\n \"UnitOfMeasurement\" => \"kos\",\r\n \"RecordDtModified\" => \"2020-01-07T12:20:00+02:00\",\r\n \"RowVersion\" => null,\r\n \"_links\" => null,\r\n ) ],\r\n\r\n \"RecordDtModified\" => date(\"Y-m-d H:i:s\"),\r\n \"RowVersion\" => null,\r\n \"_links\" => null\r\n\r\n );\r\n \r\n return $data;\r\n}", "abstract protected function get_item_from_db($item_id);", "public static function getShippingAddress($_oID, $_cID) {\n global $lC_Database;\n\n $QorderShipping = $lC_Database->query('select delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state_code, delivery_country, delivery_address_format from :table_orders where orders_id = :orders_id');\n $QorderShipping->bindTable(':table_orders', TABLE_ORDERS);\n $QorderShipping->bindInt(':orders_id', $_oID);\n $QorderShipping->execute();\n \n $shipping_data = array('firstname' => self::getFirstName($_cID),\n 'lastname' => self::getLastName($_cID),\n 'company' => $QorderShipping->value('delivery_company'),\n 'street_address' => $QorderShipping->value('delivery_street_address'),\n 'suburb' => $QorderShipping->value('delivery_suburb'),\n 'city' => $QorderShipping->value('delivery_city'),\n 'postcode' => $QorderShipping->value('delivery_postcode'),\n 'zone_code' => $QorderShipping->value('delivery_state_code'),\n 'country_title' => $QorderShipping->value('delivery_country'),\n 'format' => $QorderShipping->value('delivery_address_format'));\n\n $QorderShipping->freeResult();\n \n return $shipping_data;\n }", "public function getDeliveryOrderDetailById(Request $request)\n {\n $deliveryOrderDetail = $this->deliveryOrderDetail::find($request->delivery_order_id);\n if ($deliveryOrderDetail == null) {\n $return = array (\n 'code' => 404,\n 'error' => true,\n 'message' => 'Data Tidak Ditemukan',\n );\n }else{\n $return = array (\n 'code' => 200,\n 'success' => true,\n 'data' => $deliveryOrderDetail,\n 'message' => 'Data Ditemukan',\n );\n }\n return $return;\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 orderItem($param) { \n if (!$this->aaa->has_right('openruth', 500))\n $res->orderItemError->_value = 'authentication_error';\n else {\n $targets = $this->config->get_value('ruth', 'ztargets');\n $agencyId = self::strip_agency($param->agencyId->_value);\n if ($tgt = $targets[$agencyId]) {\n // build order\n $ord = &$order->Reservation->_value;\n $ord->LibraryNo->_value = $agencyId;\n $ord->BorrowerTicketNo->_value = $param->userId->_value;\n $ord->DisposalNote->_value = $param->orderNote->_value;\n $ord->LastUseDate->_value = self::to_zruth_date($param->orderLastInterestDate->_value);\n $ord->ServiceCounter->_value = $param->agencyCounter->_value;\n $ord->Override->_value = (self::xs_true($param->agencyCounter->_value) ? 'Y' : 'N');\n $ord->Priority->_value = $param->orderPriority->_value;\n // ?????? $ord->DisposalType->_value = $param->xxxx->_value;\n $itemIds = &$param->orderItemId;\n if (is_array($itemIds))\n foreach ($itemIds as $oid) {\n $mrid->ID->_value = $oid->_value->itemId->_value;\n if (!$mrid->TitlePartNo->_value = $oid->_value->itemSerialPartId->_value)\n $mrid->TitlePartNo->_value = 0;\n $ord->MRIDS->_value->MRID[]->_value = $mrid;\n }\n else {\n $mrid->ID->_value = $itemIds->_value->itemId->_value;\n if (!$mrid->TitlePartNo->_value = $itemIds->_value->itemSerialPartId->_value)\n $mrid->TitlePartNo->_value = 0;\n $ord->MRIDS->_value->MRID->_value = $mrid;\n }\n $xml = '<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?'.'>' . utf8_decode($this->objconvert->obj2xml($order));\n \n//print_r($ord);\n//print_r($xml);\n \n $z = new z3950();\n $z->set_target($tgt['host']);\n $z->set_database($tgt['database'].'-ophelia');\n $z->set_authentication($tgt['authentication']);\n if ($tgt['proxy']) {\n $z->set_proxy($tgt['proxy']);\n }\n $xml_ret = $z->z3950_xml_update($xml, $tgt['timeout']);\n if ($z->get_errno() == 0 && $xml_ret['xmlUpdateDoc']) {\n $dom = new DomDocument();\n $dom->preserveWhiteSpace = false;\n if ($dom->loadXML($xml_ret['xmlUpdateDoc'])) {\n if ($err = &$dom->getElementsByTagName('ErrorResponse')->item(0)) {\n verbose::log(ERROR, __FUNCTION__ . ' (' . __LINE__ . ') errno: ' . $err->getAttribute('Err') . \n ' error: ' . $err->nodeValue);\n $res->orderItemError->_value = 'unspecified error, order not possible';\n } else {\n // order at least partly ok \n foreach ($dom->getElementsByTagName('MRID') as $mrid) {\n unset($ir);\n $ir->orderItemId->_value->itemId->_value = $mrid->getAttribute('Id');\n if ($mrid->getAttribute('Tp'))\n $ir->orderItemId->_value->itemSerialPartId->_value = $mrid->getAttribute('Tp');\n if (!$mrid->nodeValue)\n $ir->orderItemOk->_value = 'true';\n elseif (!($ir->orderItemError->_value = $this->errs[$mrid->nodeValue])) \n $ir->orderItemError->_value = 'unknown error: ' . $mrid->nodeValue;\n $res->orderItem[]->_value = $ir;\n }\n }\n }\n } else {\n self::log_z_error(__FUNCTION__, __LINE__, $agencyId, $z->get_errno(), $z->get_error_string());\n $res->orderItemError->_value = 'system error';\n }\n//echo \"\\n\";\n//print_r($xml_ret);\n//print_r(\"\\nError: \" . $z->get_errno());\n } else\n $res->orderItemError->_value = 'unknown agencyId';\n }\n\n $ret->orderItemResponse->_value = $res;\n //var_dump($param); var_dump($res); die();\n return $ret;\n }", "public function show(OrderItem $orderItem)\n {\n return OrderItemResource($orderItem);\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 getOrderInfoById($orderId)\n {\n $ordersQuery = DB::table('orders')\n ->leftJoin(\n DB::raw('(SELECT locations.id, locations.full_address, locations.longitude, locations.latitude FROM locations) as location_destination'),\n 'location_destination.id',\n '=',\n 'orders.location_destination_id'\n )\n ->leftJoin(\n DB::raw('(SELECT locations.id, locations.full_address, locations.longitude, locations.latitude FROM locations) as location_arrival'),\n 'location_arrival.id',\n '=',\n 'orders.location_arrival_id'\n )\n ->leftJoin('vehicle', 'orders.vehicle_id', '=', 'vehicle.id')\n ->where([\n ['orders.id', '=', $orderId],\n ['orders.del_flag', '=', '0'],\n ['vehicle.del_flag', '=', '0']\n ]);\n $order = $ordersQuery->get([\n 'orders.id as order_id', 'order_code', 'orders.status as status',\n 'orders.ETD_date', 'orders.ETD_time', 'location_destination.full_address as location_destination', 'location_destination.longitude as location_destination_longitude', 'location_destination.latitude as location_destination_latitude',\n 'orders.ETA_date', 'orders.ETA_time', 'location_arrival.full_address as location_arrival', 'location_arrival.longitude as location_arrival_longitude', 'location_arrival.latitude as location_arrival_latitude',\n 'vehicle.latitude as current_latitude', 'vehicle.longitude as current_longitude', 'vehicle.current_location as current_location'\n ])->first();\n return $order;\n }", "public function getThisOrderCityOfDelivery($order_id){\n \n $criteria = new CDbCriteria();\n $criteria->select = '*';\n $criteria->condition='id=:id';\n $criteria->params = array(':id'=>$order_id);\n $order= Order::model()->find($criteria);\n \n return $order['delivery_city_id'];\n }", "function getMembershipPurchaseDetails($order_id)\n\t\t{\n\t\t\t//get order details\n\t\t\t$order_details = $this->_BLL_obj->manage_content->getValue_where('membership_order_info', '*', 'membership_order_id', $order_id);\n\t\t\t$user_id = $order_details[0]['user_id'];\n\t\t\t//get user parent\n\t\t\t$user_mlm = $this->_BLL_obj->manage_content->getValue_where('user_mlm_info','*', 'user_id', $user_id);\n\t\t\tif(!empty($user_mlm[0]['parent_id']))\n\t\t\t{\n\t\t\t\t//get parent details\n\t\t\t\t$parent_mlm = $this->_BLL_obj->manage_content->getValueMultipleCondtn('user_mlm_info','*', array('id'), array($user_mlm[0]['parent_id']));\n\t\t\t\tif($parent_mlm[0]['member_level'] != 0)\n\t\t\t\t{\n\t\t\t\t\t//get transaction id for referral fee distribution\n\t\t\t\t\t$ref_id = uniqid('trans');\n\t\t\t\t\t//calling referral fee distribution function\n\t\t\t\t\t$ref_fee = $this->calculateReferralFee($parent_mlm[0]['user_id'], $order_details, $ref_id);\n\t\t\t\t\tif($ref_fee != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t//insert values to fee transaction info table\n\t\t\t\t\t\t$insert_referral = $this->_BLL_obj->manage_content->insertValue('fee_transaction_info', array('transaction_id','order_id','product_id','fee_type'), array($ref_id,$order_details[0]['membership_order_id'],$order_details[0]['membership_id'],'RF'));\n\t\t\t\t\t\t//new system value\n\t\t\t\t\t\t$new_system_value_per = $this->getSystemMoneyValue() - $ref_fee;\n\t\t\t\t\t\t//insert distributed amount to system money info\n\t\t\t\t\t\t$insert_per_amount = $this->_BLL_obj->manage_content->insertValue('system_money_info', array('specification','debit','system_balance'), array($ref_id,$ref_fee,$new_system_value_per));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}", "function agenda_get_item($event_id)\n{\n\t$tbl = get_conf('mainTblPrefix') . 'event AS event INNER JOIN ' \n\t\t. get_conf('mainTblPrefix') . 'rel_event_recipient AS rel_event_recipient' \n\t\t. ' ON event.id = rel_event_recipient.event_id';\n\n $sql = \"SELECT \tevent.id \t\t\t\t\t\tAS id,\n\t\t\t\t\tevent.title \t\t\t\t\tAS title,\n\t\t\t\t\tevent.description \t\t\t\tAS description,\n\t\t\t\t\tevent.start_date \t\t\t\tAS old_start_date,\n\t\t\t\t\tevent.end_date \t\t\t\t\tAS old_end_date,\n\t\t\t\t\tevent.author_id \t\t\t\tAS author_id,\n\t\t\t\t\trel_event_recipient.visibility \tAS visibility,\n\t\t\t\t\tevent.master_event_id\t\t \tAS master_event_id,\n\t\t\t\t\trel_event_recipient.user_id\t\tAS user_id,\n\t\t\t\t\trel_event_recipient.group_id\tAS group_id\n FROM \" . $tbl . \"\n\n WHERE event.id = \" . (int) $event_id ;\n\n $event = claro_sql_query_get_single_row($sql);\n\n if ($event) return $event;\n else return claro_failure::set_failure('EVENT_ENTRY_UNKNOW');\n\n}", "public function getQuotationItemData($order_id = null)\n\t{\n\t\t$selected_financial_year = $this->session->userdata(\"selected_financial_year\");\n\n\t\tif (!$order_id) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$sql = \"SELECT * FROM quotation_item JOIN item_master WHERE quotation_item.quotation_no = ? AND item_master.Item_ID=quotation_item.item_id AND financial_year_id=$selected_financial_year AND quotation_item.status=1\";\n\t\t$query = $this->db->query($sql, array($order_id));\n\t\treturn $query->result_array();\n\t}", "public function getOrdersItemData($order_id = null)\n\t{\n\t\tif(!$order_id) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$sql = \"SELECT * FROM orders_item WHERE order_id = ?\";\n\t\t$query = $this->db->query($sql, array($order_id));\n\t\treturn $query->result_array();\n\t}", "public function order_items_with_details()\n {\n return $this->hasMany('App\\Models\\Sales\\SalesOrderItem', 'sales_order_id', 'id');\n }", "public static function getInfo( $id )\n {\n return OrderInfoGetter :: get( $id );\n }", "public function itemreturndetails(){\n\t$sel='ir_id,ir_itemid,ir_mtid,ir_name,ir_qty,ir_desc,ir_staffpfno,ir_staffname,ir_dept,ir_receivername,ir_creatordate';\n\t$whorder='ir_mtid asc,ir_itemid asc';\n\t$data['result'] = $this->picomodel->get_orderlistspficemore('items_return',$sel,'',$whorder);\n $this->logger->write_logmessage(\"view\",\" View Returned Item List \", \"Returned Item List details...\");\n\t$this->logger->write_dblogmessage(\"view\",\" View Returned Item List \", \"Returned Item List details...\");\n $this->load->view('itemaction/displayreturnitem',$data);\n }", "function getPlayerWarehouseItem($player_id, $item_id)\n{\n global $db;\n return $db->where(\"player_id\", $player_id)\n ->where(\"item_id\", $item_id)\n ->getOne(\"warehouse\", \"quantity\");\n}", "public function getInfoPaymentByOrder($order_id)\n {\n $order = $this->_getOrder($order_id);\n $payment = $order->getPayment();\n $info_payments = [];\n $fields = [\n [\"field\" => \"cardholderName\", \"title\" => \"Card Holder Name: %1\"],\n [\"field\" => \"trunc_card\", \"title\" => \"Card Number: %1\"],\n [\"field\" => \"payment_method\", \"title\" => \"Payment Method: %1\"],\n [\"field\" => \"expiration_date\", \"title\" => \"Expiration Date: %1\"],\n [\"field\" => \"installments\", \"title\" => \"Installments: %1\"],\n [\"field\" => \"statement_descriptor\", \"title\" => \"Statement Descriptor: %1\"],\n [\"field\" => \"payment_id\", \"title\" => \"Payment id (Mercado Pago): %1\"],\n [\"field\" => \"status\", \"title\" => \"Payment Status: %1\"],\n [\"field\" => \"status_detail\", \"title\" => \"Payment Detail: %1\"],\n [\"field\" => \"activation_uri\", \"title\" => \"Generate Ticket\"],\n [\"field\" => \"payment_id_detail\", \"title\" => \"Mercado Pago Payment Id: %1\"],\n [\"field\" => \"id\", \"title\" => \"Collection Id: %1\"],\n ];\n\n foreach ($fields as $field) {\n if ($payment->getAdditionalInformation($field['field']) != \"\") {\n $text = __($field['title'], $payment->getAdditionalInformation($field['field']));\n $info_payments[$field['field']] = [\n \"text\" => $text,\n \"value\" => $payment->getAdditionalInformation($field['field'])\n ];\n }\n }\n\n if ($payment->getAdditionalInformation('payer_identification_type') != \"\") {\n $text = __($payment->getAdditionalInformation('payer_identification_type'));\n $info_payments[$payment->getAdditionalInformation('payer_identification_type')] = [\n \"text\" => $text . ': ' . $payment->getAdditionalInformation('payer_identification_number')\n ];\n }\n\n return $info_payments;\n }", "public function getDetails($id, $order){\r\n $so = $this->soap->GetStandingOrderDetails($this->licence, $id, $order);\r\n return isset($so)? $so->orderdetails: array( 0 => array('ORDERNO' => -1));\r\n }", "public function actionOrderDetail($id)\n {\n $order = Order::find()\n ->where(['id' => $id, 'customer_id' => $this->customer_id])\n ->andWhere(['<>', 'status_id', Order::STATUS_DRAFT])\n ->one();\n \n if ($order !== null) {\n return $order;\n }\n \n throw new NotFoundHttpException(\"Order transaction ({$id}) is not available.\");\n }", "public function getordersummerydetailsbyorderid($orderid){\n\t\t$this->db->where('tbl_order_summery.OrderId', $orderid);\n\t\t$query=$this->db->get('tbl_order_summery');\n\t\treturn $query->result();\n\t}", "public function getDetailRequestItem($id_request_item){\n $this->session->id_request_item = $id_request_item; /*untuk ngeset harga vendor butuh id_request_item*/\n $where = array(\n \"id_request_item\" => $id_request_item\n );\n $field = array(\n \"nama_produk\",\"jumlah_produk\",\"notes_produk\",\"file\",\"satuan_produk\"\n );\n $print = array(\n \"nama_produk\",\"jumlah_produk\",\"notes_produk\",\"file\",\"satuan_produk\"\n );\n $result = selectRow(\"price_request_item\",$where);\n $data = foreachResult($result,$field,$print);\n echo json_encode($data);\n }", "public function getOrderDetails($ordid, $isDirect = false, $isCron = false)\n {\n // get order details based on query\n $sSql = \"SELECT so.id as ordid, so.ordernumber as ordernumber, so.ordertime as ordertime, so.paymentID as paymentid, so.dispatchID as dispatchid, sob.salutation as sal, sob.company, sob.department, CONCAT(sob.firstname, ' ', sob.lastname) as fullname, CONCAT(sob.street, ' ', sob.streetnumber) as streetinfo, sob.zipcode as zip, sob.city as city, scc.countryiso as country, su.email as email, spd.comment as shipping, scl.locale as language\";\n $sSql .= \" FROM s_order so\";\n $sSql .= \" JOIN s_order_shippingaddress sob ON so.id = sob.orderID\"; \n $sSql .= \" JOIN s_core_countries scc ON scc.id = sob.countryID\";\n $sSql .= \" JOIN s_user su ON su.id = so.userID\";\n $sSql .= \" JOIN s_premium_dispatch spd ON so.dispatchID = spd.id\";\n $sSql .= \" JOIN s_core_locales scl ON so.language = scl.id\";\n \n // cron?\n if ($isCron) {\n $sSql .= \" JOIN asign_orders aso ON so.id = aso.ordid\";\n }\n\n // if directly from Thank you page \n if ($isDirect) {\n $sSql .= \" WHERE so.ordernumber = '\" . $ordid . \"'\";\n } else {\n $sSql .= \" WHERE so.id = '\" . $ordid . \"'\";\n } \n\n // cron?\n if ($isCron) { \n $sSql .= \" AND aso.ycReference = 0\";\n }\n\n $aOrders = Shopware()->Db()->fetchRow($sSql);\n $orderId = $aOrders['ordid'];\n \n // get order article details\n $aOrders['orderarticles'] = Shopware()->Db()->fetchAll(\"SELECT `articleID`, `articleordernumber`, `name`, `quantity`, `ean` FROM `s_order_details` WHERE `orderID` = '\" . $orderId . \"' AND `articleID` <> 0\");\n\n return $aOrders;\n }", "function get_order_details_get()\n { \n $input = $this->get();\n \n if(!isset($input['id']) || $input['id'] == '') \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 $trip_data = $this->Common_model->getOrderDetails($input['id']);\n if($trip_data){\n $message = ['status' => TRUE,'message' => $this->lang->line('trip_details_found_success'),'data'=>$trip_data];\n $this->set_response($message, REST_Controller::HTTP_OK); // OK (200)\n }\n else{\n $message = ['status' => FALSE,'message' => $this->lang->line('trip_details_found_error')];\n $this->response($message, REST_Controller::HTTP_BAD_REQUEST); // BAD_REQUEST (400)\n }\n \n }\n }", "public function getDeliveryId()\n {\n return $this->deliveryId;\n }", "public function getDeliveryId()\n {\n return $this->deliveryId;\n }", "public function order_details(){\n\t\t\t\n\t\t\t$this->input->post(NULL, TRUE); // returns all POST items with XSS filter\n\t\t\t\n\t\t\t//escaping the post values\n\t\t\t$pid = html_escape($this->input->post('id'));\n\t\t\t$id = preg_replace('#[^0-9]#i', '', $pid); // filter everything but numbers\n\t\t\t\n\t\t\t$detail = $this->db->select('*')->from('orders')->where('id',$id)->get()->row();\n\t\t\t\n\t\t\tif($detail){\n\t\t\t\t\n\t\t\t\t\t$data['id'] = $detail->id;\n\t\t\t\t\t\n\t\t\t\t\t$data['last_updated'] = date(\"F j, Y, g:i a\", strtotime($detail->last_updated));\n\t\t\t\t\t\n\t\t\t\t\t$data['order_date'] = date(\"F j, Y\", strtotime($detail->order_date));\n\t\t\t\t\t$numOfItems = '';\n\t\t\t\t\tif($detail->num_of_items == 1){\n\t\t\t\t\t\t$numOfItems = $detail->num_of_items.' item';\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$numOfItems = $detail->num_of_items.' items';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$data['headerTitle'] = 'Order: '.$detail->reference.' <span class=\"badge bg-green\" >'.$numOfItems.'</span>';\t\n\t\t\t\t\t\n\t\t\t\t\t$data['orderDate'] = '<i class=\"fa fa-calendar-o\" aria-hidden=\"true\"></i> '.date(\"F j, Y\", strtotime($detail->order_date));\n\t\t\t\t\t$data['reference'] = $detail->reference;\n\t\t\t\t\t$data['order_description'] = $detail->order_description;\n\t\t\t\t\t$data['total_price'] = number_format($detail->total_price, 2);\n\t\t\t\t\t$data['totalPrice'] = $detail->total_price;\n\t\t\t\t\t//$data['tax'] = $detail->tax;\n\t\t\t\t\t//$data['shipping_n_handling_fee'] = $detail->shipping_n_handling_fee;\n\t\t\t\t\t//$data['payment_gross'] = $detail->payment_gross;\n\t\t\t\t\t$data['num_of_items'] = $detail->num_of_items;\n\t\t\t\t\t$data['customer_email'] = $detail->customer_email;\n\t\t\t\t\t\n\t\t\t\t\t$user_array = $this->Users->get_user($detail->customer_email);\n\t\t\t\t\t\n\t\t\t\t\t$fullname = '';\n\t\t\t\t\tif($user_array){\n\t\t\t\t\t\tforeach($user_array as $user){\n\t\t\t\t\t\t\t$fullname = $user->first_name.' '.$user->last_name;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$data['customer'] = $fullname .' ('.$detail->customer_email.')';\n\t\t\t\t\t\n\t\t\t\t\t//SELECT CUSTOMER DROPDOWN\n\t\t\t\t\t\n\t\t\t\t\t$customer_options = '<option value=\"\" >Select User</option>';\n\t\t\t\t\t\t\t\n\t\t\t\t\t$this->db->from('users');\n\t\t\t\t\t$this->db->order_by('id');\n\t\t\t\t\t$result = $this->db->get();\n\t\t\t\t\tif($result->num_rows() > 0) {\n\t\t\t\t\t\tforeach($result->result_array() as $row){\n\t\t\t\t\t\t\t//AUTO SELECT DEFAULT\n\t\t\t\t\t\t\t$d = (strtolower($row['email_address']) == strtolower($detail->customer_email))?'selected':'';\n\t\t\t\t\t\t\t$customer_options .= '<option value=\"'.$row['email_address'].'\" '.$d.'>'.ucwords($row['first_name'].' '.$row['last_name']).' ('.$row['email_address'].')</option>';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$data['customer_options'] = $customer_options;\n\t\t\t\t\t//*********END SELECT DESTINATION COUNTRY DROPDOWN**********//\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t//GET PAYMENT STATUS FROM TRANSACTION DB\n\t\t\t\t\t$transaction_array = $this->Transactions->get_transaction($detail->reference);\n\t\t\t\t\t$payment_status = '';\n\t\t\t\t\t$edit_payment_status = '';\n\t\t\t\t\t$order_amount = '';\n\t\t\t\t\t$shipping_and_handling_costs = '';\n\t\t\t\t\t$total_amount = '';\n\t\t\t\t\t$transaction_id = '';\n\t\t\t\t\t\n\t\t\t\t\tif($transaction_array){\n\t\t\t\t\t\tforeach($transaction_array as $transaction){\n\t\t\t\t\t\t\t$transaction_id = $transaction->id;\n\t\t\t\t\t\t\t$payment_status = $transaction->status;\n\t\t\t\t\t\t\t$edit_payment_status = $transaction->status;\n\t\t\t\t\t\t\t$order_amount = $transaction->order_amount;\n\t\t\t\t\t\t\t$shipping_and_handling_costs = $transaction->shipping_and_handling_costs;\n\t\t\t\t\t\t\t$total_amount = $transaction->total_amount;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif($payment_status == '1'){\n\t\t\t\t\t\t$payment_status = '<span class=\"badge bg-green\">Paid</span>';\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$payment_status = '<span class=\"badge bg-yellow\">Pending</span>';\n\t\t\t\t\t}\n\t\t\t\t\t$data['payment_status'] = $payment_status;\n\t\t\t\t\t$data['edit_payment_status'] = $edit_payment_status;\n\t\t\t\t\t\n\t\t\t\t\t$data['transaction_id'] = $transaction_id;\n\t\t\t\t\t\n\t\t\t\t\t//SELECT PAYMENT STATUS DROPDOWN\n\t\t\t\t\t$payment_status_options = '<option value=\"\" >Select Payment Status</option>';\n\t\t\t\t\t\t\t\n\t\t\t\t\tfor($i=0; $i<=1; $i++){\n\t\t\t\t\t\t//AUTO SELECT DEFAULT\n\t\t\t\t\t\t$sel = ($i == $edit_payment_status) ? 'selected' : '';\n\t\t\t\t\t\t\n\t\t\t\t\t\t//READABLE DISPLAY\n\t\t\t\t\t\t$string = ($i == '0') ? 'Pending' : 'Paid';\n\t\t\t\t\t\t\n\t\t\t\t\t\t$payment_status_options .= '<option value=\"'.$i.'\" '.$sel.'>'.$string.'</option>';\n\t\t\t\t\t}\n\t\t\t\t\t$data['payment_status_options'] = $payment_status_options;\n\t\t\t\t\t//*********END SELECT PAYMENT STATUS DROPDOWN**********//\n\t\t\t\t\t\n\t\t\t\t\t//GET PAYMENT STATUS FROM TRANSACTION DB\n\t\t\t\t\t$payment_array = $this->Payments->get_payment($detail->reference);\n\t\t\t\t\t$payment_method = '';\n\t\t\t\t\t$payment_id = '';\n\t\t\t\t\tif($payment_array){\n\t\t\t\t\t\tforeach($payment_array as $payment){\n\t\t\t\t\t\t\t$payment_method = $payment->payment_method;\n\t\t\t\t\t\t\t$payment_id = $payment->id;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$data['payment_id'] = $payment_id;\n\t\t\t\t\t\n\t\t\t\t\t//VIEW\n\t\t\t\t\t$data['view_payment_method'] = 'Payment Method: '.$payment_method;\n\t\t\t\t\t\n\t\t\t\t\t//SELECT PAYMENT METHOD DROPDOWN\n\t\t\t\t\t$payment_method_options = '<option value=\"\" >Select Payment Method</option>';\n\t\t\t\t\t\t\t\n\t\t\t\t\t$this->db->from('payment_methods');\n\t\t\t\t\t$this->db->order_by('id');\n\t\t\t\t\t$result = $this->db->get();\n\t\t\t\t\tif($result->num_rows() > 0) {\n\t\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\t//AUTO SELECT DEFAULT\n\t\t\t\t\t\t\t$default = (strtolower($row['method_name']) == strtolower($payment_method))?'selected':'';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$payment_method_options .= '<option value=\"'.$row['method_name'].'\" '.$default.'>'.$row['method_name'].'</option>';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$data['payment_method_options'] = $payment_method_options;\n\t\t\t\t\t//*********END SELECT PAYMENT METHOD DROPDOWN**********//\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$data['order_amount'] = $order_amount;\n\t\t\t\t\t$data['shipping_and_handling_costs'] = $shipping_and_handling_costs;\n\t\t\t\t\t$data['total_amount'] = $total_amount;\n\t\t\t\t\t\n\t\t\t\t\t//GET SHIPPING STATUS FROM DB\n\t\t\t\t\t$shipping_array = $this->Shipping->get_shipping($detail->reference);\n\t\t\t\t\t$shipping_status = '';\n\t\t\t\t\t$edit_shipping_status = '';\n\t\t\t\t\t$shipping_id = '';\n\t\t\t\t\t$method = '';\n\t\t\t\t\t$shipping_fee = '';\n\t\t\t\t\t$tax = '';\n\t\t\t\t\t$origin_city = '';\n\t\t\t\t\t$origin_country = '';\n\t\t\t\t\t$destination_city = '';\n\t\t\t\t\t$destination_country = '';\n\t\t\t\t\t$customer_contact_phone = '';\n\t\t\t\t\t$estimated_delivery_date = '';\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif($shipping_array){\n\t\t\t\t\t\tforeach($shipping_array as $shipping){\n\t\t\t\t\t\t\t$shipping_id = $shipping->id;\n\t\t\t\t\t\t\t$shipping_status = $shipping->status;\n\t\t\t\t\t\t\t$edit_shipping_status = $shipping->status;\n\t\t\t\t\t\t\t$method = $shipping->shipping_method;\n\t\t\t\t\t\t\t$shipping_fee = $shipping->shipping_fee;\n\t\t\t\t\t\t\t$tax = $shipping->tax;\n\t\t\t\t\t\t\t$origin_city = $shipping->origin_city;\n\t\t\t\t\t\t\t$origin_country = $shipping->origin_country;\n\t\t\t\t\t\t\t$destination_city = $shipping->destination_city;\n\t\t\t\t\t\t\t$destination_country = $shipping->destination_country;\n\t\t\t\t\t\t\t$customer_contact_phone = $shipping->customer_contact_phone;\n\t\t\t\t\t\t\t$estimated_delivery_date = $shipping->estimated_delivery_date;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif($shipping_status == '1'){\n\t\t\t\t\t\t$shipping_status = '<span class=\"badge bg-green\">Shipped</span>';\n\t\t\t\t\t\t\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$shipping_status = '<span class=\"badge bg-yellow\">Pending</span>';\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$view_delivery_date = '';\n\t\t\t\t\t$edit_delivery_date = '';\n\t\t\t\t\tif($estimated_delivery_date == '0000-00-00 00:00:00'){\n\t\t\t\t\t\t$view_delivery_date = 'Not Set';\n\t\t\t\t\t\t$edit_delivery_date = '';\n\t\t\t\t\t\t\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$view_delivery_date = date(\"F j, Y g:i A\", strtotime($estimated_delivery_date));\n\t\t\t\t\t\t$edit_delivery_date = date(\"Y-m-d g:i A\", strtotime($estimated_delivery_date));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$data['delivery_date'] = $view_delivery_date;\n\t\t\t\t\t$data['edit_delivery_date'] = $edit_delivery_date;\n\t\t\t\t\t\n\t\t\t\t\t$data['edit_shipping_status'] = $edit_shipping_status;\n\t\t\t\t\t$data['shipping_status'] = $shipping_status;\n\t\t\t\t\t$data['shipping_fee'] = $shipping_fee;\n\t\t\t\t\t$data['tax'] = $tax;\n\t\t\t\t\t$data['shipping_id'] = $shipping_id; \n\t\t\t\t\t\t\n\t\t\t\t\t//SELECT SHIPPING METHODS DROPDOWN\n\t\t\t\t\t//$shipping_methods = '<div class=\"form-group\">';\n\t\t\t\t\t//$shipping_methods .= '<select name=\"shipping_method\" id=\"shipping_method\" class=\"form-control\">';\n\t\t\t\t\t\t\n\t\t\t\t\t$shipping_methods = '<option value=\"\" >Select Shipping Method</option>';\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t$this->db->from('shipping_methods');\n\t\t\t\t\t$this->db->order_by('id');\n\t\t\t\t\t$result = $this->db->get();\n\t\t\t\t\tif($result->num_rows() > 0) {\n\t\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\t$d = (strtolower($row['shipping_company']) == strtolower($method))?'selected':'';\n\t\t\t\t\t\n\t\t\t\t\t\t\t$shipping_methods .= '<option value=\"'.ucwords($row['id']).'\" '.$d.'>'.ucwords($row['shipping_company']).'</option>';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t//$shipping_methods .= '</select>';\n\t\t\t\t\t//$shipping_methods .= '</div>';\t\n\t\t\t\t\t$data['shipping_method_options'] = $shipping_methods;\n\t\t\t\t\t//*********END SELECT SHIPPING METHODS DROPDOWN**********//\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$data['origin_city'] = $origin_city;\n\t\t\t\t\t$data['origin_country'] = $origin_country;\n\t\t\t\t\t\t\n\t\t\t\t\t//SELECT ORIGIN COUNTRY DROPDOWN\n\t\t\t\t\t\n\t\t\t\t\t$origin_country_options = '<option value=\"\" >Select Origin Country</option>';\n\t\t\t\t\t\t\t\n\t\t\t\t\t$this->db->from('countries');\n\t\t\t\t\t$this->db->order_by('id');\n\t\t\t\t\t$result = $this->db->get();\n\t\t\t\t\tif($result->num_rows() > 0) {\n\t\t\t\t\t\tforeach($result->result_array() as $row){\n\t\t\t\t\t\t\t//AUTO SELECT DEFAULT\n\t\t\t\t\t\t\t$d = (strtolower($row['name']) == strtolower($origin_country))?'selected':'';\n\t\t\t\t\t\t\t$origin_country_options .= '<option value=\"'.$row['name'].'\" '.$d.'>'.ucwords($row['name']).'</option>';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$data['origin_country_options'] = $origin_country_options;\n\t\t\t\t\t//*********END SELECT DESTINATION COUNTRY DROPDOWN**********//\n\t\t\t\t\t\n\t\t\t\t\t$data['destination_city'] = $destination_city;\n\t\t\t\t\t$data['destination_country'] = $destination_country;\n\t\t\t\t\t\t\n\t\t\t\t\t//SELECT DESTINATION COUNTRY DROPDOWN\n\t\t\t\t\t\n\t\t\t\t\t$destination_country_options = '<option value=\"\" >Select Destination Country</option>';\n\t\t\t\t\t\t\t\n\t\t\t\t\t$this->db->from('countries');\n\t\t\t\t\t$this->db->order_by('id');\n\t\t\t\t\t$result = $this->db->get();\n\t\t\t\t\tif($result->num_rows() > 0) {\n\t\t\t\t\t\tforeach($result->result_array() as $row){\n\t\t\t\t\t\t\t//AUTO SELECT DEFAULT\n\t\t\t\t\t\t\t$d = (strtolower($row['name']) == strtolower($destination_country))?'selected':'';\n\t\t\t\t\t\t\t$destination_country_options .= '<option value=\"'.$row['name'].'\" '.$d.'>'.ucwords($row['name']).'</option>';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$data['destination_country_options'] = $destination_country_options;\n\t\t\t\t\t//*********END SELECT DESTINATION COUNTRY DROPDOWN**********//\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$data['customer_contact_phone'] = $customer_contact_phone;\n\t\t\t\t\t\n\t\t\t\t\t//SELECT SHIPPING STATUS DROPDOWN\n\t\t\t\t\t$shipping_status_options = '<option value=\"\" >Select Shipping Status</option>';\n\t\t\t\t\t\t\t\n\t\t\t\t\tfor($i=0; $i<=1; $i++){\n\t\t\t\t\t\t//AUTO SELECT DEFAULT\n\t\t\t\t\t\t$sel = ($i == $edit_shipping_status) ? 'selected' : '';\n\t\t\t\t\t\t\n\t\t\t\t\t\t//READABLE DISPLAY\n\t\t\t\t\t\t$status_string = ($i == '0') ? 'Pending' : 'Shipped';\n\t\t\t\t\t\t\n\t\t\t\t\t\t$shipping_status_options .= '<option value=\"'.$i.'\" '.$sel.'>'.$status_string.'</option>';\n\t\t\t\t\t}\n\t\t\t\t\t$data['shipping_status_options'] = $shipping_status_options;\n\t\t\t\t\t//*********END SELECT SHIPPING STATUS DROPDOWN**********//\n\t\t\t\t\t\n\t\t\t\t\t$data['model'] = 'orders';\n\t\t\t\t\t$data['success'] = true;\n\n\t\t\t}else {\n\t\t\t\t$data['success'] = false;\n\t\t\t}\n\t\t\techo json_encode($data);\n\t\t}", "public function getOrderDetailsByOrderId($orderId)\n {\n $sql = <<<'EOT'\nSELECT\n `d`.`id` AS `orderdetailsID`,\n `d`.`orderID` AS `orderID`,\n `d`.`ordernumber`,\n `d`.`articleID`,\n `d`.`articleordernumber`,\n `d`.`price` AS `price`,\n `d`.`quantity` AS `quantity`,\n `d`.`price`*`d`.`quantity` AS `invoice`,\n `d`.`name`,\n `d`.`status`,\n `d`.`shipped`,\n `d`.`shippedgroup`,\n `d`.`releasedate`,\n `d`.`modus`,\n `d`.`esdarticle`,\n `d`.`taxID`,\n `t`.`tax`,\n `d`.`tax_rate`,\n `d`.`esdarticle` AS `esd`\nFROM\n `s_order_details` AS `d`\nLEFT JOIN\n `s_core_tax` AS `t`\nON\n `t`.`id` = `d`.`taxID`\nWHERE\n `d`.`orderID` = :orderId\nORDER BY\n `orderdetailsID` ASC\nEOT;\n\n return $this->db->fetchAll($sql, ['orderId' => $orderId]);\n }", "public function read($order_id) {\n\n global $user;\n\n //watchdog('musth_restws', 'W7D001 5DXS OrderResourceController start read (!i) (!p) ',\n // array('!i' => print_r($order_id, true),\n // '!p' => print_r('', true)),\n // WATCHDOG_DEBUG);\n\n $order_as_array = entity_load('commerce_order', array($order_id));\n $order = $order_as_array[$order_id];\n\n // The order total, which is in the field commerce_order_total, is calculated\n // automatically when the order is refreshed, which happens at least when we\n // call the line item api to get all the line items of an order\n\n // Refreshing the order in case any product changed its price or there are other\n // changes to take care of\n\n // Since we refresh the order here, there is no need to do it when we load\n // line items. Just call the order query api first and then the line item query api\n\n if ($order->status == 'cart')\n commerce_cart_order_refresh($order);\n\n $order_wrapper = entity_metadata_wrapper('commerce_order', $order);\n\n //watchdog('musth_restws', 'W7D001 71788 kkk OrderResourceController read (!i) (!p) ',\n // array('!i' => print_r('', true),\n // '!p' => print_r('', true)),\n // WATCHDOG_DEBUG);\n\n if (isset($order->commerce_customer_billing[LANGUAGE_NONE]))\n $customer_profile_id = $order->commerce_customer_billing[LANGUAGE_NONE][0]['profile_id'];\n else\n $customer_profile_id = 0;\n\n if ($user->uid) {\n // For logged-in users we can send back the email address\n\n $user_email = $order->mail;\n\n } else {\n // For anonymous users we can't\n\n $user_email = 'Cant send you the email address for privacy';\n }\n\n $order_to_return = new Order($order->order_id,\n $order->order_number,\n $order->uid,\n $user_email,\n $customer_profile_id,\n $order->status,\n $order_wrapper->commerce_order_total->amount->value(),\n $order_wrapper->commerce_order_total->currency_code->value(),\n $order->created,\n $order->changed\n );\n\n //watchdog('musth_restws', 'W7D001 7171 OrderResourceController read (!i) (!p) ',\n // array('!i' => print_r('', true),\n // '!p' => print_r('', true)),\n // WATCHDOG_DEBUG);\n\n // Sending back the Order object\n\n return $order_to_return;\n }", "function getReceiptItems($item_id=NULL)\n\t{\n\t\tglobal $db;\n\n\t\t$item_id_condition = ($item_id)?' AND ri.item_id = '.$item_id:NULL;\n\t\t\n\t\t$query = 'SELECT pr.product_desc AS \"Product\", ri.quantity AS \"Quantity\", uo.uom_code AS \"Uom\", ri.price AS \"Price\", ri.price * ri.quantity AS \"Value\", cu.currency_code AS \"Currency\" \n\t\tFROM '.receipt_items_table .' ri \n\t\tJOIN '.products_table.' pr ON pr.product_id=ri.product_id \n\t\tJOIN '.uom_table .' uo ON uo.uom_id=ri.uom_id \n\t\tJOIN '.currency_table.' cu ON cu.currency_id=ri.currency_id \n\t\tWHERE ri.receipt_id = '.$this->receipt_id.$item_id_condition ;\n\t\t$result = $db->query($query);\n\n\t\tif(!$result)\n\t\t{\n\t\t\t$err_info = $db->errorInfo();\n\t\t\techo $err_info[2];\n\t\t\terror_log('Function : getReceiptItems, Class : receipt, '.$err_info[2]);\n\t\t\texit;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$arr = $result->fetchAll(PDO::FETCH_ASSOC);\n\t\t}\n\t\treturn $arr;\n\t}", "function setOrderPaid($object) { \n /* you can itentify the item with $object->Item->ShopId */ \n}", "public function deliveryOrder()\n {\n return $this->belongsTo(DeliveryOrder::class);\n }", "public function orderDetail($order_id){\n $data = $this->order->getOrderById($order_id);\n return view('dashboard.order-detail', ['data' => $data, 'list_status' => $this->order->list_status]);\n }", "public function getIdDelivery()\n {\n return $this->idDelivery;\n }", "public function get($with_details = FALSE, $search_token = array(), $filter = array(), $limit = 999, $offset = 0)\n {\n $this->load->library('subquery');\n $this->load->model('inventory/m_product');\n $this->db->select(' delivery.*, DATE_FORMAT(delivery.date, \"%M %d, %Y\") as formatted_date, truck.trucking_name, customer.company_name, customer.id AS customer_id, customer.address, s_order.id as order_id,delivery.status, s_order.po_number, agent.name AS sales_agent', FALSE);\n $this->db->from('sales_delivery as delivery');\n $this->db->join('sales_trucking as truck', 'truck.id = delivery.fk_sales_trucking_id', 'left');\n $this->db->join('sales_order as s_order', 's_order.id = delivery.fk_sales_order_id');\n $this->db->join('sales_agent as agent', 'agent.id = s_order.fk_sales_agent_id', 'left');\n $this->db->join('sales_customer as customer', 'customer.id = s_order.fk_sales_customer_id');\n $this->db->join('sales_delivery_detail as deliv_detail', 'deliv_detail.fk_sales_delivery_id = delivery.id');\n $this->db->group_by('delivery.id');\n if ($search_token)\n {\n $this->db->like($search_token['category'], $search_token['token'], 'both');\n }\n if (!empty($filter))\n {\n $this->db->where($filter);\n }\n $this->db->order_by('delivery.id', 'DESC');\n $data = $this->db->limit($limit, $offset)->get()->result_array();\n if (!$with_details)\n {\n return $data;\n }\n $deliveries = array();\n $delivery_ids = array();\n $order_ids = array();\n $customer_ids = array();\n for ($x = 0; $x < count($data); $x++)\n {\n $deliveries[] = $data[$x];\n $delivery_ids[] = $data[$x]['id'];\n $order_ids[] = $data[$x]['fk_sales_order_id'];\n }\n unset($data);\n\n $details = FALSE;\n if (!empty($delivery_ids))\n {\n //get delivery ids\n $this->db->select('deliv_detail.id, deliv_detail.fk_sales_delivery_id, deliv_detail.this_delivery, deliv_detail.delivered_units, deliv_detail.fk_sales_order_detail_id');\n $this->db->select('order_detail.discount, order_detail.product_quantity, order_detail.total_units, order_detail.unit_price, IFNULL(delivery.total_qty_delivered, 0) as total_qty_delivered, IFNULL(delivery.total_units_delivered, 0) as total_units_delivered', FALSE);\n $this->db->select('product.description, product.formulation_code, product.code');\n $this->db->select('unit.description as unit_description');\n $this->db->from('sales_delivery_detail as deliv_detail');\n $this->db->where_in('deliv_detail.fk_sales_delivery_id', $delivery_ids);\n $this->db->join('sales_order_detail as order_detail', 'order_detail.id = deliv_detail.fk_sales_order_detail_id');\n $this->db->join('inventory_product as product', 'product.id = order_detail.fk_inventory_product_id');\n $this->db->join('inventory_unit as unit', 'unit.id = product.fk_unit_id', 'left');\n $sub = $this->subquery->start_subquery('join', 'left', 'delivery.order_detail_id = order_detail.id');\n $sub->select('SUM(delivery_detail.this_delivery) as total_qty_delivered, SUM(delivery_detail.delivered_units) as total_units_delivered, delivery_detail.fk_sales_order_detail_id as order_detail_id', FALSE);\n $sub->from('sales_delivery as s_delivery');\n $sub->join('sales_order', 'sales_order.id = s_delivery.fk_sales_order_id');\n $sub->join('sales_delivery_detail as delivery_detail', 'delivery_detail.fk_sales_delivery_id = s_delivery.id');\n $sub->where(array('s_delivery.status' => M_Status::STATUS_DELIVERED));\n $sub->where_in('sales_order.id', $order_ids);\n $sub->group_by('delivery_detail.fk_sales_order_detail_id');\n $this->subquery->end_subquery('delivery');\n $this->db->group_by('deliv_detail.id');\n $details = $this->db->get()->result_array();\n }\n\n foreach ($deliveries as &$d)\n {\n $DELIVERY_ID = $d['id'];\n $formatted_details = array();\n for ($x = 0; $x < count($details); $x++)\n {\n if ($d['id'] === $details[$x]['fk_sales_delivery_id'])\n {\n $formatted_details['id'][] = $details[$x]['id'];\n $formatted_details['fk_sales_order_detail_id'][] = $details[$x]['fk_sales_order_detail_id'];\n $formatted_details['prod_descr'][] = $details[$x]['description'];\n $formatted_details['prod_code'][] = $details[$x]['code'];\n $formatted_details['prod_formu_code'][] = $details[$x]['formulation_code'];\n $formatted_details['product_description'][] = \"{$details[$x]['description']} ({$details[$x]['formulation_code']})\";\n $formatted_details['product_quantity'][] = $details[$x]['product_quantity'];\n $formatted_details['total_units'][] = $details[$x]['total_units'];\n $formatted_details['this_delivery'][] = $details[$x]['this_delivery'];\n $formatted_details['delivered_units'][] = $details[$x]['delivered_units'];\n $formatted_details['quantity_delivered'][] = $details[$x]['total_qty_delivered'];\n $formatted_details['units_delivered'][] = $details[$x]['total_units_delivered'];\n $formatted_details['unit_description'][] = $details[$x]['unit_description'];\n $formatted_details['unit_price'][] = $details[$x]['unit_price'];\n $formatted_details['discount'][] = $details[$x]['discount'];\n }\n }\n $d['details'] = $formatted_details;\n }\n\n return $deliveries;\n }", "protected function detail($id)\n {\n return Show::make($id, new Order(), function (Show $show) {\n// $show->field('id');\n $show->field('order_no');\n $show->field('user_id')->as(function ($value) {\n $user = \\App\\Models\\User::where('user_id', $value)->first();\n return \"{$user->name}\";\n });\n $show->field('address', '收货地址')->as(function ($addresses) {\n return $addresses['address'] . \" \" . $addresses['zip'] . \" \" . $addresses['contact_name'] . \" \" . $addresses['contact_phone'];\n });\n $show->field('total_amount');\n// $show->field('remark');\n $show->field('paid_at');\n $show->field('payment_method');\n $show->field('payment_no');\n $show->field('refund_status')->as(function ($value) {\n return \\App\\Models\\Order::$refundStatusMap[$value];\n });\n $show->field('refund_no');\n// $show->field('closed');\n// $show->field('reviewed');\n $show->field('ship_status')->as(function ($value) {\n return \\App\\Models\\Order::$shipStatusMap[$value];\n });\n// $show->field('ship_data');\n// $show->field('extra');\n $show->field('created_at');\n// $show->field('updated_at');\n\n $show->disableDeleteButton();\n\n });\n }", "public function getJSONDeliveryDetails_View($id)\n {\n sqlsrv_configure('WarningsReturnAsErrors', 0);\n $this->connDB = $this->load->database('dbATPIDeliver',true);\n $query = $this->connDB->query(\"EXECUTE [sp_DeliverDetails_Get] $id\");\n //$this->connDB->close();\n\n return $query;\n }", "public function orderItemInfoallindia()\n {\n $user_id = $this->session->userdata('user_id');\n $this->db->where('user_id',$user_id);\n\n\n $this->db->order_by('id', 'DESC');\n $quer = $this->db->get('allindiaprodctorder');\n $user_dat=$quer->result_array();\n if($quer->num_rows() >= 1){\n $arr=Array();\n $arr2 = Array();\n\n\n\n \n $orderArr = Array();\n $itemarr2 = Array();\n for($j=0;$j<count($user_dat);$j++)\n {\n // $parts = explode(': ', $user_dat[$j]['item_id']);\n $items_id = $user_dat[$j]['item_id'];\n array_push($itemarr2,$user_dat[$j]['id']);\n \n for($i=0;$i<count($items_id);$i++)\n {\n\n $this->db->where('id',$user_dat[$j]['ship_addr_id']);\n $addrarr = $this->db->get('web_shippingaddr')->row_array();\n\n // print_r($items_id[$i]);\n // $ab= explode(':', $items_id[$i]);\n // print_r($ab[1]);\n $this->db->where('id', $user_dat[$j]['item_id']);\n $itemarr = $this->db->get('app_Items')->row_array();\n // print_r($itemarr);\n $array3=array(\n 'id' =>$itemarr['id'],\n 'item_name' =>$itemarr['item_name'],\n // 'item_id' =>$user_dat['item_id'],\n 'Item_code' =>$itemarr['Item_code'],\n 'Item_weight' =>$itemarr['Item_weight'],\n 'item_mrp' =>$itemarr['item_mrp'],\n 'item_image_path' =>$itemarr['item_image_path'],\n 'total_amount' =>$user_dat[$j]['total_amount'],\n 'app_oder_id' =>$user_dat[$j]['id'],\n 'status' =>$user_dat[$j]['status'],\n // 'order_quantity' =>$ab[1],\n 'order_quantity' =>$user_dat[$j]['quantity'],\n 'total_number' =>$itemarr2,\n 'name' =>$addrarr['name'],\n 'mobile' =>$addrarr['mobile'],\n 'email' =>$addrarr['email'],\n 'addresss' =>$addrarr['addresss'],\n 'pincode' =>$addrarr['pincode'],\n \n );\n\n array_push($orderArr, $array3);\n }\n\n \n }\n\n\n // print_r($orderArr);\n\n \n return $orderArr;\n }\n }", "function get_item_shipping() {\n\t}", "function fetchDataForBackorderItem($id) {\n $data = $this->OrderItem->find('first', array(\n 'conditions' => array('OrderItem.id' => $id),\n 'contain' => array(\n 'Item' => array(\n 'fields' => array(\n 'available_qty'\n )\n ),\n 'Order' => array(\n 'Shipment',\n 'UserCustomer' => array(\n 'Customer' => array(\n 'fields' => array(\n 'id',\n 'allow_backorder'\n )\n )\n ),\n 'Backorder' => array(\n 'OrderItem'\n )\n )\n )));\n // if backorders aren't allowed for the customer, set data to 'disallowed'\n if (!$data['Order']['UserCustomer']['Customer']['allow_backorder']) {\n $data = 'disallowed';\n }\n return $data;\n }", "public function get_shipcost_details($dom, $sku, $item_id){\t\n\t\t\t//push each entry into new array\n\t\t\t$update_item_array = array();\n\n\t\t\t$update_item_response = $dom->getElementsByTagName(DOM_ELEMENT_SHIPCOST_RESPONSE);\n\n\t\t\tforeach ($update_item_response as $item){\n\t\t\t\t//ad sku to first entry of array\n\t\t\t\tarray_push($update_item_array, $sku);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tarray_push($update_item_array, $item_id);\n\n\t\t\t\t$costs = $item->getElementsByTagName(DOM_ELEMENT_SHIP_DETAILS);\n\t\t\t\t\n\t\t\t\tforeach ($costs as $costsmsg){\n\t\t\t\t\t\n\t\t\t\t\t$serv_opts = $costsmsg->getElementsByTagName(DOM_ELEMENT_SHIP_SERVICE_OPTIONS);\n\t\t\t\t\tforeach($serv_opts as $serv){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$costers = trim($serv->getElementsByTagName(DOM_ELEMENT_SHIP_SERVICE_CST)->item(0)->nodeValue) != \"\" ? trim($serv->getElementsByTagName(DOM_ELEMENT_SHIP_SERVICE_CST)->item(0)->nodeValue) : \"No Cost Entered - Error\";\n\t\t\t\t\t\tarray_push($update_item_array, $costers);\n\n\t\t\t\t\t}\n\n\n\n\t\t\t\t\t\n\t\t\t\t}\t\t\n\n\n\t\t\t\t//errors\n\t\t\t\t$error_messages = $item->getElementsByTagName(DOM_ELEMENT_ERRORS);\n\n\t\t\t\tforeach ($error_messages as $errormsg){\n\t\t\t\t\t$error = trim($errormsg->getElementsByTagName(DOM_ELEMENT_SHORT_ERROR_MSG)->item(0)->nodeValue) != \"\" ? trim($errormsg->getElementsByTagName(DOM_ELEMENT_SHORT_ERROR_MSG)->item(0)->nodeValue) : \"No Error\";\n\t\t\t\t\tarray_push($update_item_array, $error);\n\t\t\t\t}\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\n\t\t\t}\n\n\t\t\treturn $update_item_array;\n\n\t\t//DOM_ELEMENT_SHORT_ERROR_MSG\n\t\t}", "public function getMyParcelDeliveryOptions($order_id)\r\n {\r\n $order_query = $this->db->query(\"SELECT delivery_options FROM `\" . DB_PREFIX . self::$table_name . \"` WHERE order_id = \" . (int)$order_id . \" LIMIT 1\");\r\n return $this->getValueFromQuery('delivery_options', $order_query);\r\n }", "public function invoiceitem_info( $invoiceitem_id ) {\r\n\t\treturn $this->_send_request( 'invoiceitems/'.$invoiceitem_id );\r\n\t}", "public function itemDetail($id){\n\n $datadetalle = DocumentoDetalle::\n from('documentodetalle as d')\n ->join('products as p', 'p.id', '=' , 'd.id_producto')\n ->where('d.id_documentocabecera', '=', $id)\n ->select(\n 'd.id',\n 'd.id_producto as idproduct',\n 'p.descripcion as product',\n 'd.precio_unitario as price',\n 'd.cantidad',\n 'p.stock',\n \\DB::raw('4 as tipo')\n )->get();\n\n return response()->json([\n 'data' => $datadetalle\n ]);\n\n }", "function edd_social_discounts_view_order_details( $payment_id ) {\n\t// return if nothing was shared\n\tif ( ! get_post_meta( $payment_id, '_edd_social_discount', true ) )\n\t\treturn;\n?>\n<div id=\"edd-purchased-files\" class=\"postbox\">\n\t<h3 class=\"hndle\"><?php printf( __( '%s/Posts/Pages that were shared before payment', 'edd-social-discounts' ), edd_get_label_plural() ); ?></h3>\n\t<div class=\"inside\">\n\t\t<table class=\"wp-list-table widefat fixed\" cellspacing=\"0\">\n\t\t\t<tbody id=\"the-list\">\n\t\t\t<?php\n\t\t\t\t$downloads = get_post_meta( $payment_id, '_edd_social_discount_shared_ids', true );\n\n\t\t\t\tif ( $downloads ) :\n\t\t\t\t\t$i = 0;\n\t\t\t\t\tforeach ( $downloads as $download_id ) :\n\t\t\t\t\t?>\n\t\t\t\t\t\t<tr class=\"<?php if ( $i % 2 == 0 ) { echo 'alternate'; } ?>\">\n\t\t\t\t\t\t\t<td class=\"name column-name\">\n\t\t\t\t\t\t\t\t<?php echo '<a href=\"' . admin_url( 'post.php?post=' . $download_id . '&action=edit' ) . '\">' . get_the_title( $download_id ) . '</a>'; ?>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t$i++;\n\t\t\t\t\tendforeach;\n\t\t\t\tendif;\n\t\t\t?>\n\t\t\t</tbody>\n\t\t</table>\n\t</div>\n</div>\n<?php }", "function ras_invoice_view_invoice_item($invoice_item) {\n return 'This is an invoice item - ID: ' . $invoice_item->invoice_item_id;\n}", "abstract public function getByItemId($itemId);", "public function getOrder(string $order_id): \\GDAX\\Types\\Response\\Authenticated\\Order;", "public function getCustomerOrderItem()\n {\n return $this->customerOrderItem;\n }", "public function getOrderById_get($id_order = null) {\n \n $params = array();\n $params['limit'] = (is_numeric($this->input->get('limit'))) ? $this->input->get('limit') : null;\n $params['from'] = $this->input->get('from');\n $params['to'] = $this->input->get('to');\n $this->load->model('Order_model');\n $this->load->model('Order_State_Model');\n $this->load->model('Address_model');\n $orders = array();\n $order = $this->Order_model->getLongOrderByOrderId($id_order, $params);\n if (!empty($order)) {\n $order_state = $this->Order_State_Model->getOrderStateByIdOrder($id_order);\n \n foreach ($order as $key => $value) {\n $orders['reference'] = $value->reference;\n $orders['total_paid'] = (double)$value->total_paid;\n $orders['total_paid_tax_excl'] = (double)$value->total_paid_tax_excl;\n $orders['tva'] = (float)$value->total_paid - $value->total_paid_tax_excl;\n $orders['total_shipping'] = (float)$value->total_shipping;\n $orders['order_date'] = $value->date_add;\n $orders['order_state'] = $order_state;\n $orders['adress'] = array('address_delivery' => $this->Address_model->getAddressById($value->id_address_delivery), 'address_invoice' => $this->Address_model->getAddressById($value->id_address_invoice));\n if (!isset($orders[$value->id_order])) {\n $orders['commande'][] = array('product_name' => $value->product_name, 'product_quantity' => (int)$value->product_quantity, 'total_price_tax_incl' => $value->total_price_tax_incl, 'total_price_tax_incl' => $value->total_price_tax_incl, 'id_image' => (int)$value->id_image, 'img_link' => base_url() . 'index.php/api/image/id/' . $value->id_image);\n }\n }\n return $this->response($orders, 200);\n }\n return $this->response(array(null), 200);\n \n }" ]
[ "0.64396006", "0.64067495", "0.6184897", "0.6164302", "0.61640584", "0.61118764", "0.6067972", "0.60311264", "0.6027312", "0.5994402", "0.59381455", "0.59236705", "0.592111", "0.59147996", "0.5913787", "0.58934766", "0.5861216", "0.58387995", "0.58300674", "0.58154124", "0.5813875", "0.57904416", "0.5784129", "0.57340753", "0.56963575", "0.5691394", "0.56862295", "0.56695545", "0.5652428", "0.5652059", "0.56518877", "0.56387055", "0.5635096", "0.56099856", "0.5585017", "0.5576597", "0.5553605", "0.5548273", "0.55160916", "0.5515666", "0.55147374", "0.55125946", "0.55045813", "0.5494281", "0.5491797", "0.5487095", "0.5478352", "0.54724497", "0.54651386", "0.5464966", "0.5440106", "0.54367083", "0.542189", "0.54168326", "0.54160386", "0.54102784", "0.54071146", "0.5404993", "0.53988206", "0.5394019", "0.53937805", "0.5389613", "0.5387224", "0.5383734", "0.5383613", "0.5380789", "0.5380077", "0.5376445", "0.5362261", "0.53303343", "0.5328428", "0.5321738", "0.53158456", "0.5311392", "0.5310479", "0.5310479", "0.5310056", "0.53090096", "0.5302108", "0.5298246", "0.5295008", "0.5290011", "0.52814823", "0.52768946", "0.52758956", "0.5269674", "0.5261859", "0.5256829", "0.5244995", "0.52384436", "0.5236266", "0.52334845", "0.5233077", "0.5229565", "0.52279425", "0.5223367", "0.5190723", "0.5189425", "0.51881665", "0.5183743" ]
0.666734
0
Get Item Price on Delivery Order Detail by Delivery Order ID, Item ID & Status !== (2,3)
public function ItemPriceOnDODetail($params) { return $this->deliveryOrderDetail::where($params)->get() == null ? false : $this->deliveryOrderDetail::where($params)->pluck(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDeliveryByOrderId($order_id) {\n\t\t\n\t\t$list = $this->getDeliveryListByOrderId($order_id);\n\t\t\n\t\t$delivery = $list[0];\n\t\t$delivery['value'] = $delivery['value_net'] + $delivery['vat'];\n\t\t\n\t\treturn $delivery;\n\t}", "public function ItemOnDODetail($params)\n {\n return $this->deliveryOrderDetail::where($params)->first() == null ? true : $this->deliveryOrderDetail::where($params)->first(); \n }", "public function getPriceInfos(&$orderItem, array $order) {\n $info = array();\n $postion = 0;\n $orderCurrency = $order['currency_code'];\n\n $method = $order['shipping_method'];\n $shipingMethod = array('pm_id' => '', 'title' => $method, 'description' => '', 'price' => 0);\n\n $this->load->model('account/order');\n $rows = $this->model_account_order->getOrderTotals($order['order_id']);\n foreach ($rows as $row) {\n $title = $row['title'];\n $price = $row['value'] * $order['currency_value'];\n $info[] = array(\n 'title' => $title,\n 'type' => $row['code'],\n 'price' => $price,\n 'currency' => $orderCurrency,\n 'position' => $postion++);\n\n if (ereg($method, $title)) {\n $shipingMethod['price'] = $price;\n }\n }\n $orderItem['shipping_method'] = $shipingMethod;\n\n return $info;\n }", "function wv_commission_get_order_item_record($oid) {\n\n global $wpdb;\n $sql_order_itemid = \"SELECT DISTINCT WOIM.order_item_id FROM `\" . $wpdb->prefix . \"woocommerce_order_items` AS WOI INNER JOIN `\" . $wpdb->prefix . \"woocommerce_order_itemmeta` AS WOIM ON WOI.order_item_id = WOIM.order_item_id WHERE WOI.order_item_type = 'line_item' AND WOI.order_id =$oid\";\n $arr_order_itemid = $wpdb->get_results($sql_order_itemid);\n\n if (count($arr_order_itemid) > 0) {\n $i = 1;\n foreach ($arr_order_itemid as $item) {\n\n $order_item_id = $item->order_item_id;\n $productid = $this->wv_commission_get_woo_orderitem_metavalue($order_item_id, '_product_id');\n //output HTML here.\n ?>\n <tr>\n <!-- \n In case of more than 1 item, order id should show only one times : use= rowspan :\n --> \n <?php if ($i == 1) { ?>\n <td rowSpan=\"<?php echo count($arr_order_itemid); ?>\" >#<?php echo $oid; ?></td>\n <?php } ++$i; ?>\n <!-- order date -->\n <td><?php echo get_post_time(\"dM,Y\", FALSE, $oid); ?></td>\n \n <!-- product id -->\n <td><?php echo get_the_title($productid); ?></td>\n \n <!-- vendor -->\n <td><?php echo $this->wv_get_username_by_userid(get_post_meta($oid, 'woo_order_vendor_id_' . $productid, TRUE)); ?></td>\n \n <!-- commission --> \n <td>\n <?php\n echo get_woocommerce_currency_symbol(). get_post_meta($oid, 'woo_order_commision_' . $productid, TRUE);\n ?>\n </td>\n \n <!-- Status -->\n <td>\n <?php \n //change status functionality\n $sts = $this->wv_get_commission_status($oid,$productid);\n $newsts= ($sts==1)?0:1;\n ?>\n <a title=\"Change Status\" href=\"<?php echo admin_url(\"admin.php?page=woo_vendors&tab=commission&action=sts&oid=$oid&pid=$productid&sts=$newsts\"); ?>\" onclick=\"return confirm('Are you sure want to change status ?');\">\n <?php \n echo $newsts= ($sts==1)?\"paid\":\"due\";;\n ?>\n </a> \n </td>\n \n <!-- Commission Date -->\n <td>\n <?php \n //get commission date\n echo $this->wv_get_commission_date($oid,$productid);\n ?> \n </td>\n </tr>\n <?php\n }\n }//end of the count.\n }", "public function getMyParcelOrderPrices($order_id)\r\n {\r\n $order_query = $this->db->query(\"SELECT prices FROM `\" . DB_PREFIX . self::$table_name . \"` WHERE order_id = \" . (int)$order_id . \" LIMIT 1\");\r\n return $this->getValueFromQuery('prices', $order_query);\r\n }", "public function getMyParcelOrderPrices($order_id)\r\n {\r\n $order_query = $this->db->query(\"SELECT prices FROM `\" . DB_PREFIX . self::$table_name . \"` WHERE order_id = \" . (int)$order_id . \" LIMIT 1\");\r\n return $this->getValueFromQuery('prices', $order_query);\r\n }", "Function SalesPriceUsedInOrder($int_record_id) {\r\n return GetField(\"SELECT orders.OrderID\r\n\t\t\t\t\t FROM order_details\r\n\t\t\t\t\t INNER JOIN orders ON orders.OrderID = order_details.OrderID\r\n\t\t\t\t\t INNER JOIN pricing ON pricing.ProductID = order_details.ProductID\r\n\t\t\t\t\t\t\t\t\t AND (order_details.Quantity >= pricing.start_number OR pricing.start_number = 0)\r\n\t\t\t\t\t\t\t\t\t\t AND (order_details.Quantity <= pricing.end_number OR pricing.end_number = 0)\r\n\t\t\t\t\t\t\t\t\t\t AND (pricing.ContactID = orders.ContactID OR pricing.ContactID = 0)\r\n\t\t\t\t\t\t\t\t\t AND (orders.OrderDate >= pricing.start_date OR pricing.start_date = 0)\r\n\t\t\t\t\t\t\t\t\t AND (orders.OrderDate <= pricing.end_date OR pricing.end_date = 0)\r\n\t\t\t\t\t\t\t\t\t\t AND (order_details.Quantity <= pricing.end_number OR pricing.end_number = 0)\r\n\t\t\t\t\t WHERE recordID = $int_record_id\");\r\n}", "function getOrderPurchaseDetails($order_id)\n\t\t{\n\t\t\t//get order details\n\t\t\t$orders = $this->_BLL_obj->manage_content->getValue_where('order_info', '*', 'order_id', $order_id);\n\t\t\t$user_id = $orders[0]['user_id'];\n\t\t\t//get product details from order id\n\t\t\t$order_details = $this->_BLL_obj->manage_content->getValue_where('product_inventory_info', '*', 'order_id', $order_id);\n\t\t\tif(!empty($order_details[0]))\n\t\t\t{\n\t\t\t\t//total_overridng fee distributed\n\t\t\t\t$dis_over = 0;\n\t\t\t\t$user_level = 0;\n\t\t\t\t\n\t\t\t\tforeach($order_details as $order)\n\t\t\t\t{\n\t\t\t\t\t/* code for distribute overriding fee */\n\t\t\t\t\t//get transaction id for overriding fee\n\t\t\t\t\t$over_id = uniqid('trans');\n\t\t\t\t\t//calling overriding fee function\n\t\t\t\t\t$distributed_overriding = $this->distributeOverridingFee($user_id, $order['price'], $dis_over, $user_level, $over_id,$order_id);\n\t\t\t\t\tif($distributed_overriding != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t//insert values to fee transaction info table\n\t\t\t\t\t\t$insert_over = $this->_BLL_obj->manage_content->insertValue('fee_transaction_info', array('transaction_id','order_id','product_id','fee_type'), array($over_id,$order_id,$order['product_id'],'OF'));\n\t\t\t\t\t\t//new system value\n\t\t\t\t\t\t$new_system_value = $this->getSystemMoneyValue() - $distributed_overriding;\n\t\t\t\t\t\t//insert distributed amount to system money info\n\t\t\t\t\t\t$insert_dist_amount = $this->_BLL_obj->manage_content->insertValue('system_money_info', array('specification','debit','system_balance'), array($over_id,$distributed_overriding,$new_system_value));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t/* code for personal commision calculation */\n\t\t\t\t\t//get transaction id for personal comm calculation\n\t\t\t\t\t$per_id = uniqid('trans');\n\t\t\t\t\t//calling personal commision function\n\t\t\t\t\t$per_comm = $this->calculatePersonalCommision($user_id, $order['price'], $per_id,$order_id);\n\t\t\t\t\t//checking for non empty personal commision\n\t\t\t\t\tif($per_comm != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t//insert values to fee transaction info table\n\t\t\t\t\t\t$insert_personal = $this->_BLL_obj->manage_content->insertValue('fee_transaction_info', array('transaction_id','order_id','product_id','fee_type'), array($per_id,$order_id,$order['product_id'],'PC'));\n\t\t\t\t\t\t//new system value\n\t\t\t\t\t\t$new_system_value_per = $this->getSystemMoneyValue() - $per_comm;\n\t\t\t\t\t\t//insert distributed amount to system money info\n\t\t\t\t\t\t$insert_per_amount = $this->_BLL_obj->manage_content->insertValue('system_money_info', array('specification','debit','system_balance'), array($per_id,$per_comm,$new_system_value_per));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t/* code for point value calculation */\n\t\t\t\t\t//get transaction id for point value distribution\n\t\t\t\t\t$pv_id = uniqid('trans');\n\t\t\t\t\t//get product details\n\t\t\t\t\t$product_details = $this->_BLL_obj->manage_content->getValue_where('product_info', '*', 'product_id', $order['product_id']);\n\t\t\t\t\t//total point value\n\t\t\t\t\t$total_pv = $product_details[0]['point_value'] * $order['quantity'];\n\t\t\t\t\t//insert values to fee transaction info table\n\t\t\t\t\t$insert_point = $this->_BLL_obj->manage_content->insertValue('fee_transaction_info', array('transaction_id','order_id','product_id','fee_type'), array($pv_id,$order_id,$order['product_id'],'PV'));\n\t\t\t\t\t//insert pv to system\n\t\t\t\t\t$system_pv = $this->insertSystemPV($pv_id, $total_pv);\n\t\t\t\t\t//calling point value distributive function\n\t\t\t\t\t$this->distributePointValue($user_id, $total_pv, $pv_id, $order_id);\n\t\t\t\t\t\n\t\t\t\t\t/* code for member level upgradation of user and their parent */\n\t\t\t\t\t//calling fucntion for it\n\t\t\t\t\t$this->checkingLevelOfUserAndParent($user_id);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function SumItemPriceByDeliveryOrderID($delivery_order_id)\n {\n $price = $this->deliveryOrderDetail::where('warehouse_out_id', $delivery_order_id)->pluck('sub_total')->toArray(); \n $sum_price = array_sum($price);\n return $sum_price;\n }", "public function getAbleToDeliver()\n {\n\n $data = Order::where('IsTakeOut',1)\n ->where('IsDelivery',1)\n ->where('Status',6)\n //->join('orderitem', 'orderitem.OrderID', '=', 'orders.OrderID')\n // ->join('store', 'store.StoreID', '=', 'orders.StoreID')\n // ->join('meal', 'meal.MealID', '=', 'orderitem.MealID')\n // ->leftJoin('orderitemflavor', 'orderitem.OrderItemID', '=', 'orderitemflavor.OrderItemID')\n // ->leftJoin('flavor', 'orderitemflavor.FlavorID', '=', 'flavor.FlavorID')\n // ->leftJoin('flavortype', 'flavortype.FlavorTypeID', '=', 'flavor.FlavorTypeID')\n // ->select('*', 'orders.Memo', 'orderitem.OrderItemID', 'orders.DateTime as OrderDate')\n // ->orderBy('orders.OrderID', 'desc')\n ->get();\n\n\n if ($data->isEmpty()) {\n return \\response(\"\", 204);\n }\n\n \n $collection = collect();\n $flavors = null;\n $flavorsPrice = 0;\n $temp = null;\n $count = 0;\n\n $orders = $data->groupBy('OrderID');\n\n foreach ($orders as $order) {\n $items = collect();\n $count = 0;\n\n $orderItems = $order->groupBy('OrderItemID');\n\n foreach ($orderItems as $orderItem) {\n if ($count >= 3) {\n break;\n }\n\n $flavors = collect();\n $flavorsPrice = 0;\n \n foreach ($orderItem as $orderItemFlavor) {\n if ($orderItemFlavor->FlavorTypeID == null) {\n break;\n }\n\n $flavors->push(\n collect([\n 'flavorType' => $orderItemFlavor->FlavorTypeName,\n 'flavor' => $orderItemFlavor->FlavorName,\n ])\n );\n\n $flavorsPrice += $orderItemFlavor->ExtraPrice;\n }\n\n\n $temp = $orderItem[0];\n\n $items->push(\n collect([\n 'id' => $temp->OrderItemID,\n 'name' => $temp->MealName,\n 'memo' => $temp->Memo,\n 'quantity' => $temp->Quantity,\n 'mealPrice' => $temp->MealPrice,\n 'flavors' => $flavors,\n 'amount' => $temp->MealPrice + $flavorsPrice,\n ])\n );\n\n ++$count;\n }\n\n $collection->push(\n collect([\n 'id' => $temp->OrderID,\n 'orderNumber' => $temp->OrderNumber,\n 'store' => $temp->StoreName,\n 'status' => $temp->Status,\n 'orderDate' => $temp->OrderDate,\n 'estimatedTime' => $temp->EstimatedTime,\n 'orderMemo' => $temp->Memo,\n 'orderPrice' => $temp->Price,\n 'isTakeOut' => $temp->IsTakeOut,\n 'isDelivery' => $temp->IsDelivery,\n 'orderItems' => $items,\n 'serviceFee' => $temp->ServiceFee,\n 'destination' => $temp->Destination,\n 'totalAmount' => $temp->TotalAmount\n ])\n );\n }\n /* return collect([\n 'id' => $temp->OrderID,\n 'orderNumber' => $temp->OrderNumber,\n 'store' => $temp->StoreName,\n 'status' => $temp->Status,\n 'orderDate' => $temp->OrderDate,\n 'estimatedTime' => $temp->EstimatedTime,\n 'orderMemo' => $temp->Memo,\n 'orderPrice' => $temp->Price,\n 'isTakeOut' => $temp->IsTakeOut,\n 'orderItems' => $items,\n 'isDelivery' => $temp->IsDelivery,\n 'destination' => $temp->Destination,\n 'totalAmount' => $temp->TotalAmount\n ]);*/\n\n return response()->json($collection);\n\n }", "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}", "private function getCrestData(int $item_id, int $station_id, string $order_type): float\n {\n $regionID = $this->getRegionID($station_id)->id;\n $url = \"https://crest-tq.eveonline.com/market/\" . $regionID . \"/orders/\" . $order_type . \"/?type=https://crest-tq.eveonline.com/inventory/types/\" . $item_id . \"/\";\n //$context = stream_context_create(array('http' => array('header'=>'Connection: close\\r\\n')));\n /*$ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n $result = json_decode(curl_exec($ch), true);*/\n $result = json_decode(file_get_contents($url), true);\n $array_prices = [];\n\n for ($i = 0; $i < count($result['items']); $i++) {\n // only fetch orders FROM the designated stationID\n if ($result['items'][$i]['location']['id_str'] == $station_id) {\n array_push($array_prices, $result['items'][$i]['price']);\n }\n }\n\n if ($order_type == 'buy') {\n if (!empty($array_prices)) {\n $price = max($array_prices);\n } else {\n $price = 0;\n }\n } else if ($order_type == 'sell') {\n if (!empty($array_prices)) {\n $price = min($array_prices);\n } else {\n $price = 0;\n }\n }\n return $price;\n }", "public function getDeliveryOrder();", "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 GetDetailPPHItemById($id){\n\n $data = $this->db\n ->select('form_bd_item_pph.id_form_bd_item_pph as id_item_pph,form_bd_item_pph.id_form_bd_item as id_item,form_bd_item_pph.*,form_bd_item.real_amount,form_bd_item.name as item_name')\n ->where('form_bd_item_pph.id_form_bd_item_pph',$id)\n ->join('form_bd_item','form_bd_item.id_form_bd_item=form_bd_item_pph.id_form_bd_item')\n ->get('form_bd_item_pph')\n ->row_array();\n return $data;\n }", "public function getOrderLineItems($orderID)\n {\n \n }", "function getItemCost( $itemid, $dealerid, $pricecode, $cost, $list )\n{\nglobal $db;\n\n//08.21.2015 ghh - first we're going to see if there is a dealer specific price for \n//this item and if so we'll just pass it back\n$query = \"select DealerCost from ItemCost where ItemID=$itemid and \n\t\t\t\tDealerID=$dealerid\";\nif (!$result = $db->sql_query($query))\n\t{\n\tRestLog(\"Error 16527 in query: $query\\n\".$db->sql_error());\n\tRestUtils::sendResponse(500,\"16527 - There was a problem attempting find the dealer cost\"); //Internal Server Error\n\treturn false;\n\t}\n\n$row = $db->sql_fetchrow( $result );\n\n//if there is a cost then lets just return it.\nif ( $row['DealerCost'] > 0 )\n\treturn $row['DealerCost'];\n\n//if there was no cost then the next step is to see if there is a price code\nif ( $pricecode != '' )\n\t{\n\t$query = \"select Discount from PriceCodesLink where DealerID=$dealerid\n\t\t\t\t\tand PriceCode=$pricecode\";\n\n\tif (!$result = $db->sql_query($query))\n\t\t{\n\t\tRestLog(\"Error 16528 in query: $query\\n\".$db->sql_error());\n\t\tRestUtils::sendResponse(500,\"16528 - There was a problem finding your price code\"); //Internal Server Error\n\t\treturn false;\n\t\t}\n\n\t//08.28.2015 ghh - if we did not find a dealer specific code then next we're going to \n\t//look for a global code to see if we can find that\n\tif ( $db->sql_numrows( $result ) == 0 )\n\t\t{\n\t\t$query = \"select Discount from PriceCodesLink where DealerID=0\n\t\t\t\t\t\tand PriceCode=$pricecode\";\n\n\t\tif (!$result = $db->sql_query($query))\n\t\t\t{\n\t\t\tRestLog(\"Error 16626 in query: $query\\n\".$db->sql_error());\n\t\t\tRestUtils::sendResponse(500,\"16626 - There was a problem finding your price code\"); //Internal Server Error\n\t\t\treturn false;\n\t\t\t}\n\n\t\t//if we found a global price code entry then enter here\n\t\tif ( $db->sql_numrows( $result ) > 0 )\n\t\t\t{\n\t\t\t$row = $db->sql_fetchrow( $result );\n\t\t\tif ( $row['Discount'] > 0 )\n\t\t\t\t$cost = bcmul( bcadd(1, $row['Discount']), $cost );\n\t\t\telse\n\t\t\t\t$cost = bcmul( bcadd( 1, $row['Discount']), $list );\n\t\t\t}\n\t\t}\n\telse\n\t\t{\n\t\t//if we found a dealer specific code then enter here\n\t\t$row = $db->sql_fetchrow( $result );\n\n\t\tif ( $row['Discount'] > 0 )\n\t\t\t$cost = bcmul( bcadd(1, $row['Discount']), $cost );\n\t\telse\n\t\t\t$cost = bcmul( bcadd( 1, $row['Discount']), $list );\n\t\t}\n\t}\n\nreturn $cost;\n}", "public function getorderitembyid($orderid){\n\t\t$this->db->where('OrdId', $orderid);\n\t\t$this->db->select('LintItemId,OrdId,ItemId,ItemName,ItemEdition,ItemAuther,ItemQuantity,ItemRetailPrice,ItemSellingPrice,ItemDiscount,ProductThumbImage,ProductLanguage');\n\t\t$this->db->from('tbl_order_lineitems');\n\t\t$this->db->join('tbl_products', 'tbl_products.ProductId = tbl_order_lineitems.ItemId', 'inner');\n\t\t$query=$this->db->get();\n\t\treturn $query->result();\n\t\t// $query=$this->db->get('tbl_order_lineitems');\n\t\t// return $query->result();\n\t}", "public function getPriceDelivery()\n {\n return $this->priceDelivery;\n }", "public function getShippingInvoiced();", "public function view_order_details($order_id)\n\t{\n $log=new Log(\"OrderDetailsRCV.log\");\n $query = $this->db->query(\"SELECT oc_po_order.*,\".DB_PREFIX.\"user.firstname,\".DB_PREFIX.\"user.lastname\n\t\t\t\tFROM oc_po_order\n\t\t\t\t\tLEFT JOIN \".DB_PREFIX.\"user\n\t\t\t\t\t\tON \".DB_PREFIX.\"user.user_id = oc_po_order.user_id\n\t\t\t\t\t\t\tWHERE id = \" . $order_id . \" AND delete_bit = \" . 1);\n $log->write($query);\n $order_info = $query->row;\n\t\t//ON (oc_po_receive_details.product_id = oc_po_product.id)\n\t\t$query = $this->db->query(\"SELECT\n\t\toc_po_product.*,oc_po_receive_details.quantity as rd_quantity,oc_po_receive_details.price,oc_po_supplier.first_name,oc_po_supplier.last_name,oc_po_supplier.id as supplier_id,oc_po_receive_details.order_id\n\t\tFROM\n\t\t\toc_po_receive_details\n\t\tINNER JOIN oc_po_product \n\t\t\tON (oc_po_receive_details.order_id = oc_po_product.order_id)\n\t\tLEFT JOIN oc_po_supplier \n\t\t\tON (oc_po_receive_details.supplier_id = oc_po_supplier.id)\n\t\t\t\tWHERE (oc_po_receive_details.order_id =\".$order_id.\")\");\n $log->write($query);\n\tif($this->db->countAffected() > 0)\n\t{\n\t\t$products = $query->rows;\n\t\t$quantities = array();\n\t\t$all_quantities = array();\n\t\t$prices = array();\n\t\t$all_prices = array();\n\t\t$suppliers = array();\n\t\t$all_suppliers = array();\n\t\t$supplier_names = array();\n\t\t$all_supplier_names = array();\n\t\t$index = 0;\n\t\t$index1 = 0;\n\t\tfor($i =0; $i<count($products); $i++)\n\t\t{\n\t\t\tif($products[$i] != \"\")\n\t\t\t{\n\t\t\t\tfor($j = 0; $j<count($products); $j++)\n\t\t\t\t{\n\t\t\t\t\tif($products[$j] != \"\")\n\t\t\t\t\t{\n\t\t\t\t\t\tif($products[$i]['id'] == $products[$j]['id'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$quantities[$index] = $products[$j]['rd_quantity'];\n\t\t\t\t\t\t\t$supplier_names[$index] = $products[$j]['first_name'] .\" \". $products[$j]['last_name'];\n\t\t\t\t\t\t\t$suppliers[$index] = $products[$j]['supplier_id'];\n\t\t\t\t\t\t\t$prices[$index] = $products[$j]['price'];\n\t\t\t\t\t\t\tif($j!=$i)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$products[$j] = \"\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$index++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$index = 0;\n\t\t\t\t$all_quantities[$index1] = $quantities;\n\t\t\t\t$all_suppliers[$index1] = $suppliers;\n\t\t\t\t$all_prices[$index1] = $prices;\n\t\t\t\t$all_supplier_names[$index1] = $supplier_names;\n\t\t\t\tunset($quantities);\n\t\t\t\tunset($suppliers);\n\t\t\t\tunset($prices);\n\t\t\t\tunset($supplier_names);\n\t\t\t\t$quantities = array();\n\t\t\t\t$suppliers = array();\n\t\t\t\t$prices = array();\n\t\t\t\t$supplier_names = array();\n\t\t\t\t$index1++;\n\t\t\t}\n\t\t}\n\t\t$products = array_values(array_filter($products));\n\t\tfor($i = 0; $i<count($products); $i++)\n\t\t{\n\t\t\tunset($products[$i]['rd_quantity']);\n\t\t\tunset($products[$i]['first_name']);\n\t\t\tunset($products[$i]['last_name']);\n\t\t\t$products[$i]['quantities'] = $all_quantities[$i];\n\t\t\t$products[$i]['suppliers'] = $all_suppliers[$i];\n\t\t\t$products[$i]['prices'] = $all_prices[$i];\n\t\t\t$products[$i]['supplier_names'] = $all_supplier_names[$i];\n\t\t}\n\t}\n\telse\n\t{\n\t\t$query = $this->db->query(\"SELECT * FROM oc_po_product WHERE order_id = \" . $order_info['id']);\n\t\t$products = $query->rows;\n\t}\n\t\t$i = 0;\n\t\tforeach($products as $product)\n\t\t{\n\t\t\t$query = $this->db->query(\"SELECT * FROM oc_po_attribute_group WHERE product_id = \". $product['id']);\n\t\t\t$attribute_groups[$i] = $query->rows;\n\t\t\t$i++;\n\t\t}\n\t\t\n\t\t$i = 0;\n\t\tforeach($attribute_groups as $attribute_group)\n\t\t{\n\t\t\tfor($j = 0; $j<count($attribute_group);$j++)\n\t\t\t{\n\t\t\t\t$query = $this->db->query(\"SELECT * FROM oc_po_attribute_category WHERE attribute_group_id = \". $attribute_group[$j]['id']);\n\t\t\t\t$attribute_categories[$i] = $query->row;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\t\tfor($i=0;$i<count($products); $i++)\n\t\t{\n\t\t\tfor($j=0; $j<count($attribute_groups[$i]);$j++)\n\t\t\t{\n\t\t\t\t$products[$i]['attribute_groups'][$j] = $attribute_groups[$i][$j]['name'];\n\t\t\t}\n\t\t}\n\t\t$start_loop = 0;\n\t\t//$attribute_categories = array_values(array_filter($attribute_categories));\n\t\t//print_r($attribute_categories);\n\t\t//exit;\n\t\tfor($i=0; $i<count($products); $i++)\n\t\t{\n\t\t\tfor($j=$start_loop; $j<($start_loop + count($products[$i]['attribute_groups']));$j++)\n\t\t\t{\n\t\t\t\t$products[$i]['attribute_category'][$j] = $attribute_categories[$j]['name'];\n\t\t\t}\n\t\t\t$start_loop = $j;\n\t\t}\n\t\t$order_information['products'] = $products;\n\t\t$order_information['order_info'] = $order_info;\n\t\treturn $order_information;\n\t}", "public function getQuotationItemData($order_id = null)\n\t{\n\t\t$selected_financial_year = $this->session->userdata(\"selected_financial_year\");\n\n\t\tif (!$order_id) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$sql = \"SELECT * FROM quotation_item JOIN item_master WHERE quotation_item.quotation_no = ? AND item_master.Item_ID=quotation_item.item_id AND financial_year_id=$selected_financial_year AND quotation_item.status=1\";\n\t\t$query = $this->db->query($sql, array($order_id));\n\t\treturn $query->result_array();\n\t}", "function get_item($item_id)\n\t{\n\t\tglobal $conn;\n\n\t\t$query=\"SELECT * FROM list_items WHERE item_id='$item_id' \";\n\t\t$result=mysqli_query($conn,$query);\n\n\t\t$item_data=\"\";\n\t\t\n\t\twhile($row = mysqli_fetch_array( $result))\n\t\t{\n\t\t\t$daily_price=$row['daily_rate'];\n\t\t\t$weekly_price=$row['weekly_rate'];\n\t\t\t$weekend_price=$row['weekend_rate'];\n\t\t\t$monthly_price=$row['monthly_rate'];\n\t\t\t$bond_price=$row['bond_rate'];\n\n\t\t\tif($daily_price=='0.00'){$daily_price=\"NA\";}\n\t\t\tif($weekly_price=='0.00'){$weekly_price=\"NA\";}\n\t\t\tif($weekend_price=='0.00'){$weekend_price=\"NA\";}\n\t\t\tif($monthly_price=='0.00'){$monthly_price=\"NA\";}\n\t\t\tif($bond_price=='0.00'){$bond_price=\"NA\";}\n\n\t\t\t$extra=array(\n\t\t\t\t'item_id'\t=>\t$row['item_id'],\n\t\t\t\t'item_pictures'\t=>\t$row['item_pictures'],\n\t\t\t\t'item_description'\t=>\t$row['item_description'],\n\t\t\t\t'item_name'\t=>\t$row['item_name'],\n\t\t\t\t'extra_option'\t=>\t$row['extra_option'],\t\t\t\t\n\t\t\t\t'user_id'\t=>\t$row['user_id'],\t\t\t\t\n\t\t\t\t'total_views'\t=>\t$row['total_views'],\t\t\t\t\n\t\t\t\t'cat_name'\t=>\t$row['cat_name'],\n\t\t\t\t'isLive'\t=>\t$row['isLive'],\n\t\t\t\t'user_name'\t=>\t$row['user_name'],\n\t\t\t\t'daily_rate'\t=>\t$daily_price,\n\t\t\t\t'weekly_rate'\t=>\t$weekly_price,\n\t\t\t\t'weekend_rate'\t=>\t$weekend_price,\n\t\t\t\t'monthly_rate'\t=>\t$monthly_price,\n\t\t\t\t'bond_rate'\t=>\t$bond_price\n\t\t\t);\n\t\t\t$item_data[]=$extra;\n\n\t\t}\n\n\t\tif(mysqli_query($conn, $query)){\n\t\t\t$response=array(\n\t\t\t\t'status' => 1,\n\t\t\t\t'items' => $item_data\t\t\t\t\t\t\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//insertion failure\n\t\t\t$response=array(\n\t\t\t\t'status' => 0,\n\t\t\t\t'status_message' =>'Item Details not found!!!'\t\t\t\n\t\t\t);\n\t\t}\n\t\theader('Content-Type: application/json');\n\t\techo json_encode($response);\n\t}", "static function getRestaurantReservationRevenue($id)\n {\n //lay ra cac san pham trong mot bar reservation\n $product_items =RestaurantTotalReportDB::get_reservation_product($id);\n //System::debug($product_items);\n $total_discount = 0;\n\t\t$total_price = 0;\n $product_for_report = array();\n $product_for_report['product']['original_price'] = 0;\n $product_for_report['product']['real_price'] = 0;\n $product_for_report['is_processed']['real_price'] = 0;\n $product_for_report['is_processed']['original_price'] = 0;\n $product_for_report['service']['real_price'] = 0;\n $product_for_report['service']['original_price'] = 0;\n foreach($product_items as $key=>$value)\n\t\t{\n\t\t\tif($value['is_processed'] == 1 and $value['type'] != 'SERVICE')\n {\n\t\t\t\t$ttl = $value['price']*($value['quantity'] - $value['quantity_discount']);\n\t\t\t\t$discnt = ($ttl*$value['discount_category']/100) + (($ttl*(100-$value['discount_category'])/100)*$value['discount_rate']/100);\n\t\t\t\t$total_discount += $discnt;\n\t\t\t\tif($ttl<0)\n {\n\t\t\t\t\t$ttl = 0;\n\t\t\t\t}\n\t\t\t\t$total_price += $ttl-$discnt;\n $product_for_report['is_processed']['original_price'] += $value['original_price'];\n $product_for_report['is_processed']['real_price'] += $ttl-$discnt;\n\t\t\t}\n if($value['is_processed'] == 0 and $value['type'] != 'SERVICE')\n {\n\t\t\t\t$ttl = $value['price']*($value['quantity'] - $value['quantity_discount']);\n\t\t\t\t$discnt = ($ttl*$value['discount_category']/100) + (($ttl*(100-$value['discount_category'])/100)*$value['discount_rate']/100);\n\t\t\t\t$total_discount += $discnt;\n\t\t\t\tif($ttl<0)\n {\n\t\t\t\t\t$ttl = 0;\n\t\t\t\t}\n\t\t\t\t$total_price += $ttl-$discnt;\n $product_for_report['product']['original_price'] += $value['original_price'];\n $product_for_report['product']['real_price'] += $ttl-$discnt;\t\n\t\t\t}\n if($value['type'] == 'SERVICE')\n {\n $ttl = $value['price']*($value['quantity'] - $value['quantity_discount']);\n\t\t\t\t$discnt = ($ttl*$value['discount_category']/100) + (($ttl*(100-$value['discount_category'])/100)*$value['discount_rate']/100);\n\t\t\t\t$total_discount += $discnt;\n\t\t\t\tif($ttl<0)\n {\n\t\t\t\t\t$ttl = 0;\n\t\t\t\t}\n\t\t\t\t$total_price += $ttl-$discnt;\n $product_for_report['service']['original_price'] += $value['original_price'];\n $product_for_report['service']['real_price'] += $ttl-$discnt;\t\n }\n\t\t}\n return $product_for_report;\n }", "protected function getOrderItem()\n\t{\n\t\t$search = $this->object->createSearch();\n\n\t\t$expr = [];\n\t\t$expr[] = $search->compare( '==', 'order.base.rebate', 14.50 );\n\t\t$expr[] = $search->compare( '==', 'order.base.sitecode', 'unittest' );\n\t\t$expr[] = $search->compare( '==', 'order.base.price', 53.50 );\n\t\t$expr[] = $search->compare( '==', 'order.base.editor', $this->editor );\n\t\t$search->setConditions( $search->combine( '&&', $expr ) );\n\t\t$results = $this->object->searchItems( $search );\n\n\t\tif( ( $item = reset( $results ) ) === false ) {\n\t\t\tthrow new \\RuntimeException( 'No order found' );\n\t\t}\n\n\t\treturn $item;\n\t}", "function getPurchasePrice($id, $supplier_id = null) {\n \n $result = $this->Product->getShortDet($id);\n\n $this->loadModel('Productsupplier');\n $this->Productsupplier->recursive = -1;\n $condition['product_id'] = $id;\n $condition['status'] = 'yes';\n if($supplier_id) {\n $condition['supplier_id'] = $supplier_id;\n }\n $supplierPrice = $this->Productsupplier->find('first', array('conditions' => $condition, 'fields' => array('price')));\n if($supplierPrice && $supplierPrice['Productsupplier']['price']) {\n $result['price'] = $supplierPrice['Productsupplier']['price'];\n }\n \n echo json_encode($result);\n exit;\n }", "static public function GetOrders ($order_id = null, $status = null) {\n\n $products = DB::table('orders')\n ->leftJoin('partners', 'partners.id', '=', 'orders.partner_id')\n ->leftJoin('order_products', 'order_products.order_id', '=', 'orders.id')\n ->leftJoin('products', 'products.id', '=', 'order_products.product_id')\n ->leftJoin('vendors', 'vendors.id', '=', 'products.vendor_id')\n ->select('orders.*', 'partners.id as partner_id','partners.name as partner_name','partners.email as partner_email','vendors.name as vnd_name','vendors.email as vnd_email','products.name as prod_name','order_products.quantity','products.price')\n ->when($order_id, function ($query) use ($order_id) {\n return $query->where('orders.id', $order_id);\n })\n ->get();\n //->paginate(25);\n\n // группируем массив по № ордера\n $order = Array();\n\n foreach ($products as $item) {\n\n if($item->prod_name != NULL) {\n //$order[$item->id]['id'][] = $item->id;\n $order[$item->id]['composition'][] = $item;\n $order[$item->id]['status'] = $item->status;\n $order[$item->id]['partner_id'] = $item->partner_id;\n $order[$item->id]['partner_name'] = $item->partner_name;\n $order[$item->id]['partner_email'] = $item->partner_email;\n $order[$item->id]['email'] = $item->client_email;\n $order[$item->id]['delivery_dt'] = $item->delivery_dt;\n\n isset($order[$item->id]['summ'])?$order[$item->id]['summ'] += $item->price*$item->quantity:$order[$item->id]['summ'] = 0;\n }\n }\n\n return $order;\n\n }", "public function get_shipcost_details($dom, $sku, $item_id){\t\n\t\t\t//push each entry into new array\n\t\t\t$update_item_array = array();\n\n\t\t\t$update_item_response = $dom->getElementsByTagName(DOM_ELEMENT_SHIPCOST_RESPONSE);\n\n\t\t\tforeach ($update_item_response as $item){\n\t\t\t\t//ad sku to first entry of array\n\t\t\t\tarray_push($update_item_array, $sku);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tarray_push($update_item_array, $item_id);\n\n\t\t\t\t$costs = $item->getElementsByTagName(DOM_ELEMENT_SHIP_DETAILS);\n\t\t\t\t\n\t\t\t\tforeach ($costs as $costsmsg){\n\t\t\t\t\t\n\t\t\t\t\t$serv_opts = $costsmsg->getElementsByTagName(DOM_ELEMENT_SHIP_SERVICE_OPTIONS);\n\t\t\t\t\tforeach($serv_opts as $serv){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$costers = trim($serv->getElementsByTagName(DOM_ELEMENT_SHIP_SERVICE_CST)->item(0)->nodeValue) != \"\" ? trim($serv->getElementsByTagName(DOM_ELEMENT_SHIP_SERVICE_CST)->item(0)->nodeValue) : \"No Cost Entered - Error\";\n\t\t\t\t\t\tarray_push($update_item_array, $costers);\n\n\t\t\t\t\t}\n\n\n\n\t\t\t\t\t\n\t\t\t\t}\t\t\n\n\n\t\t\t\t//errors\n\t\t\t\t$error_messages = $item->getElementsByTagName(DOM_ELEMENT_ERRORS);\n\n\t\t\t\tforeach ($error_messages as $errormsg){\n\t\t\t\t\t$error = trim($errormsg->getElementsByTagName(DOM_ELEMENT_SHORT_ERROR_MSG)->item(0)->nodeValue) != \"\" ? trim($errormsg->getElementsByTagName(DOM_ELEMENT_SHORT_ERROR_MSG)->item(0)->nodeValue) : \"No Error\";\n\t\t\t\t\tarray_push($update_item_array, $error);\n\t\t\t\t}\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\n\t\t\t}\n\n\t\t\treturn $update_item_array;\n\n\t\t//DOM_ELEMENT_SHORT_ERROR_MSG\n\t\t}", "public function getProductPriceDetails($params){\n\t\ttry {\n\t\t\t$query = \"SELECT * FROM store_products_price spp WHERE spp.statusid=1 AND spp.product_id = \".$params['id'];\n\t\t\t//exit;\t\t\t\n\t\t\t$stmt = $this->db->query($query);\t\t\t\n\t\t\treturn $stmt->fetchAll();\n\t\t\t\n\t\t} catch(Exception $e) {\n\t\t\tApplication_Model_Logging::lwrite($e->getMessage());\n\t\t\tthrow new Exception($e->getMessage());\n\t\t}\n\t}", "function getShippingByOrder($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_shipping'\");\n\t\t$shiptot = 0;\n\t\twhile($rst_arr = tep_db_fetch_array($sel_ord_query)) {\n\t\t\t$shiptot += $rst_arr[\"value\"];\n\t\t}\n\t\treturn $shiptot;\n\t}", "public function show($id)\n {\n $item = Item::find($id);\n $sale_items = $item->saleItems()->orderBy('created_at','desc')->paginate(20);\n\n $sale_item_retail_price_changes_prices = [];\n $sale_item_retail_price_changes_dates = [];\n \n $sale_items_for_retail_price_trends = $item->saleItems()->where('type','retail')->get();\n if (count($sale_items_for_retail_price_trends) > 0){\n \t$sale_item_retail_price_changes_prices = [$sale_items_for_retail_price_trends[0]->price];\n \t$sale_item_retail_price_changes_dates = [$sale_items_for_retail_price_trends[0]->created_at->toFormattedDateString()];\n \tfor($i = 1; $i < count($sale_items_for_retail_price_trends); $i++ ){\n\t \tif ($sale_items_for_retail_price_trends[$i]){\n\t \t\tif ($sale_items_for_retail_price_trends[$i]->price !== $sale_item_retail_price_changes_prices[$i-1]){\n\t \t\t\tarray_push($sale_item_retail_price_changes_prices, $sale_items_for_retail_price_trends[$i]->price);\n\t \t\t\tarray_push($sale_item_retail_price_changes_dates, $sale_items_for_retail_price_trends[$i]->created_at->toFormattedDateString());\n\t \t\t}\n\t \t}\n\t }\n }\n\n $sale_item_wholesale_price_changes_prices = [];\n $sale_item_wholesale_price_changes_dates = [];\n \n $sale_items_for_wholesale_price_trends = $item->saleItems()->where('type','wholesale')->get();\n if (count($sale_items_for_wholesale_price_trends) > 0){\n \t$sale_item_wholesale_price_changes_prices = [$sale_items_for_wholesale_price_trends[0]->price];\n \t$sale_item_wholesale_price_changes_dates = [$sale_items_for_wholesale_price_trends[0]->created_at->toFormattedDateString()];\n \tfor($i = 1; $i < count($sale_items_for_wholesale_price_trends); $i++ ){\n\t \tif ($sale_items_for_wholesale_price_trends[$i]){\n\t \t\tif ($sale_items_for_wholesale_price_trends[$i]->price !== $sale_item_wholesale_price_changes_prices[$i-1]){\n\t \t\t\tarray_push($sale_item_wholesale_price_changes_prices, $sale_items_for_wholesale_price_trends[$i]->price);\n\t \t\t\tarray_push($sale_item_wholesale_price_changes_dates, $sale_items_for_wholesale_price_trends[$i]->created_at->toFormattedDateString());\n\t \t\t}\n\t \t}\n\t }\n }\n\n $purchase_item_price_changes_prices = [];\n $purchase_item_price_changes_dates = [];\n \n $purchase_items_for_price_trends = $item->purchaseItems()->get();\n if (count($purchase_items_for_price_trends) > 0){\n \t$purchase_item_price_changes_prices = [$purchase_items_for_price_trends[0]->price];\n \t$purchase_item_price_changes_dates = [(\\Carbon\\Carbon::createFromFormat('Y-m-d',($purchase_items_for_price_trends[0]->purchase->purchase_date)))->toFormattedDateString()];\n \tfor($i = 1; $i < count($purchase_items_for_price_trends); $i++ ){\n\t \tif ($purchase_items_for_price_trends[$i]){\n\t \t\tif ($purchase_items_for_price_trends[$i]->price !== $purchase_item_price_changes_prices[$i-1]){\n\t \t\t\tarray_push($purchase_item_price_changes_prices, $purchase_items_for_price_trends[$i]->price);\n\t \t\t\tarray_push($purchase_item_price_changes_dates, (\\Carbon\\Carbon::createFromFormat('Y-m-d',($purchase_items_for_price_trends[$i]->purchase->purchase_date)))->toFormattedDateString());\n\t \t\t}\n\t \t}\n\t }\n }\n\n $sale_items_total_amount = 0;\n $sale_items_total_quantity = 0;\n foreach ($sale_items as $sale_item){\n \t$sale_items_total_quantity = $sale_items_total_quantity + $sale_item->quantity;\n \t$sale_items_total_amount = $sale_items_total_amount + $sale_item->total;\n }\n\n \n\t\t\t$purchase_items = \\DB::table('purchase_items')->rightJoin('items','items.id','=','purchase_items.item_id')->rightJoin('purchases','purchases.id','=','purchase_items.purchase_id')->where('items.id','=',$item->id)->orderBy('purchases.purchase_date','desc')->get();\n\t\t\tif (count($purchase_items) > 0){\n\t\t\t\t$last_purchase_price = $purchase_items[0]->price;\n\t\t\t}\n\n return view('items.show', compact(['item', 'sale_items', 'sale_items_total_amount', 'sale_items_total_quantity','sale_item_retail_price_changes_prices','sale_item_retail_price_changes_dates','sale_item_wholesale_price_changes_prices','sale_item_wholesale_price_changes_dates','last_purchase_price','purchase_item_price_changes_prices','purchase_item_price_changes_dates']));\n }", "public function getPrice()\n\t{\n\t\t$item = InvoiceItem::where('description', $this->description)\n\t\t\t->orderBy('updated_at', 'DESC')\n\t\t\t->first();\n\n\t\treturn is_null($item) ? 0 : $item->price;\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 getItemDetails($id)\n\t{\n\t\t$apicall = $this->endPoint. \"?callname=GetSingleItem&version=515\"\n . \"&appid=eBay3e085-a78c-4080-ac24-a322315e506&ItemID=$id\"\n . \"&responseencoding=\" .RESPONSE_ENCODING\n . \"&IncludeSelector=ShippingCosts,Details\"; \n \n \t$this->xmlResponse = simplexml_load_file($apicall);\n \t\n \t//print_r($this->xmlResponse);\n\n\t\tif ($this->xmlResponse->Item->PictureURL) \n\t\t{\n \t$this->bigPicUrl = $this->xmlResponse->Item->PictureURL;\n } else \n {\n \t$this->bigPicUrl = \"img/pic.gif\";\n }\n\t}", "protected function selectDiscount($orderDetails) {\n\n //Total order value \n $orderValue = $orderDetails->total;\n $this->logger->info(\"Select discount based on order value\");\n\n //Query for product to get product categoryId\n $productDetails = $this->assignProductCategoryId($orderDetails);\n\n foreach($productDetails->items as $key => $values) {\n \n if($values->category == 2 && $values->quantity >= 5) { \n $discountsDetail = $this->computeDiscounts(2, $orderValue, $values);\n $values->discountType = $discountsDetail[\"discountType\"];\n $values->discountQuantity = $discountsDetail[\"discountQuantity\"];\n $values->quantity = $values->quantity + $discountsDetail[\"discountQuantity\"];\n } else if($values->category == 1 && $values->quantity >= 2) { \n $discountsDetail = $this->computeDiscounts(3, $orderValue, $productDetails); \n $orderDetails = $discountsDetail[\"productDetails\"];\n $orderValue = $orderDetails->total - $discountsDetail[\"discountPrice\"]; \n }\n }\n \n $discountPrice = 0;\n $discountType = \"\"; \n $customerId = $orderDetails->{'customer-id'}; \n $customerDetail = $this->discountsRepository->findCustomerById($customerId);\n $customerRevenue = (count($customerDetail) > 0) ? $customerDetail[0]['revenue'] : 0; \n if($customerRevenue >= 1000) {\n $discountsDetail = $this->computeDiscounts(1, $orderValue, []);\n $discountPrice = $discountsDetail[\"discountPrice\"];\n $discountType = $discountsDetail[\"discountType\"]; \n }\n \n $responseData = $orderDetails;\n $responseData->discountPrice = $discountPrice;\n $responseData->discountType = $discountType; \n $responseData->payableAmount = $orderValue - $discountPrice; \n return $responseData;\n \n }", "public function view_order_details_mo($order_id)\n\t{\n $log=new Log(\"OrderDetailsRcvMo.log\");\n\t\t$query = $this->db->query(\"SELECT oc_po_order.*,\".DB_PREFIX.\"user.firstname,\".DB_PREFIX.\"user.lastname\n\t\t\t\tFROM oc_po_order\n\t\t\t\t\tLEFT JOIN \".DB_PREFIX.\"user\n\t\t\t\t\t\tON \".DB_PREFIX.\"user.user_id = oc_po_order.user_id\n\t\t\t\t\t\t\tWHERE id = \" . $order_id . \" AND delete_bit = \" . 1);\n $log->write($query);\n\t\t$order_info = $query->row;\n\t\t//ON (oc_po_receive_details.product_id = oc_po_product.id)\n $allprod=\"SELECT\n\t\toc_po_product.*,oc_po_receive_details.quantity as rd_quantity,oc_po_receive_details.price,oc_po_supplier.first_name,oc_po_supplier.last_name,oc_po_supplier.id as supplier_id,oc_po_receive_details.order_id\n\t\tFROM\n\t\t\toc_po_receive_details\n\t\tINNER JOIN oc_po_product \n\t\t\tON (oc_po_receive_details.order_id = oc_po_product.order_id)\n\t\tLEFT JOIN oc_po_supplier \n\t\t\tON (oc_po_receive_details.supplier_id = oc_po_supplier.id)\n\t\t\t\tWHERE oc_po_product.item_status <> 0 AND (oc_po_receive_details.order_id =\".$order_id.\")\";\n\t\t$log->write($allprod);\n $query = $this->db->query($allprod);\n \n $log->write($query);\n\tif($this->db->countAffected() > 0)\n\t{\n\t\t$products = $query->rows;\n\t\t$quantities = array();\n\t\t$all_quantities = array();\n\t\t$prices = array();\n\t\t$all_prices = array();\n\t\t$suppliers = array();\n\t\t$all_suppliers = array();\n\t\t$supplier_names = array();\n\t\t$all_supplier_names = array();\n\t\t$index = 0;\n\t\t$index1 = 0;\n\t\tfor($i =0; $i<count($products); $i++)\n\t\t{\n\t\t\tif($products[$i] != \"\")\n\t\t\t{\n\t\t\t\tfor($j = 0; $j<count($products); $j++)\n\t\t\t\t{\n\t\t\t\t\tif($products[$j] != \"\")\n\t\t\t\t\t{\n\t\t\t\t\t\tif($products[$i]['id'] == $products[$j]['id'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$quantities[$index] = $products[$j]['rd_quantity'];\n\t\t\t\t\t\t\t$supplier_names[$index] = $products[$j]['first_name'] .\" \". $products[$j]['last_name'];\n\t\t\t\t\t\t\t$suppliers[$index] = $products[$j]['supplier_id'];\n\t\t\t\t\t\t\t$prices[$index] = $products[$j]['price'];\n\t\t\t\t\t\t\tif($j!=$i)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$products[$j] = \"\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$index++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$index = 0;\n\t\t\t\t$all_quantities[$index1] = $quantities;\n\t\t\t\t$all_suppliers[$index1] = $suppliers;\n\t\t\t\t$all_prices[$index1] = $prices;\n\t\t\t\t$all_supplier_names[$index1] = $supplier_names;\n\t\t\t\tunset($quantities);\n\t\t\t\tunset($suppliers);\n\t\t\t\tunset($prices);\n\t\t\t\tunset($supplier_names);\n\t\t\t\t$quantities = array();\n\t\t\t\t$suppliers = array();\n\t\t\t\t$prices = array();\n\t\t\t\t$supplier_names = array();\n\t\t\t\t$index1++;\n\t\t\t}\n\t\t}\n\t\t$products = array_values(array_filter($products));\n\t\tfor($i = 0; $i<count($products); $i++)\n\t\t{\n\t\t\tunset($products[$i]['rd_quantity']);\n\t\t\tunset($products[$i]['first_name']);\n\t\t\tunset($products[$i]['last_name']);\n\t\t\t$products[$i]['quantities'] = $all_quantities[$i];\n\t\t\t$products[$i]['suppliers'] = $all_suppliers[$i];\n\t\t\t$products[$i]['prices'] = $all_prices[$i];\n\t\t\t$products[$i]['supplier_names'] = $all_supplier_names[$i];\n\t\t}\n\t}\n\telse\n\t{\n\t\t$query = $this->db->query(\"SELECT * FROM oc_po_product WHERE order_id = \" . $order_info['id']);\n\t\t$products = $query->rows;\n\t}\n\t\t$i = 0;\n\t\tforeach($products as $product)\n\t\t{\n\t\t\t$query = $this->db->query(\"SELECT * FROM oc_po_attribute_group WHERE product_id = \". $product['id']);\n\t\t\t$attribute_groups[$i] = $query->rows;\n\t\t\t$i++;\n\t\t}\n\t\t\n\t\t$i = 0;\n\t\tforeach($attribute_groups as $attribute_group)\n\t\t{\n\t\t\tfor($j = 0; $j<count($attribute_group);$j++)\n\t\t\t{\n\t\t\t\t$query = $this->db->query(\"SELECT * FROM oc_po_attribute_category WHERE attribute_group_id = \". $attribute_group[$j]['id']);\n\t\t\t\t$attribute_categories[$i] = $query->row;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\t\tfor($i=0;$i<count($products); $i++)\n\t\t{\n\t\t\tfor($j=0; $j<count($attribute_groups[$i]);$j++)\n\t\t\t{\n\t\t\t\t$products[$i]['attribute_groups'][$j] = $attribute_groups[$i][$j]['name'];\n\t\t\t}\n\t\t}\n\t\t$start_loop = 0;\n\t\t//$attribute_categories = array_values(array_filter($attribute_categories));\n\t\t//print_r($attribute_categories);\n\t\t//exit;\n\t\tfor($i=0; $i<count($products); $i++)\n\t\t{\n\t\t\tfor($j=$start_loop; $j<($start_loop + count($products[$i]['attribute_groups']));$j++)\n\t\t\t{\n\t\t\t\t$products[$i]['attribute_category'][$j] = $attribute_categories[$j]['name'];\n\t\t\t}\n\t\t\t$start_loop = $j;\n\t\t}\n\t\t$order_information['products'] = $products;\n\t\t$order_information['order_info'] = $order_info;\n\t\treturn $order_information;\n\t}", "function getReceiptItems($item_id=NULL)\n\t{\n\t\tglobal $db;\n\n\t\t$item_id_condition = ($item_id)?' AND ri.item_id = '.$item_id:NULL;\n\t\t\n\t\t$query = 'SELECT pr.product_desc AS \"Product\", ri.quantity AS \"Quantity\", uo.uom_code AS \"Uom\", ri.price AS \"Price\", ri.price * ri.quantity AS \"Value\", cu.currency_code AS \"Currency\" \n\t\tFROM '.receipt_items_table .' ri \n\t\tJOIN '.products_table.' pr ON pr.product_id=ri.product_id \n\t\tJOIN '.uom_table .' uo ON uo.uom_id=ri.uom_id \n\t\tJOIN '.currency_table.' cu ON cu.currency_id=ri.currency_id \n\t\tWHERE ri.receipt_id = '.$this->receipt_id.$item_id_condition ;\n\t\t$result = $db->query($query);\n\n\t\tif(!$result)\n\t\t{\n\t\t\t$err_info = $db->errorInfo();\n\t\t\techo $err_info[2];\n\t\t\terror_log('Function : getReceiptItems, Class : receipt, '.$err_info[2]);\n\t\t\texit;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$arr = $result->fetchAll(PDO::FETCH_ASSOC);\n\t\t}\n\t\treturn $arr;\n\t}", "function item_details($iid, $oid)\n\t{\n\t\t$q = $this->db\n\t\t\t->select('co.store_id as stid, co.drug_id as iid, co.supplier_id as suid, co.manufacturer_id as mid, co.unit_cost price, co.unit_savings, co.quantity as qtyPrev, co.date_time, lc.item_type')\n\t\t\t->from('ci_completedorders as co')\n\t\t\t->join('ci_listings_compiled as lc', 'co.drug_id = lc.drug_id')\n\t\t\t->where('co.drug_id', $iid)\n\t\t\t->where('co.order_id', $oid)\n\t\t\t->limit(1)\n\t\t\t->get();\n\t\t\t\n\t\t$r = $q->row();\n\t\t\t\n\t\tif ( $q->num_rows() === 0 )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$r->rx = ( $r->item_type == 1 ) ? false : true;\n\t\t\tunset($r->item_type);\n\t\t\t$r->date = strtotime($r->date_time);\n\t\t\tunset($r->date_time);\n\t\t\t\n\t\t\t$this->result_to_table('Queried item details: ', array($r));\n\t\t\t\n\t\t\treturn $r;\n\t\t}\n\t}", "function getSubtotalByOrder($orders_id) {\n\t\t$sel_subtotal_query = tep_db_query(\"SELECT value FROM \" . TABLE_ORDERS_TOTAL . \" WHERE orders_id = '\".$orders_id.\"' AND class = 'ot_subtotal'\");\t\t\n\t\t$rst_sub = tep_db_fetch_array($sel_subtotal_query);\t\n\t\tif(tep_db_num_rows($sel_subtotal_query)>0) {\n\t\t\treturn $rst_sub[\"value\"];\n\t\t} else {\n\t\t\t$sel_grand_query = tep_db_query(\"SELECT value FROM \" . TABLE_ORDERS_TOTAL . \" WHERE orders_id = '\".$orders_id.\"' AND class = 'ot_grand_subtotal'\");\t\t\n\t\t\t$rst_grand = tep_db_fetch_array($sel_grand_query);\t\n\t\t\tif(tep_db_num_rows($sel_grand_query)>0) {\n\t\t\t\treturn $rst_grand[\"value\"];\n\t\t\t}\n\t\t}\n\t}", "public function getMyParcelDeliveryOptions($order_id)\r\n {\r\n $order_query = $this->db->query(\"SELECT delivery_options FROM `\" . DB_PREFIX . self::$table_name . \"` WHERE order_id = \" . (int)$order_id . \" LIMIT 1\");\r\n return $this->getValueFromQuery('delivery_options', $order_query);\r\n }", "public function getOtherCharges() { \n \n $result = 0;\n $purchaseIds = !empty($_GET['purchaseIds']) ? $_GET['purchaseIds'] : '';\n $purchaseData = DB::select('SELECT * FROM purchase_master WHERE is_deleted_status = \"N\" AND id = '.$purchaseIds.'');\n if (!empty($purchaseData)) {\n $otherCharges = !empty($purchaseData[0]->other_charges) ? $purchaseData[0]->other_charges : '0.00'; \n echo $otherCharges;\n }\n\n }", "function getiteminfo($sessionID, $itemID, $debug) {\n\t\t$sql = Processwire\\wire('database')->prepare(\"SELECT * FROM pricing WHERE sessionid = :sessionID AND itemid = :itemid LIMIT 1\");\n\t\t$switching = array(':sessionID' => $sessionID, ':itemid' => $itemID); $withquotes = array(true, true);\n\t\tif ($debug) {\n\t\t\treturn returnsqlquery($sql->queryString, $switching, $withquotes);\n\t\t} else {\n\t\t\t$sql->execute($switching);\n\t\t\treturn $sql->fetch(PDO::FETCH_ASSOC);\n\t\t}\n\t}", "function decline_order_get()\n {\n $order_id = $this->get('order_id');\n $driver_id = $this->get('driver_id');\n \n if(empty($order_id) || empty($driver_id))\n {\n $message = ['status' => FALSE,'message' => $this->lang->line('text_rest_invalidparam')];\n $this->response($message, REST_Controller::HTTP_BAD_REQUEST); // BAD_REQUEST (400)\n }\n else\n {\n $order_data = $this->Common_model->getOrderDetails($order_id);\n\n if($order_data['driver_id'] != $driver_id){\n $message = ['status' => FALSE,'message' => 'This ride is not assigned to you'];\n $this->response($message, REST_Controller::HTTP_BAD_REQUEST); // BAD_REQUEST (400)\n }\n else if($order_data['status'] == 'Completed'){\n $message = ['status' => FALSE,'message' => 'This ride is already completed'];\n $this->response($message, REST_Controller::HTTP_BAD_REQUEST); // BAD_REQUEST (400)\n }\n else if($order_data['status'] == 'Cancelled'){\n $message = ['status' => FALSE,'message' => 'This ride is already cancelled'];\n $this->response($message, REST_Controller::HTTP_BAD_REQUEST); // BAD_REQUEST (400)\n }\n else if($order_data['status'] == 'Processing'){\n $message = ['status' => FALSE,'message' => 'This ride is in progress'];\n $this->response($message, REST_Controller::HTTP_BAD_REQUEST); // BAD_REQUEST (400)\n }\n else{\n $message = $this->Common_model->findDrivers($order_id);\n $this->response($message, REST_Controller::HTTP_OK); // OK (200)\n }\n } \n }", "public function get_addon_delivery($id)\n {\n $this->db->select('this_delivery, product_code, description, unit_price');\n $this->db->from('sales_order_medication_deliveries');\n $this->db->where(['delivery_id' => $id]);\n $this->db->join('sales_order_medications', 'sales_order_medications.id = medication_order_item_id');\n $this->db->join('inventory_medications', 'inventory_medications.id = medication_id');\n return $this->db->get()->result_array();\n }", "public function getPrice()\n {\n $db = new db_connector();\n $conn = $db->getConnection();\n\n $stmt = \"SELECT `Order List`.orderID, `Order List`.PQuantity, `Product`.PPrice, `Product`.PID\n FROM `Order List`\n LEFT JOIN `Product`\n ON `Order List`.productID = `Product`.PID\";\n\n $result5 = $conn->query($stmt);\n\n if($result5)\n {\n $price_array = array();\n\n while($price = $result5->fetch_assoc())\n {\n array_push($price_array, $price);\n }\n $total = 0;\n $curr = 0;\n for($x = 0; $x < count($price_array); $x ++)\n {\n // echo \"price array \" . $price_array[$x]['orderID'] . \"<br>\";\n // echo \"session order id \" . $_SESSION['orderID'] . \"<br>\";\n\n if($price_array[$x]['orderID'] == $_SESSION['orderID'])\n {\n\n // echo $price_array[$x]['orderID'];\n // echo $price_array[$x]['PQuantity'];\n\n $curr = ((float) $price_array[$x]['PPrice'] * (float) $price_array[$x]['PQuantity']);\n $total = $total + $curr;\n $curr = 0;\n }\n }\n echo \"$\" . $total;\n return $total;\n }\n }", "function print_order_detail($orderid){\n // product data in table\n\t$order_items = \"scart_purchdetail\"; // purchdetail table - order item info\n // retrieve command table order details\n\t$intorderid = intval($orderid); // => 23 mysql value in integer\n\t$cmdorder = \"select * from $order_items where orderid = $intorderid order by line_item asc;\";\n\t$result2 = mysql_query($cmdorder)\n or die (\"Query '$cmdorder' failed with error message: \\\"\" . mysql_error () . '\"');\n\t$num_rows2 = mysql_num_rows($result2);\n\t// $row_info = mysql_fetch_array($result2);\n\tif ( $num_rows2 >= 1 ) {\n\t // ========= start order items data records =========\n\t $row = 0; // line_item values\n\t while ($row_info = mysql_fetch_object($result2)) {\n\t\t $data[$row]['item'] = $row_info->line_item; // current row item number\n\t\t $data[$row]['qty'] = $row_info->order_quantity; // current row quantity\n\t\t $data[$row]['bookid'] = $row_info->bookid; // current row bookid\n\t\t $data[$row]['price'] = $row_info->order_price; // current row book price\n\t\t $row ++; // next line_item values\n\t }\n\t return $data; // return order details\n\t} else {\n\t print '<script type=\"text/javascript\">';\n\t print 'alert(\"query result mysql_errno is = '.mysql_errno($connID).' !\\nmysql_errormsg = '\n\t\t\t .mysql_error($connID).'\\nNo results found - Returning empty!\\n\")';\n\t print '</script>'; \n\t // exit(); \n\t return 0; // return failed order detail\n }\n}", "public function detailGrNotApprove($item){\n /* buat query temporary untuk dijoinkan dengan ec_gr_status */\n $_tmp = array();\n foreach($item as $i){\n $_t = array();\n foreach($i as $_k => $_v){\n array_push($_t,$_v .' as '.$_k);\n }\n array_push($_tmp,'select '.implode(',',$_t).' from dual');\n }\n $sql_tmp = implode(' union ',$_tmp);\n $sql = <<<SQL\n select EGS.*\n from EC_GR_STATUS EGS\n join ({$sql_tmp})TT\n on TT.GR_NO = EGS.GR_NO and TT.GR_YEAR = EGS.GR_YEAR and TT.GR_ITEM_NO = EGS.GR_ITEM_NO\n where EGS.STATUS = 0\nSQL;\n //log_message('ERROR',$sql);\n return $this->db->query($sql)->result_array();\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}", "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}", "function getOrderDetails($id)\n {\n }", "public static function bogo_apply_disc($order_id,$promotion_id,$prmdisc_id,$prmdisc_bogo_sbmnu,$prmdisc_bogo_sbmnu_dish,$prmdisc_bogo_qty,$disc_amt_type,$disc_amt){\r \t//echo \"$order_id,$promotion_id,$prmdisc_id,$prmdisc_bogo_sbmnu,$prmdisc_bogo_sbmnu_dish,$prmdisc_bogo_qty,$disc_amt_type,$disc_amt\";\r\t\t//..Check if discount is with sub menu item is selected\r\t\tif(is_gt_zero_num($prmdisc_bogo_sbmnu_dish)){\r\t\t\t//..do nothing..because we already ahve submenudishid\r\t\t}else{\r\t\t //..Get all submenu dish ids from submenu..\r\t\t\t$rs_apl_disc_items= tbl_submenu_dishes::getSubMenuItems($prmdisc_bogo_sbmnu);\r\t\t\tif(is_not_empty($rs_apl_disc_items)){\r\t\t\t\t$prmdisc_bogo_sbmnu_dish=$rs_apl_disc_items;\r\t\t\t}else{\r\t\t\t\t$strOpMsg= \"No items found to apply discount\" ;\r\t\t\t\treturn 0;\r\t\t\t}\r\t\t}\t\t\r \t\t//...Check if the item is in the order detail\r\t\t$tmp_fnd=0;\r\t\t$ord_det_items=tbl_order_details::readArray(array(ORD_DTL_ORDER_ID=>$order_id,ORD_DTL_SBMENU_DISH_ID=>$prmdisc_bogo_sbmnu_dish,ORDPROM_DISCOUNT_AMT=>0),$tmp_fnd,1,0);\t\t\t\t\t\t\t\r\t\tif($tmp_fnd>0){\t\t \r\t\t\t//..item presents in order detail wihtout disocunt\r\t\t\t//..loop through the all the order items records\r\t\t\tforeach($ord_det_items as $order_itm){\r\t\t\t\t //..now check if the quantity >= disc qty\t\t\t\t\t \r\t\t\t\t if($order_itm[ORD_DTL_QUANTITY]>=$prmdisc_bogo_qty){\r\t\t\t\t \t //..Right item to apply discount\r\t\t\t\t\t //..Calculate discount amount\t\r\t\t\t\t\t$discount_amount=tbl_order_details::getDiscountAmnt($disc_amt_type,$disc_amt,$order_itm[ORD_DTL_PRICE]);\r\t\t\t\t\t//..Update the order detail with discount and promot\r\t\t\t\t\t$success=tbl_order_details::update_item_with_discount($order_itm[ORD_DTL_ID],$promotion_id,$prmdisc_id,$discount_amount);\t\r\t\t\t\t\t\t\t\t\t\t\t \r\t\t\t\t }\r\t\t\t}\r\t\t\tunset($ord_det_items);\t\r\t\t}else{\r\t\t\t$strOpMsg= \"Item not present in your order or alreday discounted\" ;\r\t\t}\t\r\t\treturn 1;\r }", "function getPrice($id,$rdvtype){\r global $bdd;\r\r $req4=$bdd->prepare(\"select * from packs where idpack=? \");\r $req4->execute(array($id));\r while($ar = $req4->fetch()){\r if($rdvtype == 'visio'){return $ar['prvisio'];}else if($rdvtype == 'public'){return $ar['prpublic'];}else if($rdvtype == 'domicile'){return $ar['prdomicile'];}\r }\r\r return 200;\r}", "public function CheckItemOnDODetail($params)\n {\n return $this->deliveryOrderDetail::where($params)->first() == null ? true : false; \n }", "function checkOrderStatus($orderItem, $status){\n $statusCode = getOrderStatusCode($status);\n return $orderItem->status == $statusCode;\n}", "function GetDetailPPHItemByIdSOA($id){\n\n $data = $this->db\n ->select('form_soa_item_pph.id_form_soa_item_pph as id_item_pph,form_soa_item_pph.id_form_soa_item as id_item,form_soa_item_pph.*,form_soa_item.real_amount,form_soa_item.name as item_name')\n ->where('form_soa_item_pph.id_form_soa_item_pph',$id)\n ->join('form_soa_item','form_soa_item.id_form_soa_item=form_soa_item_pph.id_form_soa_item')\n ->get('form_soa_item_pph')\n ->row_array();\n return $data;\n }", "function getUnitCost( $modelid, $dealerid, $cost )\n{\nglobal $db;\n\n//08.21.2015 ghh - first we're going to see if there is a dealer specific price for \n//this item and if so we'll just pass it back\n$query = \"select Cost from UnitModelCost where ModelID=$modelid and \n\t\t\t\tDealerID=$dealerid\";\nif (!$result = $db->sql_query($query))\n\t{\n\tRestLog(\"Error 16562 in query: $query\\n\".$db->sql_error());\n\tRestUtils::sendResponse(500,\"16562 - There was a problem attempting find the dealer cost\"); //Internal Server Error\n\treturn false;\n\t}\n\n$row = $db->sql_fetchrow( $result );\n\n//if there is a cost then lets just return it.\nif ( $row['Cost'] > 0 )\n\treturn $row['Cost'];\n\nreturn $cost;\n}", "function get_discounted_price( $values, $price, $add_totals = false ) {\n\t\n\t\t\tif ($this->applied_coupons) foreach ($this->applied_coupons as $code) :\n\t\t\t\t$coupon = new cmdeals_coupon( $code );\n\t\t\t\t\n\t\t\t\tif ( $coupon->apply_before_tax() && $coupon->is_valid() ) :\n\t\t\t\t\t\n\t\t\t\t\tswitch ($coupon->type) :\n\t\t\t\t\t\n\t\t\t\t\t\tcase \"fixed_deals\" :\n\t\t\t\t\t\tcase \"percent_deals\" :\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this_item_is_discounted = false;\n\t\t\t\t\n\t\t\t\t\t\t\t// Specific deals ID's get the discount\n\t\t\t\t\t\t\tif (sizeof($coupon->deal_ids)>0) :\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif ((in_array($values['deal_id'], $coupon->deal_ids) || in_array($values['variation_id'], $coupon->deal_ids))) :\n\t\t\t\t\t\t\t\t\t$this_item_is_discounted = true;\n\t\t\t\t\t\t\t\tendif;\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\n\t\t\t\t\t\t\t\t// No deals ids - all items discounted\n\t\t\t\t\t\t\t\t$this_item_is_discounted = true;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tendif;\n\t\t\t\t\n\t\t\t\t\t\t\t// Specific deals ID's excluded from the discount\n\t\t\t\t\t\t\tif (sizeof($coupon->exclude_deals_ids)>0) :\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif ((in_array($values['deal_id'], $coupon->exclude_deals_ids) || in_array($values['variation_id'], $coupon->exclude_deals_ids))) :\n\t\t\t\t\t\t\t\t\t$this_item_is_discounted = false;\n\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Apply filter\n\t\t\t\t\t\t\t$this_item_is_discounted = apply_filters( 'cmdeals_item_is_discounted', $this_item_is_discounted, $values, $before_tax = true );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Apply the discount\n\t\t\t\t\t\t\tif ($this_item_is_discounted) :\n\t\t\t\t\t\t\t\tif ($coupon->type=='fixed_deals') :\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif ($price < $coupon->amount) :\n\t\t\t\t\t\t\t\t\t\t$discount_amount = $price;\n\t\t\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t\t\t$discount_amount = $coupon->amount;\n\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$price = $price - $coupon->amount;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif ($price<0) $price = 0;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif ($add_totals) :\n\t\t\t\t\t\t\t\t\t\t$this->discount_cart = $this->discount_cart + ( $discount_amount * $values['quantity'] );\n\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\telseif ($coupon->type=='percent_deals') :\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$percent_discount = ( $values['data']->get_price( false ) / 100 ) * $coupon->amount;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif ($add_totals) $this->discount_cart = $this->discount_cart + ( $percent_discount * $values['quantity'] );\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$price = $price - $percent_discount;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\tendif;\n\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\tcase \"fixed_cart\" :\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/** \n\t\t\t\t\t\t\t * This is the most complex discount - we need to divide the discount between rows based on their price in\n\t\t\t\t\t\t\t * proportion to the subtotal. This is so rows with different tax rates get a fair discount, and so rows\n\t\t\t\t\t\t\t * with no price (free) don't get discount too.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Get item discount by dividing item cost by subtotal to get a %\n\t\t\t\t\t\t\t$discount_percent = ($values['data']->get_price( false )*$values['quantity']) / $this->subtotal_ex_tax;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Use pence to help prevent rounding errors\n\t\t\t\t\t\t\t$coupon_amount_pence = $coupon->amount * 100;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Work out the discount for the row\n\t\t\t\t\t\t\t$item_discount = $coupon_amount_pence * $discount_percent;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Work out discount per item\n\t\t\t\t\t\t\t$item_discount = $item_discount / $values['quantity'];\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Pence\n\t\t\t\t\t\t\t$price = ( $price * 100 );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Check if discount is more than price\n\t\t\t\t\t\t\tif ($price < $item_discount) :\n\t\t\t\t\t\t\t\t$discount_amount = $price;\n\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t$discount_amount = $item_discount;\n\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Take discount off of price (in pence)\n\t\t\t\t\t\t\t$price = $price - $discount_amount;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Back to pounds\n\t\t\t\t\t\t\t$price = $price / 100; \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Cannot be below 0\n\t\t\t\t\t\t\tif ($price<0) $price = 0;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Add coupon to discount total (once, since this is a fixed cart discount and we don't want rounding issues)\n\t\t\t\t\t\t\tif ($add_totals) $this->discount_cart = $this->discount_cart + (($discount_amount*$values['quantity']) / 100);\n\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\tcase \"percent\" :\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Get % off each item - this works out the same as doing the whole cart\n\t\t\t\t\t\t\t//$percent_discount = ( $values['data']->get_price( false ) / 100 ) * $coupon->amount;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$percent_discount = ( $values['data']->get_price( ) / 100 ) * $coupon->amount;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ($add_totals) $this->discount_cart = $this->discount_cart + ( $percent_discount * $values['quantity'] );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$price = $price - $percent_discount;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\tendswitch;\n\t\t\t\t\t\n\t\t\t\tendif;\n\t\t\tendforeach;\n\t\t\t\n\t\t\treturn apply_filters( 'cmdeals_get_discounted_price_', $price, $values, $this );\n\t\t}", "function getDeliveryListByOrderId($order_id) {\n\t\tif (!is_numeric($order_id)) {\n\t\t\tmsg(\"ecommerce_delivery.getDeliveryListByOrderId(): order_id is not numeric\", 'error', 1);\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$list = $this->listing(\"order_id = $order_id\");\n\t\tforeach ($list as $key=>$val) {\n\t\t\t$list[$key]['carrier_detail'] = $this->getCarrierDetail($val['carrier_id']);\n\t\t}\n\t\treturn $list;\n\t}", "public function deliveryPriceDhaka()\n {\n }", "static function get_orders_by_product_id($product_id, $offset = null, $per_page = null ) {\n\n global $wpdb;\n $tabelaOrderItemMeta = $wpdb->prefix . 'woocommerce_order_itemmeta';\n $tabelaOrderItems = $wpdb->prefix . 'woocommerce_order_items';\n $limiter_str = '';\n\n if( $offset !== null && $per_page !== null ) {\n $limiter_str = \" LIMIT $offset, $per_page \";\n }\n\n if( is_array( $product_id ) ) {\n\n echo \"SELECT b.order_id, a.meta_value as product_id\nFROM {$tabelaOrderItemMeta} a, {$tabelaOrderItems} b\nWHERE a.meta_key = '_product_id'\nAND a.meta_value IN (%s)\nAND a.order_item_id = b.order_item_id\nORDER BY b.order_id DESC $limiter_str\";\n\n $results = $wpdb->get_results(\n $wpdb->prepare(\n \"SELECT b.order_id, a.meta_value as product_id\nFROM {$tabelaOrderItemMeta} a, {$tabelaOrderItems} b\nWHERE a.meta_key = '_product_id'\nAND a.meta_value IN (%s)\nAND a.order_item_id = b.order_item_id\nORDER BY b.order_id DESC $limiter_str\",\n\n implode(',', $product_id ) //array('336','378')\n )\n );\n } else {\n $results = $wpdb->get_results(\n $wpdb->prepare(\n \"SELECT b.order_id\nFROM {$tabelaOrderItemMeta} a, {$tabelaOrderItems} b\nWHERE a.meta_key = '_product_id'\nAND a.meta_value = %s\nAND a.order_item_id = b.order_item_id\nORDER BY b.order_id DESC $limiter_str\",\n $product_id\n )\n );\n }\n\n\n if ($results) {\n\n $order_ids = array();\n foreach ($results as $item)\n array_push($order_ids, $item->order_id);\n\n if ($order_ids) {\n $args = array(\n 'post_type' => 'shop_order',\n 'post_status' => array('wc-processing', 'wc-completed'),\n 'posts_per_page' => -1,\n 'post__in' => $order_ids,\n 'fields' => 'ids'\n );\n $query = new WP_Query($args);\n return $query;\n }\n }\n\n return false;\n }", "public static function getItems($id)\n {\n try{\n return DB::table('order_items')\n ->select('order_id','item_id','quantity','price','confirmed AS accept')\n ->where('order_id',$id)\n ->get();\n }\n catch(QueryException $e){\n return false;\n } \n }", "function getItemPrice($storeId = null, $merchant_id = null, $catId = null, $itemId = null, $sizeId = null) {\n App::import('Model', 'Item');\n $this->Item = new Item();\n $this->ItemPrice->bindModel(\n array('belongsTo' => array(\n 'Size' => array(\n 'className' => 'Size',\n 'foreignKey' => 'size_id',\n 'conditions' => array('Size.is_active' => 1, 'Size.is_deleted' => 0, 'Size.store_id' => $storeId),\n 'order' => array('Size.id ASC')\n ),\n 'StoreTax' => array(\n 'className' => 'StoreTax',\n 'foreignKey' => 'store_tax_id',\n 'conditions' => array('StoreTax.is_active' => 1, 'StoreTax.is_deleted' => 0, 'StoreTax.store_id' => $storeId)\n )\n )));\n $this->Item->bindModel(\n array('hasOne' => array(\n 'ItemPrice' => array(\n 'className' => 'ItemPrice',\n 'foreignKey' => 'item_id',\n 'type' => 'INNER',\n 'conditions' => array('ItemPrice.is_active' => 1, 'ItemPrice.is_deleted' => 0, 'ItemPrice.store_id' => $storeId, 'ItemPrice.size_id' => $sizeId),\n 'order' => array('ItemPrice.position ASC')\n ),\n )\n ));\n $checkItem = $this->Item->find('first', array('conditions' => array('Item.store_id' => $storeId, 'Item.merchant_id' => $merchant_id, 'Item.is_deleted' => 0, 'Item.id' => $itemId, 'Item.category_id' => $catId, 'Item.is_active' => 1), 'fields' => array('id', 'name', 'description', 'units', 'is_seasonal_item', 'start_date', 'end_date', 'is_deliverable', 'preference_mandatory', 'default_subs_price'), 'recursive' => 3));\n \n if (!empty($checkItem['ItemPrice']['Size'])) {\n $default_price = $checkItem['ItemPrice']['price'];\n $intervalPrice = 0;\n $intervalPrice = $this->getTimeIntervalPrice($itemId, $sizeId, $storeId);\n if (!empty($intervalPrice['IntervalPrice'])) {\n $default_price = $intervalPrice['IntervalPrice']['price'];\n }\n }else{\n $default_price= $checkItem['ItemPrice']['price'];\n }\n return $default_price;\n }", "function selectUnservedOrders($c){\n\t$sql = \"SELECT (SELECT picture FROM product_tbl WHERE id=ol.product_id_fk) as productImg, ol.id as order_line_id, o.id as order_id,o.order_date as order_date,o.seat_number as order_seat_number,o.cashier_fk as order_cashier_fk,(SELECT name FROM employee_tbl WHERE id=o.cashier_fk) as cashier_name,o.branch_fk as order_branch_fk,o.waiter_fk as order_waiter_fk,o.void as order_void_fk,o.total_amount as order_total_amount,o.customer_name as order_customer_name,o.payment as order_payment,o.notes as order_notes,o.down_payment as order_down_payment,o.received_date as order_received_date,o.void_reason as order_void_reason,o.printed,o.discount as order_discount,o.discount_percentage,ol.order_id_fk as oLine_order_id_fk,ol.product_id_fk as oLine_product_id_fk,ol.name as oLine_name,ol.code as oLine_code,ol.quantity as oLine_quantity,ol.price as oLine_price,ol.served as oLine_served, ol.served_items, o.vat, o.service_charge FROM order_tbl o, order_line_tbl ol WHERE\n\t o.void=0 AND o.id = ol.order_id_fk AND o.done=0 AND ol.served_items <> ol.quantity order by o.id\";\n\texecuteOrdersQuery($c,$sql);\n}", "function price( )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n return $this->Price;\n }", "function shipPriceDetailById($id) {\n\n $varQuery = \"SELECT *,c1.name as frmCountryName,c2.name as toCountryName,s1.name as fromstateName,s2.name as tostateName,\"\n . \"city1.name as fromcityName, city2.name as tocityName\"\n . \" FROM \" . TABLE_ZONEPRICE . \" \"\n . \" LEFT JOIN \" . TABLE_ZONE . \" ON zoneid = zonetitleid\"\n . \" LEFT JOIN\" . TABLE_SHIPPING_METHOD . \" ON pkShippingMethod = shippingmethod \"\n . \" LEFT JOIN \" . TABLE_ZONEDETAIL . \" ON zonetitleid = fkzoneid \"\n . \" LEFT JOIN \" . TABLE_COUNTRY . \" as c1 ON fromcountry = c1.country_id \"\n . \" LEFT JOIN \" . TABLE_COUNTRY . \" as c2 ON tocountry = c2.country_id \"\n . \" LEFT JOIN \" . TABLE_STATE . \" as s1 ON fromstate = s1.id \"\n . \" LEFT JOIN \" . TABLE_STATE . \" as s2 ON tostate = s2.id \"\n . \" LEFT JOIN \" . TABLE_CITY . \" as city1 ON fromcity = city1.id \"\n . \" LEFT JOIN \" . TABLE_CITY . \" as city2 ON tocity = city2.id \"\n . \" WHERE pkpriceid = \" . $id . \"\";\n $arrRes = $this->getArrayResult($varQuery);\n\n //return all record\n return $arrRes;\n }", "public function getItemsPrice()\n {\n return [10,20,54];\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 }", "protected function getDiscountItemData($order, $context)\n {\n $data = array();\n if (self::TYPE_RF != $context && $order->getDiscountAmount() < 0) {\n $data = array(\n 'number' =>\n '___discount___-' . $order->getDiscountDescription(),\n 'name' => 'Discount ' . $order->getDiscountDescription(),\n 'type' => 'voucher',\n 'quantity' => 1,\n 'netPrice' => round($order->getDiscountAmount(), 2),\n 'tax' => 0.00,\n );\n }\n return $data;\n }", "function _refundItemAmount($type = '', $itemIds = array())\r\n {\r\n $ItemUserConditions = array(\r\n 'OR' => array(\r\n array(\r\n 'ItemUser.is_paid' => 1,\r\n 'ItemUser.is_repaid' => 0,\r\n 'ItemUser.is_canceled' => 0,\r\n 'ItemUser.payment_gateway_id' => ConstPaymentGateways::Wallet\r\n ) ,\r\n array(\r\n 'ItemUser.is_paid' => 0,\r\n 'ItemUser.is_repaid' => 0,\r\n 'ItemUser.is_canceled' => 0,\r\n 'ItemUser.payment_gateway_id' => array(\r\n ConstPaymentGateways::CreditCard,\r\n ConstPaymentGateways::PayPalAuth,\r\n ConstPaymentGateways::AuthorizeNet,\r\n )\r\n )\r\n )\r\n );\r\n if (!empty($itemIds)) {\r\n $conditions['Item.id'] = $itemIds;\r\n } elseif (!empty($type) && $type == 'cron') {\r\n $conditions['Item.item_status_id'] = array(\r\n ConstItemStatus::Expired,\r\n ConstItemStatus::Canceled\r\n );\r\n }\r\n $items = $this->find('all', array(\r\n 'conditions' => $conditions,\r\n 'contain' => array(\r\n 'ItemUser' => array(\r\n 'User' => array(\r\n 'fields' => array(\r\n 'User.username',\r\n 'User.email',\r\n 'User.id',\r\n 'User.cim_profile_id',\r\n ) ,\r\n 'UserProfile' => array(\r\n 'fields' => array(\r\n 'UserProfile.first_name',\r\n 'UserProfile.last_name'\r\n ) ,\r\n ) ,\r\n ) ,\r\n 'PaypalDocaptureLog' => array(\r\n 'fields' => array(\r\n 'PaypalDocaptureLog.authorizationid',\r\n 'PaypalDocaptureLog.dodirectpayment_amt',\r\n 'PaypalDocaptureLog.id',\r\n 'PaypalDocaptureLog.currencycode'\r\n )\r\n ) ,\r\n 'PaypalTransactionLog' => array(\r\n 'fields' => array(\r\n 'PaypalTransactionLog.id',\r\n 'PaypalTransactionLog.authorization_auth_exp',\r\n 'PaypalTransactionLog.authorization_auth_id',\r\n 'PaypalTransactionLog.authorization_auth_amount',\r\n 'PaypalTransactionLog.authorization_auth_status'\r\n )\r\n ) ,\r\n 'AuthorizenetDocaptureLog' => array(\r\n 'fields' => array(\r\n 'AuthorizenetDocaptureLog.id',\r\n 'AuthorizenetDocaptureLog.authorize_amt',\r\n )\r\n ) ,\r\n 'conditions' => $ItemUserConditions,\r\n ) ,\r\n 'Merchant' => array(\r\n 'fields' => array(\r\n 'Merchant.name',\r\n 'Merchant.id',\r\n 'Merchant.url',\r\n 'Merchant.zip',\r\n 'Merchant.address1',\r\n 'Merchant.address2',\r\n 'Merchant.city_id'\r\n ) ,\r\n 'City' => array(\r\n 'fields' => array(\r\n 'City.id',\r\n 'City.name',\r\n 'City.slug',\r\n )\r\n ) ,\r\n 'State' => array(\r\n 'fields' => array(\r\n 'State.id',\r\n 'State.name'\r\n )\r\n ) ,\r\n 'Country' => array(\r\n 'fields' => array(\r\n 'Country.id',\r\n 'Country.name',\r\n 'Country.slug',\r\n )\r\n )\r\n ) ,\r\n 'Attachment' => array(\r\n 'fields' => array(\r\n 'Attachment.id',\r\n 'Attachment.dir',\r\n 'Attachment.filename',\r\n 'Attachment.width',\r\n 'Attachment.height'\r\n )\r\n ) ,\r\n 'City' => array(\r\n 'fields' => array(\r\n 'City.id',\r\n 'City.name',\r\n 'City.slug',\r\n )\r\n ) ,\r\n ) ,\r\n 'recursive' => 3,\r\n ));\r\n App::import('Model', 'EmailTemplate');\r\n $this->EmailTemplate = new EmailTemplate();\r\n App::import('Core', 'ComponentCollection');\r\n $collection = new ComponentCollection();\r\n App::import('Component', 'Email');\r\n $this->Email = new EmailComponent($collection);\r\n if (!empty($items)) {\r\n $itemIds = array();\r\n App::import('Component', 'Paypal');\r\n $this->Paypal = new PaypalComponent($collection);\r\n $paymentGateways = $this->User->Transaction->PaymentGateway->find('all', array(\r\n 'conditions' => array(\r\n 'PaymentGateway.id' => array(\r\n ConstPaymentGateways::CreditCard,\r\n ConstPaymentGateways::AuthorizeNet\r\n ) ,\r\n ) ,\r\n 'contain' => array(\r\n 'PaymentGatewaySetting' => array(\r\n 'fields' => array(\r\n 'PaymentGatewaySetting.key',\r\n 'PaymentGatewaySetting.test_mode_value',\r\n 'PaymentGatewaySetting.live_mode_value',\r\n ) ,\r\n ) ,\r\n ) ,\r\n 'recursive' => 1\r\n ));\r\n foreach($paymentGateways as $paymentGateway) {\r\n if ($paymentGateway['PaymentGateway']['id'] == ConstPaymentGateways::CreditCard) {\r\n if (!empty($paymentGateway['PaymentGatewaySetting'])) {\r\n foreach($paymentGateway['PaymentGatewaySetting'] as $paymentGatewaySetting) {\r\n if ($paymentGatewaySetting['key'] == 'directpay_API_UserName') {\r\n $paypal_sender_info['API_UserName'] = $paymentGateway['PaymentGateway']['is_test_mode'] ? $paymentGatewaySetting['test_mode_value'] : $paymentGatewaySetting['live_mode_value'];\r\n }\r\n if ($paymentGatewaySetting['key'] == 'directpay_API_Password') {\r\n $paypal_sender_info['API_Password'] = $paymentGateway['PaymentGateway']['is_test_mode'] ? $paymentGatewaySetting['test_mode_value'] : $paymentGatewaySetting['live_mode_value'];\r\n }\r\n if ($paymentGatewaySetting['key'] == 'directpay_API_Signature') {\r\n $paypal_sender_info['API_Signature'] = $paymentGateway['PaymentGateway']['is_test_mode'] ? $paymentGatewaySetting['test_mode_value'] : $paymentGatewaySetting['live_mode_value'];\r\n }\r\n }\r\n $paypal_sender_info['is_testmode'] = $paymentGateway['PaymentGateway']['is_test_mode'];\r\n }\r\n }\r\n if ($paymentGateway['PaymentGateway']['id'] == ConstPaymentGateways::AuthorizeNet) {\r\n if (!empty($paymentGateway['PaymentGatewaySetting'])) {\r\n foreach($paymentGateway['PaymentGatewaySetting'] as $paymentGatewaySetting) {\r\n if ($paymentGatewaySetting['key'] == 'authorize_net_api_key') {\r\n $authorize_sender_info['api_key'] = $paymentGateway['PaymentGateway']['is_test_mode'] ? $paymentGatewaySetting['test_mode_value'] : $paymentGatewaySetting['live_mode_value'];\r\n }\r\n if ($paymentGatewaySetting['key'] == 'authorize_net_trans_key') {\r\n $authorize_sender_info['trans_key'] = $paymentGateway['PaymentGateway']['is_test_mode'] ? $paymentGatewaySetting['test_mode_value'] : $paymentGatewaySetting['live_mode_value'];\r\n }\r\n }\r\n }\r\n $authorize_sender_info['is_test_mode'] = $paymentGateway['PaymentGateway']['is_test_mode'];\r\n }\r\n }\r\n foreach($items as $item) {\r\n if (!empty($item['ItemUser'])) {\r\n $ItemUserIds = array();\r\n\t\t\t\t\t$itemUserIdData = array();\r\n\t\t\t\t\t$itemIds = array();\r\n foreach($item['ItemUser'] as $item_user) {\r\n //do void for credit card\r\n if ($item_user['payment_gateway_id'] != ConstPaymentGateways::Wallet) {\r\n if ($item_user['payment_gateway_id'] == ConstPaymentGateways::AuthorizeNet) {\r\n require_once (APP . 'vendors' . DS . 'CIM' . DS . 'AuthnetCIM.class.php');\r\n if ($authorize_sender_info['is_test_mode']) {\r\n $cim = new AuthnetCIM($authorize_sender_info['api_key'], $authorize_sender_info['trans_key'], true);\r\n } else {\r\n $cim = new AuthnetCIM($authorize_sender_info['api_key'], $authorize_sender_info['trans_key']);\r\n }\r\n $cim->setParameter('customerProfileId', $item_user['User']['cim_profile_id']);\r\n $cim->setParameter('customerPaymentProfileId', $item_user['payment_profile_id']);\r\n $cim->setParameter('transId', $item_user['cim_transaction_id']);\r\n $cim->voidCustomerProfileTransaction();\r\n // And if enbaled n Credit docapture amount and item discount amount is not equal, add amount to user wallet and update transactions //\r\n if (Configure::read('wallet.is_handle_wallet')) {\r\n if ($item_user['AuthorizenetDocaptureLog']['authorize_amt'] != $item['Item']['discount_amount']) {\r\n $update_wallet = '';\r\n $update_wallet = ($item['Item']['price']*$item_user['quantity']) -$item_user['AuthorizenetDocaptureLog']['authorize_amt'];\r\n //Updating transactions\r\n $data = array();\r\n $data['Transaction']['user_id'] = $item_user['user_id'];\r\n $data['Transaction']['foreign_id'] = ConstUserIds::Admin;\r\n $data['Transaction']['class'] = 'SecondUser';\r\n $data['Transaction']['amount'] = $update_wallet;\r\n $data['Transaction']['transaction_type_id'] = ConstTransactionTypes::AddedToWallet;\r\n $transaction_id = $this->User->Transaction->log($data);\r\n if (!empty($transaction_id)) {\r\n $this->User->updateAll(array(\r\n 'User.available_balance_amount' => 'User.available_balance_amount +' . $update_wallet\r\n ) , array(\r\n 'User.id' => $item_user['user_id']\r\n ));\r\n }\r\n }\r\n } // END act like groupon wallet funct., //\r\n if ($cim->isSuccessful()) {\r\n if (!empty($itemuser['AuthorizenetDocaptureLog']['id'])) {\r\n $data_authorize_docapture_log['AuthorizenetDocaptureLog']['id'] = $itemuser['AuthorizenetDocaptureLog']['id'];\r\n $data_authorize_docapture_log['AuthorizenetDocaptureLog']['payment_status'] = 'Cancelled';\r\n $this->ItemUser->AuthorizenetDocaptureLog->save($data_authorize_docapture_log);\r\n }\r\n return true;\r\n }\r\n } else {\r\n $payment_response = array();\r\n if ($item_user['payment_gateway_id'] == ConstPaymentGateways::CreditCard) {\r\n $post_info['authorization_id'] = $item_user['PaypalDocaptureLog']['authorizationid'];\r\n } else if ($item_user['payment_gateway_id'] == ConstPaymentGateways::PayPalAuth) {\r\n $post_info['authorization_id'] = $item_user['PaypalTransactionLog']['authorization_auth_id'];\r\n }\r\n $post_info['note'] = __l('Item Payment refund');\r\n //call void function in paypal component\r\n $payment_response = $this->Paypal->doVoid($post_info, $paypal_sender_info);\r\n //update payment responses\r\n if (!empty($payment_response)) {\r\n if ($item_user['payment_gateway_id'] == ConstPaymentGateways::CreditCard) {\r\n $data_paypal_docapture_log['PaypalDocaptureLog']['id'] = $item_user['PaypalDocaptureLog']['id'];\r\n foreach($payment_response as $key => $value) {\r\n $data_paypal_docapture_log['PaypalDocaptureLog']['dovoid_' . strtolower($key) ] = $value;\r\n }\r\n $data_paypal_docapture_log['PaypalDocaptureLog']['dovoid_response'] = serialize($payment_response);\r\n $data_paypal_docapture_log['PaypalDocaptureLog']['payment_status'] = 'Cancelled';\r\n //update PaypalDocaptureLog table\r\n $this->ItemUser->PaypalDocaptureLog->save($data_paypal_docapture_log);\r\n // And if enbaled n Credit docapture amount and item discount amount is not equal, add amount to user wallet and update transactions //\r\n if (Configure::read('wallet.is_handle_wallet')) {\r\n if ($data_paypal_docapture_log['PaypalDocaptureLog']['original_amount'] != $item['Item']['discount_amount']) {\r\n $update_wallet = '';\r\n $update_wallet = ($item['Item']['price']*$item_user['quantity']) -$item_user['PaypalDocaptureLog']['dodirectpayment_amt'];\r\n //Updating transactions\r\n $data = array();\r\n $data['Transaction']['user_id'] = $item_user['user_id'];\r\n $data['Transaction']['foreign_id'] = ConstUserIds::Admin;\r\n $data['Transaction']['class'] = 'SecondUser';\r\n $data['Transaction']['amount'] = $update_wallet;\r\n $data['Transaction']['transaction_type_id'] = ConstTransactionTypes::AddedToWallet;\r\n $transaction_id = $this->User->Transaction->log($data);\r\n if (!empty($transaction_id)) {\r\n $this->User->updateAll(array(\r\n 'User.available_balance_amount' => 'User.available_balance_amount +' . $update_wallet\r\n ) , array(\r\n 'User.id' => $item_user['user_id']\r\n ));\r\n }\r\n }\r\n } // END act like groupon wallet funct., //\r\n\r\n } else if ($item_user['payment_gateway_id'] == ConstPaymentGateways::PayPalAuth) {\r\n $data_paypal_capture_log['PaypalTransactionLog']['id'] = $item_user['PaypalTransactionLog']['id'];\r\n foreach($payment_response as $key => $value) {\r\n $data_paypal_capture_log['PaypalTransactionLog']['void_' . strtolower($key) ] = $value;\r\n }\r\n $data_paypal_capture_log['PaypalTransactionLog']['void_data'] = serialize($payment_response);\r\n $data_paypal_capture_log['PaypalTransactionLog']['payment_status'] = 'Cancelled';\r\n $data_paypal_capture_log['PaypalTransactionLog']['error_no'] = '0';\r\n //update PaypalTransactionLog table\r\n $this->ItemUser->PaypalTransactionLog->save($data_paypal_capture_log);\r\n // And if enabled n PayPal docapture amount and item discount amount is not equal, add amount to user wallet and update transactions //\r\n if (Configure::read('wallet.is_handle_wallet')) {\r\n if ($item_user['PaypalTransactionLog']['orginal_amount'] != $item['Item']['discount_amount']) {\r\n $update_wallet = '';\r\n $update_wallet = ($item['Item']['price']*$item_user['quantity']) -$item_user['PaypalTransactionLog']['authorization_auth_amount'];\r\n //Updating transactions\r\n $data = array();\r\n $data['Transaction']['user_id'] = $item_user['user_id'];\r\n $data['Transaction']['foreign_id'] = ConstUserIds::Admin;\r\n $data['Transaction']['class'] = 'SecondUser';\r\n $data['Transaction']['amount'] = $update_wallet;\r\n $data['Transaction']['transaction_type_id'] = ConstTransactionTypes::AddedToWallet;\r\n $transaction_id = $this->User->Transaction->log($data);\r\n if (!empty($transaction_id)) {\r\n $this->User->updateAll(array(\r\n 'User.available_balance_amount' => 'User.available_balance_amount +' . $update_wallet\r\n ) , array(\r\n 'User.id' => $item_user['user_id']\r\n ));\r\n }\r\n }\r\n } // END act like groupon wallet funct., //\r\n\r\n }\r\n }\r\n }\r\n //authorization_auth_amount\r\n\r\n } else {\r\n $transaction['Transaction']['user_id'] = $item_user['user_id'];\r\n $transaction['Transaction']['foreign_id'] = $item_user['id'];\r\n $transaction['Transaction']['class'] = 'ItemUser';\r\n $transaction['Transaction']['amount'] = $item_user['discount_amount'];\r\n $transaction['Transaction']['transaction_type_id'] = (!empty($item_user['is_gift'])) ? ConstTransactionTypes::ItemGiftRefund : ConstTransactionTypes::ItemBoughtRefund;\r\n $this->ItemUser->User->Transaction->log($transaction);\r\n //update user balance\r\n $this->ItemUser->User->updateAll(array(\r\n 'User.available_balance_amount' => 'User.available_balance_amount +' . $item_user['discount_amount'],\r\n ) , array(\r\n 'User.id' => $item_user['user_id']\r\n ));\r\n }\r\n /* sending mail to all subscribers starts here */\r\n $city = (!empty($item['Merchant']['City']['name'])) ? $item['Merchant']['City']['name'] : '';\r\n $state = (!empty($item['Merchant']['State']['name'])) ? $item['Merchant']['State']['name'] : '';\r\n $country = (!empty($item['Merchant']['Country']['name'])) ? $item['Merchant']['Country']['name'] : '';\r\n $address = (!empty($item['Merchant']['address1'])) ? $item['Merchant']['address1'] : '';\r\n $address.= (!empty($item['Merchant']['address2'])) ? ', ' . $item['Merchant']['address2'] : '';\r\n $address.= (!empty($item['Merchant']['City']['name'])) ? ', ' . $item['Merchant']['City']['name'] : '';\r\n $address.= (!empty($item['Merchant']['State']['name'])) ? ', ' . $item['Merchant']['State']['name'] : '';\r\n $address.= (!empty($item['Merchant']['Country']['name'])) ? ', ' . $item['Merchant']['Country']['name'] : '';\r\n $address.= (!empty($item['Merchant']['zip'])) ? ', ' . $item['Merchant']['zip'] : '';\r\n $language_code = $this->getUserLanguageIso($item_user['User']['id']);\r\n $template = $this->EmailTemplate->selectTemplate('Item Amount Refunded', $language_code);\r\n $emailFindReplace = array(\r\n '##SITE_URL##' => Cache::read('site_url_for_shell', 'long') ,\r\n '##USER_NAME##' => $item_user['User']['username'],\r\n '##SITE_NAME##' => Configure::read('site.name') ,\r\n '##ITEM_NAME##' => $item['Item']['name'],\r\n '##MERCHANT_NAME##' => $item['Merchant']['name'],\r\n '##MERCHANT_ADDRESS##' => $address,\r\n '##CITY_NAME##' => $item['City']['0']['name'],\r\n '##FROM_EMAIL##' => $this->changeFromEmail(($template['from'] == '##FROM_EMAIL##') ? Configure::read('EmailTemplate.from_email') : $template['from']) ,\r\n '##BUY_PRICE##' => Configure::read('site.currency') . $item['Item']['price'],\r\n '##MERCHANT_SITE##' => $item['Merchant']['url'],\r\n '##CONTACT_URL##' => Cache::read('site_url_for_shell', 'long') . preg_replace('/\\//', '', 'contactus', 1) ,\r\n '##ITEM_URL##' => Cache::read('site_url_for_shell', 'long') . preg_replace('/\\//', '', Router::url(array(\r\n 'controller' => 'items',\r\n 'action' => 'view',\r\n $item['Item']['slug'],\r\n 'admin' => false\r\n ) , false) , 1) ,\r\n '##ITEM_LINK##' => Cache::read('site_url_for_shell', 'long') . preg_replace('/\\//', '', Router::url(array(\r\n 'controller' => 'items',\r\n 'action' => 'view',\r\n $item['Item']['slug'],\r\n 'admin' => false\r\n ) , false) , 1) ,\r\n '##SITE_LOGO##' => Cache::read('site_url_for_shell', 'long') . preg_replace('/\\//', '', Router::url(array(\r\n 'controller' => 'img',\r\n 'action' => 'blue-theme',\r\n 'logo-email.png',\r\n 'admin' => false\r\n ) , false) , 1) ,\r\n );\r\n $this->Email->from = ($template['from'] == '##FROM_EMAIL##') ? Configure::read('EmailTemplate.from_email') : $template['from'];\r\n $this->Email->replyTo = ($template['reply_to'] == '##REPLY_TO_EMAIL##') ? Configure::read('EmailTemplate.reply_to_email') : $template['reply_to'];\r\n $this->Email->to = $this->formatToAddress($item_user);\r\n $this->Email->subject = strtr($template['subject'], $emailFindReplace);\r\n $this->Email->content = strtr($template['email_content'], $emailFindReplace);\r\n $this->Email->sendAs = ($template['is_html']) ? 'html' : 'text';\r\n $this->Email->send($this->Email->content);\r\n $ItemUserIds[] = $item_user['id'];\r\n\t\t\t\t\t\t$itemIds[] = $item['Item']['id'];\r\n // SubItem: Resetting the actual item array //\r\n if (!empty($temp_item)) {\r\n $item['Item'] = $temp_item;\r\n }\r\n\t\t\t\t\t\t// after save fields //\r\n\t\t\t\t\t\t$data_for_aftersave = array();\r\n\t\t\t\t\t\t$data_for_aftersave['item_id'] = $item['Item']['id'];\r\n\t\t\t\t\t\t$data_for_aftersave['item_user_id'] = $item_user['id'];\r\n\t\t\t\t\t\t$data_for_aftersave['user_id'] = $item_user['user_id'];\r\n\t\t\t\t\t\t$data_for_aftersave['merchant_id'] = $item['Merchant']['id'];\r\n\t\t\t\t\t\t$data_for_aftersave['payment_gateway_id'] = $item_user['payment_gateway_id'];\r\n\t\t\t\t\t\t$itemUserIdData[] = $data_for_aftersave;\r\n }\r\n if (!empty($ItemUserIds)) {\r\n //is_repaid field updated\r\n $this->ItemUser->updateAll(array(\r\n 'ItemUser.is_repaid' => 1,\r\n ) , array(\r\n 'ItemUser.id' => $ItemUserIds\r\n ));\r\n\t\t\t\t\t\t$this->updateAll(array(\r\n\t\t\t\t\t\t\t'Item.item_user_count' => 0,\r\n\t\t\t\t\t\t) , array(\r\n\t\t\t\t\t\t\t'Item.id' => $itemIds\r\n\t\t\t\t\t\t));\r\n\t\t\t\t\t\tforeach($itemUserIdData as $itemUserData) {\r\n\t\t\t\t\t\t\t$this->_updateAfterPurchase($itemUserData, 'cancel');\r\n\t\t\t\t\t\t}\r\n }\r\n }\r\n $refundedItemIds[] = $item['Item']['id'];\r\n }\r\n if (!empty($refundedItemIds)) {\r\n foreach($refundedItemIds as $refunded_item_id) {\r\n $data = array();\r\n $data['Item']['id'] = $refunded_item_id;\r\n $data['Item']['item_status_id'] = ConstItemStatus::Refunded; // Already updated in model itself, calling it again for affiliate behaviour\r\n $this->save($data);\r\n }\r\n }\r\n }\r\n }", "function show_estimated_ship_date_new_subscription_orders_email( $order ) { \n $item = array_pop( $order->get_items() );\n if ( $order->status == 'processing' && $item['name'] != 'Try or Gift' ) {\n echo '<h2>Estimated Shipment Date</h2>';\n echo '<p>Your package ships by: <strong>' . new_orders_next_subscription_ship_date( $order->order_date ) . '</strong>.</p>';\n }\n}", "public function orders_get_items_list($orderID) {\n\t\t $sql = <<<EOD\n\t\t SELECT\n\t\t \t{$this->wpdb->prefix}topspin_orders_items.id,\n\t\t \t{$this->wpdb->prefix}topspin_orders_items.order_id,\n\t\t \t{$this->wpdb->prefix}topspin_orders_items.campaign_id,\n\t\t \t{$this->wpdb->prefix}topspin_orders_items.line_item_id,\n\t\t \t{$this->wpdb->prefix}topspin_orders_items.spin_name,\n\t\t \t{$this->wpdb->prefix}topspin_orders_items.product_id,\n\t\t \t{$this->wpdb->prefix}topspin_orders_items.product_name,\n\t\t \t{$this->wpdb->prefix}topspin_orders_items.product_type,\n\t\t \t{$this->wpdb->prefix}topspin_orders_items.merchandise_type,\n\t\t \t{$this->wpdb->prefix}topspin_orders_items.quantity,\n\t\t \t{$this->wpdb->prefix}topspin_orders_items.sku_id,\n\t\t \t{$this->wpdb->prefix}topspin_orders_items.sku_upc,\n\t\t \t{$this->wpdb->prefix}topspin_orders_items.sku_attributes,\n\t\t \t{$this->wpdb->prefix}topspin_orders_items.factory_sku,\n\t\t \t{$this->wpdb->prefix}topspin_orders_items.shipped,\n\t\t \t{$this->wpdb->prefix}topspin_orders_items.status,\n\t\t \t{$this->wpdb->prefix}topspin_orders_items.weight,\n\t\t \t{$this->wpdb->prefix}topspin_orders_items.bundle_sku_id,\n\t\t \t{$this->wpdb->prefix}topspin_orders_items.shipping_date\n\t\t FROM {$this->wpdb->prefix}topspin_orders_items\n\t\t WHERE\n\t\t \t{$this->wpdb->prefix}topspin_orders_items.order_id = '%d'\nEOD;\n\t\t$itemsList = $this->wpdb->get_results($this->wpdb->prepare($sql,array($orderID)));\n\t\t$unserialize = array('sku_attributes','weight');\n\t\tforeach($unserialize as $key) {\n\t\t\tforeach($itemsList as $itemKey=>$item) {\n\t\t\t\t$itemsList[$itemKey]->$key = unserialize($itemsList[$itemKey]->$key);\n\t\t\t}\n\t\t}\n\t\treturn $itemsList;\n\t}", "public function orderItem(): OrderItem\n {\n return $this->order_item;\n }", "function getUpdateItem($product_id){\n\tglobal $conn;\n\t$ip = getIp();\n\t$get_qty =mysqli_query($conn, \"SELECT * FROM `cart` WHERE `ip_add`='$ip' AND `p_id`='$product_id'\");\n\t$row_qty=mysqli_fetch_array($get_qty);\n\t$quantity= $row_qty[\"qty\"];\t\n\n\t$get_price =mysqli_query($conn, \"SELECT * FROM `products` WHERE `product_id`='$product_id' AND `stock`='0'\");\n\t$row_price = mysqli_fetch_array($get_price);\n\t$price= $row_price[\"product_price\"];\n\n\t//get the subtotal\n\t$sub_total=$price * $quantity;\n\n\treturn $sub_total;\n}", "public function getShippingPrice($productID){\n\n global $db;\n\n if(!is_numeric($productID)){\n return;\n }\n $query = sprintf('SELECT * FROM %s WHERE productID=%d', TABLE_SHOP_SHIPPING_PRICE, $productID);\n\n return $db->getResultsArray($query);\n\n }", "function processTippedStatus($item_details, $last_inserted_id)\r\n {\r\n $ItemUserConditions = array();\r\n $ItemUserConditions['ItemUser.is_canceled'] = 0;\r\n if ($item_details['Item']['is_pass_mail_sent']) {\r\n $ItemUserConditions['ItemUser.id'] = $last_inserted_id;\r\n }\r\n $item = $this->find('first', array(\r\n 'conditions' => array(\r\n 'Item.item_status_id' => ConstItemStatus::Tipped,\r\n 'Item.id' => $item_details['Item']['id']\r\n ) ,\r\n 'contain' => array(\r\n 'ItemUser' => array(\r\n 'User' => array(\r\n 'fields' => array(\r\n 'User.username',\r\n 'User.id',\r\n 'User.email',\r\n 'User.cim_profile_id'\r\n ) ,\r\n 'UserProfile' => array(\r\n 'fields' => array(\r\n 'UserProfile.first_name',\r\n 'UserProfile.last_name'\r\n ) ,\r\n ) ,\r\n ) ,\r\n 'ItemUserPass',\r\n 'PaypalDocaptureLog' => array(\r\n 'fields' => array(\r\n 'PaypalDocaptureLog.currency_id',\r\n 'PaypalDocaptureLog.converted_currency_id',\r\n 'PaypalDocaptureLog.original_amount',\r\n 'PaypalDocaptureLog.rate',\r\n 'PaypalDocaptureLog.authorizationid',\r\n 'PaypalDocaptureLog.dodirectpayment_amt',\r\n 'PaypalDocaptureLog.id',\r\n 'PaypalDocaptureLog.currencycode'\r\n )\r\n ) ,\r\n 'AuthorizenetDocaptureLog' => array(\r\n 'fields' => array(\r\n 'AuthorizenetDocaptureLog.currency_id',\r\n 'AuthorizenetDocaptureLog.converted_currency_id',\r\n 'AuthorizenetDocaptureLog.original_amount',\r\n 'AuthorizenetDocaptureLog.rate',\r\n 'AuthorizenetDocaptureLog.authorize_amt'\r\n )\r\n ) ,\r\n 'PaypalTransactionLog' => array(\r\n 'fields' => array(\r\n 'PaypalTransactionLog.currency_id',\r\n 'PaypalTransactionLog.converted_currency_id',\r\n 'PaypalTransactionLog.orginal_amount',\r\n 'PaypalTransactionLog.rate',\r\n 'PaypalTransactionLog.authorization_auth_exp',\r\n 'PaypalTransactionLog.authorization_auth_id',\r\n 'PaypalTransactionLog.authorization_auth_amount',\r\n 'PaypalTransactionLog.authorization_auth_status',\r\n 'PaypalTransactionLog.mc_currency',\r\n 'PaypalTransactionLog.mc_gross',\r\n 'PaypalTransactionLog.id'\r\n )\r\n ) ,\r\n 'conditions' => $ItemUserConditions,\r\n ) ,\r\n 'Merchant' => array(\r\n 'City' => array(\r\n 'fields' => array(\r\n 'City.id',\r\n 'City.name',\r\n 'City.slug',\r\n )\r\n ) ,\r\n 'State' => array(\r\n 'fields' => array(\r\n 'State.id',\r\n 'State.name'\r\n )\r\n ) ,\r\n 'Country' => array(\r\n 'fields' => array(\r\n 'Country.id',\r\n 'Country.name',\r\n 'Country.slug',\r\n )\r\n ) ,\r\n ) ,\r\n 'Attachment' => array(\r\n 'fields' => array(\r\n 'Attachment.id',\r\n 'Attachment.dir',\r\n 'Attachment.filename',\r\n 'Attachment.width',\r\n 'Attachment.height'\r\n )\r\n ) ,\r\n 'City' => array(\r\n 'fields' => array(\r\n 'City.id',\r\n 'City.name',\r\n 'City.slug',\r\n )\r\n ) ,\r\n ) ,\r\n 'recursive' => 3,\r\n ));\r\n //do capture for credit card\r\n if (!empty($item['ItemUser'])) {\r\n App::import('Core', 'ComponentCollection');\r\n $collection = new ComponentCollection();\r\n App::import('Component', 'Paypal');\r\n $this->Paypal = new PaypalComponent($collection);\r\n $paymentGateways = $this->User->Transaction->PaymentGateway->find('all', array(\r\n 'conditions' => array(\r\n 'PaymentGateway.id' => array(\r\n ConstPaymentGateways::CreditCard,\r\n ConstPaymentGateways::AuthorizeNet\r\n ) ,\r\n ) ,\r\n 'contain' => array(\r\n 'PaymentGatewaySetting' => array(\r\n 'fields' => array(\r\n 'PaymentGatewaySetting.key',\r\n 'PaymentGatewaySetting.test_mode_value',\r\n 'PaymentGatewaySetting.live_mode_value',\r\n ) ,\r\n ) ,\r\n ) ,\r\n 'recursive' => 1\r\n ));\r\n foreach($paymentGateways as $paymentGateway) {\r\n if ($paymentGateway['PaymentGateway']['id'] == ConstPaymentGateways::CreditCard) {\r\n if (!empty($paymentGateway['PaymentGatewaySetting'])) {\r\n foreach($paymentGateway['PaymentGatewaySetting'] as $paymentGatewaySetting) {\r\n if ($paymentGatewaySetting['key'] == 'directpay_API_UserName') {\r\n $paypal_sender_info['API_UserName'] = $paymentGateway['PaymentGateway']['is_test_mode'] ? $paymentGatewaySetting['test_mode_value'] : $paymentGatewaySetting['live_mode_value'];\r\n }\r\n if ($paymentGatewaySetting['key'] == 'directpay_API_Password') {\r\n $paypal_sender_info['API_Password'] = $paymentGateway['PaymentGateway']['is_test_mode'] ? $paymentGatewaySetting['test_mode_value'] : $paymentGatewaySetting['live_mode_value'];\r\n }\r\n if ($paymentGatewaySetting['key'] == 'directpay_API_Signature') {\r\n $paypal_sender_info['API_Signature'] = $paymentGateway['PaymentGateway']['is_test_mode'] ? $paymentGatewaySetting['test_mode_value'] : $paymentGatewaySetting['live_mode_value'];\r\n }\r\n $paypal_sender_info['is_testmode'] = $paymentGateway['PaymentGateway']['is_test_mode'];\r\n }\r\n }\r\n }\r\n if ($paymentGateway['PaymentGateway']['id'] == ConstPaymentGateways::AuthorizeNet) {\r\n if (!empty($paymentGateway['PaymentGatewaySetting'])) {\r\n foreach($paymentGateway['PaymentGatewaySetting'] as $paymentGatewaySetting) {\r\n if ($paymentGatewaySetting['key'] == 'authorize_net_api_key') {\r\n $authorize_sender_info['api_key'] = $paymentGateway['PaymentGateway']['is_test_mode'] ? $paymentGatewaySetting['test_mode_value'] : $paymentGatewaySetting['live_mode_value'];\r\n }\r\n if ($paymentGatewaySetting['key'] == 'authorize_net_trans_key') {\r\n $authorize_sender_info['trans_key'] = $paymentGateway['PaymentGateway']['is_test_mode'] ? $paymentGatewaySetting['test_mode_value'] : $paymentGatewaySetting['live_mode_value'];\r\n }\r\n }\r\n }\r\n $authorize_sender_info['is_test_mode'] = $paymentGateway['PaymentGateway']['is_test_mode'];\r\n }\r\n }\r\n $paidItemUsers = array();\r\n foreach($item['ItemUser'] as $ItemUser) {\r\n if (!$ItemUser['is_paid'] && $ItemUser['payment_gateway_id'] != ConstPaymentGateways::Wallet) {\r\n $payment_response = array();\r\n if ($ItemUser['payment_gateway_id'] == ConstPaymentGateways::AuthorizeNet) {\r\n $capture = 0;\r\n require_once (APP . 'vendors' . DS . 'CIM' . DS . 'AuthnetCIM.class.php');\r\n if ($authorize_sender_info['is_test_mode']) {\r\n $cim = new AuthnetCIM($authorize_sender_info['api_key'], $authorize_sender_info['trans_key'], true);\r\n } else {\r\n $cim = new AuthnetCIM($authorize_sender_info['api_key'], $authorize_sender_info['trans_key']);\r\n }\r\n $ItemUser['discount_amount'] = $this->_convertAuthorizeAmount($ItemUser['discount_amount'], $ItemUser['AuthorizenetDocaptureLog']['rate']);\r\n $cim->setParameter('amount', $ItemUser['discount_amount']);\r\n $cim->setParameter('refId', time());\r\n $cim->setParameter('customerProfileId', $ItemUser['User']['cim_profile_id']);\r\n $cim->setParameter('customerPaymentProfileId', $ItemUser['payment_profile_id']);\r\n $cim_transaction_type = 'profileTransAuthCapture';\r\n if (!empty($ItemUser['cim_approval_code'])) {\r\n $cim->setParameter('approvalCode', $ItemUser['cim_approval_code']);\r\n $cim_transaction_type = 'profileTransCaptureOnly';\r\n }\r\n $title = Configure::read('site.name') . ' - Item Bought';\r\n $description = 'Item Bought in ' . Configure::read('site.name');\r\n // CIM accept only 30 character in title\r\n if (strlen($title) > 30) {\r\n $title = substr($title, 0, 27) . '...';\r\n }\r\n $unit_amount = $ItemUser['discount_amount']/$ItemUser['quantity'];\r\n $cim->setLineItem($ItemUser['item_id'], $title, $description, $ItemUser['quantity'], $unit_amount);\r\n $cim->createCustomerProfileTransaction($cim_transaction_type);\r\n $response = $cim->getDirectResponse();\r\n $response_array = explode(',', $response);\r\n if ($cim->isSuccessful() && $response_array[0] == 1) {\r\n $capture = 1;\r\n }\r\n $data_authorize_docapture_log['AuthorizenetDocaptureLog']['item_user_id'] = $ItemUser['id'];\r\n $data_authorize_docapture_log['AuthorizenetDocaptureLog']['authorize_response_text'] = $cim->getResponseText();\r\n $data_authorize_docapture_log['AuthorizenetDocaptureLog']['authorize_authorization_code'] = $cim->getAuthCode();\r\n $data_authorize_docapture_log['AuthorizenetDocaptureLog']['authorize_avscode'] = $cim->getAVSResponse();\r\n $data_authorize_docapture_log['AuthorizenetDocaptureLog']['transactionid'] = $cim->getTransactionID();\r\n $data_authorize_docapture_log['AuthorizenetDocaptureLog']['authorize_amt'] = $response_array[9];\r\n $data_authorize_docapture_log['AuthorizenetDocaptureLog']['authorize_gateway_feeamt'] = $response[32];\r\n $data_authorize_docapture_log['AuthorizenetDocaptureLog']['authorize_cvv2match'] = $cim->getCVVResponse();\r\n $data_authorize_docapture_log['AuthorizenetDocaptureLog']['authorize_response'] = $response;\r\n if (!empty($capture)) {\r\n $data_authorize_docapture_log['AuthorizenetDocaptureLog']['payment_status'] = 'Completed';\r\n }\r\n $this->ItemUser->AuthorizenetDocaptureLog->save($data_authorize_docapture_log);\r\n } else {\r\n //doCapture process for credit card and paypal auth\r\n if ($ItemUser['payment_gateway_id'] == ConstPaymentGateways::CreditCard && !empty($ItemUser['PaypalDocaptureLog']['authorizationid'])) {\r\n $post_info['authorization_id'] = $ItemUser['PaypalDocaptureLog']['authorizationid'];\r\n $post_info['amount'] = $ItemUser['PaypalDocaptureLog']['dodirectpayment_amt'];\r\n $post_info['invoice_id'] = $ItemUser['PaypalDocaptureLog']['id'];\r\n $post_info['currency'] = $ItemUser['PaypalDocaptureLog']['currencycode'];\r\n } else if ($ItemUser['payment_gateway_id'] == ConstPaymentGateways::PayPalAuth && !empty($ItemUser['PaypalTransactionLog']['authorization_auth_id'])) {\r\n $post_info['authorization_id'] = $ItemUser['PaypalTransactionLog']['authorization_auth_id'];\r\n $post_info['amount'] = $ItemUser['PaypalTransactionLog']['authorization_auth_amount'];\r\n $post_info['invoice_id'] = $ItemUser['PaypalTransactionLog']['id'];\r\n $post_info['currency'] = $ItemUser['PaypalTransactionLog']['mc_currency'];\r\n }\r\n $post_info['CompleteCodeType'] = 'Complete';\r\n $post_info['note'] = __l('Item Payment');\r\n //call doCapture from paypal component\r\n $payment_response = $this->Paypal->doCapture($post_info, $paypal_sender_info);\r\n }\r\n if ((!empty($payment_response) && $payment_response['ACK'] == 'Success') || !empty($capture)) {\r\n //update PaypalDocaptureLog for credit card\r\n if ($ItemUser['payment_gateway_id'] == ConstPaymentGateways::CreditCard) {\r\n $data_paypal_docapture_log['PaypalDocaptureLog']['id'] = $ItemUser['PaypalDocaptureLog']['id'];\r\n foreach($payment_response as $key => $value) {\r\n if ($key != 'AUTHORIZATIONID' && $key != 'VERSION' && $key != 'CURRENCYCODE') {\r\n $data_paypal_docapture_log['PaypalDocaptureLog']['docapture_' . strtolower($key) ] = $value;\r\n }\r\n }\r\n $data_paypal_docapture_log['PaypalDocaptureLog']['docapture_response'] = serialize($payment_response);\r\n $data_paypal_docapture_log['PaypalDocaptureLog']['payment_status'] = 'Completed';\r\n $this->ItemUser->PaypalDocaptureLog->save($data_paypal_docapture_log);\r\n } else if ($ItemUser['payment_gateway_id'] == ConstPaymentGateways::PayPalAuth) {\r\n //update PaypalTransactionLog for PayPalAuth\r\n $data_paypal_capture_log['PaypalTransactionLog']['id'] = $ItemUser['PaypalTransactionLog']['id'];\r\n foreach($payment_response as $key => $value) {\r\n $data_paypal_capture_log['PaypalTransactionLog']['capture_' . strtolower($key) ] = $value;\r\n }\r\n $data_paypal_capture_log['PaypalTransactionLog']['capture_data'] = serialize($payment_response);\r\n $data_paypal_capture_log['PaypalTransactionLog']['error_no'] = '0';\r\n $data_paypal_capture_log['PaypalTransactionLog']['payment_status'] = 'Completed';\r\n $this->ItemUser->PaypalTransactionLog->save($data_paypal_capture_log);\r\n }\r\n // need to updatee item user record is_paid as 1\r\n $paidItemUsers[] = $ItemUser['id'];\r\n //add amount to wallet\r\n // coz of 'act like groupon' logic, amount updated from what actual taken, instead of updating item amount directly.\r\n if (!empty($ItemUser['PaypalTransactionLog']['orginal_amount'])) {\r\n $paid_amount = $ItemUser['PaypalTransactionLog']['orginal_amount'];\r\n } elseif (!empty($ItemUser['PaypalDocaptureLog']['original_amount'])) {\r\n $paid_amount = $ItemUser['PaypalDocaptureLog']['original_amount'];\r\n }\r\n $data['Transaction']['user_id'] = $ItemUser['user_id'];\r\n $data['Transaction']['foreign_id'] = ConstUserIds::Admin;\r\n $data['Transaction']['class'] = 'SecondUser';\r\n //$data['Transaction']['amount'] = $ItemUser['discount_amount'];\r\n $data['Transaction']['amount'] = $paid_amount;\r\n $data['Transaction']['transaction_type_id'] = ConstTransactionTypes::AddedToWallet;\r\n $data['Transaction']['payment_gateway_id'] = $ItemUser['payment_gateway_id'];\r\n $transaction_id = $this->User->Transaction->log($data);\r\n if (!empty($transaction_id)) {\r\n $this->User->updateAll(array(\r\n 'User.available_balance_amount' => 'User.available_balance_amount +' . $paid_amount\r\n ) , array(\r\n 'User.id' => $ItemUser['user_id']\r\n ));\r\n }\r\n //Buy item transaction\r\n $transaction['Transaction']['user_id'] = $ItemUser['user_id'];\r\n $transaction['Transaction']['foreign_id'] = $ItemUser['id'];\r\n $transaction['Transaction']['class'] = 'ItemUser';\r\n $transaction['Transaction']['amount'] = $paid_amount;\r\n $transaction['Transaction']['payment_gateway_id'] = $ItemUser['payment_gateway_id'];\r\n if (!empty($ItemUser['PaypalTransactionLog']['rate'])) {\r\n $transaction['Transaction']['currency_id'] = $ItemUser['PaypalTransactionLog']['currency_id'];\r\n $transaction['Transaction']['converted_currency_id'] = $ItemUser['PaypalTransactionLog']['converted_currency_id'];\r\n $transaction['Transaction']['converted_amount'] = $ItemUser['PaypalTransactionLog']['mc_gross'];\r\n $transaction['Transaction']['rate'] = $ItemUser['PaypalTransactionLog']['rate'];\r\n }\r\n if (!empty($ItemUser['PaypalDocaptureLog']['rate'])) {\r\n $transaction['Transaction']['currency_id'] = $ItemUser['PaypalDocaptureLog']['currency_id'];\r\n $transaction['Transaction']['converted_currency_id'] = $ItemUser['PaypalDocaptureLog']['converted_currency_id'];\r\n $transaction['Transaction']['converted_amount'] = $ItemUser['PaypalDocaptureLog']['dodirectpayment_amt'];\r\n $transaction['Transaction']['rate'] = $ItemUser['PaypalDocaptureLog']['rate'];\r\n }\r\n if (!empty($ItemUser['AuthorizenetDocaptureLog']['rate'])) {\r\n $transaction['Transaction']['currency_id'] = $ItemUser['AuthorizenetDocaptureLog']['currency_id'];\r\n $transaction['Transaction']['converted_currency_id'] = $ItemUser['AuthorizenetDocaptureLog']['converted_currency_id'];\r\n $transaction['Transaction']['converted_amount'] = $ItemUser['AuthorizenetDocaptureLog']['authorize_amt'];\r\n $transaction['Transaction']['rate'] = $ItemUser['AuthorizenetDocaptureLog']['rate'];\r\n }\r\n $transaction['Transaction']['transaction_type_id'] = (!empty($ItemUser['is_gift'])) ? ConstTransactionTypes::ItemGift : ConstTransactionTypes::BuyItem;\r\n $this->User->Transaction->log($transaction);\r\n //user update\r\n $this->User->updateAll(array(\r\n 'User.available_balance_amount' => 'User.available_balance_amount -' . $paid_amount\r\n ) , array(\r\n 'User.id' => $ItemUser['user_id']\r\n ));\r\n } else {\r\n //ack from paypal is not succes, so increasing payment_failed_count in items table\r\n $this->updateAll(array(\r\n 'Item.payment_failed_count' => 'Item.payment_failed_count +' . $ItemUser['quantity'],\r\n ) , array(\r\n 'Item.id' => $ItemUser['item_id']\r\n ));\r\n }\r\n }\r\n }\r\n if (!empty($paidItemUsers)) {\r\n //update is_paid field\r\n $this->ItemUser->updateAll(array(\r\n 'ItemUser.is_paid' => 1\r\n ) , array(\r\n 'ItemUser.id' => $paidItemUsers\r\n ));\r\n // paid user \"is_paid\" field update on $item array, bcoz this array pass the _sendPassMail.\r\n if (!empty($item['ItemUser'])) {\r\n foreach($item['ItemUser'] as &$item_user) {\r\n foreach($paidItemUsers as $paid) {\r\n if ($item_user['id'] == $paid) {\r\n $item_user['is_paid'] = 1;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n //do capture for credit card end\r\n //send pass mail to users when item tipped\r\n $this->_sendPassMail($item);\r\n if (!$item_details['Item']['is_pass_mail_sent']) {\r\n //update in items table as pass_mail_sent\r\n $this->updateAll(array(\r\n 'Item.is_pass_mail_sent' => 1\r\n ) , array(\r\n 'Item.id' => $item['Item']['id']\r\n ));\r\n }\r\n }", "public function getOrderById_get($id_order = null) {\n \n $params = array();\n $params['limit'] = (is_numeric($this->input->get('limit'))) ? $this->input->get('limit') : null;\n $params['from'] = $this->input->get('from');\n $params['to'] = $this->input->get('to');\n $this->load->model('Order_model');\n $this->load->model('Order_State_Model');\n $this->load->model('Address_model');\n $orders = array();\n $order = $this->Order_model->getLongOrderByOrderId($id_order, $params);\n if (!empty($order)) {\n $order_state = $this->Order_State_Model->getOrderStateByIdOrder($id_order);\n \n foreach ($order as $key => $value) {\n $orders['reference'] = $value->reference;\n $orders['total_paid'] = (double)$value->total_paid;\n $orders['total_paid_tax_excl'] = (double)$value->total_paid_tax_excl;\n $orders['tva'] = (float)$value->total_paid - $value->total_paid_tax_excl;\n $orders['total_shipping'] = (float)$value->total_shipping;\n $orders['order_date'] = $value->date_add;\n $orders['order_state'] = $order_state;\n $orders['adress'] = array('address_delivery' => $this->Address_model->getAddressById($value->id_address_delivery), 'address_invoice' => $this->Address_model->getAddressById($value->id_address_invoice));\n if (!isset($orders[$value->id_order])) {\n $orders['commande'][] = array('product_name' => $value->product_name, 'product_quantity' => (int)$value->product_quantity, 'total_price_tax_incl' => $value->total_price_tax_incl, 'total_price_tax_incl' => $value->total_price_tax_incl, 'id_image' => (int)$value->id_image, 'img_link' => base_url() . 'index.php/api/image/id/' . $value->id_image);\n }\n }\n return $this->response($orders, 200);\n }\n return $this->response(array(null), 200);\n \n }", "public function getDetailById($id)\r\n {\r\n $condition = [\r\n 'orderId' => $id\r\n ];\r\n return $this->getDetail($condition);\r\n }", "public function item($order)\n {\n return SiteMaintenanceItem::where('main_id', $this->id)->where('order', $order)->first();\n }", "private function inforQuoteDetail($id)\n {\n $user = auth()->user();\n $organization = \\App\\Organization::find($user->organization_id);\n $returnResult = [];\n $quoteItems = $this->getQuoteItems($id);\n $valoresVenta = $this->getQuoteVales($id);\n $itemsCategories = $this->getItemsCategories($id);\n $itemsPackages = $this->getItemsPackages($id);\n $infoVenta = $this->getInfoVenta($id);\n $places = $this->getPlaces($id);\n $totales = [];\n $value = $valoresVenta[0];\n $aumentos = $value->descuentos;\n $total = $value->subTotal + $aumentos;\n $subTotal = $value->subTotal;\n $packageValue = 0;\n foreach ($itemsPackages as $value) {\n $packageValue += $value->value;\n }\n $total = $total + $packageValue;\n $tax = ($infoVenta->tax * $total) / 100;\n $HT = $total - $tax;\n $subTotal = $subTotal + $packageValue;\n $totales['subTotal'] = number_format($subTotal, 2, ',', '.');\n $totales['tax'] = number_format($tax, 2, ',', '.');\n $totales['descuentos'] = number_format($aumentos, 2, ',', '.');\n $totales['total'] = number_format($total, 2, ',', '.');\n $totales['HT'] = number_format($HT, 2, ',', '.');\n\n $returnResult['quoteItems'] = $quoteItems;\n $returnResult['itemsCategories'] = $itemsCategories;\n $returnResult['totales'] = $totales;\n $returnResult['infoVenta'] = $infoVenta;\n $returnResult['itemsPackages'] = $itemsPackages;\n $returnResult['places'] = $places;\n\n return $returnResult;\n }", "private function get_costing_finish_goods($costing_id){\n $costing = Costing::with(['style'])->find($costing_id);\n $product_feature = ProductFeature::find($costing->style->product_feature_id);\n $item = [];\n\n if($product_feature->count > 1){//has sfg items\n $list = DB::select(\"SELECT\n costing_sfg_item.costing_id,\n costing_fng_item.costing_fng_id,\n costing_fng_item.fng_id,\n item_master_fng.master_code AS fng_code,\n item_master_fng.master_description AS fng_description,\n org_color_fng.color_code AS fng_color_code,\n org_color_fng.color_name AS fng_color_name,\n costing_sfg_item.costing_sfg_id,\n costing_sfg_item.sfg_id,\n item_master_sfg.master_code AS sfg_code,\n item_master_sfg.master_description AS sfg_description,\n org_color_sfg.color_code AS sfg_color_code,\n org_color_sfg.color_name AS sfg_color_name,\n org_country.country_description\n FROM\n costing_sfg_item\n INNER JOIN costing_fng_item ON costing_fng_item.costing_fng_id = costing_sfg_item.costing_fng_id\n INNER JOIN item_master AS item_master_sfg ON item_master_sfg.master_id = costing_sfg_item.sfg_id\n INNER JOIN item_master AS item_master_fng ON item_master_fng.master_id = costing_fng_item.fng_id\n INNER JOIN org_country ON org_country.country_id = costing_sfg_item.country_id\n INNER JOIN org_color AS org_color_fng ON org_color_fng.color_id = costing_fng_item.fng_color_id\n INNEr JOIN org_color AS org_color_sfg ON org_color_sfg.color_id = costing_sfg_item.sfg_color_id\n WHERE costing_sfg_item.costing_id = ?\", [$costing_id]);\n }\n else {//no sfg items\n $list = DB::select(\"SELECT\n costing_fng_item.costing_id,\n costing_fng_item.costing_fng_id,\n costing_fng_item.fng_id,\n item_master.master_code AS fng_code,\n item_master.master_description AS fng_description,\n org_color.color_code AS fng_color_code,\n org_color.color_name AS fng_color_name,\n 0 AS costing_sfg_id,\n 0 AS sfg_id,\n '' AS sfg_code,\n '' AS sfg_description,\n '' AS sfg_color_code,\n '' AS sfg_color_name,\n org_country.country_description\n FROM\n costing_fng_item\n INNER JOIN item_master ON item_master.master_id = costing_fng_item.fng_id\n INNER JOIN org_country ON org_country.country_id = costing_fng_item.country_id\n INNER JOIN org_color ON org_color.color_id = costing_fng_item.fng_color_id\n WHERE costing_fng_item.costing_id = ?\", [$costing_id]);\n }\n\n return $list;\n }", "public function get($with_details = FALSE, $search_token = array(), $filter = array(), $limit = 999, $offset = 0)\n {\n $this->load->library('subquery');\n $this->load->model('inventory/m_product');\n $this->db->select(' delivery.*, DATE_FORMAT(delivery.date, \"%M %d, %Y\") as formatted_date, truck.trucking_name, customer.company_name, customer.id AS customer_id, customer.address, s_order.id as order_id,delivery.status, s_order.po_number, agent.name AS sales_agent', FALSE);\n $this->db->from('sales_delivery as delivery');\n $this->db->join('sales_trucking as truck', 'truck.id = delivery.fk_sales_trucking_id', 'left');\n $this->db->join('sales_order as s_order', 's_order.id = delivery.fk_sales_order_id');\n $this->db->join('sales_agent as agent', 'agent.id = s_order.fk_sales_agent_id', 'left');\n $this->db->join('sales_customer as customer', 'customer.id = s_order.fk_sales_customer_id');\n $this->db->join('sales_delivery_detail as deliv_detail', 'deliv_detail.fk_sales_delivery_id = delivery.id');\n $this->db->group_by('delivery.id');\n if ($search_token)\n {\n $this->db->like($search_token['category'], $search_token['token'], 'both');\n }\n if (!empty($filter))\n {\n $this->db->where($filter);\n }\n $this->db->order_by('delivery.id', 'DESC');\n $data = $this->db->limit($limit, $offset)->get()->result_array();\n if (!$with_details)\n {\n return $data;\n }\n $deliveries = array();\n $delivery_ids = array();\n $order_ids = array();\n $customer_ids = array();\n for ($x = 0; $x < count($data); $x++)\n {\n $deliveries[] = $data[$x];\n $delivery_ids[] = $data[$x]['id'];\n $order_ids[] = $data[$x]['fk_sales_order_id'];\n }\n unset($data);\n\n $details = FALSE;\n if (!empty($delivery_ids))\n {\n //get delivery ids\n $this->db->select('deliv_detail.id, deliv_detail.fk_sales_delivery_id, deliv_detail.this_delivery, deliv_detail.delivered_units, deliv_detail.fk_sales_order_detail_id');\n $this->db->select('order_detail.discount, order_detail.product_quantity, order_detail.total_units, order_detail.unit_price, IFNULL(delivery.total_qty_delivered, 0) as total_qty_delivered, IFNULL(delivery.total_units_delivered, 0) as total_units_delivered', FALSE);\n $this->db->select('product.description, product.formulation_code, product.code');\n $this->db->select('unit.description as unit_description');\n $this->db->from('sales_delivery_detail as deliv_detail');\n $this->db->where_in('deliv_detail.fk_sales_delivery_id', $delivery_ids);\n $this->db->join('sales_order_detail as order_detail', 'order_detail.id = deliv_detail.fk_sales_order_detail_id');\n $this->db->join('inventory_product as product', 'product.id = order_detail.fk_inventory_product_id');\n $this->db->join('inventory_unit as unit', 'unit.id = product.fk_unit_id', 'left');\n $sub = $this->subquery->start_subquery('join', 'left', 'delivery.order_detail_id = order_detail.id');\n $sub->select('SUM(delivery_detail.this_delivery) as total_qty_delivered, SUM(delivery_detail.delivered_units) as total_units_delivered, delivery_detail.fk_sales_order_detail_id as order_detail_id', FALSE);\n $sub->from('sales_delivery as s_delivery');\n $sub->join('sales_order', 'sales_order.id = s_delivery.fk_sales_order_id');\n $sub->join('sales_delivery_detail as delivery_detail', 'delivery_detail.fk_sales_delivery_id = s_delivery.id');\n $sub->where(array('s_delivery.status' => M_Status::STATUS_DELIVERED));\n $sub->where_in('sales_order.id', $order_ids);\n $sub->group_by('delivery_detail.fk_sales_order_detail_id');\n $this->subquery->end_subquery('delivery');\n $this->db->group_by('deliv_detail.id');\n $details = $this->db->get()->result_array();\n }\n\n foreach ($deliveries as &$d)\n {\n $DELIVERY_ID = $d['id'];\n $formatted_details = array();\n for ($x = 0; $x < count($details); $x++)\n {\n if ($d['id'] === $details[$x]['fk_sales_delivery_id'])\n {\n $formatted_details['id'][] = $details[$x]['id'];\n $formatted_details['fk_sales_order_detail_id'][] = $details[$x]['fk_sales_order_detail_id'];\n $formatted_details['prod_descr'][] = $details[$x]['description'];\n $formatted_details['prod_code'][] = $details[$x]['code'];\n $formatted_details['prod_formu_code'][] = $details[$x]['formulation_code'];\n $formatted_details['product_description'][] = \"{$details[$x]['description']} ({$details[$x]['formulation_code']})\";\n $formatted_details['product_quantity'][] = $details[$x]['product_quantity'];\n $formatted_details['total_units'][] = $details[$x]['total_units'];\n $formatted_details['this_delivery'][] = $details[$x]['this_delivery'];\n $formatted_details['delivered_units'][] = $details[$x]['delivered_units'];\n $formatted_details['quantity_delivered'][] = $details[$x]['total_qty_delivered'];\n $formatted_details['units_delivered'][] = $details[$x]['total_units_delivered'];\n $formatted_details['unit_description'][] = $details[$x]['unit_description'];\n $formatted_details['unit_price'][] = $details[$x]['unit_price'];\n $formatted_details['discount'][] = $details[$x]['discount'];\n }\n }\n $d['details'] = $formatted_details;\n }\n\n return $deliveries;\n }", "function get ($id) {\n // PARAM $id : order ID\n\n $order = $this->fetch(\n \"SELECT * FROM `orders` WHERE `order_id`=?\", [$id]\n );\n $order['items'] = $this->fetch(\n \"SELECT * FROM `orders_items` LEFT JOIN `products` USING (`product_id`) WHERE `orders_items`.order_id=?\", \n [$id], \"product_id\"\n );\n return $order;\n }", "function generate_order($order,$mysqli){\r\n\r\n $orders = get_items_database($mysqli);\r\n\r\n \r\n $level = ($order->extension_attributes->shipping_assignments);\r\n foreach($level as $i){\r\n $address = $i->shipping->address;\r\n \r\n $adr = $address->street[0];\r\n $postal = $address->postcode;\r\n $city = $address->city;\r\n \r\n }\r\n\r\n \r\n foreach($order->items as $i){ \r\n foreach ($orders as $e){\r\n if ($e[\"code\"] == $i->sku){\r\n //print_r($e[\"code\"] .\" \". $i->sku);\r\n \r\n $ITid = $e[\"item_id\"];\r\n $ITname = $i->name;\r\n $ITcode = $i->sku;\r\n $qty = $i->qty_ordered;\r\n $cena = $i->price_incl_tax;\r\n \r\n \r\n } \r\n }\r\n }\r\n\r\n\r\n\r\n $data = array(\r\n \"OrderId\" => $order->increment_id,\r\n \"ReceivedIssued\" => \"P\",\r\n \"Year\" => 0,\r\n \"Number\" => null,\r\n \"Date\" => date(\"Y-m-d H:i:s\"),\r\n \"Customer\" => array(\r\n \"ID\" => 8451445,\r\n \"Name\" => null,\r\n \"ResourceUrl\" => null\r\n ),\r\n \"CustomerName\" => $order->customer_firstname.\" \". $order->customer_lastname,\r\n \"CustomerAddress\" => $adr,\r\n \"CustomerPostalCode\" => $postal,\r\n \"CustomerCity\" => $city,\r\n\r\n \"CustomerCountry\" => array(\r\n \"ID\" => 192,\r\n \"Name\" => null,\r\n \"ResourceUrl\" => null\r\n ),\r\n \"CustomerCountryName\" => null,\r\n \"Analytic\" => null,\r\n \"DueDate\" => null,\r\n \"Reference\" => $order->entity_id,\r\n \"Currency\" => array(\r\n \"ID\" => 7,\r\n \"Name\" => null,\r\n \"ResourceUrl\" => null\r\n ),\r\n \"Notes\" => null,\r\n \"Document\" => null,\r\n \"DateConfirmed\" => null,\r\n \"DateCompleted\" => null,\r\n \"DateCanceled\" => null,\r\n \"Status\" => null,\r\n \"DescriptionAbove\" => null,\r\n \"DescriptionBelow\" => null,\r\n \"ReportTemplate\" => array(\r\n \"ID\" => null,\r\n \"Name\" => null,\r\n \"ResourceUrl\" => null\r\n ),\r\n\r\n \"OrderRows\" => [array(\r\n \"OrderRowId\" => null,\r\n \"Order\" => null,\r\n \"Item\" => array(\r\n \"ID\" => $ITid,\r\n \"Name\" => null,\r\n \"ResourceUrl\" => null,\r\n ),\r\n \"ItemName\" => $ITname,\r\n \"ItemCode\" => $ITcode,\r\n \"Description\" => null,\r\n \"Quantity\" => $qty,\r\n \"Price\" => $cena,\r\n \"UnitOfMeasurement\" => \"kos\",\r\n \"RecordDtModified\" => \"2020-01-07T12:20:00+02:00\",\r\n \"RowVersion\" => null,\r\n \"_links\" => null,\r\n ) ],\r\n\r\n \"RecordDtModified\" => date(\"Y-m-d H:i:s\"),\r\n \"RowVersion\" => null,\r\n \"_links\" => null\r\n\r\n );\r\n \r\n return $data;\r\n}", "function getOverallOrderPrice(){\n\t\t$t=0;\n\t\t$a = Order::where('payment', 'verified')->get();\n\t\tforeach($a as $n){\n\t\t$dur= $n->qty;\n\t\t\n\t\t$r = intVal($n->qty)*intVal($n->price);\n\t\t$t = $t + $r;\n\t\t}\n\t\treturn $t;\n\t\t}", "public function getOrderProductData($sellerId,$orderId,$productId){\r\n \t/**\r\n \t * Load commission model\r\n \t */\r\n $productData = Mage::getModel('marketplace/commission')->getCollection()\r\n ->addFieldToFilter('seller_id',$sellerId)\r\n ->addFieldToFilter('order_id',$orderId) \r\n ->addFieldToFilter('product_id',$productId)->getFirstItem();\r\n /**\r\n * Return product data\r\n */\r\n return $productData; \r\n }", "public function find_balanced_items($order_id) {\n if (empty($order_id)) {\n return false;\n }\n $balanced_order_key = \"balanced_cart_items_\" . $order_id;\n $cache = Cache::read($balanced_order_key);\n if (empty($cache)) {\n $carts = $this->find('all', array(\n 'conditions' => array('order_id' => $order_id, 'status' => ORDER_STATUS_PAID),\n 'fields' => array('id','num', 'product_id', 'name', 'creator', 'coverimg','tuan_buy_id'),\n ));\n $jsonStr = json_encode($carts);\n Cache::write($balanced_order_key, $jsonStr);\n return $carts;\n } else {\n return json_decode($cache, true);\n }\n }", "function fetchDataForBackorderItem($id) {\n $data = $this->OrderItem->find('first', array(\n 'conditions' => array('OrderItem.id' => $id),\n 'contain' => array(\n 'Item' => array(\n 'fields' => array(\n 'available_qty'\n )\n ),\n 'Order' => array(\n 'Shipment',\n 'UserCustomer' => array(\n 'Customer' => array(\n 'fields' => array(\n 'id',\n 'allow_backorder'\n )\n )\n ),\n 'Backorder' => array(\n 'OrderItem'\n )\n )\n )));\n // if backorders aren't allowed for the customer, set data to 'disallowed'\n if (!$data['Order']['UserCustomer']['Customer']['allow_backorder']) {\n $data = 'disallowed';\n }\n return $data;\n }", "function getAmount($idItem){\n global $db;\n \n $stmt=$db->prepare(\"SELECT amount FROM inventory WHERE idItem = :idItem\");\n \n $binds= array(\n \":idItem\"=> $idItem\n );\n \n $results=[];\n if($stmt->execute($binds) && $stmt->rowCount()>0){\n $results = $stmt->fetch(PDO::FETCH_ASSOC);\n return $results;\n }\n else{\n return false;\n }\n \n }", "public function getPrice() {\n return $this->item->getPrice();\n }", "public function getAllDeliveriesExpired() //get delivery more than 3 days not received by toko\n {\n // join sma_sales on sma_deliveries.sale_id = sma_sales.id and sma_sales.client_id = \"aksestoko\"\n // where DATE(sma_deliveries.date + INTERVAL 3 DAY) < current_date\n $this->db->select('sma_deliveries.id as do_id, sma_deliveries.do_reference_no as do_ref, sma_purchases.id as purchase_id');\n $this->db->join('sma_sales', 'sma_deliveries.sale_id = sma_sales.id and sma_sales.client_id = \"aksestoko\"');\n $this->db->join('sma_purchases', 'sma_purchases.cf1 = sma_sales.reference_no and sma_purchases.supplier_id = sma_sales.biller_id');\n $this->db->where('DATE(sma_deliveries.date + INTERVAL 3 DAY) < NOW() AND sma_deliveries.date > \"2019-08-01\" AND sma_deliveries.receive_status is null');\n $q = $this->db->get('sma_deliveries');\n if ($q->num_rows() > 0) {\n return $q->result();\n }\n return [];\n }", "function ppom_get_field_option_price_by_id( $option, $product, $ppom_meta_ids ) {\n\t\n\t$data_name = isset($option['data_name']) ? $option['data_name'] : '';\n\t$option_id = isset($option['option_id']) ? $option['option_id'] : '';\n\t\n\t// soon we will remove this product param\n\t$product_id = null;\n\t$field_meta = ppom_get_field_meta_by_dataname($product_id , $data_name, $ppom_meta_ids );\n\t\n\tif( empty($field_meta) ) return 0;\n\t\n\t$field_type = isset($field_meta['type']) ? $field_meta['type'] : '';\n\t\n\tif( $field_type == 'bulkquantity' || $field_type == 'cropper' ) return 0;\n\t\n\t$option_price = 0;\n\t\n\tswitch( $field_type ) {\n\t\t\n\t\tcase 'image':\n\t\t\t\n\t\t\tif( isset( $field_meta['images']) ) {\n\t\t\t\tforeach( $field_meta['images'] as $option ) {\n\t\t\t\t\n\t\t\t\t\t$image_id\t= $field_meta['data_name'].'-'.$option['id'];\n\t\t\t\t\tif( $image_id == $option_id && isset($option['price']) && $option['price'] != '' ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(strpos($option['price'],'%') !== false){\n\t\t\t\t\t\t\t\t$option_price = ppom_get_amount_after_percentage($product->get_price(), $option['price']);\n\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\t// For currency switcher\n\t\t\t\t\t\t\t$option_price = apply_filters('ppom_option_price', $option['price']);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\tbreak;\n\t\t\n\t\tdefault:\n\t\t\t\n\t\t\tif( isset( $field_meta['options']) ) {\n\t\t\t\tforeach( $field_meta['options'] as $option ) {\n\t\t\t\n\t\t\t\t\tif( $option['id'] == $option_id && isset($option['price']) && $option['price'] != '' ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(strpos($option['price'],'%') !== false){\n\t\t\t\t\t\t\t\t$option_price = ppom_get_amount_after_percentage($product->get_price(), $option['price']);\n\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\t// For currency switcher\n\t\t\t\t\t\t\t$option_price = apply_filters('ppom_option_price', $option['price']);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\tbreak;\n\t}\n\t\n\t\n\treturn apply_filters(\"ppom_field_option_price_by_id\", wc_format_decimal($option_price), $field_meta, $option_id, $product);\n}", "public function actionGetProductPrice($id=null)\n {\n $userData = User::find()->andFilterWhere(['u_id' => $id])->andWhere(['IS NOT', 'u_mws_seller_id', null])->all();\n\n foreach ($userData as $user) {\n \\Yii::$app->data->getMwsDetails($user->u_mws_seller_id, $user->u_mws_auth_token);\n $models = FbaAllListingData::find()->andWhere(['created_by' => $user->u_id])->all(); //->andWhere(['status' => 'Active'])\n\n foreach ($models as $model) {\n if ($model->seller_sku) {\n $productDetails = \\Yii::$app->api->getProductCompetitivePrice($model->seller_sku);\n if ($productDetails) {\n $model->buybox_price = $productDetails;\n if ($model->save(false)) {\n echo $model->asin1 . \" is Updated.\";\n }\n }\n }\n sleep(3);\n }\n }\n }", "public function get_packing_list_line($pl_ids, $order = 'DESC')\n {\n if (!$pl_ids)\n {\n return;\n }\n $this->db->select('dtl.fk_sales_delivery_id as pl_id, dtl.this_delivery, (order_dtl.unit_price - order_dtl.discount) AS unit_price, p.description, p.code, '\n . '((order_dtl.unit_price - order_dtl.discount) * dtl.this_delivery) AS amount', FALSE);\n $this->db->from('sales_delivery_detail AS dtl');\n $this->db->where_in('dtl.fk_sales_delivery_id', $pl_ids);\n $this->db->where('dtl.this_delivery >', 0);\n $this->db->join('sales_order_detail AS order_dtl', 'order_dtl.id = dtl.fk_sales_order_detail_id');\n $this->db->join('inventory_product AS p', 'p.id = order_dtl.fk_inventory_product_id');\n $this->db->order_by('dtl.fk_sales_delivery_id', $order);\n return $this->db->get()->result_array();\n }", "function daylist_get() {\n $condition = \"\";\n $fromdate = $this->get('fromdate');\n $todate = $this->get('todate');\n $status = $this->get('status');\n $store = $this->get('store');\n $total_cost = 0.00;\n\n if ($status != \"\") {\n if ($status == \"Delivered\") {\n $condition .= \" and o.status='Delivered' and o.delivery_accept='1' \"; // and delivery_recieved='1'\n }else if ($status == \"Rejected\") {\n $condition .= \" and o.status='Delivered' and o.delivery_reject='1'\";\n }else{\n $condition .= \" and o.status='$status'\"; \n }\n \n };\n \n\n if ($store != \"\")\n $condition .= \" and o.orderedby='$store'\";\n if ($fromdate != \"\" && $todate == \"\") {\n $fromdate = date(\"Y-m-d\", strtotime($fromdate));\n if($status == \"Delivered\") {\n $condition .= \" and o.`deliveredon` between '$fromdate 00:00:00' and '$fromdate 23:59:59'\";\n }else{\n $condition .= \" and o.`orderedon` between '$fromdate 00:00:00' and '$fromdate 23:59:59'\";\n }\n \n } else if ($fromdate != \"\" && $todate != \"\") {\n $fromdate = date(\"Y-m-d\", strtotime($fromdate));\n $todate = date(\"Y-m-d\", strtotime($todate));\n if($status == \"Delivered\") {\n $condition .= \" and o.`deliveredon` between '$fromdate 00:00:00' and '$todate 23:59:59'\";\n }else{\n $condition .= \" and o.`orderedon` between '$fromdate 00:00:00' and '$todate 23:59:59'\";\n }\n } else if ($fromdate == \"\" && $todate == \"\") {\n\n $fromdate = date(\"Y-m-d\");\n if($status == \"Delivered\") {\n $condition .= \" and o.`deliveredon` between '$fromdate 00:00:00' and '$fromdate 23:59:59'\";\n }else{\n $condition .= \" and o.`orderedon` between '$fromdate 00:00:00' and '$fromdate 23:59:59'\";\n }\n \n }\n // echo \"select o.id,o.order_id,o.`orderedon`,s.name as store,o.order_value from orders o,stores s where o.orderedby = s.id $condition\";\n $result_set = $this->model_all->getTableDataFromQuery(\"select o.id,o.order_id,o.`orderedon`,s.name as store,o.order_value from orders o,stores s where o.orderedby = s.id $condition\");\n //echo $this->db->last_query();\n if ($result_set->num_rows() > 0) {\n $result[\"status\"] = 1;\n $result[\"message\"] = \"Records Found\";\n $result[\"total_records\"] = $result_set->num_rows();\n foreach ($result_set->result_array() as $row) {\n $row['orderedon'] = date(\"d-m-Y\", strtotime($row['orderedon']));\n $total_cost = $total_cost + $row['order_value'];\n $result[\"records\"][] = $row;\n }\n $result[\"total_cost\"] = \"Rs \" . $total_cost . \" /-\";\n\n $this->response($result, 200);\n exit;\n } else {\n $result[\"status\"] = 0;\n $result[\"message\"] = \"No records Found\";\n $this->response($result, 200);\n exit;\n }\n }", "public function lstOrderDetail(){\n\t\t$Sql = \"SELECT \n\t\t\t\t\torder_detail_id,\n\t\t\t\t\torder_id,\n\t\t\t\t\tcustomer_id,\n\t\t\t\t\textra_feature_id,\n\t\t\t\t\tfeature_name,\n\t\t\t\t\tquantity,\n\t\t\t\t\tprice\n\t\t\t\tFROM\n\t\t\t\t\trs_tbl_order_details\n\t\t\t\tWHERE\n\t\t\t\t\t1=1\";\n\t\t\n\t\tif($this->isPropertySet(\"order_detail_id\", \"V\")){\n\t\t\t$Sql .= \" AND order_detail_id='\" . $this->getProperty(\"order_detail_id\") . \"'\";\n\t\t}\n\t\tif($this->isPropertySet(\"order_id\", \"V\")){\n\t\t\t$Sql .= \" AND order_id='\" . $this->getProperty(\"order_id\") . \"'\";\n\t\t}\n\t\tif($this->isPropertySet(\"customer_id\", \"V\")){\n\t\t\t$Sql .= \" AND customer_id=\" . $this->getProperty(\"customer_id\");\n\t\t}\n\t\tif($this->isPropertySet(\"extra_feature_id\", \"V\")){\n\t\t\t$Sql .= \" AND extra_feature_id='\" . $this->getProperty(\"extra_feature_id\") . \"'\";\n\t\t}\n\t\tif($this->isPropertySet(\"ORDERBY\", \"V\")){\n\t\t\t$Sql .= \" ORDER BY \" . $this->getProperty(\"ORDERBY\");\n\t\t}\n\t\t\n\t\tif($this->isPropertySet(\"limit\", \"V\"))\n\t\t\t$Sql .= $this->appendLimit($this->getProperty(\"limit\"));\n\t\treturn $this->dbQuery($Sql);\n\t}", "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}", "abstract public function getPrice();", "public function getOrderDetails($ordid, $isDirect = false, $isCron = false)\n {\n // get order details based on query\n $sSql = \"SELECT so.id as ordid, so.ordernumber as ordernumber, so.ordertime as ordertime, so.paymentID as paymentid, so.dispatchID as dispatchid, sob.salutation as sal, sob.company, sob.department, CONCAT(sob.firstname, ' ', sob.lastname) as fullname, CONCAT(sob.street, ' ', sob.streetnumber) as streetinfo, sob.zipcode as zip, sob.city as city, scc.countryiso as country, su.email as email, spd.comment as shipping, scl.locale as language\";\n $sSql .= \" FROM s_order so\";\n $sSql .= \" JOIN s_order_shippingaddress sob ON so.id = sob.orderID\"; \n $sSql .= \" JOIN s_core_countries scc ON scc.id = sob.countryID\";\n $sSql .= \" JOIN s_user su ON su.id = so.userID\";\n $sSql .= \" JOIN s_premium_dispatch spd ON so.dispatchID = spd.id\";\n $sSql .= \" JOIN s_core_locales scl ON so.language = scl.id\";\n \n // cron?\n if ($isCron) {\n $sSql .= \" JOIN asign_orders aso ON so.id = aso.ordid\";\n }\n\n // if directly from Thank you page \n if ($isDirect) {\n $sSql .= \" WHERE so.ordernumber = '\" . $ordid . \"'\";\n } else {\n $sSql .= \" WHERE so.id = '\" . $ordid . \"'\";\n } \n\n // cron?\n if ($isCron) { \n $sSql .= \" AND aso.ycReference = 0\";\n }\n\n $aOrders = Shopware()->Db()->fetchRow($sSql);\n $orderId = $aOrders['ordid'];\n \n // get order article details\n $aOrders['orderarticles'] = Shopware()->Db()->fetchAll(\"SELECT `articleID`, `articleordernumber`, `name`, `quantity`, `ean` FROM `s_order_details` WHERE `orderID` = '\" . $orderId . \"' AND `articleID` <> 0\");\n\n return $aOrders;\n }", "public function testGetOrderDetailWithInvalidId(){\n \t \n \tPayU::$apiLogin = PayUTestUtil::API_LOGIN;\n \tPayU::$apiKey = PayUTestUtil::API_KEY;\n \t \n \tEnvironment::setReportsCustomUrl(PayUTestUtil::REPORTS_CUSTOM_URL);\n \n \t$parameters = array(\n \t\t\tPayUParameters::ORDER_ID => '123111123',\n \t);\n \t \n \t$response = PayUReports::getOrderDetail($parameters);\n }", "function getOverallPrice(){\n\t\t$t=0;\n\t\t$a = Item::all();\n\t\tforeach($a as $n){\n\t\t$dur= $n->qty;\n\t\t$sl =Order::where('status', 'delivered')->count();\n\t\t$r=intVal(intVal($dur)-intVal($sl))*intVal($n->price);\n\t\t$t = $t + $r;\n\t\t}\n\t\treturn $t;\n\t\t}" ]
[ "0.6099965", "0.6099758", "0.6071234", "0.5916364", "0.5829668", "0.5829668", "0.58047014", "0.57982755", "0.5745294", "0.57420945", "0.5741027", "0.5671254", "0.56348634", "0.5619649", "0.5583898", "0.5534118", "0.55321693", "0.55109566", "0.5497972", "0.54961646", "0.54862493", "0.545823", "0.54562676", "0.5445076", "0.54380584", "0.5435237", "0.5432091", "0.54312706", "0.5391495", "0.5374656", "0.53555596", "0.535084", "0.53451836", "0.5341873", "0.53417856", "0.5341732", "0.5333984", "0.5308409", "0.5303503", "0.5301479", "0.5300222", "0.5286673", "0.5280434", "0.5279219", "0.5273978", "0.52501404", "0.52498734", "0.5240457", "0.5236931", "0.5236453", "0.52150923", "0.5212041", "0.52065456", "0.52030504", "0.52029085", "0.5192108", "0.5182347", "0.5176589", "0.51628107", "0.5155273", "0.51443535", "0.5133941", "0.5131", "0.5130321", "0.5130024", "0.5114705", "0.5104953", "0.5096092", "0.50932306", "0.5091316", "0.5090085", "0.50897527", "0.50833774", "0.5076816", "0.50758946", "0.5072782", "0.50612634", "0.50477386", "0.5046554", "0.50455827", "0.5042161", "0.50416386", "0.503986", "0.50393355", "0.50391924", "0.50362206", "0.5032618", "0.50280255", "0.5026591", "0.50262547", "0.5017154", "0.5012915", "0.5011654", "0.50046915", "0.5004196", "0.50038886", "0.50033975", "0.49875593", "0.49863386", "0.49808684" ]
0.7244373
0
Increase Price Item per Item on Delivery Order Detail
public function SumItemPriceByDeliveryOrderID($delivery_order_id) { $price = $this->deliveryOrderDetail::where('warehouse_out_id', $delivery_order_id)->pluck('sub_total')->toArray(); $sum_price = array_sum($price); return $sum_price; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function calculateOrderAmount()\n {\n if ($this->getOffer() instanceof Offer) {\n //recalculates the new amount\n $this->getOffer()->calculateInvoiceAmount();\n Shopware()->Models()->persist($this->getOffer());\n }\n }", "function setOrderPaid($object) { \n /* you can itentify the item with $object->Item->ShopId */ \n}", "function __lineItemTotal($qty, $price, $rate) {\n\n\n\n\n\n\n\n// if ($curency_id == 2)\n// $currency = 1;\n//\n// if ($curency_id == 1)\n// $currency = 4.17;\n//\n// if ($curency_id == 3)\n// $currency = 4.50;\n\n\n\n $line_total = $qty * $price * $rate;\n\n //$line_total = $line_total + (($line_total * $taxRate) / 100);\n\n\n\n return $line_total;\n }", "function ciniki_sapos_invoiceUpdatePrices($ciniki, $tnid, $invoice_id, $args) {\n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQuery');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashIDQuery');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectUpdate');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'sapos', 'private', 'itemCalcAmount');\n\n //\n // Get the items from the invoice that have an object defined\n //\n $strsql = \"SELECT id, object, object_id, price_id, quantity, \"\n . \"unit_amount, unit_discount_amount, unit_discount_percentage, unit_preorder_amount \"\n . \"FROM ciniki_sapos_invoice_items \"\n . \"WHERE invoice_id = '\" . ciniki_core_dbQuote($ciniki, $invoice_id) . \"' \"\n . \"AND tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.sapos', 'item');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['rows']) ) {\n // No items to update\n return array('stat'=>'ok');\n }\n $items = $rc['rows'];\n\n //\n // Update the item prices\n //\n foreach($items as $item) {\n //\n // Get the new price for the object\n //\n if( $item['object'] != '' && $item['object_id'] != '' ) {\n list($pkg,$mod,$obj) = explode('.', $item['object']);\n $rc = ciniki_core_loadMethod($ciniki, $pkg, $mod, 'sapos', 'itemLookup');\n if( $rc['stat'] == 'ok' ) {\n $fn = $rc['function_call'];\n $rc = $fn($ciniki, $tnid, array(\n 'object'=>$item['object'],\n 'object_id'=>$item['object_id'],\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( isset($rc['item']) ) {\n if( $rc['item']['price_id'] != $item['price_id'] ) {\n $update_args['price_id'] = $rc['item']['price_id'];\n }\n if( $rc['item']['unit_amount'] != $item['unit_amount'] ) {\n $update_args['unit_amount'] = $rc['item']['unit_amount'];\n }\n if( $rc['item']['unit_discount_amount'] > 0\n && $rc['item']['unit_discount_amount'] != $item['unit_discount_amount'] ) {\n $update_args['unit_discount_amount'] = $rc['item']['unit_discount_amount'];\n }\n if( $rc['item']['unit_discount_percentage'] > 0 \n && $rc['item']['unit_discount_percentage'] != $item['unit_discount_percentage'] ) {\n $update_args['unit_discount_percentage'] = $rc['item']['unit_discount_percentage'];\n }\n if( $rc['item']['unit_preorder_amount'] > 0 \n && $rc['item']['unit_preorder_amount'] != $item['unit_preorder_amount'] ) {\n $update_args['unit_preorder_amount'] = $rc['item']['unit_preorder_amount'];\n }\n }\n }\n }\n\n //\n // Calculate new item totals\n //\n $rc = ciniki_sapos_itemCalcAmount($ciniki, array(\n 'quantity'=>$item['quantity'],\n 'unit_amount'=>(isset($update_args['unit_amount'])?$update_args['unit_amount']:$item['unit_amount']),\n 'unit_discount_amount'=>(isset($update_args['unit_discount_amount'])?$update_args['unit_discount_amount']:$item['unit_discount_amount']),\n 'unit_discount_percentage'=>(isset($update_args['unit_discount_percentage'])?$update_args['unit_discount_percentage']:$item['unit_discount_percentage']),\n 'unit_preorder_amount'=>(isset($update_args['unit_preorder_amount'])?$update_args['unit_preorder_amount']:$item['unit_preorder_amount']),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $update_args['subtotal_amount'] = $rc['subtotal'];\n $update_args['discount_amount'] = $rc['discount'];\n $update_args['total_amount'] = $rc['total'];\n\n //\n // Update the item \n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectUpdate');\n $rc = ciniki_core_objectUpdate($ciniki, $tnid, 'ciniki.sapos.invoice_item', \n $item['id'], $update_args, 0x04);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.sapos');\n return $rc;\n }\n }\n\n\n\n return array('stat'=>'ok');\n}", "private function makeItemPurchase() : void\n {\n $this->item->available = $this->item->available - 1;\n $this->coinService->setCoinCount(\n $this->coinService->getCurrenCoinCount() - $this->item->cost\n );\n $this->item->save();\n }", "public function calItem($quantity,$item_price){\n $cal_price=$quantity*$item_price;\n return $cal_price;\n }", "public function deliveryPriceDhaka()\n {\n }", "function setItem_price($price){\n $this->item_price = $price;\n }", "public function testOrderItem() {\n /** @var \\Drupal\\commerce_order\\Entity\\OrderItemInterface $order_item */\n $order_item = OrderItem::create([\n 'type' => 'test',\n ]);\n $order_item->save();\n\n $order_item->setTitle('My order item');\n $this->assertEquals('My order item', $order_item->getTitle());\n\n $this->assertEquals(1, $order_item->getQuantity());\n $order_item->setQuantity('2');\n $this->assertEquals(2, $order_item->getQuantity());\n\n $this->assertEquals(NULL, $order_item->getUnitPrice());\n $this->assertFalse($order_item->isUnitPriceOverridden());\n $unit_price = new Price('9.99', 'USD');\n $order_item->setUnitPrice($unit_price, TRUE);\n $this->assertEquals($unit_price, $order_item->getUnitPrice());\n $this->assertTrue($order_item->isUnitPriceOverridden());\n\n $adjustments = [];\n $adjustments[] = new Adjustment([\n 'type' => 'custom',\n 'label' => '10% off',\n 'amount' => new Price('-1.00', 'USD'),\n 'percentage' => '0.1',\n ]);\n $adjustments[] = new Adjustment([\n 'type' => 'fee',\n 'label' => 'Random fee',\n 'amount' => new Price('2.00', 'USD'),\n ]);\n $order_item->addAdjustment($adjustments[0]);\n $order_item->addAdjustment($adjustments[1]);\n $adjustments = $order_item->getAdjustments();\n $this->assertEquals($adjustments, $order_item->getAdjustments());\n $this->assertEquals($adjustments, $order_item->getAdjustments(['custom', 'fee']));\n $this->assertEquals([$adjustments[0]], $order_item->getAdjustments(['custom']));\n $this->assertEquals([$adjustments[1]], $order_item->getAdjustments(['fee']));\n $order_item->removeAdjustment($adjustments[0]);\n $this->assertEquals([$adjustments[1]], $order_item->getAdjustments());\n $this->assertEquals(new Price('21.98', 'USD'), $order_item->getAdjustedTotalPrice());\n $this->assertEquals(new Price('10.99', 'USD'), $order_item->getAdjustedUnitPrice());\n $order_item->setAdjustments($adjustments);\n $this->assertEquals($adjustments, $order_item->getAdjustments());\n $this->assertEquals(new Price('9.99', 'USD'), $order_item->getUnitPrice());\n $this->assertEquals(new Price('19.98', 'USD'), $order_item->getTotalPrice());\n $this->assertEquals(new Price('20.98', 'USD'), $order_item->getAdjustedTotalPrice());\n $this->assertEquals(new Price('18.98', 'USD'), $order_item->getAdjustedTotalPrice(['custom']));\n $this->assertEquals(new Price('21.98', 'USD'), $order_item->getAdjustedTotalPrice(['fee']));\n // The adjusted unit prices are the adjusted total prices divided by 2.\n $this->assertEquals(new Price('10.49', 'USD'), $order_item->getAdjustedUnitPrice());\n $this->assertEquals(new Price('9.49', 'USD'), $order_item->getAdjustedUnitPrice(['custom']));\n $this->assertEquals(new Price('10.99', 'USD'), $order_item->getAdjustedUnitPrice(['fee']));\n\n $this->assertEquals('default', $order_item->getData('test', 'default'));\n $order_item->setData('test', 'value');\n $this->assertEquals('value', $order_item->getData('test', 'default'));\n $order_item->unsetData('test');\n $this->assertNull($order_item->getData('test'));\n $this->assertEquals('default', $order_item->getData('test', 'default'));\n\n $order_item->setCreatedTime(635879700);\n $this->assertEquals(635879700, $order_item->getCreatedTime());\n\n $this->assertFalse($order_item->isLocked());\n $order_item->lock();\n $this->assertTrue($order_item->isLocked());\n $order_item->unlock();\n $this->assertFalse($order_item->isLocked());\n }", "public function apply(OrderItem $item)\n {\n $product = $item->model;\n $order = $item->order;\n\n $originalPrice = $product->getPrice($order->currency, $item->options);\n\n $discount = 0;\n if ($this->type == self::TYPE_FIXED) {\n $discount = $this->discount;\n } elseif ($this->type == self::TYPE_PERCENTAGE) {\n $discount = ($originalPrice / 100) * $this->discount;\n }\n $item->update([\n 'title' => $product->getTitle(),\n 'price' => $originalPrice,\n 'discount' => $discount,\n ]);\n }", "public function calculatePrices(): void\n {\n $orders = ServiceContainer::orders();\n $pizzaPrice = $orders->calculatePizzaPrice($this->items);\n $deliveryPrice = $orders->calculateDeliveryPrice($pizzaPrice, $this->outside, $this->currency);\n $this->delivery_price = $deliveryPrice;\n $this->total_price = $pizzaPrice + $deliveryPrice;\n }", "public function updateInvoiceDetail($pid, $iid, $qty, $selling_price, $total)\n {\n }", "function fix_order_amount_item_total( $price, $order, $item, $inc_tax = false, $round = true ) {\n $qty = ( ! empty( $item[ 'qty' ] ) && $item[ 'qty' ] != 0 ) ? $item[ 'qty'] : 1;\n if( $inc_tax ) {\n $price = ( $item[ 'line_total' ] + $item[ 'line_tax' ] ) / $qty;\n } else {\n $price = $item[ 'line_total' ] / $qty;\n }\n $price = $round ? round( $price, 2 ) : $price;\n return $price;\n}", "public function paid()\n {\n $this->paidAmount = $this->price;\n }", "public function item_setprice($item)\n {\n if ($item['product_type'] != 2 || $item['product_payment'] != 'prepay') return;\n\n $db = db(config('db'));\n\n if ($_POST)\n {\n $db -> beginTrans();\n\n switch ($item['objtype'])\n {\n case 'room':\n $data = $this -> _format_room_price($item);\n\n // close old price\n $where = \"`supply`='EBK' AND `supplyid`=:sup AND `payment`=3 AND `hotel`=:hotel AND `room`=:room AND `date`>=:start AND `date`<=:end\";\n $condition = array(':sup'=>$item['pid'], ':hotel'=>$item['objpid'], ':room'=>$item['id'], ':start'=>$_POST['start'], ':end'=>$_POST['end']);\n $rs = $db -> prepare(\"UPDATE `ptc_hotel_price_date` SET `close`=1, `price`=0 WHERE {$where}\") -> execute($condition);\n if ($rs === false)\n json_return(null, 6, '保存失败,请重试');\n\n if ($data)\n {\n $data = array_values($data);\n list($column, $sql, $value) = array_values(insert_array($data));\n\n $_columns = update_column(array_keys($data[0]));\n $rs = $db -> prepare(\"INSERT INTO `ptc_hotel_price_date` {$column} VALUES {$sql} ON DUPLICATE KEY UPDATE {$_columns};\") -> execute($value); //var_dump($rs); exit;\n if (false == $rs)\n {\n $db -> rollback();\n json_return(null, 7, '数据保存失败,请重试~');\n }\n }\n break;\n\n case 'auto':\n $data = $this -> _format_auto_price($item);\n\n // close old price\n $where = \"`auto`=:auto AND `date`>=:start AND `date`<=:end\";\n $condition = array(':auto'=>$item['objpid'], ':start'=>$_POST['start'], ':end'=>$_POST['end']);\n $rs = $db -> prepare(\"UPDATE `ptc_auto_price_date` SET `close`=1, `price`=0 WHERE {$where}\") -> execute($condition);\n if ($rs === false)\n json_return(null, 6, '保存失败,请重试');\n\n if ($data)\n {\n $data = array_values($data);\n list($column, $sql, $value) = array_values(insert_array($data));\n\n $_columns = update_column(array_keys($data[0]));\n $rs = $db -> prepare(\"INSERT INTO `ptc_auto_price_date` {$column} VALUES {$sql} ON DUPLICATE KEY UPDATE {$_columns};\") -> execute($value); //var_dump($rs); exit;\n if (false == $rs)\n {\n $db -> rollback();\n json_return(null, 7, '数据保存失败,请重试~');\n }\n }\n break;\n }\n\n if (false === $db -> commit())\n json_return(null, 9, '数据保存失败,请重试~');\n else\n json_return($rs);\n }\n\n $month = !empty($_GET['month']) ? $_GET['month'] : date('Y-m');\n\n $first = strtotime($month.'-1');\n $first_day = date('N', $first);\n\n $start = $first_day == 7 ? $first : $first - $first_day * 86400;\n $end = $start + 41 * 86400;\n\n switch ($item['objtype'])\n {\n case 'room':\n $_date = $db -> prepare(\"SELECT `key`,`date`,`price`,`breakfast`,`allot`,`sold`,`filled`,`standby`,`close` FROM `ptc_hotel_price_date` WHERE `supply`='EBK' AND `supplyid`=:sup AND `hotel`=:hotel AND `room`=:room AND `date`>=:start AND `date`<=:end AND `close`=0\")\n -> execute(array(':sup'=>$item['pid'], ':hotel'=>$item['objpid'], ':room'=>$item['id'], ':start'=>$start, ':end'=>$end));\n break;\n\n case 'auto':\n $_date = $db -> prepare(\"SELECT `key`,`date`,`price`,`child`,`baby`,`allot`,`sold`,`filled`,`close` FROM `ptc_auto_price_date` WHERE `auto`=:auto AND `date`>=:start AND `date`<=:end AND `close`=0\")\n -> execute(array(':auto'=>$item['objpid'], ':start'=>$start, ':end'=>$end));\n break;\n }\n\n $date = array();\n foreach ($_date as $v)\n {\n $date[$v['date']] = $v;\n }\n unset($_date);\n\n include dirname(__FILE__).'/product/price_'.$item['objtype'].'.tpl.php';\n }", "protected function displayRecalculateItemPrice(\\XLite\\Model\\OrderItem $item)\n {\n \\XLite\\Core\\Event::recalculateItem($this->assembleRecalculateItemEvent($item));\n }", "function builder_price() {\n\n $this->Item->recursive = 0;\n\n if( !isset($this->params['named']['limit']) ) {\n $this->paginate['limit'] = REPORT_LIMIT;\n $this->paginate['maxLimit'] = REPORT_LIMIT;\n }\n elseif( isset($this->params['named']['limit']) && $this->params['named']['limit'] != 'All' ) {\n $this->paginate['limit'] = isset($this->params['named']['limit']) ? $this->params['named']['limit'] : REPORT_LIMIT;\n $this->paginate['maxLimit'] = isset($this->params['named']['limit']) ? $this->params['named']['limit'] : REPORT_LIMIT;\n }\n else {\n $this->paginate['limit'] = 0;\n $this->paginate['maxLimit'] = 0;\n }\n $this->Prg->commonProcess();\n $this->paginate['conditions'] = $this->Item->parseCriteria($this->passedArgs);\n $this->paginate['conditions']['Item.base_item']['base_item'] = 0;\n\n $items = $this->paginate();\n $paginate = true;\n $legend = \"Items\";\n\n $this->set(compact('items', 'paginate', 'legend'));\n }", "public function updateQuantity()\n {\n $this->load('itemAddressFiles');\n $quantity = 0;\n foreach ($this->itemAddressFiles as $addressFileLink) {\n $quantity += $addressFileLink->count;\n }\n $quantity += $this->mail_to_me;\n $this->quantity = $quantity;\n $this->save();\n $this->_calculateTotal();\n }", "protected function calculatePrices()\n {\n }", "public function onBeforeWrite() {\n parent::onBeforeWrite();\n\n // See if this order was just marked paid, if so reduce quantities for\n // items.\n if($this->isChanged(\"Status\") && $this->Status == \"paid\") {\n foreach($this->Items() as $item) {\n $product = $item->MatchProduct;\n\n if($product->ID && $product->Quantity) {\n $new_qty = $product->Quantity - $item->Quantity;\n $product->Quantity = ($new_qty > 0) ? $new_qty : 0;\n $product->write();\n }\n }\n }\n }", "function wv_commission_get_order_item_record($oid) {\n\n global $wpdb;\n $sql_order_itemid = \"SELECT DISTINCT WOIM.order_item_id FROM `\" . $wpdb->prefix . \"woocommerce_order_items` AS WOI INNER JOIN `\" . $wpdb->prefix . \"woocommerce_order_itemmeta` AS WOIM ON WOI.order_item_id = WOIM.order_item_id WHERE WOI.order_item_type = 'line_item' AND WOI.order_id =$oid\";\n $arr_order_itemid = $wpdb->get_results($sql_order_itemid);\n\n if (count($arr_order_itemid) > 0) {\n $i = 1;\n foreach ($arr_order_itemid as $item) {\n\n $order_item_id = $item->order_item_id;\n $productid = $this->wv_commission_get_woo_orderitem_metavalue($order_item_id, '_product_id');\n //output HTML here.\n ?>\n <tr>\n <!-- \n In case of more than 1 item, order id should show only one times : use= rowspan :\n --> \n <?php if ($i == 1) { ?>\n <td rowSpan=\"<?php echo count($arr_order_itemid); ?>\" >#<?php echo $oid; ?></td>\n <?php } ++$i; ?>\n <!-- order date -->\n <td><?php echo get_post_time(\"dM,Y\", FALSE, $oid); ?></td>\n \n <!-- product id -->\n <td><?php echo get_the_title($productid); ?></td>\n \n <!-- vendor -->\n <td><?php echo $this->wv_get_username_by_userid(get_post_meta($oid, 'woo_order_vendor_id_' . $productid, TRUE)); ?></td>\n \n <!-- commission --> \n <td>\n <?php\n echo get_woocommerce_currency_symbol(). get_post_meta($oid, 'woo_order_commision_' . $productid, TRUE);\n ?>\n </td>\n \n <!-- Status -->\n <td>\n <?php \n //change status functionality\n $sts = $this->wv_get_commission_status($oid,$productid);\n $newsts= ($sts==1)?0:1;\n ?>\n <a title=\"Change Status\" href=\"<?php echo admin_url(\"admin.php?page=woo_vendors&tab=commission&action=sts&oid=$oid&pid=$productid&sts=$newsts\"); ?>\" onclick=\"return confirm('Are you sure want to change status ?');\">\n <?php \n echo $newsts= ($sts==1)?\"paid\":\"due\";;\n ?>\n </a> \n </td>\n \n <!-- Commission Date -->\n <td>\n <?php \n //get commission date\n echo $this->wv_get_commission_date($oid,$productid);\n ?> \n </td>\n </tr>\n <?php\n }\n }//end of the count.\n }", "public function updateProduct()\n {\n \t$quote=$this->getQuote();\n \tif($quote)\n \t{\n \t\t$detailproduct=$this->getProduct();\n \t\t$quoteproduct=$quote->getProduct();\n \t\tif(\n\t\t\t\t$quote->getPrice()!=$this->getPrice() or\n\t\t\t\t$quote->getDiscrate()!=$this->getDiscrate() or\n\t\t\t\t$quote->getDiscamt()!=$this->getDiscamt() or\n\t\t\t\t$quote->getProductId()!=$this->getProductId()\n\t\t\t)\n\t\t\t{\n\t\t\t\t$quote->setPrice($this->getPrice());\n\t\t\t\t$quote->setDiscrate($this->getDiscrate());\n\t\t\t\t$quote->setDiscamt($this->getDiscamt());\n\t\t\t\t$quote->setProductId($this->getProductId());\n\t\t\t\t$quote->calc(); //auto save\n\t\t\t\t$detailproduct->calcSalePrices();\n\t\t\t\t\n\t\t\t\t//if product changed, calc old product\n\t\t\t\tif($quoteproduct->getId()!=$detailproduct->getId())\n\t\t\t\t\t$quoteproduct->calcSalePrices();\n\t\t\t}\n \t}\n \telse\n \t{\n\t\t\t//if none, see if product quote by vendor with similar pricing exists. \n\t\t\t$quote=Fetcher::fetchOne(\"Quote\",array('total'=>$this->getUnittotal(),'vendor_id'=>SettingsTable::fetch(\"me_vendor_id\"),'product_id'=>$this->getProductId()));\n\n\t\t\t//if it doesn't exist, create it, and product->calc()\n\t\t\tif(!$quote)\n\t\t\t{\n\t\t\t\tQuoteTable::createOne(array(\n\t\t\t\t\t'date'=>$this->getInvoice()->getDate(),\n\t\t\t\t\t'price'=>$this->getPrice(),\n\t\t\t\t\t'discrate'=>$this->getDiscrate(),\n\t\t\t\t\t'discamt'=>$this->getDiscamt(),\n\t\t\t\t\t'vendor_id'=>SettingsTable::fetch(\"me_vendor_id\"),\n\t\t\t\t\t'product_id'=>$this->getProductId(),\n\t\t\t\t\t'ref_class'=>\"Invoicedetail\",\n\t\t\t\t\t'ref_id'=>$this->getId(),\n\t\t\t\t\t'mine'=>1,\n\t\t\t\t\t));\n\t\t\t\t$this->getProduct()->calcSalePrices();\n\t\t\t}\n \t}\n }", "public function orderDeliverySuccess($id){\n $products = Orderdetail::where('order_id',$id)->get();\n foreach ($products as $product){\n Product::where('id', $product->product_id)->update([\n 'product_quantity' => DB::raw('product_quantity-'.$product->qty)\n ]);\n }\n\n $deliverySuccess = Order::findOrFail($id);\n $deliverySuccess->status = 3;\n $deliverySuccess->save();\n\n Toastr::success('Order delivery done');\n return redirect()->route('delivered.order');\n\n }", "public function set_order_cost_meta( $order_id ) {\n\n\t\t// get the order object.\n\t\t$order = wc_get_order( $order_id );\n\n\t\t$total_cost = 0;\n\n\t\t// loop through the order items and set their cost meta.\n\t\tforeach ( $order->get_items() as $item_id => $item ) {\n\n\t\t\t$product_id = ( ! empty( $item['variation_id'] ) ) ? $item['variation_id'] : $item['product_id'];\n\t\t\t$item_cost = (float) WC_COG_Product::get_cost( $product_id );\n\t\t\t$quantity = (float) $item['qty'];\n\n\t\t\t/**\n\t\t\t * Order Item Cost Filer.\n\t\t\t *\n\t\t\t * Allow actors to modify the item cost before the meta is updated.\n\t\t\t *\n\t\t\t * @since 1.9.0\n\t\t\t * @param float|string $item_cost order item cost to set\n\t\t\t * @param array $item order item\n\t\t\t * @param \\WC_Order $order order object\n\t\t\t */\n\t\t\t$item_cost = (float) apply_filters( 'wc_cost_of_goods_set_order_item_cost_meta_item_cost', $item_cost, $item, $order );\n\n\t\t\t$this->set_item_cost_meta( $item_id, $item_cost, $quantity );\n\n\t\t\t// add to the item cost to the total order cost.\n\t\t\t$total_cost += ( $item_cost * $quantity );\n\t\t}\n\n\t\t/**\n\t\t * Order Total Cost Filter.\n\t\t *\n\t\t * Allow actors to modify the order total cost before the meta is updated.\n\t\t *\n\t\t * @since 1.9.0\n\t\t * @param float|string $total_cost order total cost to set\n\t\t * @param \\WC_Order $order order object\n\t\t */\n\t\t$total_cost = apply_filters( 'wc_cost_of_goods_set_order_cost_meta', $total_cost, $order );\n\n\t\t$formatted_total_cost = wc_format_decimal( $total_cost, wc_get_price_decimals() );\n\n\t\t// save the order total cost meta.\n\t\tSV_WC_Order_Compatibility::update_meta_data( $order, '_wc_cog_order_total_cost', $formatted_total_cost );\n\t}", "public function getCustomOptionsOfProduct(Varien_Event_Observer $observer)\n{\n $invoice = $observer->getEvent()->getInvoice();\n$invoidData = $invoice->getData();\n//Mage::log($invoidData);\n$orderId = $invoidData['order_id'];\n$cid = $invoidData['customer_id'];\n$order1 = Mage::getModel('sales/order')->load($orderId);\n $Incrementid = $order1->getIncrementId();\n//Mage::log( $Incrementid.\"Order Id\"); \n\n// Assign Field To Inset Into CreditInfo Table\n\n$currentTimestamp = Mage::getModel('core/date')->timestamp(time()); \n$nowdate = date('Y-m-d H:m:s', $currentTimestamp); // Current TimeStamp\n\n$arr['c_id'] = $cid;//Customer Id\n$arr['store_view'] = Mage::app()->getStore()->getName(); //Storeview\n$arr['state'] = 1; //State Of Transaction\n$arr['order_id'] = $Incrementid; //OrderId\n$arr['action'] = \"Crdits\"; //Action\n$arr['customer_notification_status'] = 'Notified'; //Email Sending Status\n$arr['action_date'] = $nowdate; //Current TimeStamp\n$arr['website1'] = \"Main Website\"; //Website\n\nforeach ($invoice->getAllItems() as $item) {\n\n//Mage::log($item->getQty().\"Item Quntity\");\n\n$orderItem = Mage::getResourceModel('sales/order_item_collection'); \n $orderItem->addIdFilter($item->getOrderItemId()); \n$data = $orderItem->getData();\n$arr['action_credits'] = $data[0]['credits'] * $item->getQty();\n\n$collection = Mage::getModel('kartparadigm_storecredit/creditinfo')->getCollection()->addFieldToFilter('c_id',$cid)->addFieldToFilter('website1','Main Website')->getLastItem();\n\n$totalcredits = $collection->getTotalCredits();\n$arr['total_credits'] = $arr['action_credits'] + $totalcredits;\n$arr['custom_msg'] = \"By User:For Purchage The Product \" .$item->getName().\" For Quantity \" . round($item->getQty()) ; //Custom Message\n$arr['item_id'] = $item->getOrderItemId();\n$table1 = Mage::getModel('kartparadigm_storecredit/creditinfo');\n$table1->setData($arr);\ntry{\n if($arr['action_credits'] > 0)\n $table1->save();\n\n}catch(Exception $e){\n Mage::log($e);\n }\n\n}//end Foreach\n\n\n\n}", "public function action_order(Order $order, $status) {\n // dd($status);\n if($status == 3){\n $order_id = $order->id;\n $order_items = OrderItem::where('order_id' , $order_id)->get();\n for($i = 0; $i < count($order_items); $i++){\n $count = $order_items[$i]['count'];\n $product_id = $order_items[$i]['product_id'];\n if ($order->status == 2) {\n $product = Product::find($product_id);\n $product->update(['remaining_quantity' => $product->remaining_quantity + $count, 'sold_count' => $product->sold_count - $count]);\n if ($order_items[$i]['option_id'] != 0) {\n $m_option = ProductMultiOption::find($order_items[$i]['option_id']);\n $m_option->update(['remaining_quantity' => $m_option->remaining_quantity + $count, 'sold_count' => $m_option->sold_count - $count]);\n }\n }\n \n\n // $product->save();\n }\n }\n\n if($status == 2){\n $order_id = $order->id;\n $order_items = OrderItem::where('order_id' , $order_id)->get();\n for($i = 0; $i < count($order_items); $i++){\n $count = $order_items[$i]['count'];\n $product_id = $order_items[$i]['product_id'];\n $product = Product::find($product_id);\n $product->sold_count = $product->sold_count + $count;\n $product->save();\n if ($order_items[$i]['option_id'] != 0) {\n $m_option = ProductMultiOption::find($order_items[$i]['option_id']);\n $m_option->update(['sold_count' => (int)$m_option->sold_count + $count]);\n }\n }\n }\n\n $order->update(['status' => (int)$status]);\n\n\n return redirect()->back();\n }", "function setPrice($new_price)\n {\n $this->price = $new_price;\n }", "private function sellTrasactionAddsMoney(){\n\n }", "function getUpdateItem($product_id){\n\tglobal $conn;\n\t$ip = getIp();\n\t$get_qty =mysqli_query($conn, \"SELECT * FROM `cart` WHERE `ip_add`='$ip' AND `p_id`='$product_id'\");\n\t$row_qty=mysqli_fetch_array($get_qty);\n\t$quantity= $row_qty[\"qty\"];\t\n\n\t$get_price =mysqli_query($conn, \"SELECT * FROM `products` WHERE `product_id`='$product_id' AND `stock`='0'\");\n\t$row_price = mysqli_fetch_array($get_price);\n\t$price= $row_price[\"product_price\"];\n\n\t//get the subtotal\n\t$sub_total=$price * $quantity;\n\n\treturn $sub_total;\n}", "public function calculateQtyToShip();", "public function update(Request $request, $id)\n {\n // dd($request->itemdetail);\n $order = $this->model->find($id);\n\n foreach ($order->orderDetails as $key => $orderDetail) {\n $detail = ItemDetail::with('ingredients')->withTrashed()->findOrFail($orderDetail->item_detail_id);\n // dd($detail);\n foreach ($detail->ingredients as $key => $ingredient) {\n $usedIngredient = Ingredient::find($ingredient->id);\n $stock = $ingredient->stock;\n $used = $ingredient->pivot->amount_ingredient * $orderDetail->qty;\n $nowStock = $stock + $used;\n $usedIngredient->update(['stock' => $nowStock]);\n // dd($usedIngredient);\n };\n // dd($orderDetail->qty);\n };\n\n // dd($order->orderDetails->first()->item_detail_id);\n // dd(Ingredient::find(1)->stock);\n\n $order->orderDetails()->delete();\n\n $this->validate($request, [\n 'customer' => 'required',\n 'total' => 'required',\n 'itemdetail.*' => 'required',\n 'qty.*' => 'required',\n ]);\n\n $order->update([\n 'user_id' => auth()->user()->id,\n 'customer' => $request->customer,\n 'total' => $request->total,\n ]);\n\n for ($i = 0; $i < count($request->itemdetail); $i++) {\n $order->orderDetails()->create([\n 'item_detail_id' => $request->itemdetail[$i],\n 'qty' => $request->qty[$i],\n 'sub_total' => $request->subtotal[$i],\n ]);\n $detail = ItemDetail::with('ingredients')->find($request->itemdetail[$i]);\n foreach ($detail->ingredients as $key => $ingredient) {\n $usedIngredient = Ingredient::find($ingredient->id);\n $stock = $ingredient->stock;\n $used = $ingredient->pivot->amount_ingredient * $request->qty[$i];\n $nowStock = $stock - $used;\n $usedIngredient->update(['stock' => $nowStock]);\n // dd($ingredient->stock);\n };\n };\n\n return redirect($this->redirect);\n }", "public function __tallyUpInvoice() {\n\n $this->__itemTotals();\n\n $subTotal = $this->__subtotal($this->request->data['items']);\n\n //$taxTotal = $this->__tax($subTotal, $this->request->data['Invoice']['taxRate']);\n\n //$taxTotal = $this->__tax($this->request->data['items']);\n\n //$this->request->data['total'] = $subTotal + $taxTotal;\n $this->request->data['total'] = $subTotal;\n\n //$this->request->data['subTotal'] = $subTotal;\n\n //$this->request->data['taxTotal'] = $taxTotal;\n\n return true;\n }", "public function UpdateDeliveryOrder($id, Request $request)\n {\n $sub_total = $this->deliveryOrderServices->SumItemDiscountToSubTotal($request);\n $DO_Detail = $this->deliveryOrderServices->ItemOnDODetail(array('warehouse_out_id' => $request->warehouse_out_id, 'item_id' => $request->item_id));\n try {\n DB::beginTransaction();\n\n // Update Delivery Order Detail by Delivery Order Detail ID\n BagItemWarehouseOut::find($DO_Detail->id)->update([\n 'qty' => $request->qty,\n ]);\n\n // New Grand Total on Delivery Order\n // $DO_GT_update = $this->deliveryOrderServices->SumItemPriceByDeliveryOrderID($request->warehouse_out_id);\n // WarehouseOut::find($request->warehouse_out_id)->update([\n // 'grand_total' => $DO_GT_update\n // ]);\n\n DB::commit();\n return $this->returnSuccess($DO_Detail, 'Delivery Order dengan ID '.$DO_Detail->warehouse_out_id.' Berhasil di Update');\n } catch (\\Throwable $th) {\n DB::rollback();\n return $this->returnError($th->getMessage().'-'.$th->getLine());\n }\n }", "public function editPriceMoney(){\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public function addOrderedItemsToStock($order)\r\n {\r\n \t$nVersion = Mage::getModel('paymentsensegateway/direct')->getVersion();\r\n \t$isCustomStockManagementEnabled = Mage::getModel('paymentsensegateway/direct')->getConfigData('customstockmanagementenabled');\r\n\t\t\r\n \tif($nVersion >= 1410 &&\r\n \t\t$isCustomStockManagementEnabled)\r\n \t{\r\n\t \t$items = $order->getAllItems();\r\n\t\t\tforeach ($items as $itemId => $item)\r\n\t\t\t{\r\n\t\t\t\t// ordered quantity of the item from stock\r\n\t\t\t\t$quantity = $item->getQtyOrdered();\r\n\t\t\t\t$productId = $item->getProductId();\r\n\t\t\t\t\r\n\t\t\t\t$stock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($productId);\r\n\t\t\t\t$stockManagement = $stock->getManageStock();\r\n\t\t\t\t\r\n\t\t\t\tif($stockManagement)\r\n\t\t\t\t{\r\n\t\t\t\t\t$stock->setQty($stock->getQty() + $quantity);\r\n\t\t\t\t\t$stock->save();\r\n\t\t\t\t}\r\n\t\t\t}\r\n \t}\r\n }", "public function incrPrice($increment) {\n $this->setPrice($this->getPrice() + $increment);\n }", "public function getProductPrice()\n {\n }", "public function salesConvertQuoteItemToOrderItem(Varien_Event_Observer $observer)\n{\n$quoteItem = $observer->getItem();\n if ($additionalOptions = $quoteItem->getOptionByCode('additional_options')) {\n $orderItem = $observer->getOrderItem();\n $options = $orderItem->getProductOptions();\n $options['additional_options'] = unserialize($additionalOptions->getValue());\n$var;\nif (count($options['additional_options'] > 0)) {\n if ($options['additional_options'][0]['value'] != '') \n $i = 0;\n $val = $options['additional_options'][0]['value'];\n\n}\n//Mage::log($val.\" trgy\");\n$orderItem->setCredits($val);\n $orderItem->setProductOptions($options);\n }\n\n}", "private function calculate_item_prices()\r\n\t{\r\n\t\t// Loop through cart items.\r\n\t\tforeach($this->flexi->cart_contents['items'] as $row_id => $row)\r\n\t\t{\r\n\t\t\t// Check if the item has a specific tax rate set.\r\n\t\t\t$item_tax_rate = $this->get_item_tax_rate($row_id, FALSE); \r\n\r\n\t\t\t// Calculate the internal item price.\r\n\t\t\t$item_internal_tax_data = $this->calculate_tax($row[$this->flexi->cart_columns['item_internal_price']], $item_tax_rate);\r\n\r\n\t\t\t// Calculate the tax on the item price using the carts current location settings.\r\n\t\t\t$item_tax_data = $this->calculate_tax($item_internal_tax_data['value_ex_tax'], $item_tax_rate, FALSE, TRUE);\r\n\t\t\t\t\t\t\r\n\t\t\t// Update the item price.\r\n\t\t\t$row[$this->flexi->cart_columns['item_price']] = $this->format_calculation($item_tax_data['value_inc_tax']);\r\n\r\n\t\t\t// Save item pricing.\r\n\t\t\t$this->flexi->cart_contents['items'][$row_id] = $row;\r\n\t\t}\r\n\t}", "public function logCartUpdate($observer){\r\n\r\n\t\tforeach ($observer->getCart()->getQuote()->getAllVisibleItems() as $quote_item ) {\r\n\t\t/* @var $item Mage_Sales_Model_Quote_Item */\r\n\r\n\t\t\t$website_id=Mage::getModel('core/store')->load($quote_item->getData('store_id'))->getWebsiteId();\r\n\r\n\t\t\t$company_id=Mage::helper('insync_company')\r\n\t\t\t->getCustomerCompany(Mage::getSingleton('customer/session')->getCustomer()->getId());\r\n\r\n\t\t\t$product_id=$quote_item->getProductId();\r\n\r\n\t\t\t//$qty=$quote_item->getQty();\r\n\t\t\t\r\n\t\t\t/* Product Group wise Qty set */\r\n\t\t\tMage::log('logCartUpdate', null, 'arijit1.log');\r\n\t\t\t$quote = Mage::getModel('checkout/cart')->getQuote();\r\n\t\t\t$item_group = Mage::getModel('catalog/product')->load($product_id)->getProduct_group();\t//\titem_group -> current item\r\n\t\t\tMage::log($item_group, null, 'arijit1.log');\r\n\t\t\tforeach ($quote->getAllItems() as $item) {\r\n\t\t\t\t//Mage::log('Itm Qty'.$item->getQty(), null, 'arijit1.log');\r\n\t\t //$product_group = $item->getProduct()->getData('product_group');//->getProduct_group();\t\r\n\t\t $product_group = Mage::getModel('catalog/product')->load($item->getProductId())->getData('product_group');\r\n\t\t\t\tMage::log('productGroup'.$product_group, null, 'arijit1.log');//\tproduct_group -> quote items\r\n\t\t\t\t//Mage::log($product_group, null, '19-Oct-15.log');\r\n\t\t\t\tif ($item_group == $product_group) {\r\n\t\t\t\t\t$qty += $item->getQty();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tMage::log($qty, null, 'arijit1.log');\r\n\t\t\t/* Tier-Price by product_group */\r\n\t\t\t$quotePrice = $quote_item->getPrice();\r\n\t\t\tMage::log('quote Price', null, 'arijit1.log');\r\n\t\t\tMage::log($quotePrice, null, 'arijit1.log');\r\n\t\t\t$product = Mage::getModel('catalog/product')->load($product_id);\r\n\t\t\t$productTierPrice = $product->getTierPrice($qty);\r\n\t\t\tif (!empty($productTierPrice)) {\r\n\t\t\t\tMage::log('Tier Price', null, 'arijit1.log');\r\n\t\t\t\tMage::log($productTierPrice, null, 'arijit1.log');\r\n\t\t\t\t$quotePrice = min($productTierPrice, $quotePrice);\r\n\t\t\t}\r\n\t\t\t/* ------------------------- */\r\n\t\t\t\r\n\t\t\tif($company_id){\r\n\t\t\t\tif(!empty($website_id) && !empty($company_id) && !empty($product_id) && !empty($qty) ){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t$new_price =\"\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t$product = Mage::getModel('catalog/product')->load($product_id);\r\n\t\t\t\t\t$finalPrice = $product->getFinalPrice($qty);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t// Product specific price\r\n\t\t\t\t\t$prod_price= Mage::helper('insync_companyrule')->getNewPrice($website_id,$company_id,$product_id,$qty);\r\n\r\n\t\t\t\t\t// Category specific price\r\n\t\t\t\t\t$cat_price=Mage::helper('insync_companyrule')->getCategoryPrice($product_id,$finalPrice,$company_id,$website_id);\r\n\t\t\t\t\t// Get applicable price\r\n\t\t\t\t\t$new_price=Mage::helper('insync_companyrule')->getMinPrice($prod_price,$cat_price,$finalPrice);\r\n\t\t\t\t\tMage::log('new_price'.$new_price, null, 'arijit1.log');\r\n\t\t\t\t\tif($new_price!=''){\r\n\r\n\t\t\t\t\t\t//if($new_price < $quote_item->getPrice()){\r\n\t\t\t\t\t\t$quote_item->setOriginalCustomPrice($new_price);\r\n\t\t\t\t\t\t$quote_item->save();\r\n\t\t\t\t\t\t//}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\t// add new calculated price\r\n\t\t\t\t\t\t$product = Mage::getModel('catalog/product')->load($product_id);\r\n\t\t\t\t\t\t$finalPrice = $product->getFinalPrice($quote_item->getQty());\r\n\r\n\t\t\t\t\t\t$quote_item->setOriginalCustomPrice($finalPrice);\r\n\t\t\t\t\t\t$quote_item->save();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tunset($qty);\r\n\t\t}\r\n\t}", "private function attach_order($request,$client){\n $order=$client->orders()->create([]);\n $order->products()->attach($request->products);\n $total_price=0;\n foreach ($request->products as $id=>$quantity){\n $product=Product::findOrFail($id);\n $total_price+=$quantity['quantity'] * $product->sale_price;\n $product->update([\n 'stock'=>$product->stock - $quantity['quantity']\n ]);\n }\n\n $order->update([\n 'total_price'=>$total_price\n ]);\n\n }", "public function testUpdateOrder()\n {\n }", "public function updateCart() {\n if (func_num_args() > 0):\n $userid = func_get_arg(0);\n $productid = func_get_arg(1);\n $quantity = func_get_arg(2);\n $cost = func_get_arg(3);\n $hotelid = func_get_arg(4);\n $select = $this->select()\n ->from($this)\n ->where('user_id = ?', $userid)\n ->where('product_id = ?', $productid)\n ->where('hotel_id = ?', $hotelid);\n $res = $this->getAdapter()->fetchRow($select);\n\n $value = 1;\n if ($quantity['quantity'] === 'increase') {\n $data = array('quantity' => new Zend_Db_Expr('quantity + ' . $value),\n 'cost' => new Zend_Db_Expr('cost + ' . $cost));\n } else if ($quantity['quantity'] === 'decrease' && $res['quantity'] > 1) {\n $data = array('quantity' => new Zend_Db_Expr('quantity - ' . $value),\n 'cost' => new Zend_Db_Expr('cost - ' . $cost));\n } else {\n $value = 0;\n $cost = 0;\n $data = array('quantity' => new Zend_Db_Expr('quantity + ' . $value),\n 'cost' => new Zend_Db_Expr('cost + ' . $cost));\n }\n try {\n $where[] = $this->getAdapter()->quoteInto('user_id = ?', $userid);\n $where[] = $this->getAdapter()->quoteInto('product_id = ?', $productid);\n $where[] = $this->getAdapter()->quoteInto('hotel_id = ?', $hotelid);\n $result = $this->update($data, $where);\n if ($result) {\n try {\n $select = $this->select()\n ->from($this)\n ->where('user_id = ?', $userid)\n ->where('product_id = ?', $productid)\n ->where('hotel_id = ?', $hotelid);\n $response = $this->getAdapter()->fetchRow($select);\n if ($response) {\n $select = $this->select()\n ->from($this, array(\"totalcost\" => \"SUM(cost)\"))\n ->where('user_id = ?', $userid)\n ->where('hotel_id = ?', $hotelid);\n $res = $this->getAdapter()->fetchRow($select);\n $response['total'] = $res['totalcost'];\n if ($response) {\n return $response;\n } else {\n return null;\n }\n } else {\n return null;\n }\n } catch (Exception $ex) {\n \n }\n } else {\n return null;\n }\n } catch (Exception $exc) {\n echo $exc->getTraceAsString();\n }\n else:\n throw new Exception(\"Argument not passed\");\n endif;\n }", "function generate_order($order,$mysqli){\r\n\r\n $orders = get_items_database($mysqli);\r\n\r\n \r\n $level = ($order->extension_attributes->shipping_assignments);\r\n foreach($level as $i){\r\n $address = $i->shipping->address;\r\n \r\n $adr = $address->street[0];\r\n $postal = $address->postcode;\r\n $city = $address->city;\r\n \r\n }\r\n\r\n \r\n foreach($order->items as $i){ \r\n foreach ($orders as $e){\r\n if ($e[\"code\"] == $i->sku){\r\n //print_r($e[\"code\"] .\" \". $i->sku);\r\n \r\n $ITid = $e[\"item_id\"];\r\n $ITname = $i->name;\r\n $ITcode = $i->sku;\r\n $qty = $i->qty_ordered;\r\n $cena = $i->price_incl_tax;\r\n \r\n \r\n } \r\n }\r\n }\r\n\r\n\r\n\r\n $data = array(\r\n \"OrderId\" => $order->increment_id,\r\n \"ReceivedIssued\" => \"P\",\r\n \"Year\" => 0,\r\n \"Number\" => null,\r\n \"Date\" => date(\"Y-m-d H:i:s\"),\r\n \"Customer\" => array(\r\n \"ID\" => 8451445,\r\n \"Name\" => null,\r\n \"ResourceUrl\" => null\r\n ),\r\n \"CustomerName\" => $order->customer_firstname.\" \". $order->customer_lastname,\r\n \"CustomerAddress\" => $adr,\r\n \"CustomerPostalCode\" => $postal,\r\n \"CustomerCity\" => $city,\r\n\r\n \"CustomerCountry\" => array(\r\n \"ID\" => 192,\r\n \"Name\" => null,\r\n \"ResourceUrl\" => null\r\n ),\r\n \"CustomerCountryName\" => null,\r\n \"Analytic\" => null,\r\n \"DueDate\" => null,\r\n \"Reference\" => $order->entity_id,\r\n \"Currency\" => array(\r\n \"ID\" => 7,\r\n \"Name\" => null,\r\n \"ResourceUrl\" => null\r\n ),\r\n \"Notes\" => null,\r\n \"Document\" => null,\r\n \"DateConfirmed\" => null,\r\n \"DateCompleted\" => null,\r\n \"DateCanceled\" => null,\r\n \"Status\" => null,\r\n \"DescriptionAbove\" => null,\r\n \"DescriptionBelow\" => null,\r\n \"ReportTemplate\" => array(\r\n \"ID\" => null,\r\n \"Name\" => null,\r\n \"ResourceUrl\" => null\r\n ),\r\n\r\n \"OrderRows\" => [array(\r\n \"OrderRowId\" => null,\r\n \"Order\" => null,\r\n \"Item\" => array(\r\n \"ID\" => $ITid,\r\n \"Name\" => null,\r\n \"ResourceUrl\" => null,\r\n ),\r\n \"ItemName\" => $ITname,\r\n \"ItemCode\" => $ITcode,\r\n \"Description\" => null,\r\n \"Quantity\" => $qty,\r\n \"Price\" => $cena,\r\n \"UnitOfMeasurement\" => \"kos\",\r\n \"RecordDtModified\" => \"2020-01-07T12:20:00+02:00\",\r\n \"RowVersion\" => null,\r\n \"_links\" => null,\r\n ) ],\r\n\r\n \"RecordDtModified\" => date(\"Y-m-d H:i:s\"),\r\n \"RowVersion\" => null,\r\n \"_links\" => null\r\n\r\n );\r\n \r\n return $data;\r\n}", "public function getPrice()\n {\n return parent::getPrice();\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 increaseItem($rowId){\n // kemudian ambil semua isi product\n // ambil session login id\n // cek eloquent id\n $idProduct = substr($rowId, 4, 5);\n $product = ProductModel::find($idProduct);\n $cart = \\Cart::session(Auth()->id())->getContent();\n $checkItem = $cart->whereIn('id', $rowId);\n \n // kita cek apakah value quantity yang ingin kita tambah sama dengan quantity product yang tersedia\n if($product->qty == $checkItem[$rowId]->quantity){\n session()->flash('error', 'Kuantiti terbatas');\n }\n else{\n \\Cart::session(Auth()->id())->update($rowId, [\n 'quantity' => [\n 'relative' => true,\n 'value' => 1\n ]\n ]);\n }\n\n }", "public static function update_item_with_discount($detail_id,$order_promotion,$order_discount_id,$order_discount_amt){\r\tif(is_gt_zero_num($detail_id)){\r\t\t$objtbl_order_details=new tbl_order_details();\r\t\tif($objtbl_order_details->readObject(array(ORD_DTL_ID=>$detail_id))){\r\t\t\t$objtbl_order_details->setordprom_promotion($order_promotion);\r\t\t\t$objtbl_order_details->setordprom_discount_id($order_discount_id);\r\t\t\t$objtbl_order_details->setordprom_discount_amt($order_discount_amt);\r\t\t\t$objtbl_order_details->insert();\r\t\t\treturn 1;\r\t\t}\r\t\tunset($objtbl_order_details);\t\r\t} \r\treturn 0;\t\r }", "public function readdItems($input) {\n $orderItems = \\App\\OrderItem::where('order_id', $input['order_id'])->get();\n foreach ($orderItems as $orderItem) {\n \\App\\Product::where('id', $orderItem->product_id)->increment('qty', $orderItem->qty);\n }\n }", "function purchaseditem () {\n\t\t\t$this->layout = 'mobilelayout';\n\t\t\t$this->set('title_for_layout','- Settings');\n\t\t\tglobal $loguser;\n\t\t\t$userid = $loguser[0]['User']['id'];\n\t\t\tif(!$this->isauthenticated()){\n\t\t\t\t$this->redirect('/mobile/');\n\t\t\t}\n\t\t\t$itemModel = array();\n\t\t\n\t\t\t$this->loadModel('Orders');\n\t\t\t$this->loadModel('Order_items');\n\t\t\t$this->loadModel('Item');\n\t\t\t$this->loadModel('Forexrate');\n\t\t\t\n\t\t\t$forexrateModel = $this->Forexrate->find('all');\n\t\t\t$currencySymbol = array();\n\t\t\tforeach($forexrateModel as $forexrate){\n\t\t\t\t$cCode = $forexrate['Forexrate']['currency_code'];\n\t\t\t\t$cSymbol = $forexrate['Forexrate']['currency_symbol'];\n\t\t\t\t$currencySymbol[$cCode] = $cSymbol;\n\t\t\t}\n\t\t\n\t\t\t$ordersModel = $this->Orders->find('all',array('conditions'=>array('userid'=>$userid),'order'=>array('orderid'=>'desc')));\n\t\t\t$orderid = array();\n\t\t\tforeach ($ordersModel as $value) {\n\t\t\t\t$orderid[] = $value['Orders']['orderid'];\n\t\t\t}\n\t\t\tif(count($orderid) > 0) {\n\t\t\t\t$orderitemModel = $this->Order_items->find('all',array('conditions'=>array('orderid'=>$orderid)));\n\t\t\t\t$itemid = array();\n\t\t\t\tforeach ($orderitemModel as $value) {\n\t\t\t\t\t$orid = $value['Order_items']['orderid'];\n\t\t\t\t\tif (!isset($oritmkey[$orid])){\n\t\t\t\t\t\t$oritmkey[$orid] = 0;\n\t\t\t\t\t}\n\t\t\t\t\t$itemid[] = $value['Order_items']['itemid'];\n\t\t\t\t\t$orderitems[$orid][$oritmkey[$orid]]['itemname'] = $value['Order_items']['itemname'];\n\t\t\t\t\t$orderitems[$orid][$oritmkey[$orid]]['itemtotal'] = $value['Order_items']['itemprice'];\n\t\t\t\t\t$orderitems[$orid][$oritmkey[$orid]]['itemsunitprice'] = $value['Order_items']['itemunitprice'];\n\t\t\t\t\t$orderitems[$orid][$oritmkey[$orid]]['itemssize'] = $value['Order_items']['item_size'];\n\t\t\t\t\t$orderitems[$orid][$oritmkey[$orid]]['quantity'] = $value['Order_items']['itemquantity'];\n\t\t\t\t\t$oritmkey[$orid]++;\n\t\t\t\t}\n\t\t\t\t/* if (count($itemid) > 0) {\n\t\t\t\t\t$itemModel = $this->Item->find('all',array('conditions'=>array('Item.id'=>$itemid)));\n\t\t\t\t}\n\t\t\t\tforeach($itemModel as $item) {\n\t\t\t\t\t$itemArray[$item['Item']['id']] = $item['Item'];\n\t\t\t\t} */\n\t\t\t}\n\t\t\t$orderDetails = array();\n\t\t\tforeach ($ordersModel as $key => $orders){\n\t\t\t\t$orderid = $orders['Orders']['orderid'];\n\t\t\t\t$orderCurny = $orders['Orders']['currency'];\n\t\t\t\t$orderDetails[$key]['orderid'] = $orders['Orders']['orderid'];\n\t\t\t\t$orderDetails[$key]['price'] = $orders['Orders']['totalcost'];\n\t\t\t\t$orderDetails[$key]['saledate'] = $orders['Orders']['orderdate'];\n\t\t\t\t$orderDetails[$key]['status'] = $orders['Orders']['status'];\n\t\t\t\t$itemkey = 0;\n\t\t\t\tforeach ($orderitems[$orderid] as $orderkey => $orderitem) {\n\t\t\t\t\t//$itemTable = $itemArray[$orderitem];\n\t\t\t\t\t$orderDetails[$key]['orderitems'][$itemkey]['itemname'] = $orderitems[$orderid][$orderkey]['itemname'];\n\t\t\t\t\t$orderDetails[$key]['orderitems'][$itemkey]['quantity'] = $orderitems[$orderid][$orderkey]['quantity'];\n\t\t\t\t\t$orderDetails[$key]['orderitems'][$itemkey]['price'] = $orderitems[$orderid][$orderkey]['itemtotal'];\n\t\t\t\t\t$orderDetails[$key]['orderitems'][$itemkey]['unitprice'] = $orderitems[$orderid][$orderkey]['itemsunitprice'];\n\t\t\t\t\t$orderDetails[$key]['orderitems'][$itemkey]['size'] = $orderitems[$orderid][$orderkey]['itemssize'];\n\t\t\t\t\t$orderDetails[$key]['orderitems'][$itemkey]['cSymbol'] = $currencySymbol[$orderCurny];\n\t\t\t\t\t$itemkey++;\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\t//echo \"<pre>\";print_r($orderitems);die;\n\t\t\t$this->set('orderDetails',$orderDetails);\n\t\t\t\n\t\t}", "public function placeOrder($refName, $quantityOrder, $buyerNm, $buyerAdd, $buyerApt, $buyerCiti, $buyerState, $buyerZip, $buyerCountry, $buyerNotes, $sellerId, $sellerNm)\n\t{\n\t\t$conn = $this->inv_conn();\n\t\t$qry_all = \"SELECT DISTINCT `id`, `quantity`,`price` FROM `inventory` WHERE `ref_name` = '$refName'\";\n\t\t$result = mysqli_query($conn, $qry_all);\n\n\t\twhile($res = mysqli_fetch_assoc($result))\n\t\t{\n\t\t\t$refid = $res['id'];\n\t\t\t$quant = $res['quantity'];\n\t\t\t$val = $res['price'];\n\t\t}\n\n\t\tif(($quant - $quantityOrder) < 0)\n\t\t{\n\t\t\treturn 4;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$orderTotal = $val * $quantityOrder;\n\n\t\t\t//International orders\n\t\t\tif($buyerCountry != \"United States\")\n\t\t\t{\n\t\t\t\t$orderTotal += 10;\n\t\t\t}\n\n\t\t\t$qryIns = \"INSERT INTO `order`(`ord_id`, `ord_ref_item`, `ref_fk`, `ord_quant`, `buyer_nm`, `buyer_add`, `buyer_apt`, `ord_city`, `ord_state`, `ord_zip`, `ord_country`, `ord_observ`, `seller_id`, `seller`, `ord_total`)\n\t\t\t\t\t VALUES ('', '$refName','$refid','$quantityOrder', '$buyerNm', '$buyerAdd', '$buyerApt', '$buyerCiti', ' $buyerState', '$buyerZip' ,'$buyerCountry', '$buyerNotes', '$sellerId','$sellerNm', $orderTotal)\";\n\n\t\t\t$conn = $this->inv_conn();\n\t\t\tif($conn->query($qryIns) == TRUE)\n\t\t\t{\n\t\t\t\t$updQuantity = $quant - $quantityOrder;\n\t\t\t\t$qry_upd = \"UPDATE `inventory` SET `quantity` = $updQuantity, `last_update` = CURRENT_TIMESTAMP WHERE `ref_name` = '$refName'\";\n\t\t\t\tif($conn->query($qry_upd) == TRUE)\n\t\t\t\t{\n\t\t\t\t\tif($updQuantity == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$obj = new ordering();\n\t\t\t\t\t\t$obj->outOfStockEmail($refName);\n\t\t\t\t\t}\n\t\t\t\t\t//Order has been placed successful. Send email to system admin.\n\t\t\t\t\t$this->sendEmailAdmin($sellerNm, $refName, $quantityOrder, $updQuantity );\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn 2;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn 3;\n\t\t\t}\n\t\t}\n\t}", "public function updated(Order $order)\n {\n foreach (OrderProduct::where('order_id',$order->id)->get() as $orderProduct) {\n $product = Product::find($orderProduct->product_id);\n $cardController = new GlobalCardController();\n $product->count = $cardController->countProduct($orderProduct->product_id);\n $product->save();\n }\n }", "function getOverallOrderPrice(){\n\t\t$t=0;\n\t\t$a = Order::where('payment', 'verified')->get();\n\t\tforeach($a as $n){\n\t\t$dur= $n->qty;\n\t\t\n\t\t$r = intVal($n->qty)*intVal($n->price);\n\t\t$t = $t + $r;\n\t\t}\n\t\treturn $t;\n\t\t}", "public function appr_paid($paid_id) {\n\n\t\t$sql = $this->query(\"SELECT * FROM `app_order` WHERE `id` = '$paid_id'\");\n\n\twhile($fetch = mysql_fetch_array($sql)) {\n\n\n\t\t\t\t$pro_id \t\t\t= $fetch['pro_id'];\n\t\t\t \t$pro_count \t\t\t= $fetch['count'];\n\t\t\t\t$pro_name \t\t\t= $fetch['name'];\n\t\t\t\t$pro_email \t\t\t= $fetch['email'];\n\t\t\t\t$pro_address \t\t= $fetch['address'];\n\t\t\t\t$pro_mobile \t\t= $fetch['mobile'];\n\t\t\t\t$pro_total \t\t\t= $fetch['total'];\n}\n\t\t\t$transfer_data_part_2_array = array($pro_id,$pro_count,$pro_name,$pro_email,$pro_address,$pro_mobile,$pro_total);\n\t\t\t\n\t\t\t\n\t\t\t$this->transfer_data_part_2($transfer_data_part_2_array);\n\n\t\t\t//After Sending them in a function via array........... The next programme delete the Item by using `id`\n\n\t\t\t$this->query(\"DELETE FROM `my_cart`.`app_order` WHERE `app_order`.`id` = '$paid_id'\");\n\n// Add into Main Balance............STARTS\n\t\t\t$balance_sql = $this->query(\"SELECT `total` FROM `balance`\");\n\t\t\t\n\t\t\t$balance_sql_fetch = mysql_fetch_array($balance_sql);\n\t\t\t$main_balance = $balance_sql_fetch['total'];\n\t\t\t$add_total = $main_balance + (int)$pro_total;\n\n\t\t\t$this->query(\"UPDATE `my_cart`.`balance` SET `total` = '$add_total' WHERE `id` = '1'\");\n\n// Add into Main Balance............ENDS\n\n//Add into sub balance (This balance is for Search term (it'll help Admin to Find out the Sold Date...)) ............. STARTS\n\n\n\n//Add into sub balance (This balance is for Search term (it'll help Admin to Find out the Sold Date...)) ............. ENDS\n\t}", "public function getPrice() {\n $sum = parent::getPrice();\n foreach ($this->extraItems as $extraItem) {\n $sum += $extraItem->getPrice();\n }\n return $sum;\n }", "public function addSale($item, $id){\n\n $storedItem = ['qty' => 0, 'productPrice' => $item->productPrice, 'item' => $item];\n if($this->items){\n if(array_key_exists($id, $this->items)){\n $storedItem = $this->items[$id];\n }\n }\n\n $storedItem['qty']++;\n $storedItem['productPrice'] = $item->productPrice * $storedItem['qty'];\n $this->items[$id] = $storedItem;\n $this->totalQty++;\n $this->totalPrice += $item->productPrice;\n }", "function add_cart_item( $cart_item ) {\n\t\t\t\tif (isset($cart_item['addons'])) :\n\t\t\t\t\t\n\t\t\t\t\t$extra_cost = 0;\n\t\t\t\t\t\n\t\t\t\t\tforeach ($cart_item['addons'] as $addon) :\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($addon['price']>0) $extra_cost += $addon['price'];\n\t\t\t\t\t\t\n\t\t\t\t\tendforeach;\n\t\t\t\t\t\n\t\t\t\t\t$cart_item['data']->adjust_price( $extra_cost );\n\t\t\t\t\t\n\t\t\t\tendif;\n\t\t\t\t\n\t\t\t\treturn $cart_item;\n\t\t\t\t\n\t\t\t}", "public function updateItems()\n {\n if (count($this->items)) {\n foreach ($this->items as $item) {\n $item->setInvoice($this);\n }\n }\n }", "function es_product_bulk_price($price, $quantity, $sku) {\n\t/*\n\t* PUB41 - Your child’s first year at school Bulk discount\n\t* For orders of x >= 20 $12.95, x >= 50 $9.90\n\t*/\n\tif ($sku == 'PUB41') {\n\t\tif ($quantity >= 20 AND $quantity < 50) {\n\t\t\t$price = 12.95;\n\t\t}\n\t\telseif ($quantity >= 50) {\n\t\t\t$price = 9.95;\n\t\t}\n\t}\n\telseif($sku == 'SUND507') {\n\t\tif ($quantity >= 3)\n\t\t\t$price = 10.95;\n\t}\n\telseif($sku == 'SUND621') {\n\t\tif ($quantity >= 3)\n\t\t\t$price = 16.95;\n\t}\n\telseif($sku == 'SUND620') {\n\t\tif ($quantity >= 5)\n\t\t\t$price = 14.95;\n\t}\n\t\n\treturn $price;\n}", "protected function calculatePrice()\n {\n $amount = 5 * $this->rate;\n $this->outputPrice($amount);\n }", "private function calculateFOBPriceAction()\n {\n // than 99, then modify shippingPrice to 0.00 \n \t$price = $this->info['productPrice'];\n if($price <= 99){\n $shippingPrice = $this->info['shippingPrice'];\n }\n else{\n $this->info['shippingPrice'] = 0.0;\n }\n $this->info['fobPrice'] = ($price + $shippingPrice) * 1.07; // It also adds US TAXes\n }", "public function orderItem()\n {\n /* @var $customerAccount MagentoComponents_Pages_CustomerAccount */\n $customerAccount = Menta_ComponentManager::get('MagentoComponents_Pages_CustomerAccount');\n $customerAccount->login();\n\n /* @var $cart MagentoComponents_Pages_Cart */\n $cart = Menta_ComponentManager::get('MagentoComponents_Pages_Cart');\n $cart->clearCart();\n\n /* @var $productSingleView MagentoComponents_Pages_ProductSingleView */\n $productSingleView = Menta_ComponentManager::get('MagentoComponents_Pages_ProductSingleView');\n $productSingleView->putProductsIntoCart($this->getConfiguration()->getValue('testing.simple.product.id'));\n\n /* @var $onePageCheckout MagentoComponents_Pages_OnePageCheckout */\n $onePageCheckout = Menta_ComponentManager::get('MagentoComponents_Pages_OnePageCheckout');\n\n $onePageCheckout->goThroughCheckout();\n\n $this->getHelperAssert()->assertTextNotPresent(\"There was an error capturing the transaction.\");\n $orderNumber = $onePageCheckout->getOrderNumberFromSuccessPage();\n\n return $orderNumber;\n }", "function wc_csv_export_order_row_one_row_per_line_number( $order_data, $item ) {\n\n\t\t$order = wc_get_order($order_data['order_id']); \n\t\t$product = wc_get_product( $item['product_id'] ); \n\t\t// SHIPPING\t\t\n\t\t$ship_meth_id = '';\n\t\t\t\t\n\t\t\t\tif ( $order->get_shipping_method() === 'Flat rate' ) {\n\t\t\t\t\t\t\t$ship_meth_id = 'FR1';\n\t\t\t\t\t\t} elseif ($order->get_shipping_method() === 'Free shipping') {\n\t\t\t\t\t\t\t$ship_meth_id = 'FR2';\n\t\t\t\t\t\t}\n\t\t// coupon amount\t\t\t\t\n\t\tforeach ( $order->get_items( 'coupon' ) as $coupon_item_id => $coupon ) {\n\t\t\n\t\t\t$_coupon = new WC_Coupon( $coupon['name'] );\n\t\t\t$coupon_post = get_post( SV_WC_Data_Compatibility::get_prop( $_coupon, 'id' ) );\n\t\t}\n\t\t$coupon_percentage = 0;\n\t\tif ( is_object($_coupon) ){\n\t\t$coupon_percentage = $_coupon->get_amount() / 100 ;\n\t\t}\n\t\t$user_id = $order->user_id;\n\t\t$user_info = get_userdata($user_id);\n\t\t$macola_id = get_user_meta( $user_id, 'macola_id', true); // Defines 'macola_id' for column based on user placing order. - Matt\n\t\t$sales_person = get_user_meta( $user_id, 'sales_person', true);\n\t\t$user = get_user_by( 'id', $user_id );\n\t\t$user_role = $user->roles;\n\t\t$the_price[] = get_post_meta($product->id, 'festiUserRolePrices', true);\n\t\t$discount = $product->get_price() * $coupon_percentage; \n\t\t$reg_price = $product->get_price() - $discount;\n\t\t// print_r($item);\n\t\tif(isset($the_price[0]['d'])) { $d_price = $the_price[0]['d']; }\n\t\tif(isset($the_price[0]['m'])) { $m_price = $the_price[0]['m']; }\n\t\t\t\t\tif ($user_role[0] == 'd'){\n\t\t\t\t\t\t$thePrice = $d_price - $discount;\n\t\t\t\t\t} elseif ($user_role[0] == 'm') {\n\t\t\t\t\t\t$thePrice = $m_price - $discount;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$thePrice = wc_format_decimal( $reg_price, 2); // . ' -- ' . print_r($cus_type);\n\t\t\t\t\t}\n\t\t$item_name = htmlentities(substr($item['name'],0,30));\n\t\t$item_name_clean = preg_replace(\"/&#?[a-z0-9]+;/i\",\"\",$item_name);\n\t\t$order_data['item_no'] = $item['sku'];\n\t\t//$order_data['item_quantity'] = $item['item_quantity'];\n\t\t$order_data['item_desc_1']\t= $item_name_clean; // Item Description 1\n\t\t$order_data['qty_to_ship']\t= $item['quantity']; // Qty To Ship\n\t\t$order_data['this_price'] = $thePrice;\n\n\t\t$order_data['order_type'] \t\t\t\t= 'O';\n\t\t$order_data['cus_number']\t\t\t \t= $macola_id;\n\t\t$order_data['bill_to_name']\t\t \t\t= $order->billing_first_name . ' ' . $order->billing_last_name;\n\t\t$order_data['billing_address_1'] \t= $order->billing_address_1;\n\t\t$order_data['billing_address_2'] \t= $order->billing_address_2;\n\t\t$order_data['billing_city'] \t\t\t= $order->billing_city;\n\t\t$order_data['billing_state'] \t\t\t= $order->billing_state;\n\t\t$order_data['billing_postcode'] \t\t= $order->billing_postcode;\n\t\t$order_data['billing_country'] \t\t= $order->billing_country;\n\t\t$order_data['shipping_full_name'] = $order->shipping_first_name . ' ' . $order->shipping_last_name;\n\t\t$order_data['shipping_address_1'] \t= $order->shipping_address_1;\n\t\t$order_data['shipping_address_2'] \t= $order->shipping_address_2;\n\t\t$order_data['shipping_city'] \t\t= $order->shipping_city;\n\t\t$order_data['shipping_state'] \t\t= $order->shipping_state;\n\t\t$order_data['shipping_postcode'] \t= $order->shipping_postcode;\n\t\t$order_data['shipping_country'] \t= $order->shipping_country;\n\t\t$order_data['customer_type']\t\t\t= 'WEB'; // Cus Type - user role\n\t\t$order_data['ship_via_code']\t\t\t= $ship_meth_id;\n\t\t$order_data['taxable'] \t\t\t\t\t\t= 'Y'; // Taxable(Y|N) = always Y\n\t\t$order_data['tax_code'] \t\t\t\t\t= ''; // Tax Code // blank\n\t\t$order_data['terms']\t\t\t\t\t\t\t= 'CC'; // Terms\n\t\t$order_data['sales_person_code']\t= '13'; // Sales Person Code\n\t\t$order_data['customer_location']\t= 'G2'; // Customer Location\n\t\t$order_data['allow_backorders']\t= 'N'; // Allow Backorders(Y|N)\n\t\t$order_data['allow_part_ship']\t= 'N'; // Allow Partial Shipments(Y|N)\n\t\t$order_data['allow_subs']\t= 'N'; // Allow Substitute Items(Y|N)\n\t\t$order_data['freight']\t= $shipping_item['total']; //$order->get_total_shipping(); // Freight\n\t\t\n\t\t$status = $order->get_status();\n\t\tif ($status == 'failed') {\n\t\t$order_data['payment_trx_type']\t= 'failed'; //'2'; // Payment TrxType (0-Cash | 1-Check | 2-Credit Card | 3-Gift Card | 4-Wire Transfer)\n\t\t} else {\n\t\t$order_data['payment_trx_type']\t= '2'; // Payment TrxType (0-Cash | 1-Check | 2-Credit Card | 3-Gift Card | 4-Wire Transfer)\n\t\t}\n\t\t\n\t\t$order_data['payment_cash_acct']\t= ''; // Payment Cash Account Code (Cash Account G/L Number)\n\t\t$order_data['status']\t= '1'; // Status\n\t\t$order_data['discount']\t= '';//wc_format_decimal( $order->get_total_discount(), 2 ); // Discount\n\t\t// all blank\n\t\t$order_data['shipping_code']\t\t\t= ''; // Ship to Code // blank\n\t\t$order_data['tax_schedule_code']\t\t=\t$order->shipping_state; // Tax Schedule Code \n\t\t$order_data['miscellaneous']\t= ''; // Miscellaneous // blank\n\t\t$order_data['comments']\t= ''; // Comments\n\t\t$order_data['po_number']\t= ''; // PO Number\n\t\t$order_data['header_location']\t= ''; // Header Location\n\t\t$order_data['ship_instruct_1']\t= ''; // Ship Instructions 1\n\t\t$order_data['ship_instruct_2']\t= ''; // Ship Instructions 2\n\t\t$order_data['payment_doc_number']\t= ''; // Payment DocNo (Check Number or other Document Number)\n\t\t$order_data['payment_doc_date']\t= ''; // Payment Doc Date(MM/DD/YYYY)\n\t\t$order_data['ar_ref_1']\t= ''; // AR Reference1\n\t\t$order_data['ar_ref_2']\t= ''; // AR Reference2\n\t\t$order_data['ar_ref_3']\t= ''; // AR Reference3\n\t\t$order_data['commission_percent']\t= ''; // Commission Percent\n\t\t$order_data['ar_ref']\t= ''; // AR Reference\n\t\t$order_data['batch_id']\t= ''; // Batch ID\n\t\t$order_data['apply_to_memo']\t= ''; // ApplyTo (Credit Memos only)\n\t\t$order_date = $order->order_date;\n\t\t$date = explode(\" \",$order_date);\n\t\t$order_data['ship_date']\t= \t$date[0]; // Shipping Date(MM/DD/YYYY)\n\t\t$order_data['header_user_1']\t= ''; // Header User Field 1\n\t\t$order_data['header_user_2']\t= ''; // Header User Field 2\n\t\t$order_data['header_user_3']\t= ''; // Header User Field 3\n\t\t$order_data['header_user_4']\t= ''; // Header User Field 4\n\t\t$order_data['request_date']\t= ''; // Request Date(MM/DD/YYYY)\n\t\t$order_data['promise_date']\t= ''; // Promise Date(MM/DD/YYYY)\n\t\t$order_data['required_ship_date']\t= ''; // Required ShipDate(MM/DD/YYYY)\n\t\t$order_data['line_user_1']\t= ''; // Line User Field 1\n\t\t$order_data['line_user_2']\t= ''; // Line User Field 2\n\t\t$order_data['line_user_3']\t= ''; // Line User Field 3\n\t\t$order_data['line_user_4']\t= ''; // Line User Field 4\n\t\t$order_data['line_user_5']\t= ''; // Line User Field 5\n\t\t$order_data['line_comment']\t= ''; // Line Comment\n\t\t$order_data['feature_number']\t= ''; // Feature No (The following 4 fields may be repeated for each option)\n\t\t$order_data['option_item_number']\t= ''; // Option Item No\n\t\t$order_data['option_qty']\t= ''; // Option Qty\n\t\t$order_data['option_price']\t= ''; // Option Price (blank for default price)\n\t\t$order_data['line_location']\t= ''; // Line Location\n\t\t$order_data['item_desc_2']\t= ''; // Item Description 2\n\t\t\n\t\t\n\t\t//if ($GLOBALS['wc_csv_export_index'] === 0 ) { // first row of $data\n\t\t//$order_data['payment_amount']\t= $GLOBALS['wc_csv_export_index']; //wc_format_decimal( $order->get_total(), 2 ); // Payment Amount // first row only\n\t\t//}\n\t\t\n\t\t$order_data['payment_amount']\t= wc_format_decimal( $order->get_total(), 2 ); // Payment Amount // first row only\n\n\tif( !empty( $order->get_tax_totals() ) ) {\n\t\t\tforeach ($order->get_tax_totals() as $tax_rate => $tax ){\n\t\t\t\t$order_data['tax_schedule_code'] =\t$tax->label;//$order->shipping_state; // Tax Schedule Code \n\t\t\t}\t\t\n\t\t} else {\n\t\t$order_data['tax_schedule_code'] =\t'ALL'; // ALL\n\t\t}\n\n\treturn $order_data;\n}", "public function execute(Observer $observer)\n {\n $item = $observer->getEvent()->getData('quote_item');\n $item = ($item->getParentItem() ? $item->getParentItem() : $item);\n $price = $item->getProduct()->getPriceInfo()->getPrice('final_price')->getValue();\n $new_price = $price - ($price * 50 / 100); //discount the price of the product to 50%\n $item->setCustomPrice($new_price);\n $item->setOriginalCustomPrice($new_price);\n $item->getProduct()->setIsSuperMode(true);\n }", "public function getPricing()\n {\n // get current quantity as its the basis for pricing\n $quantity = $this->quantity;\n\n // Get pricing but maintain original unitPrice (only if post-CASS certification quantity drop is less than 10%),\n $adjustments = $this->quantity_adjustment + $this->count_adjustment;\n if ($adjustments < 0) {\n $originalQuantity = 0;\n $originalQuantity = $this->itemAddressFiles()->sum('count');\n $originalQuantity += $this->mail_to_me;\n if ((($originalQuantity + $adjustments) / $originalQuantity) > 0.90) { // (less than 10%)\n $quantity = $originalQuantity;\n }\n }\n\n // Get pricing based on quantity.\n // If quantity is less than minimum quantity required (only if post-CASS certification),\n // then use the minimum quantity required to retrieve pricing\n if ((\n $this->quantity_adjustment != 0 || $this->count_adjustment != 0) &&\n $this->quantity < $this->getMinimumQuantity()\n ) {\n $quantity = $this->getMinimumQuantity();\n }\n\n // Pricing date is based on submission date or now.\n $pricingDate = (!is_null($this->date_submitted) ? $this->date_submitted : time());\n\n if (!is_null($this->product_id) && !is_null($this->product)) {\n $newPricing = $this->product->getPricing(\n $quantity, $pricingDate,\n $this->invoice->getBaseSiteId()\n );\n $oldPricing = $this->getProductPrice();\n // TODO: refactor this pricing history section, it really shouldn't belong in this method\n if (!is_null($newPricing)) {\n $insert = true;\n if (!is_null($oldPricing) && $newPricing->id == $oldPricing->product_price_id) {\n $insert = false;\n }\n if ($insert) {\n try {\n InvoiceItemProductPrice::firstOrCreate(\n [\n 'invoice_item_id' => $this->id,\n 'product_price_id' => $newPricing->id,\n 'date_created' => date('Y-m-d H:i:s', time()),\n 'is_active' => 1\n ]\n );\n } catch (QueryException $e) {\n // TODO: fix this hack (e.g. why do we need integrity constraint on this table )\n if (strpos($e->getMessage(), 'Duplicate entry') === false) {\n throw $e;\n } else {\n Logger::error($e->getMessage());\n }\n }\n\n if (!is_null($oldPricing)) {\n $oldPricing->is_active = 0;\n $oldPricing->save();\n }\n }\n }\n\n return $newPricing;\n }\n if (!is_null($this->data_product_id) && $this->data_product_id != 0) {\n return $this->dataProduct->getPricing($pricingDate, $this->invoice->site_id);\n }\n if (!is_null($this->line_item_id) && $this->line_item_id != 0) {\n return $this->line_item->getPricing($pricingDate, $this->invoice->getBaseSiteId());\n }\n if ($this->isAdHocLineItem() && $this->unit_price) {\n return (object)array('price' => $this->unit_price);\n }\n return null;\n }", "function update_promo() {\n\tconnect_to_db(DB_SERVER, DB_UN, DB_PWD, DB_NAME);\n\n\t$price = 0;\n\n\t$promo_code = mysql_real_escape_string($_POST['promoCode']);\n\t$promo_name = mysql_real_escape_string($_POST['promoName']);\n\t$promo_description = mysql_real_escape_string($_POST['promoDesc']);\n\t$promo_type = mysql_real_escape_string($_POST['promoType']);\n\t$promo_amount = mysql_real_escape_string($_POST['promoAmount']);\n\n\t// first we grab the pre-existing entry and reapply amounts to the stored item values\n\t$statement_getAmount = \"select PromotionItem.ItemNumber, Item.FullRetailPrice, Promotion.AmountOff, Promotion.PromoType from Promotion, PromotionItem, Item where (Item.ItemNumber=PromotionItem.ItemNumber) AND (Promotion.PromoCode = PromotionItem.PromoCode) AND Promotion.PromoCode='$promo_code'\";\n\t$returnResult = mysql_query($statement_getAmount);\n\n\t// next we grab the PromotionItem table and reapply the sale price.\n\t// this is then recalculated after the edit has been made.\n\t// should've resulted in a 1 output query, any more then the schema must broken. Any less, we skip this step\n\tif(mysql_num_rows($returnResult) > 0) {\n\t\twhile($the_row = mysql_fetch_assoc($returnResult)) {\n\t\t\t// run loop evaluating prices\n\t\t\t$myAmount = $the_row['AmountOff'];\n\t\t\t$myType \t= $the_row['PromoType'];\n\t\t\t$myNumber\t= $the_row['ItemNumber'];\t// was leading to an infamous bug where it would simply grab the first number since were table hopping.\n\t\t\t$myRetail = $the_row['FullRetailPrice'];\t// part two of the glitch, reapply the previous price. If 0 then the number could've been negative, lets fix that\n\n\t\t\t$statement_getSalePrice = \"select SalePrice from PromotionItem where PromoCode='$promo_code' and ItemNumber='$myNumber'\";\n\t\t\t$returnResultItem = mysql_query($statement_getSalePrice);\n\n\t\t\t$the_row_item = mysql_fetch_array($returnResultItem);\n\t\t\t$myPrice\t= $the_row_item['SalePrice'];\n\n\t\t\t$price = recalculatePrice($myAmount, $myType, $myPrice, $myRetail);\n\n\t\t\t// calculate new price\n\t\t\t$new_price = calculatePrice($promo_amount, $promo_type, $price);\n\t\t\t\t//display_result(\"Recalc $price, Calc $new_price values Amount $myAmount, Type $myType, Price $myPrice, FullRetail $myRetail, Promo Amount $promo_amount, Promo Type $promo_type\");\n\n\t\t\t// new price achieved, now add it back into the Promotion Item database\n\t\t\t$update_statement = \"update PromotionItem set SalePrice='$new_price' where PromoCode='$promo_code' AND ItemNumber='$myNumber'\";\n\t\t\t$update_result = mysql_query($update_statement);\n\t\t}\n\t}\n\n\t$promo_amount = applyDecimal($promo_amount);\n\n\t// append string\n\t$appendString=\"\";\n\n\t// setup string\n\tif($promo_code != '')\t\t\t$appendString .= \"PromoCode='$promo_code', \";\n\tif($promo_name != '') $appendString .= \"Name='$promo_name', \";\n\tif($promo_description != '') $appendString .= \"Description='$promo_description', \";\n\tif($promo_type != '') $appendString .= \"PromoType='$promo_type', \";\n\tif($promo_amount != '') $appendString .= \"AmountOff='$promo_amount', \";\n\n\t$appendString = str_lreplace(\",\",\"\",$appendString);\n\t// create the statement\n\t$insertStatement = \"update Promotion set $appendString where PromoCode='$promo_code';\";\n\n\t$result = mysql_query($insertStatement);\n\n\t$message = \"\";\n\n\tif(!$result) {\n\t\t$message = \"Error in updating promo: $promo_code: \". mysql_error();\n\t} else {\n\t\t$message = \"Promotion Successfully Updated for PromoCode: $promo_code.\";\n\t}\n\n\tdisplay_result($message);\n}", "function setOrderSend($object) { \n /* you can itentify the item with $object->Item->ShopId */ \n}", "function pricing() {\n\t\t\tparent::controller();\n\t\t\t\n\t\t}", "private function sellTrasactionPendingAddsMoney(){\n\n }", "function fn_warehouses_update_product_amount(&$new_amount, $product_id, $cart_id, $tracking, $notify, $order_info, $amount_delta, $current_amount, $original_amount, $sign)\n{\n /** @var Tygh\\Addons\\Warehouses\\Manager $manager */\n $manager = Tygh::$app['addons.warehouses.manager'];\n /** @var Tygh\\Addons\\Warehouses\\ProductStock $product_stock */\n $product_stock = $manager->getProductWarehousesStock($product_id);\n\n if (!$product_stock->hasStockSplitByWarehouses()) {\n return;\n }\n\n // return amount that will be save to main table to its original amount\n $new_amount = $original_amount;\n\n $location = fn_warehouses_get_location_from_order($order_info);\n $pickup_point_id = fn_warehouses_get_pickup_point_id_from_order($order_info, $product_id, $cart_id);\n $destination_id = fn_warehouses_get_destination_id($location);\n\n if ($sign == '-') {\n if ($pickup_point_id && $product_stock->getWarehousesById($pickup_point_id)) {\n $product_stock->reduceStockByAmountForStore($amount_delta, $pickup_point_id);\n } elseif ($destination_id) {\n $product_stock->reduceStockByAmountForDestination($amount_delta, $destination_id);\n } else {\n $product_stock->reduceStockByAmount($amount_delta);\n }\n } else {\n $product_stock->increaseStockByAmount($amount_delta);\n }\n\n $manager->saveProductStock($product_stock);\n}", "public function execute(\\Magento\\Framework\\Event\\Observer $observer)\n {\n $product = $observer->getProduct();\n $_pricePerPound = $product->getPricePerPound();\n if($_pricePerPound > 0){\n $weight = $product->getWeight() ? $product->getWeight() : 1;\n $_pricePerPound = str_replace(',', '', $_pricePerPound);\n $price = $_pricePerPound * $weight;\n $product->setPrice($price);\n }\n }", "public function getPrice() {\n }", "abstract function total_price($price_summary);", "public function updateAfterInsertDeliveryItem($sale_type, $status, $sale_item, $sent_quantity)\n {\n if ($sale_type == 'booking') {\n if ($status != 'packing') {\n $get_item = $this->getSaleBookingItem($sale_item->product_id, $sale_item->sale_id);\n if (!$get_item) {\n throw new \\Exception(lang(\"not_get_data\"));\n }\n // $get_item = $this->db->get_where('sale_booking_items', ['product_id' => $sale_item->product_id, 'sale_id' => $sale_item->sale_id])->row();\n $qty_deliver = $get_item->quantity_delivering + $sent_quantity;\n $qty_booking = $get_item->quantity_booking - $sent_quantity;\n $qty_delivered = $get_item->quantity_delivered + $sent_quantity;\n\n $get_wh = $this->getWarehouseProductCompany($get_item->warehouse_id, $sale_item->product_id);\n $get_prod = $this->site->getProductByID($sale_item->product_id);\n\n $wh_book = (int) $get_wh->quantity_booking - (int) $sent_quantity;\n $prod_book = (int) $get_prod->quantity_booking - (int) $sent_quantity;\n\n if ($wh_book < 0 || $prod_book < 0) {\n throw new \\Exception(lang(\"error_insert_delivery_item\"));\n }\n\n if ($status == 'delivered') {\n $update_booking = [\n \"quantity_booking\" => $qty_booking,\n \"quantity_delivering\" => $qty_deliver,\n \"quantity_delivered\" => $qty_delivered\n ];\n } else {\n $update_booking = [\n \"quantity_booking\" => $qty_booking,\n \"quantity_delivering\" => $qty_deliver\n ];\n }\n if (!$this->db->update('sale_booking_items', $update_booking, ['product_id' => $sale_item->product_id, 'sale_id' => $sale_item->sale_id])) {\n throw new \\Exception(lang(\"failed_update_sale_booking_item\"));\n } else {\n if (!$this->db->update('warehouses_products', ['quantity_booking' => $wh_book], ['warehouse_id' => $get_item->warehouse_id, 'product_id' => $sale_item->product_id, 'company_id' => $this->session->userdata('company_id')])) {\n throw new \\Exception(lang(\"failed_update_stock\"));\n } else {\n if (!$this->db->update('products', ['quantity_booking' => $prod_book], ['id' => $sale_item->product_id])) {\n throw new \\Exception(lang(\"failed_update_stock_prod\"));\n }\n }\n }\n }\n if ($this->db->update('sale_items', [\"sent_quantity\" => $sale_item->sent_quantity + $sent_quantity], ['id' => $sale_item->id])) {\n return true;\n }\n } elseif ($sale_type == NULL) {\n if ($this->db->update('sale_items', [\"sent_quantity\" => $sale_item->sent_quantity + $sent_quantity], ['id' => $sale_item->id])) {\n return true;\n }\n }\n return false;\n }", "public function getCartPrice()\n {\n return 111;\n }", "public function getPrice()\n {\n }", "public function getPrice()\n {\n }", "public function getPrice() {\n return $this->item->getPrice();\n }", "function enhanced_invoice($order_id, $end = 0){\n $order = $this->order_model->get($order_id);\n $order_type = $this->order_model->get_order_type($order->order_type);\n $od = $this->order_details_model->get_order_details($order_id, true);\n\n $inv = array();\n $total = 0;\n foreach ($od as $key) {\n $inv[$key->id]['name'] = $key->arabic;\n $inv[$key->id]['eng'] = $key->eng;\n $inv[$key->id]['price'] = $key->price;\n $inv[$key->id]['qty'] = $key->quantity;\n $inv[$key->id]['total_line'] = $key->quantity*$key->price;\n $total += $inv[$key->id]['total_line'];\n }\n //$items_table = to_table($inv);\n\n $this->load->helper('orders');\n $s = get_service($order->order_type);\n\n $service = get_service_value($total, $s);\n $grand_total = $total+$service;\n \n $this->data['grand_total'] = $grand_total;\n $this->data['service_value'] = ($service)? $service : 0;\n $this->data['ratio'] = $s;\n $this->data['total'] = $total;\n $this->data['table'] = $this->order_model->get_table($order->customer_id);\n $this->data['order'] = $order;\n $this->data['order_type'] = $order_type;\n $this->data['items_table'] = $inv ;\n\n $this->check_order($order_type, $this->data);\n\n\n $invID = str_pad($order->id, 5, '0', STR_PAD_LEFT); \n\n$header = $this->load->view('app/orders/invoice/header',$this->data, true);\n$items = $this->load->view('app/orders/invoice/items', $this->data, true);\n$footer = $this->load->view('app/orders/invoice/footer',$this->data, true);\n\n $od = $this->order_details_model->get_count($order_id);\n\n\n $format = $this->get_pdf_format($od);\n\n $this->load->library('pdf', array(\n 'format'=>$format, \n 'title'=>'Club21 Cafe & Restaurant', \n 'string'=>'Invoice Details', \n 'footer'=>false\n ));\n //$this->pdf->lib_setTitle('Invoice Details');\n $this->pdf->lib_Cell(0, 10, \"$od lines [ $format ] $order_type->name\", 1, 1, 'C');\n\n $y_head = $this->pdf->lib_getY();\n $this->pdf->lib_writeHTMLCell(0, 0, 0, $y_head, $header, 1, 0, false, true, '', true);\n $y_items = $y_head + $this->pdf->lib_getLastH();\n $this->pdf->lib_writeHTMLCell(0, 0, 0, $y_items, $items, 0, 0, false, true, '', true);\n $y_foot = $y_items + $this->pdf->lib_getLastH();\n $this->pdf->lib_writeHTMLCell(0, 0, 0, $y_foot, $footer, 0, 0, false, true, '', true);\n\n\n $this->pdf->lib_output(APPPATH .\"invoice/inv_$invID.pdf\");\n $this->pdf_image(APPPATH .\"invoice/inv_$invID.pdf\"); \n $this->load->library('ReceiptPrint'); \n $this->receiptprint->connect('192.168.0.110', 9100);//any ip and port \n $this->receiptprint->print_image(APPPATH .\"invoice/inv_$invID.pdf.$this->ext\"); \n//unlink(APPPATH .\"invoice/inv_$invID.pdf.$this->ext\");\n if($end == 1 )\n $this->end($order_id, $grand_total);\n $this->edit_order($order->id);\n\n }", "function price( )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n return $this->Price;\n }", "public function ItemPriceOnDODetail($params)\n {\n return $this->deliveryOrderDetail::where($params)->get() == null ? false : $this->deliveryOrderDetail::where($params)->pluck(); \n }", "public function update(Request $request, DeliveryPrice $deliveryPrice)\n {\n //\n }", "public function update(Request $request, DeliveryPrice $deliveryPrice)\n {\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 getPrice()\n {\n return 0.2;\n }", "function showTransactionResult()\r\n{\r\n global $config;\r\n $items_subtotal = 0; //init\r\n $extras_subtotal = 0; //init\r\n \r\n /*\r\n echo '<pre>';\r\n var_dump($_POST);\r\n echo'</pre>';\r\n */\r\n \r\n //start ITEMS ordered table\r\n //date format May 13, 2018, 1:16 am\r\n $html = '\r\n\r\n <h2>\r\n <span>Order Details</span>\r\n </h2>\r\n\r\n <p style=\"margin-left:1rem; margin-top:0;\">Order Date: ' . date(\"F j, Y, g:i a\") . '</p>\r\n <div class=\"menuitem\">\r\n <h3 style=\"margin-top:0;\">Items Ordered:</h3>\r\n <table style=\"width:100%\">\r\n <tr>\r\n <th>Item Name</th>\r\n <th>Qty</th>\r\n <th>Price</th>\r\n <th>Item Total</th>\r\n </tr>\r\n ';\r\n \r\n //this foreach block generates the table rows of ITEMS ordered\r\n foreach ($_POST as $key => $value) \r\n {\r\n //check $key is an item or a topping\r\n if (substr($key,0,5) == 'item_') {\r\n \r\n //get qty, cast as int\r\n $quantity = (int)$value;\r\n \r\n //check if there is an order for this item\r\n if ($quantity > 0) {\r\n \r\n //seperate string with _ as the delimiter\r\n $key_array = explode('_',$key);\r\n \r\n //cast item number as an integer\r\n $key_id = (int)$key_array[1];\r\n \r\n //get price, cast as float\r\n $price = (float)$config->items[$key_id - 1]->Price;\r\n \r\n //get name\r\n $name = $config->items[$key_id - 1]->Name;\r\n \r\n //calculate total for this item\r\n $item_total = $quantity * $price;\r\n \r\n //add to over items subtotal\r\n $items_subtotal += $item_total;\r\n \r\n //money format\r\n $price_output = money_format('%.2n', $price);\r\n $item_total_output = money_format('%.2n', $item_total);\r\n \r\n $html .= '\r\n <tr>\r\n <td>' . $name . '</td>\r\n <td>' . $quantity . '</td>\r\n <td>' . $price_output . '</td>\r\n <td>' . $item_total_output . '</td>\r\n </tr>\r\n ';\r\n }\r\n }\r\n }\r\n \r\n //money format\r\n $items_subtotal_output = money_format('%.2n', $items_subtotal);\r\n \r\n //finish ITEMS table\r\n $html .= '\r\n <tr class=\"tabletotal\">\r\n <td colspan=3 class=\"tabletotaltitle\">Items Subtotal: </td>\r\n <td>' . $items_subtotal_output . '</td>\r\n </tr>\r\n </table>\r\n '; \r\n \r\n //start EXTRAS ordered table\r\n $extras_html = '\r\n <h3>Extras Ordered:</h3>\r\n <table style=\"width:100%\">\r\n <tr>\r\n <th>Extra</th>\r\n\r\n <th>Qty</th>\r\n\r\n <th>Price</th>\r\n </tr>\r\n ';\r\n \r\n //this foreach block generates the table rows of EXTRAS ordered\r\n foreach ($_POST as $key => $value) \r\n {\r\n if (substr($key,0,7) == 'extras_') {\r\n \r\n foreach ($value as $extra_key => $extra) {\r\n \r\n //seperate string with _ as the delimiter\r\n $key_array = explode('_',$key);\r\n \r\n //cast item number as an integer\r\n $key_id = (int)$key_array[1];\r\n \r\n $associated_item_key = 'item_' . $key_id;\r\n \r\n $quantity_of_extra = $_POST[$associated_item_key];\r\n \r\n $extra_subtotal = $quantity_of_extra * 0.25; //calculates subtotal of each particular extra\r\n \r\n $extras_subtotal += $extra_subtotal; //adds to overall subtotal of all extras\r\n \r\n $extra_subtotal_output = money_format('%.2n', $extra_subtotal);\r\n\r\n //add row to EXTRAS table\r\n $extras_html .= '\r\n <tr>\r\n <td>' . $extra . '</td>\r\n\r\n <td>' . $quantity_of_extra . '</td>\r\n <td>' . $extra_subtotal_output . '</td>\r\n\r\n </tr>\r\n ';\r\n }\r\n }\r\n }\r\n \r\n //money format\r\n $extras_subtotal_output = money_format('%.2n', $extras_subtotal);\r\n \r\n //finish EXTRAS table\r\n $extras_html .='\r\n <tr class=\"tabletotal\">\r\n\r\n <td colspan=\"2\" class=\"tabletotaltitle\">Extras Subtotal: </td>\r\n\r\n <td>' . $extras_subtotal_output . '</td>\r\n </tr>\r\n </table>\r\n </div>\r\n ';\r\n \r\n if ($extras_subtotal == 0) {\r\n $extras_html = '\r\n <h3>Extras Ordered:</h3>\r\n <p>No extras were ordered.</p>\r\n </div>\r\n ';\r\n }\r\n \r\n $html .= $extras_html;\r\n \r\n //calculate tax & totals\r\n $order_subtotal = $items_subtotal + $extras_subtotal;\r\n $tax = $order_subtotal * .101; //10.1%\r\n $grand_total = $order_subtotal + $tax;\r\n \r\n //money format\r\n $order_subtotal = money_format('%.2n', $order_subtotal);\r\n $tax = money_format('%.2n', $tax);\r\n $grand_total = money_format('%.2n', $grand_total);\r\n\r\n //display order summary\r\n $html .= '\r\n <div class=\"menuitem\">\r\n <h3 style=\"margin-top:0;\">Order Summary:</h3>\r\n <table style=\"width:100%\">\r\n <tr>\r\n <td>Item(s) Subtotal: </td>\r\n <td>' . $items_subtotal_output . '</td>\r\n </tr>\r\n <tr>\r\n <td>Extra(s) Subtotal: </td>\r\n <td>' . $extras_subtotal_output . '</td>\r\n </tr>\r\n <tr>\r\n <td>Order Subtotal: </td>\r\n <td>' . $order_subtotal . '</td>\r\n </tr>\r\n <tr>\r\n <td>Tax: </td>\r\n <td>' . $tax . '</td>\r\n </tr>\r\n <tr class=\"tabletotal\">\r\n <td>Grand Total: </td>\r\n <td>' . $grand_total . '</td>\r\n </tr>\r\n </table>\r\n </div>\r\n ';\r\n\r\n\r\n return $html;\r\n}", "function getOverallPrice(){\n\t\t$t=0;\n\t\t$a = Item::all();\n\t\tforeach($a as $n){\n\t\t$dur= $n->qty;\n\t\t$sl =Order::where('status', 'delivered')->count();\n\t\t$r=intVal(intVal($dur)-intVal($sl))*intVal($n->price);\n\t\t$t = $t + $r;\n\t\t}\n\t\treturn $t;\n\t\t}", "public function update($id) {\n $data = ItemOrder::where('id', $id)->first();\n $data->user_name = request()->user_name;\n $data->table_number = request()->table_number;\n \n $data->save();\n $orderId = $data->id;\n\n ItemOrderDetail::where('order_id', $orderId)->delete();\n\n foreach(request()->order_details as $val) {\n $detailObj = new ItemOrderDetail();\n $detailObj->order_id = $orderId;\n $detailObj->item_id = $val['item_id'];\n $detailObj->quantity = $val['quantity'];\n $detailObj->final_price = $val['price'] * $val['quantity'];\n $detailObj->price = $val['price'];\n\n $detailObj->save();\n }\n\n $data->save();\n\n return redirect()->route('orders')->with('success', 'Order updated successfully.');\n }", "public function addPurchase($item)\n\t{\n\n\t $sql=\"UPDATE item set purchase_price = ? WHERE id = ? \";\n \tif($this->db->query($sql,$item)) {\n \n \t return true;\n \t }\n \t\treturn FALSE;\n\n\t}", "function pewc_set_product_weight_meta( $cart_item_data, $item, $group_id, $field_id, $value ) {\n\n\t$item_weight = ! empty( $cart_item_data['product_extras']['weight'] ) ? $cart_item_data['product_extras']['weight'] : 0;\n\tif( $item['field_type'] == 'calculation' && ( ! empty( $item['formula_action'] ) && $item['formula_action'] == 'weight' ) ) {\n\t\t$cart_item_data['product_extras']['weight'] = $item_weight + $value;\n\t}\n\n\treturn $cart_item_data;\n\n}", "public function api_update_price(){\n $watchlists = $this->wr->all();\n foreach($watchlists as $watchlist)\n {\n $current_price = $this->get_quotes($watchlist->id);\n\n $this->wr->update([\n 'current_price' => $current_price,\n ],$watchlist->id);\n }\n }", "public function getPrice(){\n return $this->price;\n }", "function getPrice()\n {\n return $this->price;\n }", "public function getPriceInfos(&$orderItem, array $order) {\n $info = array();\n $postion = 0;\n $orderCurrency = $order['currency_code'];\n\n $method = $order['shipping_method'];\n $shipingMethod = array('pm_id' => '', 'title' => $method, 'description' => '', 'price' => 0);\n\n $this->load->model('account/order');\n $rows = $this->model_account_order->getOrderTotals($order['order_id']);\n foreach ($rows as $row) {\n $title = $row['title'];\n $price = $row['value'] * $order['currency_value'];\n $info[] = array(\n 'title' => $title,\n 'type' => $row['code'],\n 'price' => $price,\n 'currency' => $orderCurrency,\n 'position' => $postion++);\n\n if (ereg($method, $title)) {\n $shipingMethod['price'] = $price;\n }\n }\n $orderItem['shipping_method'] = $shipingMethod;\n\n return $info;\n }", "private function setProductItem(array $itemData): void\n {\n //====================================================================//\n // Safety Check\n if (!$this->item instanceof WC_Order_Item_Product) {\n return;\n }\n //====================================================================//\n // Update Quantity\n if (isset($itemData[\"quantity\"])) {\n $this->setGeneric(\"_quantity\", $itemData[\"quantity\"], \"item\");\n }\n //====================================================================//\n // Update Name\n if (isset($itemData[\"name\"])) {\n $this->setGeneric(\"_name\", $itemData[\"name\"], \"item\");\n }\n //====================================================================//\n // Update Product Id\n if (isset($itemData[\"product\"])) {\n $productId = self::objects()->id($itemData[\"product\"]);\n $this->setGeneric(\"_product_id\", $productId, \"item\");\n }\n //====================================================================//\n // Update Unit Price\n if (isset($itemData[\"subtotal\"])) {\n // Compute Expected Subtotal\n $subtotal = $this->item->get_quantity() * self::prices()->taxExcluded($itemData[\"subtotal\"]);\n // Compute Expected Subtotal Tax Incl.\n $subtotalTax = $this->item->get_quantity() * self::prices()->taxAmount($itemData[\"subtotal\"]);\n } else {\n $subtotal = $this->item->get_subtotal();\n $subtotalTax = $this->item->get_subtotal_tax();\n }\n //====================================================================//\n // Update Total Line Price\n // There is A Discount Percent\n if (isset($itemData[\"discount\"])) {\n // Compute Expected Total\n $total = (float) $subtotal * (1 - $itemData[\"discount\"] / 100);\n // Compute Expected Total Tax Incl.\n $totalTax = (float) $subtotalTax * (1 - $itemData[\"discount\"] / 100);\n // There is NO Discount\n } else {\n $total = $subtotal;\n $totalTax = $subtotalTax;\n }\n //====================================================================//\n // Update Item Taxes Array\n if (($totalTax != $this->item->get_total_tax()) || ($subtotalTax != $this->item->get_subtotal_tax())) {\n $this->setProductTaxArray((float) $totalTax, (float) $subtotalTax);\n }\n //====================================================================//\n // Update Item Totals\n $this->setGeneric(\"_total\", $total, \"item\");\n $this->setGeneric(\"_subtotal\", $subtotal, \"item\");\n }", "function CallOrder()\n {\n global $USER, $CONF, $UNI;\n\n $this->amount = str_replace(\".\",\"\",HTTP::_GP('amount',0));\n $this->amountbis = HTTP::_GP('amount',0);\n\t\t\t\t\n\t\t\t\tif($this->amount < 10000){\n\t\t\t\t$this->printMessage('You have to buy minimum 10.000 AM!', true, array('game.php?page=donate', 3)); \n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif($this->amount >= 10000 && $this->amount < 20000)\t\t$this->amount *= 1.05;\n\t\t\t\telseif($this->amount >= 20000 && $this->amount < 50000) $this->amount *= 1.10;\n\t\t\t\telseif($this->amount >= 50000 && $this->amount < 100000) $this->amount *= 1.20;\n\t\t\t\telseif($this->amount >= 100000 && $this->amount < 150000) $this->amount *= 1.30;\n\t\t\t\telseif($this->amount >= 150000 && $this->amount < 200000) $this->amount *= 1.40;\n\t\t\t\telseif($this->amount >= 200000) $this->amount *= 1.50;\n\t\t\t\t\n\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$this->amount = round($this->amount + ($this->amount / 100 * 0));\n\t\t\t\t$this->amount = $this->amount + ($this->amount / 100 * 0);\n\t\t\t\t$this->cost = round($this->amountbis * 0.00011071);\n \n\n \n\t\t\t\t\n\t\t\t\t$this_p = new paypal_class;\n\t\t\t\t\n \n $this_p->add_field('business', $this::MAIL);\n \n\t\t\t\t\n\t\t\t $this_p->add_field('return', 'http://'.$_SERVER['HTTP_HOST'].'/game.php?page=overview');\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$this_p->add_field('cancel_return', 'http://'.$_SERVER['HTTP_HOST'].'/ipns.php');\n $this_p->add_field('notify_url', 'http://'.$_SERVER['HTTP_HOST'].'/ipns.php');\n\t\t\t\t\n $this_p->add_field('item_name', $this->amount.' AM-User('.$USER['username'].').');\n $this_p->add_field('item_number', $this->amount.'_AM');\n $this_p->add_field('amount', $this->cost);\n //$this_p->add_field('action', $action); ?\n $this_p->add_field('currency_code', 'EUR');\n $this_p->add_field('custom', $USER['id']);\n $this_p->add_field('rm', '2');\n //$this_p->dump_fields(); \n\t\t\t\t foreach ($this_p->fields as $name => $value) {\n\t\t\t\t\t$field[] = array('text'=>'<input type=\"hidden\" name=\"'.$name.'\" value=\"'.$value.'\">');\n\t\t\t\t}\n\t\t\t $this->tplObj->assign_vars(array(\n\t\t\t\t'fields' => $field,\n\t\t\t ));\n\t\t\t$this->display('paypal_class.tpl');\n }", "public function getStoreToOrderRate();", "function wwt_perform_consignment_stocks_increase($status, $order) {\r\n $shippingMethod = get_shipping_method_with_id($order);\r\n $consignmentStocks = WWT_ConsignmentEntity::get_all();\r\n\r\n foreach ($consignmentStocks as $consignment) {\r\n $consignmentStockShippingMethods = explode(FIELDS_SEPARATOR, $consignment->paymentMethods);\r\n\r\n if (in_array($shippingMethod, $consignmentStockShippingMethods)) {\r\n $order->add_order_note(sprintf(__('Goods were taken from consignment stock [%s]. No main warehouse changes.', 'medinatur_v3'), $consignment->name));\r\n\r\n $products = $order->get_items();\r\n\r\n foreach ($products as $product) {\r\n $itemStockReduced = $product->get_meta( WWT_STOCK_REDUCED_FLAG, true );\r\n\r\n if (!$itemStockReduced) {\r\n $quantity = $product->get_quantity();\r\n $productId = $product->get_product_id();\r\n WWT_ConsignmentEntity::update_product($consignment->id, $productId, -$quantity);\r\n $logEntry = new WWT_ConsignmentLogEntity($consignment->id, NULL, $productId, -$quantity, sprintf(__('Amout reduced because of change in order %d.', 'woocommerce-warehouse-transactions'), $order->id), $order->id);\r\n $logEntry->save();\r\n $product->add_meta_data( WWT_STOCK_REDUCED_FLAG, $quantity, true );\r\n $product->save();\r\n }\r\n }\r\n\r\n $status = false;\r\n }\r\n }\r\n\r\n return $status;\r\n}", "public function getPrice() {\n return $this->price;\n}", "public function changeQtyAction()\n {\n if (!$this->_isActive()\n || !$this->_getHelper()->isChangeItemQtyAllowed()) {\n $this->norouteAction();\n return;\n }\n\n if ($this->_expireAjax()) {\n return;\n }\n\n $result = array();\n\n $quoteItem = $this->getOnepage()->getQuote()->getItemById(\n $this->getRequest()->getPost('item_id')\n );\n\n if ($quoteItem) {\n $quoteItem->setQty(\n $this->getRequest()->getPost('qty')\n );\n\n try {\n if ($quoteItem->getHasError() === true) {\n $result['error'] = $quoteItem->getMessage(true);\n } else {\n $this->_recalculateTotals();\n $result['success'] = true;\n }\n } catch (Mage_Core_Exception $e) {\n $result['error'] = $e->getMessage();\n } catch (Exception $e) {\n Mage::logException($e);\n $result['error'] = Mage::helper('ecomdev_checkitout')->__('There was an error during changing product qty');\n }\n } else {\n $result['error'] = Mage::helper('ecomdev_checkitout')->__('Product was not found');\n }\n\n $this->_addHashInfo($result);\n\n $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));\n }", "public function treatmentprice($slug = null, $orderid = null, $update = null) {\n \n $this->loadModel('Treatments');\n $this->loadModel('Orders');\n $this->loadModel('Orderdetails');\n $this->loadModel('Medicines');\n $this->loadModel('Pils');\n\n if ($this->request->is('post')) {\n //pr($this->request->data); exit; \n if(!empty($this->request->data)){\n if($update != ''){\n $oldOrderList = $this->Orders->get(base64_decode($orderid) , ['contain' => ['Orderdetails']])->toArray();\n foreach($oldOrderList['orderdetails'] as $delOrd){\n $orderdetaildt = $this->Orderdetails->get($delOrd['id']);\n $this->Orderdetails->delete($orderdetaildt);\n } \n }\n\n if(!empty($this->request->data['checkbox'])){ \n foreach($this->request->data['checkbox'] as $k=>$v){\n $dt = explode(\"|,|\", $v);\n $ordid = $dt[0];\n //pr($dt); exit;\n $orderdetailTable = TableRegistry::get('Orderdetails');\n $orderdetail = $orderdetailTable->newEntity(); \n $orderdetail->ord_id = $dt[0];\n $orderdetail->treatment_id = $dt[1];\n $orderdetail->medicine_id = $dt[2];\n $orderdetail->pil_id = $dt[3];\n $orderdetail->pil_name = $dt[4];\n $orderdetail->pil_qty = $dt[5];\n $orderdetail->pil_price = $dt[6];\n if ($orderdetailTable->save($orderdetail)) {\n $id = $orderdetail->id;\n } \n }\n \n $tableRegObj = TableRegistry::get('Orders');\n $query = $tableRegObj->query();\n $query->update()->set(['is_cart' => 1])->where(['id' => $ordid])->execute(); \n }\n return $this->redirect(['action' => 'cart']); \n } else {\n $this->Flash->error(__('Please Select Pil.'));\n }\n }\n\n $treatment = $this->Treatments->find()\n ->contain(['Categories', 'Medicines','Medicines.Pils','TreatmentQuestions','TreatmentQuestions.Questions','TreatmentQuestions.Questions.QuestionCheckboxes'])\n ->where(['Treatments.slug' => $slug])\n ->first()->toArray();\n\n $order_id = base64_decode($orderid); \n $medicine_list = $treatment['Medicines'];\n $medicine = array();\n $ik = 1;\n foreach($medicine_list as $mlist){\n $pil = $this->Pils->find()->hydrate(false)->where(['Pils.mid' => $mlist['id']])->toArray(); \n if(!empty($pil)){\n $medicine[$ik]['Mediciine']['id'] = $mlist['id'];\n $medicine[$ik]['Mediciine']['title'] = $mlist['title'];\n $medicine[$ik]['Pils'] = $pil;\n }\n $ik++;\n }\n \n if($update != ''){\n $order = $this->Orders->get($order_id , ['contain' => ['Orderdetails']])->toArray();\n $inOrder = array(); $totAmt = 0;\n foreach($order['orderdetails'] as $orddt){ $inOrder[] = $orddt['pil_id']; $totAmt = $totAmt + $orddt['pil_price']; }\n } else {\n $totAmt = 0.00;\n } \n\n $this->set(compact('treatment','questionlist','order_id','medicine','order','inOrder','update','totAmt'));\n $this->set('_serialize', ['treatment']); \n }" ]
[ "0.62517107", "0.6140885", "0.6121479", "0.6097807", "0.6069457", "0.6024238", "0.60186845", "0.60075897", "0.5979373", "0.5971058", "0.5931979", "0.59287536", "0.5922904", "0.5911991", "0.5909844", "0.58986706", "0.5893429", "0.58852726", "0.586664", "0.5855399", "0.5804308", "0.580404", "0.58031785", "0.57846445", "0.5777181", "0.57553464", "0.57445365", "0.5734026", "0.571564", "0.569767", "0.56964016", "0.5693285", "0.5687065", "0.5684167", "0.56796926", "0.5671496", "0.56636465", "0.5656839", "0.56483036", "0.5644571", "0.5643441", "0.5639002", "0.5634221", "0.56302446", "0.5624373", "0.5616472", "0.56117547", "0.56067616", "0.55992675", "0.55982697", "0.55915743", "0.5564272", "0.5549341", "0.55459905", "0.55452234", "0.55422795", "0.55419534", "0.55412537", "0.55345196", "0.5528542", "0.5527802", "0.5527304", "0.55244476", "0.55218244", "0.55163324", "0.551525", "0.5513674", "0.5504393", "0.5504064", "0.5503202", "0.5502155", "0.55017453", "0.54990196", "0.5497226", "0.54967743", "0.54829127", "0.54829127", "0.54824114", "0.548131", "0.54812056", "0.54798645", "0.54763454", "0.54763454", "0.54697406", "0.5464475", "0.54624104", "0.5460377", "0.5458372", "0.5456209", "0.54476184", "0.5444377", "0.5443431", "0.54431427", "0.54308206", "0.5429081", "0.54219514", "0.54175454", "0.54124326", "0.54044056", "0.53992236", "0.5396621" ]
0.0
-1
Multiplied Price Item and Discount on Delivery Order Detail
public function SumItemDiscountToSubTotal($request) { if (empty($request['discount'])) { $sub_total = $request['price']*$request['qty']; } else { $sub_total = ($request['price'] - ($request['discount']/100*$request['price']))*$request['qty']; } return $sub_total; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function __lineItemTotal($qty, $price, $rate) {\n\n\n\n\n\n\n\n// if ($curency_id == 2)\n// $currency = 1;\n//\n// if ($curency_id == 1)\n// $currency = 4.17;\n//\n// if ($curency_id == 3)\n// $currency = 4.50;\n\n\n\n $line_total = $qty * $price * $rate;\n\n //$line_total = $line_total + (($line_total * $taxRate) / 100);\n\n\n\n return $line_total;\n }", "public function ItemPriceOnDODetail($params)\n {\n return $this->deliveryOrderDetail::where($params)->get() == null ? false : $this->deliveryOrderDetail::where($params)->pluck(); \n }", "protected function calculatePrices()\n {\n }", "protected function calculateDiscount() : void{\r\n $percentage = ($this->discounted_value * 100) / $this->order->getTrueTotal();\r\n $new_total = $this->order->getTrueTotal() - $this->discounted_value;\r\n\r\n $this->order_discount_value = $this->discounted_value;\r\n $this->order_discount_percentage = $percentage;\r\n $this->order_discount_reason = \"For every \" . $this->products_nr . \" products from category #\" . $this->category_id . \" you get one free. You got: \";\r\n foreach($this->items_matching as $item){\r\n $this->order_discount_reason .= floor($item[\"qty\"] / $this->products_nr) . \" x '\" . $item[\"description\"] . \"' (€\". $item[\"price\"] .\" each) ; \";\r\n }\r\n $this->order_new_total = $new_total;\r\n }", "public function deliveryPriceDhaka()\n {\n }", "function calc_extra_sp_cost($Discount = 1){\r\n\t$list = array('D','E','A');\r\n\tforeach($list as $v){\r\n\t\tif(preg_match('/CostSP<([0-9]+)>/',$this->Eq[$v]['spec'],$array)){\r\n\t\t\t$a = intval($array[1]);\r\n\t\t\t$this->SP_Cost += ceil($a * $Discount);\r\n\t\t}\r\n\t}\r\n}", "protected function selectDiscount($orderDetails) {\n\n //Total order value \n $orderValue = $orderDetails->total;\n $this->logger->info(\"Select discount based on order value\");\n\n //Query for product to get product categoryId\n $productDetails = $this->assignProductCategoryId($orderDetails);\n\n foreach($productDetails->items as $key => $values) {\n \n if($values->category == 2 && $values->quantity >= 5) { \n $discountsDetail = $this->computeDiscounts(2, $orderValue, $values);\n $values->discountType = $discountsDetail[\"discountType\"];\n $values->discountQuantity = $discountsDetail[\"discountQuantity\"];\n $values->quantity = $values->quantity + $discountsDetail[\"discountQuantity\"];\n } else if($values->category == 1 && $values->quantity >= 2) { \n $discountsDetail = $this->computeDiscounts(3, $orderValue, $productDetails); \n $orderDetails = $discountsDetail[\"productDetails\"];\n $orderValue = $orderDetails->total - $discountsDetail[\"discountPrice\"]; \n }\n }\n \n $discountPrice = 0;\n $discountType = \"\"; \n $customerId = $orderDetails->{'customer-id'}; \n $customerDetail = $this->discountsRepository->findCustomerById($customerId);\n $customerRevenue = (count($customerDetail) > 0) ? $customerDetail[0]['revenue'] : 0; \n if($customerRevenue >= 1000) {\n $discountsDetail = $this->computeDiscounts(1, $orderValue, []);\n $discountPrice = $discountsDetail[\"discountPrice\"];\n $discountType = $discountsDetail[\"discountType\"]; \n }\n \n $responseData = $orderDetails;\n $responseData->discountPrice = $discountPrice;\n $responseData->discountType = $discountType; \n $responseData->payableAmount = $orderValue - $discountPrice; \n return $responseData;\n \n }", "public function calculateDiscount(array $order): float;", "public function calItem($quantity,$item_price){\n $cal_price=$quantity*$item_price;\n return $cal_price;\n }", "public function calculatePrices(): void\n {\n $orders = ServiceContainer::orders();\n $pizzaPrice = $orders->calculatePizzaPrice($this->items);\n $deliveryPrice = $orders->calculateDeliveryPrice($pizzaPrice, $this->outside, $this->currency);\n $this->delivery_price = $deliveryPrice;\n $this->total_price = $pizzaPrice + $deliveryPrice;\n }", "function get_discounted_price( $values, $price, $add_totals = false ) {\n\t\n\t\t\tif ($this->applied_coupons) foreach ($this->applied_coupons as $code) :\n\t\t\t\t$coupon = new cmdeals_coupon( $code );\n\t\t\t\t\n\t\t\t\tif ( $coupon->apply_before_tax() && $coupon->is_valid() ) :\n\t\t\t\t\t\n\t\t\t\t\tswitch ($coupon->type) :\n\t\t\t\t\t\n\t\t\t\t\t\tcase \"fixed_deals\" :\n\t\t\t\t\t\tcase \"percent_deals\" :\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this_item_is_discounted = false;\n\t\t\t\t\n\t\t\t\t\t\t\t// Specific deals ID's get the discount\n\t\t\t\t\t\t\tif (sizeof($coupon->deal_ids)>0) :\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif ((in_array($values['deal_id'], $coupon->deal_ids) || in_array($values['variation_id'], $coupon->deal_ids))) :\n\t\t\t\t\t\t\t\t\t$this_item_is_discounted = true;\n\t\t\t\t\t\t\t\tendif;\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\n\t\t\t\t\t\t\t\t// No deals ids - all items discounted\n\t\t\t\t\t\t\t\t$this_item_is_discounted = true;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tendif;\n\t\t\t\t\n\t\t\t\t\t\t\t// Specific deals ID's excluded from the discount\n\t\t\t\t\t\t\tif (sizeof($coupon->exclude_deals_ids)>0) :\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif ((in_array($values['deal_id'], $coupon->exclude_deals_ids) || in_array($values['variation_id'], $coupon->exclude_deals_ids))) :\n\t\t\t\t\t\t\t\t\t$this_item_is_discounted = false;\n\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Apply filter\n\t\t\t\t\t\t\t$this_item_is_discounted = apply_filters( 'cmdeals_item_is_discounted', $this_item_is_discounted, $values, $before_tax = true );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Apply the discount\n\t\t\t\t\t\t\tif ($this_item_is_discounted) :\n\t\t\t\t\t\t\t\tif ($coupon->type=='fixed_deals') :\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif ($price < $coupon->amount) :\n\t\t\t\t\t\t\t\t\t\t$discount_amount = $price;\n\t\t\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t\t\t$discount_amount = $coupon->amount;\n\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$price = $price - $coupon->amount;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif ($price<0) $price = 0;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif ($add_totals) :\n\t\t\t\t\t\t\t\t\t\t$this->discount_cart = $this->discount_cart + ( $discount_amount * $values['quantity'] );\n\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\telseif ($coupon->type=='percent_deals') :\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$percent_discount = ( $values['data']->get_price( false ) / 100 ) * $coupon->amount;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif ($add_totals) $this->discount_cart = $this->discount_cart + ( $percent_discount * $values['quantity'] );\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$price = $price - $percent_discount;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\tendif;\n\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\tcase \"fixed_cart\" :\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/** \n\t\t\t\t\t\t\t * This is the most complex discount - we need to divide the discount between rows based on their price in\n\t\t\t\t\t\t\t * proportion to the subtotal. This is so rows with different tax rates get a fair discount, and so rows\n\t\t\t\t\t\t\t * with no price (free) don't get discount too.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Get item discount by dividing item cost by subtotal to get a %\n\t\t\t\t\t\t\t$discount_percent = ($values['data']->get_price( false )*$values['quantity']) / $this->subtotal_ex_tax;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Use pence to help prevent rounding errors\n\t\t\t\t\t\t\t$coupon_amount_pence = $coupon->amount * 100;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Work out the discount for the row\n\t\t\t\t\t\t\t$item_discount = $coupon_amount_pence * $discount_percent;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Work out discount per item\n\t\t\t\t\t\t\t$item_discount = $item_discount / $values['quantity'];\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Pence\n\t\t\t\t\t\t\t$price = ( $price * 100 );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Check if discount is more than price\n\t\t\t\t\t\t\tif ($price < $item_discount) :\n\t\t\t\t\t\t\t\t$discount_amount = $price;\n\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t$discount_amount = $item_discount;\n\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Take discount off of price (in pence)\n\t\t\t\t\t\t\t$price = $price - $discount_amount;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Back to pounds\n\t\t\t\t\t\t\t$price = $price / 100; \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Cannot be below 0\n\t\t\t\t\t\t\tif ($price<0) $price = 0;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Add coupon to discount total (once, since this is a fixed cart discount and we don't want rounding issues)\n\t\t\t\t\t\t\tif ($add_totals) $this->discount_cart = $this->discount_cart + (($discount_amount*$values['quantity']) / 100);\n\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\tcase \"percent\" :\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Get % off each item - this works out the same as doing the whole cart\n\t\t\t\t\t\t\t//$percent_discount = ( $values['data']->get_price( false ) / 100 ) * $coupon->amount;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$percent_discount = ( $values['data']->get_price( ) / 100 ) * $coupon->amount;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ($add_totals) $this->discount_cart = $this->discount_cart + ( $percent_discount * $values['quantity'] );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$price = $price - $percent_discount;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\tendswitch;\n\t\t\t\t\t\n\t\t\t\tendif;\n\t\t\tendforeach;\n\t\t\t\n\t\t\treturn apply_filters( 'cmdeals_get_discounted_price_', $price, $values, $this );\n\t\t}", "public static function bogo_apply_disc($order_id,$promotion_id,$prmdisc_id,$prmdisc_bogo_sbmnu,$prmdisc_bogo_sbmnu_dish,$prmdisc_bogo_qty,$disc_amt_type,$disc_amt){\r \t//echo \"$order_id,$promotion_id,$prmdisc_id,$prmdisc_bogo_sbmnu,$prmdisc_bogo_sbmnu_dish,$prmdisc_bogo_qty,$disc_amt_type,$disc_amt\";\r\t\t//..Check if discount is with sub menu item is selected\r\t\tif(is_gt_zero_num($prmdisc_bogo_sbmnu_dish)){\r\t\t\t//..do nothing..because we already ahve submenudishid\r\t\t}else{\r\t\t //..Get all submenu dish ids from submenu..\r\t\t\t$rs_apl_disc_items= tbl_submenu_dishes::getSubMenuItems($prmdisc_bogo_sbmnu);\r\t\t\tif(is_not_empty($rs_apl_disc_items)){\r\t\t\t\t$prmdisc_bogo_sbmnu_dish=$rs_apl_disc_items;\r\t\t\t}else{\r\t\t\t\t$strOpMsg= \"No items found to apply discount\" ;\r\t\t\t\treturn 0;\r\t\t\t}\r\t\t}\t\t\r \t\t//...Check if the item is in the order detail\r\t\t$tmp_fnd=0;\r\t\t$ord_det_items=tbl_order_details::readArray(array(ORD_DTL_ORDER_ID=>$order_id,ORD_DTL_SBMENU_DISH_ID=>$prmdisc_bogo_sbmnu_dish,ORDPROM_DISCOUNT_AMT=>0),$tmp_fnd,1,0);\t\t\t\t\t\t\t\r\t\tif($tmp_fnd>0){\t\t \r\t\t\t//..item presents in order detail wihtout disocunt\r\t\t\t//..loop through the all the order items records\r\t\t\tforeach($ord_det_items as $order_itm){\r\t\t\t\t //..now check if the quantity >= disc qty\t\t\t\t\t \r\t\t\t\t if($order_itm[ORD_DTL_QUANTITY]>=$prmdisc_bogo_qty){\r\t\t\t\t \t //..Right item to apply discount\r\t\t\t\t\t //..Calculate discount amount\t\r\t\t\t\t\t$discount_amount=tbl_order_details::getDiscountAmnt($disc_amt_type,$disc_amt,$order_itm[ORD_DTL_PRICE]);\r\t\t\t\t\t//..Update the order detail with discount and promot\r\t\t\t\t\t$success=tbl_order_details::update_item_with_discount($order_itm[ORD_DTL_ID],$promotion_id,$prmdisc_id,$discount_amount);\t\r\t\t\t\t\t\t\t\t\t\t\t \r\t\t\t\t }\r\t\t\t}\r\t\t\tunset($ord_det_items);\t\r\t\t}else{\r\t\t\t$strOpMsg= \"Item not present in your order or alreday discounted\" ;\r\t\t}\t\r\t\treturn 1;\r }", "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 }", "function ciniki_sapos_itemCalcAmount($ciniki, $item) {\n\n if( !isset($item['quantity']) || !isset($item['unit_amount']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.30', 'msg'=>'Unable to calculate the item amount, missing quantity or unit amount'));\n }\n\n $unit_amount = $item['unit_amount'];\n //\n // Apply the dollar amount discount first\n //\n if( isset($item['unit_discount_amount']) && $item['unit_discount_amount'] > 0 ) {\n $unit_amount = bcsub($unit_amount, $item['unit_discount_amount'], 4);\n }\n //\n // Apply the percentage discount second\n //\n if( isset($item['unit_discount_percentage']) && $item['unit_discount_percentage'] > 0 ) {\n $percentage = bcdiv($item['unit_discount_percentage'], 100, 4);\n $unit_amount = bcsub($unit_amount, bcmul($unit_amount, $percentage, 4), 4);\n }\n\n //\n // Calculate what the amount should have been without discounts\n //\n $subtotal = bcmul($item['quantity'], $item['unit_amount'], 2);\n\n //\n // Apply the quantity\n //\n $total = bcmul($item['quantity'], $unit_amount, 2);\n\n //\n // Calculate the total discount on the item\n //\n $discount = bcsub(bcmul($item['quantity'], $item['unit_amount'], 2), $total, 2);\n\n //\n // Calculate the preorder_amount, after all discount calculations because this amount will be paid later\n //\n $preorder = 0;\n if( isset($item['unit_preorder_amount']) ) {\n $preorder = bcmul($item['quantity'], $item['unit_preorder_amount'], 2);\n if( $preorder > 0 ) {\n $total = bcsub($total, $preorder, 2);\n }\n }\n\n return array('stat'=>'ok', 'subtotal'=>$subtotal, 'preorder'=>$preorder, 'discount'=>$discount, 'total'=>$total);\n}", "public static function update_item_with_discount($detail_id,$order_promotion,$order_discount_id,$order_discount_amt){\r\tif(is_gt_zero_num($detail_id)){\r\t\t$objtbl_order_details=new tbl_order_details();\r\t\tif($objtbl_order_details->readObject(array(ORD_DTL_ID=>$detail_id))){\r\t\t\t$objtbl_order_details->setordprom_promotion($order_promotion);\r\t\t\t$objtbl_order_details->setordprom_discount_id($order_discount_id);\r\t\t\t$objtbl_order_details->setordprom_discount_amt($order_discount_amt);\r\t\t\t$objtbl_order_details->insert();\r\t\t\treturn 1;\r\t\t}\r\t\tunset($objtbl_order_details);\t\r\t} \r\treturn 0;\t\r }", "public function getPricing()\n {\n // get current quantity as its the basis for pricing\n $quantity = $this->quantity;\n\n // Get pricing but maintain original unitPrice (only if post-CASS certification quantity drop is less than 10%),\n $adjustments = $this->quantity_adjustment + $this->count_adjustment;\n if ($adjustments < 0) {\n $originalQuantity = 0;\n $originalQuantity = $this->itemAddressFiles()->sum('count');\n $originalQuantity += $this->mail_to_me;\n if ((($originalQuantity + $adjustments) / $originalQuantity) > 0.90) { // (less than 10%)\n $quantity = $originalQuantity;\n }\n }\n\n // Get pricing based on quantity.\n // If quantity is less than minimum quantity required (only if post-CASS certification),\n // then use the minimum quantity required to retrieve pricing\n if ((\n $this->quantity_adjustment != 0 || $this->count_adjustment != 0) &&\n $this->quantity < $this->getMinimumQuantity()\n ) {\n $quantity = $this->getMinimumQuantity();\n }\n\n // Pricing date is based on submission date or now.\n $pricingDate = (!is_null($this->date_submitted) ? $this->date_submitted : time());\n\n if (!is_null($this->product_id) && !is_null($this->product)) {\n $newPricing = $this->product->getPricing(\n $quantity, $pricingDate,\n $this->invoice->getBaseSiteId()\n );\n $oldPricing = $this->getProductPrice();\n // TODO: refactor this pricing history section, it really shouldn't belong in this method\n if (!is_null($newPricing)) {\n $insert = true;\n if (!is_null($oldPricing) && $newPricing->id == $oldPricing->product_price_id) {\n $insert = false;\n }\n if ($insert) {\n try {\n InvoiceItemProductPrice::firstOrCreate(\n [\n 'invoice_item_id' => $this->id,\n 'product_price_id' => $newPricing->id,\n 'date_created' => date('Y-m-d H:i:s', time()),\n 'is_active' => 1\n ]\n );\n } catch (QueryException $e) {\n // TODO: fix this hack (e.g. why do we need integrity constraint on this table )\n if (strpos($e->getMessage(), 'Duplicate entry') === false) {\n throw $e;\n } else {\n Logger::error($e->getMessage());\n }\n }\n\n if (!is_null($oldPricing)) {\n $oldPricing->is_active = 0;\n $oldPricing->save();\n }\n }\n }\n\n return $newPricing;\n }\n if (!is_null($this->data_product_id) && $this->data_product_id != 0) {\n return $this->dataProduct->getPricing($pricingDate, $this->invoice->site_id);\n }\n if (!is_null($this->line_item_id) && $this->line_item_id != 0) {\n return $this->line_item->getPricing($pricingDate, $this->invoice->getBaseSiteId());\n }\n if ($this->isAdHocLineItem() && $this->unit_price) {\n return (object)array('price' => $this->unit_price);\n }\n return null;\n }", "public function getProductPrice()\n {\n }", "public function desc_view($observer)\r\n\t{\r\n\t\t$company_id=Mage::helper('insync_company')\r\n\t\t->getCustomerCompany(Mage::getSingleton('customer/session')->getCustomer()->getId());\r\n\t\tif($company_id){\r\n\t\t\t$event = $observer->getEvent();\r\n\t\t\t$product = $event->getProduct();\r\n\r\n\t\t\t$website_id=Mage::getModel('core/store')->load($product->getData('store_id'))->getWebsiteId();\r\n\t\t\t$product_id=$product->getEntityId();\r\n\t\t\t$qty=\"1\";\r\n\r\n\r\n\t\t\t// process percentage discounts only for simple products\r\n\t\t\tif ($product->getSuperProduct() && $product->getSuperProduct()->isConfigurable()) {\r\n\t\t\t} else {\r\n\r\n\t\t\t\tif(!empty($website_id) && !empty($company_id) && !empty($product_id) ){\r\n\t\t\t\t\t$new_price=\"\";\r\n\t\t\t\t\t// Product specific price\r\n\t\t\t\t\t$prod_price = Mage::helper('insync_companyrule')->getNewPrice($website_id,$company_id,$product_id,$qty);\r\n\t\t\t\t\t// Category specific price\r\n\t\t\t\t\t$cat_price=Mage::helper('insync_companyrule')->getCategoryPrice($product_id,$product->getFinalPrice(),$company_id,$website_id);\r\n\t\t\t\t\t// Get applicable price\r\n\t\t\t\t\t$new_price=Mage::helper('insync_companyrule')->getMinPrice($prod_price,$cat_price,$product->getFinalPrice());\r\n\r\n\t\t\t\t\tif($new_price!=''){\r\n\t\t\t\t\t\t// compare prices\r\n\t\t\t\t\t\t$product->setFinalPrice($new_price);\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 $this;\r\n\t}", "public function getStoreToOrderRate();", "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 }", "function get_deals_subtotal( $_deals, $quantity ) {\n\t\t\tglobal $cmdeals;\n\t\t\t\n\t\t\t$price \t\t\t= $_deals->get_sale();\n\t\t\t\t\t\t\t\n $row_price \t\t= $price * $quantity;\n $return = cmdeals_price( $row_price );\n\t\t\t\n\t\t\treturn $return; \n\t\t\t\n\t\t}", "public function getShippingDiscountAmount();", "function example_price_free_delivery_note()\n{\n ?>\n <style>\n .delivery-note .head-item-price,\n .delivery-note .head-price,\n .delivery-note .product-item-price,\n .delivery-note .product-price,\n .delivery-note .order-items tfoot {\n display: none;\n }\n .delivery-note .head-name,\n .delivery-note .product-name {\n width: 50%;\n }\n .delivery-note .head-quantity,\n .delivery-note .product-quantity {\n width: 50%;\n }\n .delivery-note .order-items tbody tr:last-child {\n border-bottom: 0.24em solid black;\n }\n </style>\n <?php\n}", "public function getDiscountInvoiced();", "public function getDiscountAmount();", "public function getPrice() {\n }", "public function designProfit(){\n\t\treturn $this->campaigns()\n\t\t\t->join('order_detail', 'product_campaign.id', 'order_detail.campaign_id')\n\t\t\t->join('order', 'order_detail.order_id', 'order.id')\n\t\t\t->join('order_status', 'order.id', 'order_status.order_id')\n\t\t\t->where('order_status.value', 4)\n\t\t\t->sum('product_quantity') * 25000;\n\t}", "function cartTotal ($cartItems) {\n\n$grouped = $cartItems->groupBy(\"product_id\");\n$product_quantities = $grouped->map(function ($item, $key) {\n return [$key => $item->sum(\"qty\")];\n});\n$products_ids = array_keys($product_quantities->all());\n$products = Product::whereIn(\"id\", $products_ids)->select([\"price\", \"name\", \"id\", \"item_value_discount\", \"items_value_discount\", \"items_items_discount\"])->get();\n$products = $products->groupBy(\"id\");\n\n$item_value_discounts = collect([]);\n$items_value_discounts = collect([]);\n$items_items_discounts = collect([]);\n\nforeach ($products as $product) {\n if ($product[0]->item_value_discount) {\n \n $item_value_discounts->put($product[0]->id, $product[0]->getActiveItemValueDiscount());\n\n // $item_value_discounts = item_value_discount::where(function ($query) {\n // $query->whereDate(\"starts_at\", \"<=\", date(\"Y-m-d\"))\n // ->whereDate(\"ends_at\", \">=\", date(\"Y-m-d\"));\n // })->orWhere(function ($query) {\n // $query->whereDate(\"starts_at\", \"<=\", date(\"Y-m-d\"))\n // ->whereNull(\"ends_at\");\n // })->get();\n }\n if ($product[0]->items_value_discounts) {\n $items_value_discounts->put($product[0]->id, $product[0]->getActiveItemsValueDiscount());\n // $items_value_discounts = items_value_discount::where(function ($query) {\n // $query->whereDate(\"starts_at\", \"<=\", date(\"Y-m-d\"))\n // ->whereDate(\"ends_at\", \">=\", date(\"Y-m-d\"));\n // })->orWhere(function ($query) {\n // $query->whereDate(\"starts_at\", \"<=\", date(\"Y-m-d\"))\n // ->whereNull(\"ends_at\");\n // })->get();\n }\n if ($product[0]->items_items_discounts) {\n $items_items_discounts->put($product[0]->id, $product[0]->getActiveItemsItemsDiscount());\n // $items_items_discounts = items_items_discount::where(function ($query) {\n // $query->whereDate(\"starts_at\", \"<=\", date(\"Y-m-d\"))\n // ->whereDate(\"ends_at\", \">=\", date(\"Y-m-d\"));\n // })->orWhere(function ($query) {\n // $query->whereDate(\"starts_at\", \"<=\", date(\"Y-m-d\"))\n // ->whereNull(\"ends_at\");\n // })->get();\n }\n}\n// return $item_value_discounts;\n// return $items_value_discounts;\n// return $items_items_discounts;\n\n// if ($item_value_discounts)\n// $item_value_discounts = $item_value_discounts->groupBy(\"product_id\");\n// if ($items_value_discounts)\n// $items_value_discounts = $items_value_discounts->groupBy(\"product_id\");\n// if ($items_items_discounts)\n// $items_items_discounts = $items_items_discounts->groupBy(\"product_id\");\n// return $item_value_discounts;\n\n// return $items_value_discounts;\n// return $items_items_discounts;\n$product_prices_qty = collect([]);\n$product_present = collect([]);\nforeach ($products_ids as $products_id) {\n $product_qty = $product_quantities[$products_id][$products_id];\n $items_items_discounts_product_qty = $product_quantities[$products_id][$products_id];\n if (isset($items_value_discounts[$products_id])) {\n if ($items_value_discounts[$products_id] !== []) {\n foreach ($items_value_discounts[$products_id] as $discount) {\n $count = floor($product_qty / $discount->items_count);\n if ($count) {\n $product_prices_qty->push([\n \"product_id\" => $products_id,\n \"product_name\" => $products[$products_id][0]->name,\n \"qty\" => $discount->items_count * $count,\n \"price\" => $count*$discount->items_value,\n ]);\n $product_qty = $product_qty - ($count * $discount->items_count);\n }\n }\n }\n }\n if (isset($item_value_discounts[$products_id])) {\n if ($item_value_discounts[$products_id] !== []) {\n foreach ($item_value_discounts[$products_id] as $discount) {\n if ($product_qty) {\n $price = $products[$products_id][0]->price;\n $value = $discount->value;\n $percent = $discount->percent;\n \n if ($value && $percent) {\n $price = $price - $value;\n } else if ($value && !$percent) {\n $price = $price - $value;\n } else {\n $price = $price - (($percent / 100) * $price);\n }\n $total = $price*$product_qty;\n $product_prices_qty->push([\n \"product_id\" => $products_id,\n \"product_name\" => $products[$products_id][0]->name,\n \"qty\" => $product_qty,\n \"price\" => $total,\n ]);\n }\n }\n }\n }\n if (isset($items_items_discounts[$products_id])) {\n if ($items_items_discounts[$products_id] !== []) {\n $items_number = $items_items_discounts_product_qty;\n $max_get_number = 0;\n // $product_present = collect([]);\n foreach ($items_items_discounts[$products_id] as $discount) {\n $count = floor($items_number / $discount->buy_items_count);\n if (!$product_prices_qty->contains('product_id', $products_id)){\n $price = $products[$products_id][0]->price;\n $total = $price * $items_items_discounts_product_qty;\n $product_prices_qty->push([\n \"product_id\" => $products_id,\n \"qty\" => $items_items_discounts_product_qty,\n \"product_name\" => $products[$products_id][0]->name,\n \"price\" => $total,\n ]);\n }\n if ($count) {\n if ($discount->get_items_count > $max_get_number) {\n $max_get_number = $discount->get_items_count * $count;\n \n $offer = [\n \"product_id\" => $products_id,\n \"buy_items_count\" => $discount->buy_items_count,\n \"presents_count\" => $max_get_number,\n \"present_product_id\" => $discount->present_product_id,\n ];\n }\n }\n }\n $product_present->push($offer);\n }\n }\n}\n$data = [\"totals\" => $product_prices_qty, \"presents\" => $product_present];\nreturn $data;\n}", "abstract public function getPrice();", "public function getAditionalPrice()\n {\n return @$this->attributes[\"preco_adicional\"];\n }", "public function calc(Order $order);", "public function getPrice()\n {\n }", "public function getPrice()\n {\n }", "public function __subTotal($items) {\n\n $price = 0.0;\n\n foreach ($items as $item) {\n\n// if ($item['currency_id'] == 2)\n// $currency = 1;\n//\n// if ($item['currency_id'] == 1)\n// $currency = 4.17;\n//\n// if ($item['currency_id'] == 3)\n// $currency = 4.50;\n\n //$price += $this->__lineItemTotal($item['qty'], $item['price'], $item['taxRate'], $item['currency_id']);\n //$price += $item['qty'] * $item['price'] * $currency;\n $price += $item['qty'] * $item['price'] * $item['rate'];\n }\n\n return $price;\n }", "function getOrderPurchaseDetails($order_id)\n\t\t{\n\t\t\t//get order details\n\t\t\t$orders = $this->_BLL_obj->manage_content->getValue_where('order_info', '*', 'order_id', $order_id);\n\t\t\t$user_id = $orders[0]['user_id'];\n\t\t\t//get product details from order id\n\t\t\t$order_details = $this->_BLL_obj->manage_content->getValue_where('product_inventory_info', '*', 'order_id', $order_id);\n\t\t\tif(!empty($order_details[0]))\n\t\t\t{\n\t\t\t\t//total_overridng fee distributed\n\t\t\t\t$dis_over = 0;\n\t\t\t\t$user_level = 0;\n\t\t\t\t\n\t\t\t\tforeach($order_details as $order)\n\t\t\t\t{\n\t\t\t\t\t/* code for distribute overriding fee */\n\t\t\t\t\t//get transaction id for overriding fee\n\t\t\t\t\t$over_id = uniqid('trans');\n\t\t\t\t\t//calling overriding fee function\n\t\t\t\t\t$distributed_overriding = $this->distributeOverridingFee($user_id, $order['price'], $dis_over, $user_level, $over_id,$order_id);\n\t\t\t\t\tif($distributed_overriding != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t//insert values to fee transaction info table\n\t\t\t\t\t\t$insert_over = $this->_BLL_obj->manage_content->insertValue('fee_transaction_info', array('transaction_id','order_id','product_id','fee_type'), array($over_id,$order_id,$order['product_id'],'OF'));\n\t\t\t\t\t\t//new system value\n\t\t\t\t\t\t$new_system_value = $this->getSystemMoneyValue() - $distributed_overriding;\n\t\t\t\t\t\t//insert distributed amount to system money info\n\t\t\t\t\t\t$insert_dist_amount = $this->_BLL_obj->manage_content->insertValue('system_money_info', array('specification','debit','system_balance'), array($over_id,$distributed_overriding,$new_system_value));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t/* code for personal commision calculation */\n\t\t\t\t\t//get transaction id for personal comm calculation\n\t\t\t\t\t$per_id = uniqid('trans');\n\t\t\t\t\t//calling personal commision function\n\t\t\t\t\t$per_comm = $this->calculatePersonalCommision($user_id, $order['price'], $per_id,$order_id);\n\t\t\t\t\t//checking for non empty personal commision\n\t\t\t\t\tif($per_comm != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t//insert values to fee transaction info table\n\t\t\t\t\t\t$insert_personal = $this->_BLL_obj->manage_content->insertValue('fee_transaction_info', array('transaction_id','order_id','product_id','fee_type'), array($per_id,$order_id,$order['product_id'],'PC'));\n\t\t\t\t\t\t//new system value\n\t\t\t\t\t\t$new_system_value_per = $this->getSystemMoneyValue() - $per_comm;\n\t\t\t\t\t\t//insert distributed amount to system money info\n\t\t\t\t\t\t$insert_per_amount = $this->_BLL_obj->manage_content->insertValue('system_money_info', array('specification','debit','system_balance'), array($per_id,$per_comm,$new_system_value_per));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t/* code for point value calculation */\n\t\t\t\t\t//get transaction id for point value distribution\n\t\t\t\t\t$pv_id = uniqid('trans');\n\t\t\t\t\t//get product details\n\t\t\t\t\t$product_details = $this->_BLL_obj->manage_content->getValue_where('product_info', '*', 'product_id', $order['product_id']);\n\t\t\t\t\t//total point value\n\t\t\t\t\t$total_pv = $product_details[0]['point_value'] * $order['quantity'];\n\t\t\t\t\t//insert values to fee transaction info table\n\t\t\t\t\t$insert_point = $this->_BLL_obj->manage_content->insertValue('fee_transaction_info', array('transaction_id','order_id','product_id','fee_type'), array($pv_id,$order_id,$order['product_id'],'PV'));\n\t\t\t\t\t//insert pv to system\n\t\t\t\t\t$system_pv = $this->insertSystemPV($pv_id, $total_pv);\n\t\t\t\t\t//calling point value distributive function\n\t\t\t\t\t$this->distributePointValue($user_id, $total_pv, $pv_id, $order_id);\n\t\t\t\t\t\n\t\t\t\t\t/* code for member level upgradation of user and their parent */\n\t\t\t\t\t//calling fucntion for it\n\t\t\t\t\t$this->checkingLevelOfUserAndParent($user_id);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function getPrice()\n {\n return 0.2;\n }", "public function getDiscountPriceInfo()\n {\n return $this->discountPriceInfo;\n }", "Function SalesPriceUsedInOrder($int_record_id) {\r\n return GetField(\"SELECT orders.OrderID\r\n\t\t\t\t\t FROM order_details\r\n\t\t\t\t\t INNER JOIN orders ON orders.OrderID = order_details.OrderID\r\n\t\t\t\t\t INNER JOIN pricing ON pricing.ProductID = order_details.ProductID\r\n\t\t\t\t\t\t\t\t\t AND (order_details.Quantity >= pricing.start_number OR pricing.start_number = 0)\r\n\t\t\t\t\t\t\t\t\t\t AND (order_details.Quantity <= pricing.end_number OR pricing.end_number = 0)\r\n\t\t\t\t\t\t\t\t\t\t AND (pricing.ContactID = orders.ContactID OR pricing.ContactID = 0)\r\n\t\t\t\t\t\t\t\t\t AND (orders.OrderDate >= pricing.start_date OR pricing.start_date = 0)\r\n\t\t\t\t\t\t\t\t\t AND (orders.OrderDate <= pricing.end_date OR pricing.end_date = 0)\r\n\t\t\t\t\t\t\t\t\t\t AND (order_details.Quantity <= pricing.end_number OR pricing.end_number = 0)\r\n\t\t\t\t\t WHERE recordID = $int_record_id\");\r\n}", "protected function calculatePrice()\n {\n $amount = 5 * $this->rate;\n $this->outputPrice($amount);\n }", "private function SetPricingDetails()\n\t{\n\t\t$product = $this->productClass->getProduct();\n\n\t\t$GLOBALS['PriceLabel'] = GetLang('Price');\n\n\t\tif($this->productClass->GetProductCallForPricingLabel()) {\n\t\t\t$GLOBALS['ProductPrice'] = $GLOBALS['ISC_CLASS_TEMPLATE']->ParseGL($this->productClass->GetProductCallForPricingLabel());\n\t\t}\n\t\t// If prices are hidden, then we don't need to go any further\n\t\telse if($this->productClass->ArePricesHidden()) {\n\t\t\t$GLOBALS['HidePrice'] = \"display: none;\";\n\t\t\t$GLOBALS['HideRRP'] = 'none';\n\t\t\t$GLOBALS['ProductPrice'] = '';\n\t\t\treturn;\n\t\t}\n\t\telse if (!$this->productClass->IsPurchasingAllowed()) {\n\t\t\t$GLOBALS['ProductPrice'] = GetLang('NA');\n\t\t}\n\t\telse {\n\t\t\t$options = array('strikeRetail' => false);\n\t\t\t$GLOBALS['ProductPrice'] = formatProductDetailsPrice($product, $options);\n\t\t}\n\n\t\t// Determine if we need to show the RRP for this product or not\n\t\t// by comparing the price of the product including any taxes if\n\t\t// there are any\n\t\t$GLOBALS['HideRRP'] = \"none\";\n\t\t$productPrice = $product['prodcalculatedprice'];\n\t\t$retailPrice = $product['prodretailprice'];\n\t\tif($retailPrice) {\n\t\t\t// Get the tax display format\n\t\t\t$displayFormat = getConfig('taxDefaultTaxDisplayProducts');\n\t\t\t$options['displayInclusive'] = $displayFormat;\n\n\t\t\t// Convert to the browsing currency, and apply group discounts\n\t\t\t$productPrice = formatProductPrice($product, $productPrice, array(\n\t\t\t\t'localeFormat' => false, 'displayInclusive' => $displayFormat\n\t\t\t));\n\t\t\t$retailPrice = formatProductPrice($product, $retailPrice, array(\n\t\t\t\t'localeFormat' => false, 'displayInclusive' => $displayFormat\n\t\t\t));\n\n\t\t\tif($productPrice < $retailPrice) {\n\t\t\t\t$GLOBALS['HideRRP'] = '';\n\n\t\t\t\t// Showing call for pricing, so just show the RRP and that's all\n\t\t\t\tif($this->productClass->GetProductCallForPricingLabel()) {\n\t\t\t\t\t$GLOBALS['RetailPrice'] = CurrencyConvertFormatPrice($retailPrice);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// ISC-1057: do not apply customer discount to RRP in this case\n\t\t\t\t\t$retailPrice = formatProductPrice($product, $product['prodretailprice'], array(\n\t\t\t\t\t\t'localeFormat' => false,\n\t\t\t\t\t\t'displayInclusive' => $displayFormat,\n\t\t\t\t\t\t'customerGroup' => 0,\n\t\t\t\t\t));\n\t\t\t\t\t$GLOBALS['RetailPrice'] = '<strike>' . formatPrice($retailPrice) . '</strike>';\n\t\t\t\t\t$GLOBALS['PriceLabel'] = GetLang('YourPrice');\n\t\t\t\t\t$savings = $retailPrice - $productPrice;\n\t\t\t\t\t$string = sprintf(getLang('YouSave'), '<span class=\"YouSaveAmount\">'.formatPrice($savings).'</span>');\n\t\t\t\t\t$GLOBALS['YouSave'] = '<span class=\"YouSave\">'.$string.'</span>';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "abstract function total_price($price_summary);", "public function getPrice(): float;", "public function getPrice(): float;", "public function getPriceInfos(&$orderItem, array $order) {\n $info = array();\n $postion = 0;\n $orderCurrency = $order['currency_code'];\n\n $method = $order['shipping_method'];\n $shipingMethod = array('pm_id' => '', 'title' => $method, 'description' => '', 'price' => 0);\n\n $this->load->model('account/order');\n $rows = $this->model_account_order->getOrderTotals($order['order_id']);\n foreach ($rows as $row) {\n $title = $row['title'];\n $price = $row['value'] * $order['currency_value'];\n $info[] = array(\n 'title' => $title,\n 'type' => $row['code'],\n 'price' => $price,\n 'currency' => $orderCurrency,\n 'position' => $postion++);\n\n if (ereg($method, $title)) {\n $shipingMethod['price'] = $price;\n }\n }\n $orderItem['shipping_method'] = $shipingMethod;\n\n return $info;\n }", "public function getPrice()\n {\n return parent::getPrice();\n }", "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 getPriceFromDatabase()\n {\n }", "public function getPriceDelivery()\n {\n return $this->priceDelivery;\n }", "public function getSubtotalInvoiced();", "function wv_commission_get_order_item_record($oid) {\n\n global $wpdb;\n $sql_order_itemid = \"SELECT DISTINCT WOIM.order_item_id FROM `\" . $wpdb->prefix . \"woocommerce_order_items` AS WOI INNER JOIN `\" . $wpdb->prefix . \"woocommerce_order_itemmeta` AS WOIM ON WOI.order_item_id = WOIM.order_item_id WHERE WOI.order_item_type = 'line_item' AND WOI.order_id =$oid\";\n $arr_order_itemid = $wpdb->get_results($sql_order_itemid);\n\n if (count($arr_order_itemid) > 0) {\n $i = 1;\n foreach ($arr_order_itemid as $item) {\n\n $order_item_id = $item->order_item_id;\n $productid = $this->wv_commission_get_woo_orderitem_metavalue($order_item_id, '_product_id');\n //output HTML here.\n ?>\n <tr>\n <!-- \n In case of more than 1 item, order id should show only one times : use= rowspan :\n --> \n <?php if ($i == 1) { ?>\n <td rowSpan=\"<?php echo count($arr_order_itemid); ?>\" >#<?php echo $oid; ?></td>\n <?php } ++$i; ?>\n <!-- order date -->\n <td><?php echo get_post_time(\"dM,Y\", FALSE, $oid); ?></td>\n \n <!-- product id -->\n <td><?php echo get_the_title($productid); ?></td>\n \n <!-- vendor -->\n <td><?php echo $this->wv_get_username_by_userid(get_post_meta($oid, 'woo_order_vendor_id_' . $productid, TRUE)); ?></td>\n \n <!-- commission --> \n <td>\n <?php\n echo get_woocommerce_currency_symbol(). get_post_meta($oid, 'woo_order_commision_' . $productid, TRUE);\n ?>\n </td>\n \n <!-- Status -->\n <td>\n <?php \n //change status functionality\n $sts = $this->wv_get_commission_status($oid,$productid);\n $newsts= ($sts==1)?0:1;\n ?>\n <a title=\"Change Status\" href=\"<?php echo admin_url(\"admin.php?page=woo_vendors&tab=commission&action=sts&oid=$oid&pid=$productid&sts=$newsts\"); ?>\" onclick=\"return confirm('Are you sure want to change status ?');\">\n <?php \n echo $newsts= ($sts==1)?\"paid\":\"due\";;\n ?>\n </a> \n </td>\n \n <!-- Commission Date -->\n <td>\n <?php \n //get commission date\n echo $this->wv_get_commission_date($oid,$productid);\n ?> \n </td>\n </tr>\n <?php\n }\n }//end of the count.\n }", "public function getPrice();", "public function getPrice();", "public function getPrice();", "public function getPrice();", "private function _getExtraAmountValues(){\n return Tools::convertPrice($this->_getCartRulesValues() + $this->_getWrappingValues());\n }", "public function getPrice()\n {\n $db = new db_connector();\n $conn = $db->getConnection();\n\n $stmt = \"SELECT `Order List`.orderID, `Order List`.PQuantity, `Product`.PPrice, `Product`.PID\n FROM `Order List`\n LEFT JOIN `Product`\n ON `Order List`.productID = `Product`.PID\";\n\n $result5 = $conn->query($stmt);\n\n if($result5)\n {\n $price_array = array();\n\n while($price = $result5->fetch_assoc())\n {\n array_push($price_array, $price);\n }\n $total = 0;\n $curr = 0;\n for($x = 0; $x < count($price_array); $x ++)\n {\n // echo \"price array \" . $price_array[$x]['orderID'] . \"<br>\";\n // echo \"session order id \" . $_SESSION['orderID'] . \"<br>\";\n\n if($price_array[$x]['orderID'] == $_SESSION['orderID'])\n {\n\n // echo $price_array[$x]['orderID'];\n // echo $price_array[$x]['PQuantity'];\n\n $curr = ((float) $price_array[$x]['PPrice'] * (float) $price_array[$x]['PQuantity']);\n $total = $total + $curr;\n $curr = 0;\n }\n }\n echo \"$\" . $total;\n return $total;\n }\n }", "public function getCartPrice()\n {\n return 111;\n }", "function builder_price() {\n\n $this->Item->recursive = 0;\n\n if( !isset($this->params['named']['limit']) ) {\n $this->paginate['limit'] = REPORT_LIMIT;\n $this->paginate['maxLimit'] = REPORT_LIMIT;\n }\n elseif( isset($this->params['named']['limit']) && $this->params['named']['limit'] != 'All' ) {\n $this->paginate['limit'] = isset($this->params['named']['limit']) ? $this->params['named']['limit'] : REPORT_LIMIT;\n $this->paginate['maxLimit'] = isset($this->params['named']['limit']) ? $this->params['named']['limit'] : REPORT_LIMIT;\n }\n else {\n $this->paginate['limit'] = 0;\n $this->paginate['maxLimit'] = 0;\n }\n $this->Prg->commonProcess();\n $this->paginate['conditions'] = $this->Item->parseCriteria($this->passedArgs);\n $this->paginate['conditions']['Item.base_item']['base_item'] = 0;\n\n $items = $this->paginate();\n $paginate = true;\n $legend = \"Items\";\n\n $this->set(compact('items', 'paginate', 'legend'));\n }", "public function getSubtotal()\n {\n $price = 0;\n\n foreach ($this->order_configurations as $config) {\n $products = EntityUtils::getRepository(\"Product\")->getProducts($config->configuration, true);\n foreach ($products as $product) {\n $price += $product->getDiscountedPrice($this->program->id) * $config->quantity;\n }\n }\n\n return number_format($price, 2, \".\", \",\");\n }", "public function discountBifurcation(Varien_Event_Observer $observer)\n {\n $rule = $observer->getEvent()->getRule();\n $result = $observer->getEvent()->getResult();\n $itemId = $observer->getEvent()->getItem()->getItemId();\n //set Unique key\n $curUnique= $rule->getRuleId().'_'.$itemId;\n //check if Mage registry unique call set\n if(Mage::registry('uniqueCall')!==null){\n //if check in array\n $uniqueCalls = Mage::registry('uniqueCall');\n if( in_array($curUnique,$uniqueCalls)){\n return;\n }else{\n //unset existing registry. also take existing array in variable\n Mage::unregister('uniqueCall');\n $uniqueCalls[]= $curUnique ;\n //set registry again with new array include $uniqueCall into it\n Mage::register('uniqueCall',$uniqueCalls);\n }\n }else{\n //set registry again with new array include $uniqueCall into it\n $array = array();\n $array[]=$rule->getRuleId().'_'.$itemId;\n Mage::register('uniqueCall',$array);\n\n } \n\n //condition for the Promotional coupons\n if ( $rule->getCouponType() == Mage_SalesRule_Model_Rule::COUPON_TYPE_NO_COUPON ) {\n $promotionDiscount = 0;\n $promotionDiscount = Mage::registry('promotion');\n if (Mage::registry('promotion')!==null){\n Mage::unregister('promotion');\n }\n if (Mage::registry('promo_lable')!==null){\n Mage::unregister('promo_lable');\n }\n $promotionDiscount += $result->getDiscountAmount();\n Mage::register('promotion', $promotionDiscount);\n Mage::register('promo_lable',$rule->getName());\n } elseif ( $rule->getCouponType() == self::COUPON_TYPE_FUE_GENERATED ) {\n $couponDiscount = 0;\n $couponDiscount = Mage::registry('coupon');\n if(Mage::registry('coupon')!==null){\n Mage::unregister('coupon');\n }\n //sum up all the values of discounted coupons\n $couponDiscount += $result->getDiscountAmount();\n Mage::register('coupon',$couponDiscount);\n }\n $quote = $observer->getEvent()->getQuote();\n $quoteAddress = $observer->getEvent()->getAddress();\n //set discounted coupons and promotional coupons amount in quote\n $quote->setCouponDiscount(Mage::registry('coupon'));\n $quote->setPromotionalDiscount(Mage::registry('promotion'));\n\n if (Mage::getStoreConfig('promodiscount/promodiscount/use_default')) {\n $quote->setPromoLable(Mage::getStoreConfig('promodiscount/promodiscount/default_lable'));\n } else {\n if (Mage::registry('promo_lable')) {\n $quote->setPromoLable(Mage::registry('promo_lable'));\n } else {\n $quote->setPromoLable(Mage::getStoreConfig('promodiscount/promodiscount/default_lable'));\n }\n }\n \n $quoteAddress->setCouponDiscount(Mage::registry('coupon'));\n $quoteAddress->setPromotionalDiscount(Mage::registry('promotion'));\n if (Mage::registry('promo_lable')) {\n $quoteAddress->setPromoLable(Mage::registry('promo_lable'));\n } else {\n $quoteAddress->setPromoLable(Mage::getStoreConfig('promodiscount/promodiscount/default_lable'));\n }\n }", "public function AssignDiscount()\n\t{\t\n\t}", "public function updateProduct()\n {\n \t$quote=$this->getQuote();\n \tif($quote)\n \t{\n \t\t$detailproduct=$this->getProduct();\n \t\t$quoteproduct=$quote->getProduct();\n \t\tif(\n\t\t\t\t$quote->getPrice()!=$this->getPrice() or\n\t\t\t\t$quote->getDiscrate()!=$this->getDiscrate() or\n\t\t\t\t$quote->getDiscamt()!=$this->getDiscamt() or\n\t\t\t\t$quote->getProductId()!=$this->getProductId()\n\t\t\t)\n\t\t\t{\n\t\t\t\t$quote->setPrice($this->getPrice());\n\t\t\t\t$quote->setDiscrate($this->getDiscrate());\n\t\t\t\t$quote->setDiscamt($this->getDiscamt());\n\t\t\t\t$quote->setProductId($this->getProductId());\n\t\t\t\t$quote->calc(); //auto save\n\t\t\t\t$detailproduct->calcSalePrices();\n\t\t\t\t\n\t\t\t\t//if product changed, calc old product\n\t\t\t\tif($quoteproduct->getId()!=$detailproduct->getId())\n\t\t\t\t\t$quoteproduct->calcSalePrices();\n\t\t\t}\n \t}\n \telse\n \t{\n\t\t\t//if none, see if product quote by vendor with similar pricing exists. \n\t\t\t$quote=Fetcher::fetchOne(\"Quote\",array('total'=>$this->getUnittotal(),'vendor_id'=>SettingsTable::fetch(\"me_vendor_id\"),'product_id'=>$this->getProductId()));\n\n\t\t\t//if it doesn't exist, create it, and product->calc()\n\t\t\tif(!$quote)\n\t\t\t{\n\t\t\t\tQuoteTable::createOne(array(\n\t\t\t\t\t'date'=>$this->getInvoice()->getDate(),\n\t\t\t\t\t'price'=>$this->getPrice(),\n\t\t\t\t\t'discrate'=>$this->getDiscrate(),\n\t\t\t\t\t'discamt'=>$this->getDiscamt(),\n\t\t\t\t\t'vendor_id'=>SettingsTable::fetch(\"me_vendor_id\"),\n\t\t\t\t\t'product_id'=>$this->getProductId(),\n\t\t\t\t\t'ref_class'=>\"Invoicedetail\",\n\t\t\t\t\t'ref_id'=>$this->getId(),\n\t\t\t\t\t'mine'=>1,\n\t\t\t\t\t));\n\t\t\t\t$this->getProduct()->calcSalePrices();\n\t\t\t}\n \t}\n }", "public function cal_price_in_markup_margin(){\n\t\t$arr = $this->arr_product_items;\n\t\tif(isset($arr['unit_price']))\n\t\t\t$this->arr_product_items['unit_price'] = (float)$arr['unit_price'];\n\t\telse\n\t\t\t$this->arr_product_items['unit_price'] = 0;\n\n\t\tif(isset($arr['markup']))\n\t\t\t$this->arr_product_items['markup'] = (float)$arr['markup'];\n\t\telse\n\t\t\t$this->arr_product_items['markup'] = 0;\n\n\t\tif(isset($arr['margin']))\n\t\t\t$this->arr_product_items['margin'] = (float)$arr['margin'];\n\t\telse\n\t\t\t$this->arr_product_items['margin'] = 0;\n\n\t\tif(isset($arr['discount']))\n\t\t\t$this->arr_product_items['discount'] = (float)$arr['discount'];\n\t\telse\n\t\t\t$this->arr_product_items['discount'] = 0;\n\n\t\tif(isset($arr['quantity']))\n\t\t\t$this->arr_product_items['quantity'] = (float)$arr['quantity'];\n\t\telse\n\t\t\t$this->arr_product_items['quantity'] = 0;\n\n\t\t$arr = $this->arr_product_items;\n\t\t$more_markup = $arr['unit_price']*($arr['markup']/100);\n\t\t$more_margin = $arr['unit_price']*($arr['margin']/100);\n\t\t$more_discount = $arr['unit_price']*($arr['discount']/100);\n\t\t$this->arr_product_items['sub_total'] = ($arr['unit_price'] + $more_markup + $more_margin - $more_discount)*$arr['quantity'];\n\t\t//return $this->arr_product_items;\n\t}", "public function getPrice(){\n }", "public function getPrice(){\n }", "public function getDollarPrice(): float;", "public function getCustomOptionsOfProduct(Varien_Event_Observer $observer)\n{\n $invoice = $observer->getEvent()->getInvoice();\n$invoidData = $invoice->getData();\n//Mage::log($invoidData);\n$orderId = $invoidData['order_id'];\n$cid = $invoidData['customer_id'];\n$order1 = Mage::getModel('sales/order')->load($orderId);\n $Incrementid = $order1->getIncrementId();\n//Mage::log( $Incrementid.\"Order Id\"); \n\n// Assign Field To Inset Into CreditInfo Table\n\n$currentTimestamp = Mage::getModel('core/date')->timestamp(time()); \n$nowdate = date('Y-m-d H:m:s', $currentTimestamp); // Current TimeStamp\n\n$arr['c_id'] = $cid;//Customer Id\n$arr['store_view'] = Mage::app()->getStore()->getName(); //Storeview\n$arr['state'] = 1; //State Of Transaction\n$arr['order_id'] = $Incrementid; //OrderId\n$arr['action'] = \"Crdits\"; //Action\n$arr['customer_notification_status'] = 'Notified'; //Email Sending Status\n$arr['action_date'] = $nowdate; //Current TimeStamp\n$arr['website1'] = \"Main Website\"; //Website\n\nforeach ($invoice->getAllItems() as $item) {\n\n//Mage::log($item->getQty().\"Item Quntity\");\n\n$orderItem = Mage::getResourceModel('sales/order_item_collection'); \n $orderItem->addIdFilter($item->getOrderItemId()); \n$data = $orderItem->getData();\n$arr['action_credits'] = $data[0]['credits'] * $item->getQty();\n\n$collection = Mage::getModel('kartparadigm_storecredit/creditinfo')->getCollection()->addFieldToFilter('c_id',$cid)->addFieldToFilter('website1','Main Website')->getLastItem();\n\n$totalcredits = $collection->getTotalCredits();\n$arr['total_credits'] = $arr['action_credits'] + $totalcredits;\n$arr['custom_msg'] = \"By User:For Purchage The Product \" .$item->getName().\" For Quantity \" . round($item->getQty()) ; //Custom Message\n$arr['item_id'] = $item->getOrderItemId();\n$table1 = Mage::getModel('kartparadigm_storecredit/creditinfo');\n$table1->setData($arr);\ntry{\n if($arr['action_credits'] > 0)\n $table1->save();\n\n}catch(Exception $e){\n Mage::log($e);\n }\n\n}//end Foreach\n\n\n\n}", "public function deliveryPriceOutDhaka()\n {\n }", "function get_order_discount_total() {\n\t\t\treturn $this->discount_total;\n\t\t}", "function getOverallOrderPrice(){\n\t\t$t=0;\n\t\t$a = Order::where('payment', 'verified')->get();\n\t\tforeach($a as $n){\n\t\t$dur= $n->qty;\n\t\t\n\t\t$r = intVal($n->qty)*intVal($n->price);\n\t\t$t = $t + $r;\n\t\t}\n\t\treturn $t;\n\t\t}", "public function providerDiscountPurchases()\r\n\t{\r\n\t\t$appleProduct = $this->getAppleProduct(self::PRODUCT_WITH_DISCOUNT_PRICE);\r\n\t\t$lightProduct = $this->getLightProduct(self::PRODUCT_WITH_DISCOUNT_PRICE);\r\n\t\t$starshipProduct = $this->getStarshipProduct(self::PRODUCT_WITH_DISCOUNT_PRICE);\r\n\r\n\t\treturn array(\r\n\t\t\tarray(\r\n\t\t\t\t7.0 * self::PRODUCT_APPLE_DISCOUNT_PRICE,\r\n\t\t\t\tarray(\r\n\t\t\t\t\tnew ProductToPurchase($appleProduct, 7.0),\r\n\t\t\t\t),\r\n\t\t\t),\r\n\t\t\tarray(\r\n\t\t\t\t5 * self::PRODUCT_LIGHT_PRICE + 8.0 * self::PRODUCT_APPLE_DISCOUNT_PRICE,\r\n\t\t\t\tarray(\r\n\t\t\t\t\tnew ProductToPurchase($lightProduct, 5),\r\n\t\t\t\t\tnew ProductToPurchase($appleProduct, 8.0),\r\n\t\t\t\t),\r\n\t\t\t),\r\n\t\t\tarray(\r\n\t\t\t\t4 * self::PRODUCT_STARSHIP_PRICE,\r\n\t\t\t\tarray(\r\n\t\t\t\t\tnew ProductToPurchase($starshipProduct, 6)\r\n\t\t\t\t),\r\n\t\t\t),\r\n\t\t);\r\n\t}", "function _golfpass_cal_total_price($order)\n {\n $out_total_price = 0;\n $start_date = $order->start_date;\n $end_date = $order->end_date;\n $obj_start_date = date_create($start_date);\n $obj_end_date = date_create($end_date);\n $period = date_diff($obj_start_date, $obj_end_date)->days;\n $period += 1;\n $num_singleroom = $order->num_singleroom;\n //시작 날자 ~끝날자 * 인 === 총가격 변조 있는지 체크 시작\n $product =$this->db->where(\"id\",$order->product_id)->from(\"products\")->get()->row();\n if(true)\n {\n $config['groups']= $order->groups;\n $config['start_date']= $order->start_date;\n $config['end_date']= $order->end_date;\n $config['product_id']= $order->product_id;\n $config['num_people']= $order->num_people;\n $out_total_price += modules::run(\"golfpass/p_daily_price/_cal_by_group\",$config);\n }\n //옵션가격 추가시작\n foreach($order as $key=>$val)\n {\n $$key= $val;\n }\n \n // 총합계애 옵션가격더하기\n $this->load->model(\"product_option_model\");\n for($i=0; $i < count($options); $i++)\n {\n \n $option =$this->product_option_model->_get($options[$i]);\n $option_name = $option->name;\n\n for($j=0;$j<count($groups);$j++)\n {\n \n $row=$this->db->select(\"*\")\n ->where(\"product_id\",$product_id)\n ->where(\"kind\",\"main_option\")\n ->where(\"name\",$option_name)\n ->where(\"option_1\",$groups[$j])\n ->from(\"product_option\")->get()->row();\n $out_total_price += (int)$row->price*(int)$groups[$j];\n }\n }\n \n \n \n \n \n //홀추가 가격 더하기\n if($hole_option_id !== null && $hole_option_id !== \"\"){\n $this->load->library(\"date\");\n $result =$this->date->number_of_days($start_date,$end_date);\n $num_workingdays= $result->num_workingdays;\n $num_weekenddays= $result->num_weekenddays;\n\n if($num_workingdays === 1)\n {\n $day = \"work_day\";\n }\n else if($num_weekenddays ===1)\n {\n $day =\"week_day\";\n }\n $hole_option_name = $this->product_option_model->_get($hole_option_id)->name;\n for($i=0;$i<count($groups);$i++)\n {\n \n $row=$this->db->select(\"*\")\n ->where(\"product_id\",$product_id)\n ->where(\"kind\",\"hole_option\")\n ->where(\"name\",$hole_option_name)\n ->where(\"option_1\",$groups[$i])\n ->where(\"option_2\",$day)\n ->from(\"product_option\")->get()->row();\n $out_total_price +=(int)$row->price*(int)$groups[$i];\n }\n // $hole_option_price = $this->product_option_model->_get($hole_option_id)->price;\n // $added_hole_price = $hole_option_price * $num_people;\n // $out_total_price += $added_hole_price;\n }\n \n //싱글룸 가격 더하기\n $this->load->model(\"products_model\");\n \n if($num_singleroom !== null && $num_singleroom !== \"\"){\n $singleroom_price = $this->products_model->_get($product_id)->singleroom_price;\n $out_total_price += $singleroom_price * $num_singleroom *($period -1);\n }\n return $out_total_price;\n //옵션가격 추가끝\n\n\n }", "function sale_price() {\n\t\treturn $this->_apptivo_sale_price;\n\t}", "public function getTotalDiscountAmount();", "private function _calculateTotal()\n {\n\n if (!is_null($this->shipping_option_id)) {\n $this->total = $this->unit_price * $this->quantity - $this->promotion_amount -\n $this->discount_amount;\n $this->save();\n return;\n }\n\n if ($this->quantity == 0) {\n if ($this->total > 0) {\n $this->total = '0.00';\n $this->save();\n }\n return;\n }\n\n if (is_null($pricing = $this->getPricing()) && $this->unit_price_overridden == 'false') {\n if ($this->total > 0) {\n $this->total = '0.00';\n $this->save();\n }\n return;\n }\n\n if ($this->unit_price_overridden != 'true') {\n $this->unit_price = $pricing->price;\n }\n\n // Reset promotion to capture any adjustments affecting discount\n if (!is_null($promotion = $this->promotion)) {\n $this->save();//flush current values to db for promo calculations\n $promotion->calculate($this->invoice);\n $this->refresh();\n }\n\n /**\n * Multipay discount\n */\n if (!$this->invoice->discount_id && 'incomplete' == $this->invoice->status) {\n $discount = $this->invoice->user->account()->discounts()->active()->first();\n } else {\n $discount = $this->invoice->discount;\n }\n if ($discount) {\n // flush current values to db prior to calculations\n if (count($this->getDirty())) {\n $this->save();\n }\n $discount->calculate($this->invoice);\n $this->refresh();\n }\n\n $this->total = $this->getSubTotal() - $this->promotion_amount - $this->discount_amount;\n $this->save();\n }", "public function getSubtotalAttribute()\n {\n if ( $this->picked > 0 ) {\n return (float) $this->price * (float) $this->picked;\n }\n return (float) $this->price * (float) $this->quantity;\n }", "public function getPrice(){\n return $this->price;\n }", "function pricing() {\n\t\t\tparent::controller();\n\t\t\t\n\t\t}", "public function displayOrderQuantityBasedWholesalePricing( $wholesalePriceHTML , $price , $product , $userWholesaleRole ) {\n\n // Only apply this to single product pages\n if ( !empty( $userWholesaleRole ) &&\n ( ( get_option( 'wwpp_settings_hide_quantity_discount_table' , false ) !== 'yes' && is_product() && in_array( WWP_Helper_Functions::wwp_get_product_type( $product ) , array( 'simple' , 'composite' , 'bundle' , 'variation' ) ) ) ||\n apply_filters( 'render_order_quantity_based_wholesale_pricing' , false ) ) ) {\n \n $productId = WWP_Helper_Functions::wwp_get_product_id( $product );\n\n // Since quantity based wholesale pricing relies on the presence of the wholesale price at a product level\n // We need to get the original wholesale price ( per product level ), we don't need to filter the wholesale price.\n $wholesalePrice = WWP_Wholesale_Prices::get_product_raw_wholesale_price( $productId , $userWholesaleRole );\n \n if ( !empty( $wholesalePrice ) ) {\n\n $enabled = get_post_meta( $productId , WWPP_POST_META_ENABLE_QUANTITY_DISCOUNT_RULE , true );\n\n $mapping = get_post_meta( $productId , WWPP_POST_META_QUANTITY_DISCOUNT_RULE_MAPPING , true );\n if ( !is_array( $mapping ) )\n $mapping = array();\n\n // Table view\n $mappingTableHtml = '';\n\n if ( $enabled == 'yes' && !empty( $mapping ) ) {\n ob_start();\n\n /*\n * Get the base currency mapping. The base currency mapping well determine what wholesale\n * role and range pairing a product has wholesale price with.\n */\n $baseCurrencyMapping = $this->_getBaseCurrencyMapping( $mapping , $userWholesaleRole );\n\n if ( WWPP_ACS_Integration_Helper::aelia_currency_switcher_active() ) {\n\n $baseCurrency = WWPP_ACS_Integration_Helper::get_product_base_currency( $productId );\n $activeCurrency = get_woocommerce_currency();\n\n // No point on doing anything if have no base currency mapping\n if ( !empty( $baseCurrencyMapping ) ) {\n\n if ( $baseCurrency == $activeCurrency ) {\n\n /*\n * If active currency is equal to base currency, then we just need to pass\n * the base currency mapping.\n */\n $this->_printWholesalePricePerOrderQuantityTable( $wholesalePrice , $baseCurrencyMapping , array() , $mapping , $product , $userWholesaleRole , true , $baseCurrency , $activeCurrency );\n\n } else {\n\n $specific_currency_mapping = $this->_getSpecificCurrencyMapping( $mapping , $userWholesaleRole , $activeCurrency , $baseCurrencyMapping );\n\n $this->_printWholesalePricePerOrderQuantityTable( $wholesalePrice , $baseCurrencyMapping , $specific_currency_mapping , $mapping , $product , $userWholesaleRole , false , $baseCurrency , $activeCurrency );\n\n }\n\n }\n\n } else {\n\n // Default without Aelia currency switcher plugin\n\n if ( !empty( $baseCurrencyMapping ) )\n $this->_printWholesalePricePerOrderQuantityTable( $wholesalePrice , $baseCurrencyMapping , array() , $mapping , $product , $userWholesaleRole , true , get_woocommerce_currency() , get_woocommerce_currency() );\n\n }\n\n $mappingTableHtml = ob_get_clean();\n\n }\n\n $wholesalePriceHTML .= $mappingTableHtml;\n\n }\n\n }\n\n return $wholesalePriceHTML;\n\n }", "function getPrice()\n {\n return $this->price;\n }", "public function calculate_separate_shipping_items()\r\n\t{\r\n\t\t$separate_item_ids = $this->flexi->cart_contents['settings']['shipping']['data']['separate_shipping_items'];\r\n\t\t$separate_item_shipping_rate = 0;\r\n\t\t\r\n\t\t// Loop through cart items.\r\n\t\tforeach($this->flexi->cart_contents['items'] as $row_id => $row)\r\n\t\t{\r\n\t\t\t// Only calculate separate shipping rates for items that have been listed as being shipped separate.\r\n\t\t\tif (! empty($separate_item_ids) && in_array($row_id, $separate_item_ids))\r\n\t\t\t{\r\n\t\t\t\t// Check the shipping tables exist in the config file and are enabled.\r\n\t\t\t\tif ($this->get_enabled_status('shipping'))\r\n\t\t\t\t{\r\n\t\t\t\t\t$item_shipping_rate = $this->get_database_shipping_data(\r\n\t\t\t\t\t\t$this->flexi_cart->shipping_id(), $this->flexi_cart->shipping_location_data(), \r\n\t\t\t\t\t\t$row[$this->flexi->cart_columns['item_price']], $row[$this->flexi->cart_columns['item_weight']]\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t\t// Else use the current cart shipping rate as the separate shipping rate for this item.\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t$item_shipping_rate['value'] = $this->flexi->cart_contents['settings']['shipping']['value'];\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$separate_item_shipping_rate += $this->format_calculation($item_shipping_rate['value'] * $row[$this->flexi->cart_columns['item_quantity']]);\r\n\t\t\t\t\r\n\t\t\t\t// Update cart item array.\r\n\t\t\t\t$this->flexi->cart_contents['items'][$row_id] = $row;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $separate_item_shipping_rate;\r\n\t}", "private function calculateOrderAmount()\n {\n if ($this->getOffer() instanceof Offer) {\n //recalculates the new amount\n $this->getOffer()->calculateInvoiceAmount();\n Shopware()->Models()->persist($this->getOffer());\n }\n }", "function getItemCost( $itemid, $dealerid, $pricecode, $cost, $list )\n{\nglobal $db;\n\n//08.21.2015 ghh - first we're going to see if there is a dealer specific price for \n//this item and if so we'll just pass it back\n$query = \"select DealerCost from ItemCost where ItemID=$itemid and \n\t\t\t\tDealerID=$dealerid\";\nif (!$result = $db->sql_query($query))\n\t{\n\tRestLog(\"Error 16527 in query: $query\\n\".$db->sql_error());\n\tRestUtils::sendResponse(500,\"16527 - There was a problem attempting find the dealer cost\"); //Internal Server Error\n\treturn false;\n\t}\n\n$row = $db->sql_fetchrow( $result );\n\n//if there is a cost then lets just return it.\nif ( $row['DealerCost'] > 0 )\n\treturn $row['DealerCost'];\n\n//if there was no cost then the next step is to see if there is a price code\nif ( $pricecode != '' )\n\t{\n\t$query = \"select Discount from PriceCodesLink where DealerID=$dealerid\n\t\t\t\t\tand PriceCode=$pricecode\";\n\n\tif (!$result = $db->sql_query($query))\n\t\t{\n\t\tRestLog(\"Error 16528 in query: $query\\n\".$db->sql_error());\n\t\tRestUtils::sendResponse(500,\"16528 - There was a problem finding your price code\"); //Internal Server Error\n\t\treturn false;\n\t\t}\n\n\t//08.28.2015 ghh - if we did not find a dealer specific code then next we're going to \n\t//look for a global code to see if we can find that\n\tif ( $db->sql_numrows( $result ) == 0 )\n\t\t{\n\t\t$query = \"select Discount from PriceCodesLink where DealerID=0\n\t\t\t\t\t\tand PriceCode=$pricecode\";\n\n\t\tif (!$result = $db->sql_query($query))\n\t\t\t{\n\t\t\tRestLog(\"Error 16626 in query: $query\\n\".$db->sql_error());\n\t\t\tRestUtils::sendResponse(500,\"16626 - There was a problem finding your price code\"); //Internal Server Error\n\t\t\treturn false;\n\t\t\t}\n\n\t\t//if we found a global price code entry then enter here\n\t\tif ( $db->sql_numrows( $result ) > 0 )\n\t\t\t{\n\t\t\t$row = $db->sql_fetchrow( $result );\n\t\t\tif ( $row['Discount'] > 0 )\n\t\t\t\t$cost = bcmul( bcadd(1, $row['Discount']), $cost );\n\t\t\telse\n\t\t\t\t$cost = bcmul( bcadd( 1, $row['Discount']), $list );\n\t\t\t}\n\t\t}\n\telse\n\t\t{\n\t\t//if we found a dealer specific code then enter here\n\t\t$row = $db->sql_fetchrow( $result );\n\n\t\tif ( $row['Discount'] > 0 )\n\t\t\t$cost = bcmul( bcadd(1, $row['Discount']), $cost );\n\t\telse\n\t\t\t$cost = bcmul( bcadd( 1, $row['Discount']), $list );\n\t\t}\n\t}\n\nreturn $cost;\n}", "function price( )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n return $this->Price;\n }", "function _getDmstcQuote($pkg, $method = '') {\r\n\t\tglobal $order;\r\n\t\tif (tep_not_null($method) && in_array($method, $this->dmstc_available)) {\r\n\t\t\t$request_types = array($method);\r\n\t\t} else {\r\n\t\t\t$request_types = $this->dmstc_available;\r\n\t\t}\r\n\t\t$shipping_weight = ($pkg['item_weight'] < 0.0625 ? 0.0625 : $pkg['item_weight']);\r\n\t\t$shipping_pounds = floor($shipping_weight);\r\n\t\t$shipping_ounces = ceil((16 * ($shipping_weight - $shipping_pounds)) * 100) / 100; // rounded to two decimal digits\r\n\t\t$ounces = $shipping_weight * 16.0;\r\n\t\t$pkgvalue = $pkg['item_price'];\r\n\t\tif ($pkgvalue > MODULE_SHIPPING_USPS_DMSTC_INSURANCE_MAX) $pkgvalue = MODULE_SHIPPING_USPS_DMSTC_INSURANCE_MAX;\r\n\t\tif ($pkgvalue <= 0) $pkgvalue = 0.01;\r\n\t\t$nonuspsinsurancecost = 0;\r\n\t\tif (MODULE_SHIPPING_USPS_NON_USPS_INSURE == 'True') {\r\n\t\t\tif ($pkg['item_price'] <= 50) {\r\n\t\t\t\t$nonuspsinsurancecost = MODULE_SHIPPING_USPS_INS1;\r\n\t\t\t} else if ($pkg['item_price'] <= 100) {\r\n\t\t\t\t$nonuspsinsurancecost = MODULE_SHIPPING_USPS_INS2;\r\n\t\t\t}\telse if ($pkg['item_price'] <= 200) {\r\n\t\t\t\t$nonuspsinsurancecost = MODULE_SHIPPING_USPS_INS3;\r\n\t\t\t} else if ($pkg['item_price'] <= 300) {\r\n\t\t\t\t$nonuspsinsurancecost = MODULE_SHIPPING_USPS_INS4;\r\n\t\t\t} else {\r\n\t\t\t\t$nonuspsinsurancecost = MODULE_SHIPPING_USPS_INS4 + ((ceil($pkg['item_price']/100) - 3) * MODULE_SHIPPING_USPS_INS5);\r\n\t\t\t}\r\n\t\t}\r\n\t\t$sservs = array(); // any special services to request\r\n\t\tif (MODULE_SHIPPING_USPS_DMSTC_INSURANCE_OPTION == 'True') $sservs = array(1, 11); //request insurance, both regular & express mail\r\n\t\tif ((MODULE_SHIPPING_USPS_DMST_SIG_CONF == 'True') && ($order->info['subtotal'] >= MODULE_SHIPPING_USPS_SIG_THRESH)) {\r\n\t\t\t$sservs[] = 15;\r\n\t\t} elseif (MODULE_SHIPPING_USPS_DMST_DEL_CONF == 'True') {\r\n\t\t\t$sservs[] = 13;\r\n\t\t}\r\n\t\t$sservice = '';\r\n\t\tif (!empty($sservs)) {\r\n\t\t\tforeach ($sservs as $id) $sservice .= '<SpecialService>' . $id . '</SpecialService>';\r\n\t\t\t$sservice = '<SpecialServices>' . $sservice . '</SpecialServices>';\r\n\t\t}\r\n\t\t$box = array($pkg['item_length'], $pkg['item_width'], $pkg['item_height']);\r\n\t\trsort($box); // put package size in large to small order for purposes of checking dimensions\r\n\t\tlist($length, $width, $height) = $box;\r\n\t\t$id = 0;\r\n\t\t$quotes = $request_group = array();\r\n\t\t$group_count = 1;\r\n\t\t$type_count = 0;\r\n\t\t$urllength = strlen('production.shippingapis.com/shippingAPI.dll?<RateV4Request USERID=\"' . MODULE_SHIPPING_USPS_USERID . '\"><Revision>2</Revision></RateV4Request>');\r\n\t\tforeach ($request_types as $service) { // break the requested shipping methods into groups\r\n\t\t\tif (strpos($service, 'First') !== false) { // if first class mail service check if will fit type\r\n\t\t\t\t$fcmt = $this->first_class_to_mail_type[$service];\r\n\t\t\t\tif (($fcmt == 'LETTER') && (($length > $this->first_class_letter['length']) || ($width > $this->first_class_letter['width']) || ($height > $this->first_class_letter['height']) || ($ounces > $this->first_class_letter['ounces']))) continue; // don't check letter type if package doesn't fit\r\n\t\t\t\tif (($fcmt == 'FLAT') && (($length > $this->first_class_large_letter['length']) || ($width > $this->first_class_large_letter['width']) || ($height > $this->first_class_large_letter['height']) || ($ounces > $this->first_class_large_letter['ounces']))) continue; // don't check large letter type if package doesn't fit\r\n\t\t\t\tif (($fcmt == 'POSTCARD') && (($length > 6) || ($width > 4.25) || ($height > 0.016) || ($ounces > 3.5))) continue; // don't check postcard type if package doesn't fit\r\n\t\t\t\tif ($ounces > $this->first_class_parcel_max_ounces) continue; // don't check First Class if too heavy\r\n\t\t\t}\r\n\t\t\t$cont = $this->type_to_container[$service]; // begin checking for packages larger than USPS containers\r\n\t\t\t// if this service type specifies a container and this package won't fit then skip this service\r\n\t\t\tif (strpos($cont, 'Envelope') !== false) { // if service container is envelope\r\n\t\t\t\tif ($height > 1) continue; // anything thicker than one inch won't fit an envelope\r\n\t\t\t\tif ((strpos($cont, 'SM') !== false) && (($length > 10) || ($width > 6))) continue;\r\n\t\t\t\tif ((strpos($cont, 'Window') !== false) && (($length > 10) || ($width > 5))) continue;\r\n\t\t\t\tif ((strpos($cont, 'Gift') !== false) && (($length > 10) || ($width > 7))) continue;\r\n\t\t\t\tif ((strpos($cont, 'Legal') !== false) && (($length > 15) || ($width > 9.5))) continue;\r\n\t\t\t\tif (($length > 12.5) || ($width > 9.5)) continue; // other envelopes\r\n\t\t\t}\r\n\t\t\tif (($cont == 'SM Flat Rate Box') && (($length > 8.625) || ($width > 5.375) || ($height > 1.625))) continue;\r\n\t\t\tif (($cont == 'MD Flat Rate Box') || ($cont == 'Flat Rate Box')) {\r\n\t\t\t\tif ($length > 13.625) continue; // too big for longest medium box\r\n\t\t\t\tif ($length > 11) { // check medium type 2 box\r\n\t\t\t\t\tif (($length > 13.625) || ($width > 11.875) || ($height > 3.375)) continue; // won't fit medium type 2 box\r\n\t\t\t\t} elseif (($length > 11) || ($width > 8.5) || ($height > 5.5)) continue; // won't fit either type medium box\r\n\t\t\t}\r\n\t\t\tif (($cont == 'LG Flat Rate Box') && (($length > 12) || ($width > 12) || ($height > 5.5))) continue;\r\n\t\t\tif ($cont == 'Regional Rate Box A') {\r\n\t\t\t\tif ($length > 12.8125) continue; // too big for longest A box\r\n\t\t\t\tif ($length > 10) { // check A2 box\r\n\t\t\t\t\tif (($length > 12.8125) || ($width > 10.9375) || ($height > 2.375)) continue; // won't fit A2 box\r\n\t\t\t\t} elseif (($length > 10) || ($width > 7) || ($height > 4.75)) continue; // won't fit either type A box\r\n\t\t\t}\r\n\t\t\tif ($cont == 'Regional Rate Box B') {\r\n\t\t\t\tif ($length > 15.875) continue; // too big for longest B box\r\n\t\t\t\tif ($length > 12) { // check B2 box\r\n\t\t\t\t\tif (($length > 15.875) || ($width > 14.375) || ($height > 2.875)) continue; // won't fit B2 box\r\n\t\t\t\t} elseif (($length > 12) || ($width > 10.25) || ($height > 5)) continue; // won't fit either type B box\r\n\t\t\t}\r\n\t\t\tif (($cont == 'Regional Rate Box C') && (($length > 14.75) || ($width > 11.75) || ($height > 11.5))) continue;\r\n\t\t\t// passed all size checks so build request\r\n\t\t\t$request = '<Package ID=\"'. $id . '\"><Service>' . $this->type_to_request[$service] . '</Service>';\r\n\t\t\tif (strpos($service, 'First') !== false) $request .= '<FirstClassMailType>' . $fcmt . '</FirstClassMailType>';\r\n\t\t\t$request .= '<ZipOrigination>' . SHIPPING_ORIGIN_ZIP . '</ZipOrigination>' .\r\n\t\t\t\t\t'<ZipDestination>' . $this->dest_zip . '</ZipDestination>' .\r\n\t\t\t\t\t'<Pounds>' . $shipping_pounds . '</Pounds>' .\r\n\t \t\t'<Ounces>' . $shipping_ounces . '</Ounces>';\r\n\t\t\tif ((strpos($cont, 'Rate') === false) && (max($length, $width, $height) > 12)) {\r\n\t\t\t\t$request .= '<Container>RECTANGULAR</Container><Size>LARGE</Size>' .\r\n\t\t\t\t\t\t'<Width>' . $width . '</Width>' .\r\n\t\t\t\t\t\t'<Length>' . $length . '</Length>'.\r\n\t\t\t\t\t\t'<Height>' . $height . '</Height>';\r\n\t\t\t} else {\r\n\t\t\t\t$request .= '<Container>' . $cont . '</Container><Size>REGULAR</Size>';\r\n\t\t\t}\r\n\t\t\tif (MODULE_SHIPPING_USPS_DMSTC_INSURANCE_OPTION == 'True') $request .= '<Value>' . number_format($pkgvalue, 2, '.', '') . '</Value>';\r\n\t\t\t$request .= $sservice;\r\n\t\t\tif ((strpos($service, 'First') !== false) || (strpos($service, 'Post') !== false)) $request .= '<Machinable>true</Machinable>';\r\n\t\t\t$request .= '</Package>';\r\n\t\t\t$id++;\r\n\t\t\t$type_count++;\r\n\t\t\tif (($type_count > 25) || (($urllength + strlen(urlencode($request))) > 2000)) { // only 25 services allowed per request or 2000 characters per url\r\n\t\t\t\t$group_count++;\r\n\t\t\t\t$type_count = 1;\r\n\t\t\t\t$urllength = strlen('production.shippingapis.com/shippingAPI.dll?<RateV4Request USERID=\"' . MODULE_SHIPPING_USPS_USERID . '\"><Revision>2</Revision></RateV4Request>');\r\n\t\t\t}\r\n\t\t\t$urllength += strlen(urlencode($request));\r\n\t\t\t$request_group[$group_count][$type_count] = $request;\r\n\t\t} // end foreach request type as service\r\n\t\tif (empty($request_group)) return array('error' => MODULE_SHIPPING_USPS_ERROR_NO_SERVICES);\r\n\t\tif (!class_exists('httpClient')) {\r\n\t\t\tinclude(DIR_FS_CATALOG . DIR_WS_CLASSES .'http_client.php');\r\n\t\t} //print_r($request_group);\r\n\t\tforeach ($request_group as $service_group) {\r\n\t\t\t$request = '<RateV4Request USERID=\"' . MODULE_SHIPPING_USPS_USERID . '\"><Revision>2</Revision>';\r\n\t\t\tforeach ($service_group as $service_request) {\r\n\t\t\t\t$request .= $service_request;\r\n\t\t\t}\r\n\t\t\t$request .= '</RateV4Request>';\r\n\t\t\t$request = \t'API=RateV4&XML=' . urlencode($request);\r\n\t\t\t$body = '';\r\n\t\t\t$http = new httpClient();\r\n\t\t\tif ($http->Connect('production.shippingapis.com', 80)) {\r\n\t\t\t\t$http->addHeader('Host', 'production.shippingapis.com');\r\n\t\t\t\t$http->addHeader('User-Agent', 'IntenseCart');\r\n\t\t\t\t$http->addHeader('Connection', 'Close');\r\n\t\t\t\tif ($http->Get('/shippingAPI.dll?' . $request)) $body = $http->getBody();\r\n\t\t\t\t$http->Disconnect();\r\n\t\t\t} else {\r\n\t\t\t\t$body = '<Error><Number></Number><Description>' . MODULE_SHIPPING_USPS_TEXT_CONNECTION_ERROR . '</Description></Error>';\r\n\t\t\t}\r\n\t\t\t$doc = XML_unserialize($body); //print_r($doc);\r\n\t\t\tif (isset($doc['Error'])) return array('error' => $doc['Error']['Number'] . ' ' . $doc['Error']['Description']);\r\n\t\t\tif (isset($doc['RateV4Response']['Package']['Postage'])) { // single mail service response\r\n\t\t\t\t$tmp = $this->_decode_domestic_response($doc['RateV4Response']['Package']['Postage'], $pkgvalue, $nonuspsinsurancecost, $pkg['item_price']);\r\n\t\t\t\tif (!empty($tmp)) $quotes[$tmp['id']] = $tmp;\r\n\t\t\t} elseif (isset($doc['RateV4Response']['Package'][0])) { // multiple mailing services returned\r\n\t\t\t\tforeach ($doc['RateV4Response']['Package'] as $mailsvc) {\r\n\t\t\t\t\tif (isset($mailsvc['Postage'])) {\r\n\t\t\t\t\t\t$tmp = $this->_decode_domestic_response($mailsvc['Postage'], $pkgvalue, $nonuspsinsurancecost, $pkg['item_price']);\r\n\t\t\t\t\t\tif (!empty($tmp)) $quotes[$tmp['id']] = $tmp;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} // end foreach $request_group\r\n\t\treturn $quotes;\r\n\t}", "public function calcTotal()\n {\n\n $productBusinessService = new ProductBusinessService();\n\n // create an array to hold all subtotals\n $subtotals_array = array();\n $this->total_price = 0;\n\n foreach ($this->items as $item => $qty) {\n\n // get the price of the product from the database\n $product = $productBusinessService->getProductByID($item);\n\n // calculate the total (price * quantity)\n $product_subtotal = $product->getPrice() * $qty;\n\n // add that subtotal to the subtotal array\n $subtotals_array = $subtotals_array + array($item => $product_subtotal);\n\n // add the item subtotal to the cart total\n $this->total_price += $product_subtotal;\n }\n\n // set the subtotals array\n $this->subtotals = $subtotals_array;\n }", "function it_calculates_delivery_prices()\n {\n $this->calculateDeliveryPrice(49.99)->shouldEqual(4.95);\n $this->calculateDeliveryPrice(50.00)->shouldEqual(2.95);\n $this->calculateDeliveryPrice(90.00)->shouldEqual(0);\n }", "public function getTonicDiscount()\n {\n }", "public function resolvePrice();", "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 }", "public function getProductPrice(){\n return $this->product_price;\n }", "function showTransactionResult()\r\n{\r\n global $config;\r\n $items_subtotal = 0; //init\r\n $extras_subtotal = 0; //init\r\n \r\n /*\r\n echo '<pre>';\r\n var_dump($_POST);\r\n echo'</pre>';\r\n */\r\n \r\n //start ITEMS ordered table\r\n //date format May 13, 2018, 1:16 am\r\n $html = '\r\n\r\n <h2>\r\n <span>Order Details</span>\r\n </h2>\r\n\r\n <p style=\"margin-left:1rem; margin-top:0;\">Order Date: ' . date(\"F j, Y, g:i a\") . '</p>\r\n <div class=\"menuitem\">\r\n <h3 style=\"margin-top:0;\">Items Ordered:</h3>\r\n <table style=\"width:100%\">\r\n <tr>\r\n <th>Item Name</th>\r\n <th>Qty</th>\r\n <th>Price</th>\r\n <th>Item Total</th>\r\n </tr>\r\n ';\r\n \r\n //this foreach block generates the table rows of ITEMS ordered\r\n foreach ($_POST as $key => $value) \r\n {\r\n //check $key is an item or a topping\r\n if (substr($key,0,5) == 'item_') {\r\n \r\n //get qty, cast as int\r\n $quantity = (int)$value;\r\n \r\n //check if there is an order for this item\r\n if ($quantity > 0) {\r\n \r\n //seperate string with _ as the delimiter\r\n $key_array = explode('_',$key);\r\n \r\n //cast item number as an integer\r\n $key_id = (int)$key_array[1];\r\n \r\n //get price, cast as float\r\n $price = (float)$config->items[$key_id - 1]->Price;\r\n \r\n //get name\r\n $name = $config->items[$key_id - 1]->Name;\r\n \r\n //calculate total for this item\r\n $item_total = $quantity * $price;\r\n \r\n //add to over items subtotal\r\n $items_subtotal += $item_total;\r\n \r\n //money format\r\n $price_output = money_format('%.2n', $price);\r\n $item_total_output = money_format('%.2n', $item_total);\r\n \r\n $html .= '\r\n <tr>\r\n <td>' . $name . '</td>\r\n <td>' . $quantity . '</td>\r\n <td>' . $price_output . '</td>\r\n <td>' . $item_total_output . '</td>\r\n </tr>\r\n ';\r\n }\r\n }\r\n }\r\n \r\n //money format\r\n $items_subtotal_output = money_format('%.2n', $items_subtotal);\r\n \r\n //finish ITEMS table\r\n $html .= '\r\n <tr class=\"tabletotal\">\r\n <td colspan=3 class=\"tabletotaltitle\">Items Subtotal: </td>\r\n <td>' . $items_subtotal_output . '</td>\r\n </tr>\r\n </table>\r\n '; \r\n \r\n //start EXTRAS ordered table\r\n $extras_html = '\r\n <h3>Extras Ordered:</h3>\r\n <table style=\"width:100%\">\r\n <tr>\r\n <th>Extra</th>\r\n\r\n <th>Qty</th>\r\n\r\n <th>Price</th>\r\n </tr>\r\n ';\r\n \r\n //this foreach block generates the table rows of EXTRAS ordered\r\n foreach ($_POST as $key => $value) \r\n {\r\n if (substr($key,0,7) == 'extras_') {\r\n \r\n foreach ($value as $extra_key => $extra) {\r\n \r\n //seperate string with _ as the delimiter\r\n $key_array = explode('_',$key);\r\n \r\n //cast item number as an integer\r\n $key_id = (int)$key_array[1];\r\n \r\n $associated_item_key = 'item_' . $key_id;\r\n \r\n $quantity_of_extra = $_POST[$associated_item_key];\r\n \r\n $extra_subtotal = $quantity_of_extra * 0.25; //calculates subtotal of each particular extra\r\n \r\n $extras_subtotal += $extra_subtotal; //adds to overall subtotal of all extras\r\n \r\n $extra_subtotal_output = money_format('%.2n', $extra_subtotal);\r\n\r\n //add row to EXTRAS table\r\n $extras_html .= '\r\n <tr>\r\n <td>' . $extra . '</td>\r\n\r\n <td>' . $quantity_of_extra . '</td>\r\n <td>' . $extra_subtotal_output . '</td>\r\n\r\n </tr>\r\n ';\r\n }\r\n }\r\n }\r\n \r\n //money format\r\n $extras_subtotal_output = money_format('%.2n', $extras_subtotal);\r\n \r\n //finish EXTRAS table\r\n $extras_html .='\r\n <tr class=\"tabletotal\">\r\n\r\n <td colspan=\"2\" class=\"tabletotaltitle\">Extras Subtotal: </td>\r\n\r\n <td>' . $extras_subtotal_output . '</td>\r\n </tr>\r\n </table>\r\n </div>\r\n ';\r\n \r\n if ($extras_subtotal == 0) {\r\n $extras_html = '\r\n <h3>Extras Ordered:</h3>\r\n <p>No extras were ordered.</p>\r\n </div>\r\n ';\r\n }\r\n \r\n $html .= $extras_html;\r\n \r\n //calculate tax & totals\r\n $order_subtotal = $items_subtotal + $extras_subtotal;\r\n $tax = $order_subtotal * .101; //10.1%\r\n $grand_total = $order_subtotal + $tax;\r\n \r\n //money format\r\n $order_subtotal = money_format('%.2n', $order_subtotal);\r\n $tax = money_format('%.2n', $tax);\r\n $grand_total = money_format('%.2n', $grand_total);\r\n\r\n //display order summary\r\n $html .= '\r\n <div class=\"menuitem\">\r\n <h3 style=\"margin-top:0;\">Order Summary:</h3>\r\n <table style=\"width:100%\">\r\n <tr>\r\n <td>Item(s) Subtotal: </td>\r\n <td>' . $items_subtotal_output . '</td>\r\n </tr>\r\n <tr>\r\n <td>Extra(s) Subtotal: </td>\r\n <td>' . $extras_subtotal_output . '</td>\r\n </tr>\r\n <tr>\r\n <td>Order Subtotal: </td>\r\n <td>' . $order_subtotal . '</td>\r\n </tr>\r\n <tr>\r\n <td>Tax: </td>\r\n <td>' . $tax . '</td>\r\n </tr>\r\n <tr class=\"tabletotal\">\r\n <td>Grand Total: </td>\r\n <td>' . $grand_total . '</td>\r\n </tr>\r\n </table>\r\n </div>\r\n ';\r\n\r\n\r\n return $html;\r\n}", "function calculateDelivery($basket_content, $delivery_address_id, $delivery_options = false, $promotion_detail = false) {\n\t\t\t\t\n\t\t//if there is a product with vat rate > 0, add vat to the shipping\n\t\t$add_vat = $this->findVATEligibility($basket_content);\n\n\t\t//get weight for delivery\n\t\t$total_weight = $basket_content['total_weight_gross'];\n\t\t\n\t\t//convert total weight to grams\n\t\trequire_once('models/ecommerce/ecommerce_product_variety.php');\n\t\t$product_variety_conf = ecommerce_product_variety::initConfiguration();\n\t\t$total_weight = $this->convertWeight($total_weight, $product_variety_conf['weight_units'], 'g');\n\n\t\t//calculate delivery\n\t\t$delivery_price = $this->calculate($delivery_address_id, $total_weight, $basket_content['total_goods_net'], $delivery_options, $promotion_detail);\n\t\n\t\t//assign\n\t\t$delivery['value_net'] = $delivery_price;\n\t\t$delivery['weight'] = $total_weight;\n\t\t$delivery['vat_rate'] = $add_vat;\n\n\t\t//format\n\t\t$delivery['value_net'] = sprintf(\"%0.2f\", $delivery['value_net']);\n\t\t\n\t\t//add vat\n\t\tif ($add_vat > 0) {\n\t\t\t$delivery['vat'] = $delivery['value_net'] * $add_vat / 100;\n\t\t\t$delivery['value'] = $delivery['value_net'] + $delivery['vat'];\n\t\t} else {\n\t\t\t$delivery['vat'] = 0;\n\t\t\t$delivery['value'] = $delivery['value_net'];\n\t\t}\n\t\t\n\t\treturn $delivery;\n\t}", "static function generate_order_prices(Model_Cart $shopping_cart, $shipping_id=false, $payment_id=false, $raw_discount=0)\n {\n\n if($shopping_cart->total_cart_price_with_tax==0) return array();\n \n // nazvy indexu shodne s db tabulkou \"order\"\n \n // inicializace vsech promennych co se budou pocitat v kosiku\n \n $prices[\"order_price_no_vat\"]=0; // soucet cen produktu s nulovou dani\n $prices[\"order_price_lower_vat\"]=0; // soucet cen produktu s nizsi sazbou dane (vcetne dane)\n $prices[\"order_price_higher_vat\"]=0; // soucet cen produktu s vyssi sazbou dane (vcetne dane)\n\n // nasledujici se bude generovat az v create_order:\n $prices[\"order_no_vat_rate\"]=0; // \n $prices[\"order_lower_vat_rate\"]=db::select(\"hodnota\")->from(\"taxes\")->where(\"code\",\"=\",\"lower_vat\")->execute()->get(\"hodnota\"); // hodnota nizsi sazby dane\n $prices[\"order_higher_vat_rate\"]=db::select(\"hodnota\")->from(\"taxes\")->where(\"code\",\"=\",\"higher_vat\")->execute()->get(\"hodnota\"); // hodnota vyssi sazby dane\n \n $prices[\"order_lower_vat\"]=0; // soucet vsech nizsich dani na produktech\n $prices[\"order_higher_vat\"]=0; // soucet vsech vyssich dani na produktech\n \n $prices[\"order_total_without_vat\"]=0; // celkova cena kosiku bez dane\n $prices[\"order_total_with_vat\"]=0; // celkova cena kosiku s dani\n \n $prices[\"order_discount\"]=0; // hodnota slevy na objednavce (vcetne dane)\n \n $prices[\"order_total_with_discount\"]=0;// celkova cena kosiku s dani a zapoctenymi slevami \n \n $prices[\"order_shipping_price\"]=0; // cena dopravy s dani\n $prices[\"order_payment_price\"]=0; // cena platby s dani\n \n $prices[\"order_total\"]=0; // cena celkem po zapocitani dopravy a platby\n $prices[\"order_correction\"]=0; // hodnota zaokrouhleni platby\n $prices[\"order_total_CZK\"]=0; // cena k zaplaceni celkem po zaokrouhleni\n \n // udaje k doprave, ktera byla pouzita k vypoctu objednavky\n $prices[\"order_shipping_id\"]=0;\n $prices[\"order_shipping_nazev\"]=\"\";\n $prices[\"order_shipping_popis\"]=\"\";\n \n // udaje k platbe, ktera byla pouzita k vypoctu objednavky\n $prices[\"order_payment_id\"]=0;\n $prices[\"order_payment_nazev\"]=\"\";\n $prices[\"order_payment_popis\"]=\"\";\n \n \n \n // generovani vyse uvedenych promennych\n \n $prices[\"order_price_no_vat\"] = $shopping_cart->total_cart_price_no_tax;\n $prices[\"order_price_lower_vat\"] = $shopping_cart->total_cart_price_lower_tax;\n $prices[\"order_price_higher_vat\"] = $shopping_cart->total_cart_price_higher_tax;\n \n $prices[\"order_lower_vat\"] = $shopping_cart->total_lower_tax_value; \n $prices[\"order_higher_vat\"] = $shopping_cart->total_higher_tax_value;\n \n $prices[\"order_total_without_vat\"] = $shopping_cart->total_cart_price_without_tax; \n $prices[\"order_total_with_vat\"] = $shopping_cart->total_cart_price_with_tax; \n \n $prices[\"order_shipping_id\"] =$shipping_id;\n $prices[\"order_payment_id\"] =$payment_id;\n \n //////////////////////////////////////// \n // vypocet slev na objednavce TODO podle potreb projektu:\n $prices=static::calculate_order_discount($prices, $shopping_cart, $raw_discount);\n \n // prirazeni voucheru k objednavce\n $voucher=Service_Voucher::get_voucher();\n if($voucher)\n {\n $prices[\"order_voucher_id\"]=$voucher->id;\n $prices[\"order_voucher_discount\"]=$shopping_cart->total_cart_voucher_discount;\n }\n \n ////////////////////////////////////////\n $prices[\"order_total_with_discount\"] = $prices[\"order_total_with_vat\"]-$prices[\"order_discount\"];\n if($prices[\"order_total_with_discount\"]<0) $prices[\"order_total_with_discount\"]=0;\n \n // cena za dopdieravu\n if($shipping_id)\n {\n $shipping = orm::factory(\"shipping\",$shipping_id);\n $prices[\"order_shipping_nazev\"] = $shipping->nazev;\n $prices[\"order_shipping_popis\"] = $shipping->popis;\n // cena dopravy\n if($shipping->cenove_hladiny)\n {\n $prices[\"order_shipping_price\"] = Service_Hana_Shipping::get_level_price($shipping_id, round($prices[\"order_total_with_discount\"]));\n if($prices[\"order_shipping_price\"]==false) $prices[\"order_shipping_price\"]=$shipping->cena;\n }\n else\n { \n $prices[\"order_shipping_price\"] = $shipping->cena;\n } \n\n }\n\n // cena za platbu\n if($payment_id)\n {\n $payment = orm::factory(\"payment\",$payment_id);\n $prices[\"order_payment_nazev\"]=$payment->nazev;\n $prices[\"order_payment_popis\"]=$payment->popis;\n \n // vypocet platby na zaklade typu\n if($payment->typ==2)\n {\n // TODO - platba na zaklade hodnoty objednaneho zbozi \n $prices[\"order_payment_price\"] = $price[\"order_total_with_discount\"]($payment->cena/100); \n }\n else\n {\n $prices[\"order_payment_price\"] = $payment->cena;\n }\n \n $shp=$prices[\"order_shipping_price\"] + $prices[\"order_payment_price\"];\n if($shp<0) $prices[\"order_payment_price\"]=$prices[\"order_shipping_price\"]; // pokud je platba dana slevou, nelze se dostat do zaporu (jeji sleva je ve vysi max ceny dopravy)\n \n }\n \n //////////////////////////////////////////////\n $prices[\"order_total\"] = $prices[\"order_total_with_discount\"] + $prices[\"order_shipping_price\"] + $prices[\"order_payment_price\"];\n $prices[\"order_total_CZK\"] =round($prices[\"order_total\"]); \n $prices[\"order_correction\"] =$prices[\"order_total_CZK\"]-$prices[\"order_total\"]; \n \n return $prices;\n }", "public function getPrice() {\n return $this->price;\n}", "public function collect(\n Quote $quote,\n ShippingAssignmentInterface $shippingAssignment,\n Total $total\n ) {\n parent::collect($quote, $shippingAssignment, $total);\n\n $items = $shippingAssignment->getItems();\n if (!count($items)) {\n return $this;\n }\n\n $amount = 0;\n \n\n /* foreach($quote->getItemsCollection() as $_quoteItem){\n $amount += $_quoteItem->getQty() * \\Magento360\\CustomeName\\Pricing\\Adjustment::ADJUSTMENT_VALUE;\n }*/\n if ($this->sessionFactory->create()->isLoggedIn()) {\n $amount = $this->addAdminFee($quote,$amount);\n }\n\n /*$total->setTotalAmount(self::COLLECTOR_TYPE_CODE, $amount);\n $total->setBaseTotalAmount(self::COLLECTOR_TYPE_CODE, $amount);\n $total->setCustomAmount($amount);\n $total->setBaseCustomAmount($amount);\n $total->setGrandTotal($total->getGrandTotal() + $amount);\n $total->setBaseGrandTotal($total->getBaseGrandTotal() + $amount);\n */\n\n $enabled = $this->dataHelper->isModuleEnabled();\n $subtotal = $total->getTotalAmount('subtotal');\n if ($enabled) {\n //$fee = $this->dataHelper->getAdminFee();\n\n $total->setTotalAmount('custom-admin-fee', $amount);\n $total->setBaseTotalAmount('custom-admin-fee', $amount);\n /*$total->setCustomAdminFee($amount);\n $quote->setCustomAdminFee($amount);*/\n\n $total->setGrandTotal($total->getGrandTotal() + $amount);\n\n if ($this->taxHelper->isTaxEnabled()) {\n $address = $this->_getAddressFromQuote($quote);\n //$address = $this->_getAddressFromQuote($quote);\n $this->_calculateTax($address, $total);\n\n $extraTaxables = $address->getAssociatedTaxables();\n $extraTaxables[] = [\n 'code' => 'custom-admin-fee',\n 'type' => 'custom-admin-fee',\n 'quantity' => 1,\n 'tax_class_id' => $this->taxHelper->getTaxClassId(),\n 'unit_price' => $amount,\n 'base_unit_price' => $amount,\n 'price_includes_tax' => false,\n 'associated_item_code' => false\n ];\n\n $address->setAssociatedTaxables($extraTaxables);\n \n $total->setGrandTotal($total->getGrandTotal() + $address->getAdminFeeTax());\n }\n\n }\n\n return $this;\n }", "function calculatePrice($price, $discount){\n\t$DollarsOFF = $price * ($discount/100);\n\t$finalPrice = $price - $DollarsOFF;\n\treturn $finalPrice;\n}", "public function getTaxedPrice();", "function total_price($price_summary) {\r\n return ($price_summary ['OfferedPriceRoundedOff']);\r\n }", "public function calculation()\n {\n $this->autoRender=false;\n $this->loadModel('Contract');\n $this->loadModel('Delivery');\n $this->Contract->recursive=-1;\n $contracts=$this->Contract->find('all');\n $this->Delivery->recursive=-1;\n foreach ($contracts as $contract)\n {\n $contract_id=$contract['Contract']['id'];\n \n $pli_pac_con=($contract['Contract']['pli_pac']>0)?$contract['Contract']['pli_pac']:0;\n $pli_aproval_con=($contract['Contract']['pli_aproval']>0)?$contract['Contract']['pli_aproval']:0;\n $rr_collection_progressive_con=($contract['Contract']['rr_collection_progressive']>0)?$contract['Contract']['rr_collection_progressive']:0;\n \n $invoice_submission_progressive_con=($contract['Contract']['invoice_submission_progressive']>0)?$contract['Contract']['invoice_submission_progressive']:0;\n $payment_cheque_collection_progressive_con=($contract['Contract']['payment_cheque_collection_progressive']>0)?$contract['Contract']['payment_cheque_collection_progressive']:0;\n $payment_credited_to_bank_progressive_con=($contract['Contract']['payment_credited_to_bank_progressive']>0)?$contract['Contract']['payment_credited_to_bank_progressive']:0;\n \n $conditions=array(\n 'conditions'=>array(\n 'Delivery.contract_id'=>$contract_id,\n 'Delivery.actual_delivery_date NOT LIKE'=>\"0000-00-00\",\n //'Delivery.invoice_submission_progressive LIKE'=>\"0000-00-00\",//this condition may change\n ),\n 'group'=>array(\n 'Delivery.contract_id',\n 'Delivery.actual_delivery_date'\n )\n );\n $deliveries=$this->Delivery->find('all',$conditions);\n $sql=\"\";\n foreach ($deliveries as $deliverie)\n {\n \n $actual_delivery_date=strtotime($deliverie['Delivery']['actual_delivery_date']);\n $id=$deliverie['Delivery']['id'];\n \n $pli_pac1 = $actual_delivery_date+$pli_pac_con * 86400;\n $pli_pac = date('Y-m-d',$pli_pac1);\n\n $pli_aproval1 = $pli_pac1 + $pli_aproval_con * 86400;\n $pli_aproval = date('Y-m-d', $pli_aproval1);\n //planned_rr_collection_date\n $rr_collection_progressive1=$pli_aproval1+$rr_collection_progressive_con* 86400;\n $rr_collection_progressive= date('Y-m-d', $rr_collection_progressive1);\n //invoice_submission_progressive\n $invoice_submission_progressive1 =$rr_collection_progressive1+ $invoice_submission_progressive_con * 86400;\n $invoice_submission_progressive = date('Y-m-d', $invoice_submission_progressive1); \n //payment_cheque_collection_progressive\n $payment_cheque_collection_progressive1=$invoice_submission_progressive1+$payment_cheque_collection_progressive_con * 86400;\n $payment_cheque_collection_progressive = date('Y-m-d', $payment_cheque_collection_progressive1);\n //payment_credited_to_bank_progressive\n $payment_credited_to_bank_progressive1=$payment_cheque_collection_progressive1+$payment_credited_to_bank_progressive_con * 86400;\n $payment_credited_to_bank_progressive = date('Y-m-d', $payment_credited_to_bank_progressive1);\n \n $sql.=\"UPDATE deliveries SET invoice_submission_progressive = '\".$invoice_submission_progressive.\"',payment_cheque_collection_progressive='\".$payment_cheque_collection_progressive.\"',payment_credited_to_bank_progressive='\".$payment_credited_to_bank_progressive.\"' WHERE contract_id= $contract_id and actual_delivery_date='\".$deliverie['Delivery']['actual_delivery_date'].\"';\";\n }\n if($sql){\n \n $this->Delivery->query($sql);\n }\n } \n }", "public function cost()\n {\n return $this->price;\n }" ]
[ "0.65661514", "0.6336627", "0.633452", "0.62958866", "0.6272911", "0.6133519", "0.611328", "0.6069351", "0.6054684", "0.6035616", "0.6031902", "0.6016142", "0.5973715", "0.59558755", "0.5955804", "0.59295845", "0.59289765", "0.592171", "0.59100044", "0.5888301", "0.5888105", "0.5884939", "0.5866562", "0.5846047", "0.5802918", "0.5792723", "0.5792671", "0.5775641", "0.5775151", "0.5773192", "0.5768065", "0.5767691", "0.5767691", "0.57633483", "0.5755444", "0.5744016", "0.5742353", "0.5734422", "0.5729121", "0.5728709", "0.57278246", "0.57200974", "0.57200974", "0.571672", "0.57139194", "0.5707963", "0.56933206", "0.5688172", "0.5684252", "0.5681834", "0.5664221", "0.5664221", "0.5664221", "0.5664221", "0.56352735", "0.5635067", "0.56339574", "0.5633075", "0.5632463", "0.5627014", "0.5619685", "0.5618032", "0.5609317", "0.5608722", "0.5608722", "0.5605984", "0.56045514", "0.56034255", "0.55953944", "0.5592627", "0.557015", "0.5567642", "0.5566898", "0.55654556", "0.5563336", "0.5561509", "0.555581", "0.55544984", "0.5552254", "0.55488163", "0.55470747", "0.5546109", "0.55450815", "0.554065", "0.553951", "0.5538941", "0.5534764", "0.5528902", "0.55225676", "0.5514784", "0.5514135", "0.5513361", "0.5509907", "0.5502474", "0.54957145", "0.54936934", "0.5487448", "0.5486941", "0.548268", "0.54808784", "0.54795194" ]
0.0
-1
Handle Update Quality Controll Pass By Delivery Order Detail ID
public function UpdateQCPass($delivery_order_detail_id) { $QC_pass_update_qty = $this->deliveryOrderDetail::where('warehouse_out_id', $delivery_order_detail_id)->pluck('qty_confirm')->toArray(); return $QC_pass_update_qty; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateOrder($data_update,$purc_order_id)\n\t {\n\t\t \n\t\t $this->db->where(\"purc_order_id\", $purc_order_id);\n\t\t $this->db->where(\"status\", 'Open');\n\t\t if($this->session->userdata('userrole') == 'Purchase' ){\n\t\t\t$this->db->where(\"order_by\",$this->session->userdata('userid'));\n\t\t }\n\t\t $this->db->update(\"purchase_orders\", $data_update); \n\t\t //echo $this->db->last_query();die;\n\t\t $this->db->limit(1);\n\t\t return $purc_order_id;\n\t }", "public function updateAction() {\n $model = Mage::getModel('inventorypurchasing/purchaseorder_draftpo')\n ->load($this->getRequest()->getParam('id'));\n $field = $this->getRequest()->getParam('field');\n if (!$field) {\n return $this->getResponse()->setBody(json_encode(array('success' => 0)));\n }\n $value = $this->getRequest()->getParam('value');\n $updateData = Mage::helper('vendorsinventory/draftpo')->prepareUpdateData($field, $value);\n try {\n $returnObject = $model->update($updateData);\n $return = $returnObject->getData();\n $return['success'] = 1;\n return $this->getResponse()->setBody(json_encode($return));\n } catch (Exception $ex) {\n return $this->getResponse()->setBody(json_encode(array('success' => 0)));\n }\n }", "public function update(Request $request, DeliveryExecutive $deliveryExecutive,$id)\n {\n $executives = new DeliveryExecutive;\n $executives->exists = true;\n $executives->id = $request->id;\n $executives->method = $request->method;\n $executives->delivery_date = date(\"Y-m-d\",strtotime(str_replace('/', '-',$request->delivery_date)));\n if($request->method=='others')\n $executives->others = $request->others;\n $executives->distance = $request->distance;\n $executives->delivery_time = date(\"H:i\", strtotime($request->delivery_time));\n $executives->delivery_person = $request->delivery_person;\n $executives->delivery_vehicle_type = $request->delivery_vehicle_type;\n if($request->delivery_vehicle_type=='company')\n $executives->delivery_vehicle_id = $request->delivery_vehicle_id;\n $executives->branch_id = $request->branch_id;\n $executives->delivery_note = $request->delivery_note;\n $executives->save();\n return redirect('executives')->withSuccess('Delivery Details Updated Successfully.');\n }", "private function updateOrderDetail($order){\n $endpoint = $this->endpointBase.\"/\".$order['id'];\n $params = array('url_params' => \"\");\n\n return $this->MPAPI->callMallAPI(HTTP_Method::PUT, $endpoint, $order);\n }", "public function update_delivery_status() {\n \n $delivery=$this->uri->segment(3);\n $data['order']=$delivery;\n $data['order_ord']=Kemsa_Order_Details::get_order($delivery);\n $data['batch_no']=Kemsa_Order::get_batch_no($delivery);\n $data['title'] = \"Update Delivery Status\";\n $data['content_view'] = \"update_delivery_status_v\";\n $data['banner_text'] = \"Update Status\";\n $data['link'] = \"order_management\";\n $data['quick_link'] = \"all_deliveries\";\n $this -> load -> view(\"template\", $data);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'order_detail_id'=>'required',\n 'product_id'=>'required',\n 'product_quantity'=>'required|numeric',\n 'order_id'=>'required',\n ]);\n\n\n $order_detail = OrderDetail::where('order_detail_id',$id)->first();\n $order_detail->order_detail_id = $request->get('order_detail_id');\n $order_detail->product_id = $request->get('product_id');\n $order_detail->product_quantity = $request->get('product_quantity');\n $order_detail->order_id = $request->get('order_id');\n $order_detail->delivery_id = $request->get('delivery_id');\n $order_detail->save();\n\n return redirect('/orderdetails')->with('success','Order Detail updated!');\n }", "public function UpdateDeliveryOrder($id, Request $request)\n {\n $sub_total = $this->deliveryOrderServices->SumItemDiscountToSubTotal($request);\n $DO_Detail = $this->deliveryOrderServices->ItemOnDODetail(array('warehouse_out_id' => $request->warehouse_out_id, 'item_id' => $request->item_id));\n try {\n DB::beginTransaction();\n\n // Update Delivery Order Detail by Delivery Order Detail ID\n BagItemWarehouseOut::find($DO_Detail->id)->update([\n 'qty' => $request->qty,\n ]);\n\n // New Grand Total on Delivery Order\n // $DO_GT_update = $this->deliveryOrderServices->SumItemPriceByDeliveryOrderID($request->warehouse_out_id);\n // WarehouseOut::find($request->warehouse_out_id)->update([\n // 'grand_total' => $DO_GT_update\n // ]);\n\n DB::commit();\n return $this->returnSuccess($DO_Detail, 'Delivery Order dengan ID '.$DO_Detail->warehouse_out_id.' Berhasil di Update');\n } catch (\\Throwable $th) {\n DB::rollback();\n return $this->returnError($th->getMessage().'-'.$th->getLine());\n }\n }", "function update_covered_line($id,$params)\n {\n $this->db->where('id',$id);\n return $this->db->update('covered_lines',$params);\n }", "public function update($id, $order_data);", "public function update(Request $request, $order_id)\n {\n $order=Orders::findOrFail($order_id);\n $validator = validator()->make($request->all(), [\n 'product_id' =>'required',\n 'supplier_id' => 'required',\n 'quantity_total' => 'required',\n \n ]);\n \n if ($validator->fails()) {\n\n // /echo \"here\"; exit;\n flash(trans('messages.parameters-fail-validation'),'danger');\n return back()->withErrors($validator)->withInput();\n }\n\n // SET AND UPDATE\n extract($request->all());\n $order->product_id = $product_id;\n $order->supplier_id = $supplier_id;\n $order->quantity_total = $quantity_total;\n $order->save();\n\n if($request->wantsJson()){\n return response([\n \"message\" =>trans('Order details updated successfully!!'),\n \"status_code\" =>201\n ],201);\n }\n flash(trans('Order details updated successfully!!'),'success');\n return back();\n\n\n }", "public function update_details($param) {\n \n }", "function update($pid=null)\n {\n if ($this->acl->otentikasi2($this->title) == TRUE && $this->model->valid_add_trans($pid, $this->title) == TRUE){ \n\n\t// Form validation\n $this->form_validation->set_rules('tdate', 'Invoice Date', 'required|callback_valid_period');\n $this->form_validation->set_rules('tnote', 'Note', 'required');\n $this->form_validation->set_rules('tcosts', 'Landed Cost', 'numeric');\n $this->form_validation->set_rules('tdocno', 'Docno', '');\n $this->form_validation->set_rules('cacc', 'Account', 'required');\n\n if ($this->form_validation->run($this) == TRUE && $this->valid_confirmation($pid) == TRUE)\n {\n $purchase_returns = $this->model->get_by_id($pid)->row();\n\n $purchase_return = array('log' => $this->decodedd->log, 'docno' => $this->input->post('tdocno'),\n 'dates' => $this->input->post('tdate'), 'acc' => $this->input->post('cacc'), 'notes' => $this->input->post('tnote'),\n 'user' => $this->decodedd->userid, 'costs' => $this->input->post('tcosts'),\n 'balance' => floatval($this->input->post('tcosts')+$purchase_returns->total)\n );\n if ($this->model->update($pid,$purchase_return) == true){ $this->error = 'transaction successfully saved..!'; }else{ $this->reject(); }\n }\n elseif ($this->valid_confirmation($pid) != TRUE){ $this->reject(\"Journal already approved..!\"); }\n else{ $this->reject(validation_errors()); }\n }else { $this->reject_token('Invalid Token or Expired..!'); }\n $this->response(); \n }", "function update_prop_detail($prop_id,$params)\n {\n $this->db->where('prop_id',$prop_id);\n return $this->db->update('prop_details',$params);\n }", "public function editorderAction()\r\n {\r\n $orderid = $this->getRequest()->getParam('orderid');\r\n $deliverydate = $this->getRequest()->getPost('codesbug_delivery_date');\r\n $deliverytime = $this->getRequest()->getPost('time_interval');\r\n $deliverycomment = $this->getRequest()->getPost('deliverycomment');\r\n $storecomment = $this->getRequest()->getPost('storecomment');\r\n $notifyemail = $this->getRequest()->getPost('notifyemail');\r\n\r\n $deliverycomment = preg_replace(\"/\\r\\n|\\r/\", \"<br/>\", $deliverycomment);\r\n $deliverycomment = trim($deliverycomment);\r\n\r\n $a = explode('-', $deliverytime);\r\n $model = Mage::getModel('sales/order')->load($orderid);\r\n $deliverydatebefore = $model->getCodesbugDeliveryDate();\r\n $deliverytimefirstbefore = $model->getCodesbugDeliveryTimefirst();\r\n $deliverytimelastbefore = $model->getCodesbugDeliveryTimelast();\r\n $customername = $model->getCustomerName();\r\n $status = $model->getStatus();\r\n\r\n $currtime = date(\"Y-m-d H:i:s\", Mage::getModel('core/date')->timestamp(time()));\r\n\r\n $model->setCodesbugDeliveryDate($deliverydate);\r\n $model->setCodesbugDeliveryComment($deliverycomment);\r\n $model->setCodesbugDeliveryTimefirst($a[0]);\r\n $model->setCodesbugDeliveryTimelast($a[1]);\r\n\r\n /*\r\n * order comment\r\n */\r\n $comment = 'Delivery Information Changes From ' . $deliverydatebefore . ' ' . $deliverytimefirstbefore . '-' . $deliverytimelastbefore . ' To ' . $deliverydate . ' ' . $deliverytime . ' By ' . $customername . ' at ' . $currtime . '<br/>';\r\n $comment .= $storecomment;\r\n\r\n $deliveryinformation = 'Delivery Date:' . $deliverydate . '<br/>';\r\n $deliveryinformation .= 'Delivery Time:' . $deliverytime . '<br/>';\r\n $deliveryinformation .= 'Delivery Comment:' . $deliverycomment . '<br/><br/>';\r\n $deliveryinformation .= $comment;\r\n\r\n if (isset($notifyemail)) { //check the notify email is checked or not ,checked then email send\r\n try {\r\n //$data = array();\r\n //$data['comment'] = $comment;\r\n //$data['status'] = $status;\r\n $model->addStatusHistoryComment($comment, $status);\r\n // $comment = trim(strip_tags($data['comment']));\r\n\r\n $model->save();\r\n $model->sendOrderUpdateEmail($status, $deliveryinformation);\r\n } catch (Mage_Core_Exception $e) {\r\n $response = array(\r\n 'error' => true,\r\n 'message' => $e->getMessage(),\r\n );\r\n } catch (Exception $e) {\r\n $response = array(\r\n 'error' => true,\r\n 'message' => $this->__('Cannot add order history.'),\r\n );\r\n }\r\n }\r\n\r\n $this->_redirectReferer();\r\n\r\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 editAttribute($data) {\n// $purchase_id = $data['purchase_id'];\n// $today = date(\"Y-m-d H:i:s\");\n//\n// $data_upd = array();\n// $data_upd['purchase_date'] = date_str_replace($data['purchase_date']);\n// $data_upd['delivery_date'] = !empty($data['delivery_date']) ? date_str_replace($data['delivery_date']) : null;\n// $data_upd['currency'] = $data['currency'];\n// $data_upd['shipping'] = $data['shipping'];\n// $data_upd['payment'] = $data['payment'];\n// $data_upd['carrier'] = $data['carrier'];\n// $data_upd['comment'] = $data['comment'];\n// $data_upd['vendor_id'] = $data['vendor_id'];\n// $data_upd['vendor_delivery_id'] = $data['vendor_delivery_id'];\n// $data_upd['store_id'] = $data['store_id'];\n// $data_upd['store_delivery_id'] = $data['store_delivery_id'];\n// $data_upd['type'] = $data['type'];\n// $data_upd['status'] = Agent::STATUS_MASTER_OPEN;\n// $data_upd['active'] = 1;\n// $data_upd['date_upd'] = $today;\n// $this->db->where('purchase_id', $purchase_id);\n// $this->db->update(DB_PREFIX.'purchase', $data_upd);\n//\n// $detail_id = array();\n// $line_no = 1;\n// foreach ($data['detail'] as $key => $value) {\n// $data_det = array();\n// $data_det['purchase_id'] = $purchase_id;\n// $data_det['product_id'] = $value['product_id'];\n// $data_det['line_no'] = $line_no;\n// $data_det['qty'] = $value['qty'];\n// $data_det['unit'] = $value['unit'];\n// $data_det['unit_cost'] = $value['unit_cost'];\n// $data_det['status'] = Agent::STATUS_DETAIL_OPEN;\n// $data_det['date_upd'] = $today;\n// $line_no = $line_no + 1;\n//\n// if (!empty($value['purchase_detail_id'])) {\n//\t$purchase_detail_id = $value['purchase_detail_id'];\n//\t$this->db->where('purchase_detail_id', $purchase_detail_id); // condition for update.\n//\t$this->db->update(DB_PREFIX.'purchase_detail', $data_det);\n// } else {\n//\t$data_det['date_add'] = $today; // add detail\n//\t$this->db->insert(DB_PREFIX.'purchase_detail', $data_det);\n//\t$purchase_detail_id = $this->db->insert_id();\n// }\n// \n// $detail_id[$key] = $purchase_detail_id; // for not delete or update detail.\n// }\n//\n// if (!empty($detail_id)) {\n// $detail_id = implode(',', $detail_id);\n// $sql = \"DELETE FROM purchase_detail WHERE purchase_id = $purchase_id AND purchase_detail_id NOT IN ($detail_id) \";\n// $this->db->query($sql); // delete not exists.\n// }\n//\n// unset($data_upd);\n// unset($data_det);\n//\n// return $purchase_id;\n }", "public function update(Request $request, $id) {\n $validation = Validator::make($request->all(), [\n 'order_id' => 'required',\n // 'sub_order_id' => 'required',\n 'remarks' => 'sometimes',\n 'deliveryman_id' => 'required',\n ]);\n\n if ($validation->fails()) {\n return Redirect::back()->withErrors($validation)->withInput();\n }\n\n // Update Sub-Order\n $suborder = SubOrder::findOrFail($id);\n $suborder->sub_order_status = '8';\n $suborder->delivery_assigned_by = auth()->user()->id;\n $suborder->deliveryman_id = $request->deliveryman_id;\n $suborder->delivery_status = '0';\n $suborder->save();\n\n // orderLog($user_id, $order_id, $sub_order_id, $product_id, $ref_id, $ref_table, $text)\n $this->orderLog(auth()->user()->id, $suborder->order_id, $suborder->id, '', $suborder->deliveryman_id, 'users', 'Assigned a delivery man for the Sub-Order');\n\n // Update Order\n $order_due = SubOrder::where('sub_order_status', '!=', '8')->where('order_id', '=', $request->order_id)->count();\n if ($order_due == 0) {\n $order = Order::findOrFail($request->order_id);\n $order->order_status = '8';\n $order->save();\n\n // orderLog($user_id, $order_id, $sub_order_id, $product_id, $ref_id, $ref_table, $text)\n $this->orderLog(auth()->user()->id, $order->id, '', '', auth()->user()->reference_id, 'hubs', 'All Sub-Order(s) received');\n }\n\n // Release Trip\n $trip = SuborderTrip::where('sub_order_id', '=', $id)->where('status', '=', '1')->firstOrFail();\n $trip->status = '2';\n $trip->save();\n\n // orderLog($user_id, $order_id, $sub_order_id, $product_id, $ref_id, $ref_table, $text)\n $this->orderLog(auth()->user()->id, $suborder->order_id, $suborder->id, '', $trip->id, 'trips', 'Sub-Order released from the trip');\n\n // Select Hubs\n $picking_hub_id = $suborder->source_hub_id;\n $delivery_hub_id = $suborder->destination_hub_id;\n\n // Decide Hub or Rack\n $sub_order_size = OrderProduct::select(array(\n DB::raw(\"SUM(`width`) AS width\"),\n DB::raw(\"SUM(`height`) AS height\"),\n DB::raw(\"SUM(`length`) AS length\"),\n ))\n ->where('sub_order_id', '=', $id)\n ->where('status', '!=', '0')\n ->first();\n\n $rackData = Rack::whereStatus(true)->where('hub_id', '=', $delivery_hub_id)->get();\n if ($rackData->count() != 0) {\n foreach ($rackData as $rack) {\n $rackUsed = RackProduct::select(array(\n DB::raw(\"SUM(`width`) AS total_width\"),\n DB::raw(\"SUM(`height`) AS total_height\"),\n DB::raw(\"SUM(`length`) AS total_length\"),\n ))\n ->join('order_product AS op', 'op.id', '=', 'rack_products.product_id')\n ->where('rack_products.status', '=', '1')\n ->where('rack_products.rack_id', '=', $rack->id)\n ->first();\n $available_width = $rack->width - $rackUsed->width;\n $available_height = $rack->height - $rackUsed->height;\n $available_length = $rack->length - $rackUsed->length;\n\n if ($available_width >= $sub_order_size->width && $available_height >= $sub_order_size->height && $available_length >= $sub_order_size->length) {\n $rack_id = $rack->id;\n $message = \"Please keep the product on \" . $rack->rack_title;\n break;\n } else {\n $rack_id = 0;\n $message = \"Dedicated rack hasn't enough space. Please use defult rack\";\n }\n }\n } else {\n $rack_id = 0;\n $message = \"No Rack defined for this delivery zone.\";\n }\n\n // Insert product on rack\n $sub_order_products = OrderProduct::where('sub_order_id', '=', $id)\n ->where('status', '!=', '0')\n ->get();\n\n foreach ($sub_order_products as $product) {\n $rack_suborder = new RackProduct();\n $rack_suborder->rack_id = $rack_id;\n $rack_suborder->product_id = $product->id;\n $rack_suborder->status = '1';\n $rack_suborder->created_by = auth()->user()->id;\n $rack_suborder->updated_by = auth()->user()->id;\n $rack_suborder->save();\n\n // orderLog($user_id, $order_id, $sub_order_id, $product_id, $ref_id, $ref_table, $text)\n $this->orderLog(auth()->user()->id, $suborder->order_id, $suborder->id, $rack_suborder->product_id, $rack_suborder->id, 'rack_products', 'Product racked');\n }\n\n Session::flash('inventory', $message);\n return redirect('/hub-receive');\n\n // Session::flash('message', \"Sub-Order received successfully\");\n // return redirect('/hub-receive');\n }", "public function modifyOrder(){\r\n $cookies = new CookieModel();\r\n $cookie_id = $cookies -> read();\r\n $Form = M('userinfo');\r\n $condition_in['stuid'] = $cookie_id;\r\n $data = $Form->where($condition_in)->find();\r\n if (! $data['manager']) $this->redirect('/');\r\n $key = $_REQUEST['id'];\r\n $condition['id'] = $key;\r\n $form = M(\"orderinfo\");\r\n $data = $form->where($condition)->find();\r\n if ($_REQUEST['number']) $data['number'] = $_REQUEST['number'];\r\n if ($_REQUEST['area']) $data['area'] = $_REQUEST['area'];\r\n if ($_REQUEST['ordertime']) $data['ordertime'] = $_REQUEST['ordertime'];\r\n if ($_REQUEST['address']) $data['address'] = $_REQUEST['address'];\r\n if ($_REQUEST['pay']) $data['pay'] = $_REQUEST['pay'];\r\n if ($_REQUEST['phone']) $data['phone'] = $_REQUEST['phone'];\r\n if ($_REQUEST['food']) $data['food'] = $_REQUEST['food'];\r\n if ($_REQUEST['amount']) $data['amount'] = $_REQUEST['amount'];\r\n if ($_REQUEST['status']) $data['status'] = $_REQUEST['status']; \r\n if ($_REQUEST['pay_status']) $data['pay_status'] = $_REQUEST['pay_status'];\r\n $data['id'] = $key;\r\n $form->save($data);\r\n $this->redirect('/index.php/Admin/index');\r\n //$this->display();\r\n }", "function getfaircoin_edd_updated_edited_purchase( $payment_id ) {\r\n // get the payment meta\r\n $payment_meta = edd_get_payment_meta( $payment_id );\r\n // update our fairaddress number\r\n $payment_meta['fairaddress'] = isset( $_POST['edd_fairaddress'] ) ? $_POST['edd_fairaddress'] : false;\r\n $payment_meta['fairsaving'] = isset( $_POST['edd_fairsaving'] ) ? $_POST['edd_fairsaving'] : false;\r\n // update the payment meta with the new array\r\n update_post_meta( $payment_id, '_edd_payment_meta', $payment_meta );\r\n}", "function update_itinerary($pid) {\n $i_trip_name = $_POST['trip_name'];\n $i_region_name = $_POST['region_name'];\n $i_price_include = $_POST['price_include'];\n $i_price_exclude = $_POST['price_exclude'];\n $i_equipment = $_POST['equipment'];\n $i_itinerary_detail = $_POST['itinerary_detail'];\n $i_faqs = $_POST['faqs'];\n $i_highlight = $_POST['highlight'];\n $i_video_link = $_POST['video_link'];\n $sql = \"UPDATE itinerary SET trip_id='$i_trip_name',region_id='$i_region_name',price_include='$i_price_include',price_exclude='$i_price_exclude',equipment='$i_equipment',itinerary_detail='$i_itinerary_detail',faqs='$i_faqs',\n\t\t\thighlight='$i_highlight',video_link='$i_video_link' WHERE id='$pid'\";\n $this->mysqli->query($sql);\n if ($this->mysqli->error) {\n echo $this->mysqli->error;\n } else {\n echo \"<script type='text/javascript'>alert('Itinerary updated successfully')</script>\";\n }\n }", "public function update(){\n\n $sql = 'UPDATE fullorder SET ';\n $sql .= 'Status = \"' . $this->__get('Status') . '\"';\n if ($this->__get('Status') == 'Delivered') {\n $date = date('Y-m-d');\n $time = $date . '' . time();\n $sql .= ', OrderDeliverTime = NOW() ';\n }\n $sql .= 'WHERE OrderID =' . $this->__get('OrderID');\n $con = $this->openconnection();\n $stmt = $con->prepare($sql);\n $stmt = $stmt->execute(); \n $con = null;\n if(!$stmt){\n //echo \"FROM MODEL <br>\";\n return false;\n } else {\n //echo \"FROM MODELllll true<br>\" . $lastId;\n return true;\n \n }\n }", "public function update_purchase_info($id = Null)\n\t{\t\n\t\t\n\t\t$this->form_validation->set_rules('supplier_id', 'Select Supplier', 'required|trim');\n\n\t\tif($this->form_validation->run() == FALSE){\n $result = $this->Purchase_model->purchase_info_by_id($id);\n\t\t\t$data['title'] = 'Edit Purchase Information'; \n\t\t\t$data['content'] = 'purchase/edit_purchase';\n\t\t\t$data['supplires'] = $this->Supplier_model->find_all_supplier_info();\n\t\t\t$data['supplier'] = $this->Supplier_model->supplier_by_id($result->supplier_id);\n\t\t\t$data['purchase'] = $result;\n\t\t\t$this->load->view('admin/adminMaster', $data);\n\n\t\t}else{\n\t\t\t\n\t\t\tif($this->Purchase_model->Update_purchase_info($id)){\n\n if($this->input->post('order_id')){\n\n if($this->Order_model->order_purchase_info_update($id)){\n $data['success']=\" Store Successfully!\";\n $this->session->set_flashdata($data);\n redirect($this->input->post('redirect_url'));\n }\n $data['success']=\" Store Successfully!\";\n $this->session->set_flashdata($data);\n redirect($this->input->post('redirect_url'));\n }\n $data['warning']=\"Car Info Store Successfully! But Order Info Not Updated.\";\n $this->session->set_flashdata($data);\n redirect($this->input->post('redirect_url'));\n\t\t\t}else{\n\n\t\t\t\t$data['error']=\"Update Unsuccessfully!\";\n\t\t\t\t$this->session->set_flashdata($data);\n\t\t\t\tredirect($this->input->post('redirect_url'));\n\t\t\t}\n\t\t}\n\t}", "function edit_order($order_id){\n /**/ //GET ORDER BY ID\n /**/ /**************************************************/\n /**/ /**/$order = $this->order_model->get($order_id);/**/\n /**/ /**************************************************/\n /**/ $order_shift = $this->shift_model->get($order->shift_id);\n /**/ $order->shift_date = $order_shift->date;\n /**/ $this->e_order($order);\n /**/ }", "function update_finish_trip_detail($finish_id,$params)\n {\n $this->db->where('finish_id',$finish_id);\n $response = $this->db->update('Finish_trip_details',$params);\n if($response)\n {\n return \"finish_trip_detail updated successfully\";\n }\n else\n {\n return \"Error occuring while updating finish_trip_detail\";\n }\n }", "public function updateDeal($data,$did) {\n $this->db->where('did', $did);\n return $this->db->update('Deals', $data);\n }", "public function update($id)\n\t{\n\t\t$orderdelivery = Orderdelivery::findOrFail($id);\n\n\t\t$validator = Validator::make($data = Input::all(), Orderdelivery::$rules);\n\n\t\tif ($validator->fails())\n\t\t{\n\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n\t\t}\n\n\t\t$orderdelivery->update($data);\n\n\t\treturn Redirect::route('orderdeliveries.index');\n\t}", "function update() {\n\t\t$sql = \"UPDATE cost_detail \n\t\t\t\tSET\tcd_start_time=?, cd_end_time=?, cd_hour=?, cd_minute=?, cd_cost=?, cd_update=?, cd_user_update=? \n\t\t\t\tWHERE cd_fr_id=?, cd_seq=?\";\t\n\t\t$this->ffm->query($sql, array($this->cd_start_time, $this->cd_end_time, $this->cd_hour, $this->cd_minute, $this->cd_cost, $this->cd_update, $this->cd_user_update, $this->cd_fr_id, $this->cd_seq));\t\n\t}", "public function update(Request $request, $id)\n {\n $order=Order::find($id);\n $this->validate($request,[\n 'status'=>'required|in:new,process,delivered,cancel'\n ]);\n $data=$request->all();\n // return $request->status;\n if($request->status=='delivered'){\n foreach($order->cart as $cart){\n $product=$cart->product;\n // return $product;\n $product->stock -=$cart->quantity;\n $product->save();\n }\n }\n $status=$order->fill($data)->save();\n if($status){\n request()->session()->flash('success','Successfully updated order');\n }\n else{\n request()->session()->flash('error','Error while updating order');\n }\n return redirect()->route('order.index');\n }", "public function postOrderDelivery(OrderDeliveryRequest $request){\n $data = [\n 'ongkir_real'=>$request->input('ongkir_real'),\n 'kurir'=>$request->input('kurir'),\n 'no_resi'=>$request->input('no_resi'),\n 'delivery_date'=>xformatDate($request->input('delivery_date')),\n 'status'=>'on delivery',\n 'modified_by'=>Auth::user()->username\n ];\n $order = Order::where('id',Input::get('order_id'))->update($data);\n //ipansuryadiflash()->success('Success', 'Order delivery success...');\n return redirect()->route('admin.pages.order');\n }", "public function update_displayOrder($tblname,$fldname,$fld_id){\n\t\t$posted_order_data=$this->input->post('ord');\n\t\twhile(list($key,$val)=each($posted_order_data)){\n\t\t\tif( $val!='' ){\n\t\t\t\t$val = (int) $val;\n\t\t\t\t$data = array($fldname=>$val);\n\t\t\t\t$where = \"$fld_id=$key\";\n\t\t\t\t$this->utils_model->safe_update($tblname,$data,$where,TRUE);\t\t\t\n\t\t\t}\n\t\t}\n\t\t$this->session->set_userdata(array('msg_type'=>'success'));\n\t\t$this->session->set_flashdata('success',lang('order_updated'));\t\t\n\t\tredirect($_SERVER['HTTP_REFERER'], '');\n\t}", "public function orderDeliverySuccess($id){\n $products = Orderdetail::where('order_id',$id)->get();\n foreach ($products as $product){\n Product::where('id', $product->product_id)->update([\n 'product_quantity' => DB::raw('product_quantity-'.$product->qty)\n ]);\n }\n\n $deliverySuccess = Order::findOrFail($id);\n $deliverySuccess->status = 3;\n $deliverySuccess->save();\n\n Toastr::success('Order delivery done');\n return redirect()->route('delivered.order');\n\n }", "public function update($id, $purchase_no)\n\t{\n\t\tif (!in_array('updateOrder', $this->permission)) {\n\t\t\tredirect('dashboard', 'refresh');\n\t\t}\n\n\t\tif (!$id || !$purchase_no) {\n\t\t\tredirect('dashboard', 'refresh');\n\t\t}\n\n\t\t$this->data['page_title'] = 'Update Purchase Order';\n\n\t\t$this->form_validation->set_rules('product[]', 'Product name', 'trim|required');\n\n\n\t\tif ($this->form_validation->run() == TRUE) {\n\n\t\t\t$update = $this->model_purchase->update($id, $purchase_no);\n\n\t\t\tif ($update == true) {\n\t\t\t\t$this->session->set_flashdata('success', 'Successfully updated');\n\t\t\t\tredirect('purchase/update/' . $id . '/' . $purchase_no, 'refresh');\n\t\t\t} else {\n\t\t\t\t$this->session->set_flashdata('errors', 'Error occurred!!');\n\t\t\t\tredirect('purchase/update/' . $id . '/' . $purchase_no, 'refresh');\n\t\t\t}\n\t\t} else {\n\t\t\t// false case\n\t\t\t$company = $this->model_company->getCompanyData(1);\n\t\t\t$this->data['company_data'] = $company;\n\t\t\t// $this->data['is_vat_enabled'] = ($company['vat_charge_value'] > 0) ? true : false;\n\t\t\t// $this->data['is_service_enabled'] = ($company['service_charge_value'] > 0) ? true : false;\n\n\t\t\t$result = array();\n\t\t\t$purchase_data = $this->model_purchase->getPurchaseData($id);\n\n\t\t\t$result['purchase_master'] = $purchase_data;\n\t\t\t$purchase_item = $this->model_purchase->getPurchaseItemData($purchase_data['purchase_no']);\n\t\t\t$this->data['party_data'] = $this->model_party->getActiveParty();\n\t\t\tforeach ($purchase_item as $k => $v) {\n\t\t\t\t$result['purchase_item'][] = $v;\n\t\t\t}\n\n\t\t\t$this->data['purchase_data'] = $result;\n\t\t\t$this->data['tax_data'] = $this->model_tax->getActiveTax();\n\n\n\t\t\t$this->data['products'] = $this->model_products->getActiveProductData();\n\n\t\t\t$this->render_template('purchase/edit', $this->data);\n\t\t}\n\t}", "public function actionUpdate($id)\n\t{\n\t //echo \"<pre>\";\n\t\t//print_r($_POST);die;\n $w_id = '';\n if(isset($_GET['w_id'])){\n $w_id = $_GET['w_id'];\n }\n /*if(!($this->checkAccess('ProcurementEditor', array('warehouse_id'=>$w_id)) || $this->checkAccess('PurchaseEditor',array('warehouse_id'=>$w_id)))){\n Yii::app()->controller->redirect(\"index.php?r=purchaseHeader/admin&w_id=\".$w_id);\n }*/\n if(!($this->checkAccessByData(array('ProcurementEditor', 'PurchaseEditor'), array('warehouse_id'=>$w_id)))){\n Yii::app()->controller->redirect(\"index.php?r=purchaseHeader/admin&w_id=\".$w_id);\n }\n\n $model=$this->loadModel($id);\n $purchaseLines = PurchaseLine::model()->findAllByAttributes(array('purchase_id' => $id));\n //list($popularItems, $otherItems) = BaseProduct::PopularItems();\n $purchaseLineMap = array();\n $purchaseLinesArr = array();\n foreach ($purchaseLines as $item){\n //var_dump($item->BaseProduct); die;\n $purchaseLineMap[$item->base_product_id] = $item;\n array_push($purchaseLinesArr,$item);\n }\n\n $dataProvider=new CArrayDataProvider($purchaseLinesArr, array(\n 'pagination'=>array(\n 'pageSize'=>100,\n ),\n ));\n\n\n $inv_header = new InventoryHeader('search');\n $inv_header->warehouse_id = $w_id;\n\n if(isset($_GET['InventoryHeader'])) {\n $inv_header->attributes = $_GET['InventoryHeader'];\n }\n\n $dataProvider = $inv_header->search();\n\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n if(isset($_POST['purchase-update'])) {\n $transaction = Yii::app()->db->beginTransaction();\n try {\n\n $model->attributes = $_POST['PurchaseHeader'];\n $parentIdArr = array();\n $parentIdToUpdate = '';\n if(isset($_POST['parent_id'][0]) && $_POST['parent_id'][0] >= 0){\n array_push($parentIdArr, $_POST['parent_id'][0]);\n }\n\n if($model->payment_method == ''){\n $model->payment_method = null;\n }\n if($model->payment_status == ''){\n $model->payment_status = null;\n }\n if($model->paid_amount == ''){\n $model->paid_amount = null;\n }\n if($model->comment == ''){\n $model->comment = null;\n }\n if ($model->save()) {\n if(isset($_POST['order_qty'])){\n foreach ($_POST['order_qty'] as $key => $quantity) {\n\n if (isset($purchaseLineMap[$_POST['base_product_id'][$key]])) {\n $purchaseLine = $purchaseLineMap[$_POST['base_product_id'][$key]];\n } else {\n $purchaseLine = new PurchaseLine();\n $purchaseLine->purchase_id = $model->id;\n $purchaseLine->base_product_id = $_POST['base_product_id'][$key];\n $purchaseLine->created_at = date(\"y-m-d H:i:s\");\n\n }\n\n if (isset($_POST['order_qty'][$key]) ) {\n if($quantity==''){\n $quantity = 0;\n }\n $purchaseLine->order_qty = $quantity;\n }\n\n $purchaseLine->save();\n $parentIdToUpdate = $_POST['parent_id'][$key];\n }\n }\n if(isset($_POST['received_qty'])){\n foreach ($_POST['received_qty'] as $key => $quantity) {\n\n if (isset($purchaseLineMap[$_POST['base_product_id'][$key]])) {\n $purchaseLine = $purchaseLineMap[$_POST['base_product_id'][$key]];\n } else {\n $purchaseLine = new PurchaseLine();\n $purchaseLine->purchase_id = $model->id;\n $purchaseLine->base_product_id = $_POST['base_product_id'][$key];\n $purchaseLine->created_at = date(\"y-m-d H:i:s\");\n\n }\n\n if (isset($_POST['received_qty'][$key]) ) {\n if($quantity==''){\n $quantity = 0;\n }\n $purchaseLine->received_qty = $quantity;\n }\n\n $purchaseLine->save();\n $parentIdToUpdate = $_POST['parent_id'][$key];\n }\n }\n\n $transaction->commit();\n if($parentIdToUpdate != '' && $parentIdToUpdate > 0){\n array_push($parentIdArr, $parentIdToUpdate);\n }\n $this->updateParentsItems($parentIdArr, $model->id);\n $url = Yii::app()->controller->createUrl(\"purchaseHeader/update\",array(\"w_id\"=>$w_id, \"id\"=>$model->id));\n Yii::app()->user->setFlash('success', 'purchase order successfully Updated.');\n Yii::app()->controller->redirect($url);\n //$this->redirect(array('admin','w_id'=>$model->warehouse_id));\n }\n else{\n Yii::app()->user->setFlash('error', 'Purchase order Update failed.');\n }\n }catch (\\Exception $e) {\n $transaction->rollBack();\n Yii::app()->user->setFlash('error', 'Purchase order Creation failed.');\n throw $e;\n }\n }\n\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n 'inv_header'=>$inv_header,\n 'purchaseLineMap'=> $purchaseLineMap,\n 'dataProvider'=>$dataProvider,\n //'otherItems'=> $otherItems,\n 'w_id' => $_GET['w_id'],\n 'update'=>true,\n\t\t));\n\t}", "public function update(ActiveOrder $activeOrder)\n {\n }", "public function update($id)\n {\n $purchasing = PurchasingForm::find($id);\n $purchasing->particular_id = Input::get(\"particular_id\");\n $purchasing->client_id = Input::get(\"client_id\");\n $purchasing->your_ref_no = Input::get(\"your_ref_no\");\n $purchasing->our_ref_no = Input::get(\"our_ref_no\");\n $purchasing->purchasing_from = Input::get(\"purchasing_from\");\n $purchasing->delivered_to = Input::get(\"delivered_to\");\n $purchasing->save();\n\n }", "public function updateConfirmedInward($data_confirm, $data_update_po, $qc_id, $purc_order_id){\n\t\t $this->db->where(\"qc_id\", $qc_id);\n\t\t $this->db->where(\"qc_status\", 'Pending');\n\t\t $this->db->update(\"purchase_confirm_list\", $data_confirm); \n\t\t $this->db->limit(1);\n\t\t $affectedRows = $this->db->affected_rows();\n\t\t if($affectedRows > 0 ){\n\t\t\t\tif($data_confirm['qc_status'] == 'Confirmed'){\n\t\t\t\t\t// update the total inward in purchase order products for the PO with pid\n\t\t\t\t\t$this->db->set('total_inword', 'total_inword+'.$data_update_po['total_inword_qty'], FALSE);\n\t\t\t\t\t$this->db->where(\"id\", $data_update_po['prod_ref_id']); \n\t\t\t\t\t$this->db->update(\"purchase_order_products\"); \n\t\t\t\t\t$this->db->limit(1);\n\t\t\t\t\t// check for the PO is completed or not. If completed update status to \"Completed\"\n\t\t\t\t\t// SELECT (`purchase_qty` - `total_inword`) AS balance FROM `purchase_order_products` WHERE `purc_order_id` =9 GROUP BY `purchase_pid` HAVING balance >0\n\t\t\t\t\t$this->db->select('(`purchase_qty` - `total_inword`) AS balance');\n\t\t\t\t\t$this->db->from('purchase_order_products');\n\t\t\t\t\t$this->db->where(\"purc_order_id\", $purc_order_id);\n\t\t\t\t\t$this->db->group_by('purchase_pid');\n\t\t\t\t\t$this->db->having('balance > \"0\" ');\n\t\t\t\t\t$query_products_pending = $this->db->get();\n\t\t\t\t\tif($query_products_pending->num_rows() == 0){\n\t\t\t\t\t\t$order_status['status'] = 'Completed';\n\t\t\t\t\t\t$this->db->where(\"purc_order_id\", $purc_order_id);\n\t\t\t\t\t\t$this->db->update(\"purchase_orders\", $order_status);\n\t\t\t\t\t\t$this->db->limit(1);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t// notify to store person\n\t\t\t\t\t$this->load->model('Orders_model', 'orders_model'); \t\t\n\t\t\t\t\t$notificationDataArray = array();\n\t\t\t\t\t$today = date(\"Y-m-d\");\n\t\t\t\t\t$notificationDataArray['uid'] = $data_update_po['notify_to'];\n\t\t\t\t\t$notificationDataArray['message_text'] = 'A product is confirmed by QC Dept. for the order '.$data_update_po['purc_order_number'].'. The lot # is '.$data_confirm['lot_no'];\n\t\t\t\t\t$notificationDataArray['added_on'] = $today;\n\t\t\t\t\t$notificationDataArray['reminder_date'] = $today;\n\t\t\t\t\t$notificationDataArray['read_flag'] = 'Pending';\n\t\t\t\t\t$this->orders_model->add_notification($notificationDataArray);\n\t\t\t\t\t\n\t\t\t\t}else if($data_confirm['qc_status'] == 'Rejected'){\n\t\t\t\t\t// notify to store person\n\t\t\t\t\t$this->load->model('Orders_model', 'orders_model'); \t\t\n\t\t\t\t\t$notificationDataArray = array();\n\t\t\t\t\t$today = date(\"Y-m-d\");\n\t\t\t\t\t$notificationDataArray['uid'] = $data_update_po['notify_to'];\n\t\t\t\t\t$notificationDataArray['message_text'] = 'A product is Rejected by QC Dept. for the order #'.$data_update_po['purc_order_number'];\n\t\t\t\t\t$notificationDataArray['added_on'] = $today;\n\t\t\t\t\t$notificationDataArray['reminder_date'] = $today;\n\t\t\t\t\t$notificationDataArray['read_flag'] = 'Pending';\n\t\t\t\t\t$this->orders_model->add_notification($notificationDataArray);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t \treturn 1;\n\t\t\t\n\t\t }else {\n\t\t \treturn 0;\n\t\t }\n\t}", "public function edit($id)\n {\n $po = Purchaseorder::findOrFail($id);\n $po->isDelivery = 1;\n $po->save();\n return redirect()->route('stocks.index')->with('message','This invoice has been updated successfully!');\n }", "public function update($shoppingcartInvoice);", "public function update(Request $request, $id) {\n\n $data = $request->all();\n\n $rules = [\n //'status' => 'required|numeric|max:4',\n 'order_notes' => 'max:255'\n ];\n\n $validator = Validator::make($data, $rules);\n\n if ($validator->fails()) {\n $request->session()->flash('alert-error', 'Please make sure the information is correct');\n return redirect()->route('orders.details', $id)->withErrors($validator)->withInput();\n }\n\n $order = Order::findOrFail($id);\n //$order->delivery_status_id = $request->input('status');\n $order->order_notes = $request->input('order_notes');\n $order->save();\n\n $request->session()->flash('alert-success', 'Order information updated');\n return redirect()->route('orders.details', $id);\n\n }", "function update_product_details($data,$iCatalogueId)\n {\n $this->db->where('iCatelogueId',$iCatalogueId);\n $query = $this->db->update('r_app_catalogue_details',$data);\n return $query;\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n $modelline = \\backend\\models\\Purchaseorderline::find()->where(['purchase_order_id'=>$id])->all();\n if ($model->load(Yii::$app->request->post())) {\n $prodid = Yii::$app->request->post('product_id');\n $qty = Yii::$app->request->post('qty');\n $price = Yii::$app->request->post('price');\n $lineamt = Yii::$app->request->post('line_amount');\n\n $model->purchase_date = strtotime($model->purchase_date);\n if($model->save()){\n \\backend\\models\\Purchaseorderline::deleteAll(['purchase_order_id'=>$id]);\n if(count($prodid)>0){\n for($i=0;$i<=count($prodid)-1;$i++){\n $modelline = new \\backend\\models\\Purchaseorderline();\n $modelline->purchase_order_id = $model->id;\n $modelline->product_id = $prodid[$i];\n $modelline->qty = $qty[$i];\n $modelline->price = $price[$i];\n $modelline->line_amount=$lineamt[$i];\n $modelline->save(false);\n }\n }\n $this->updateAmount($id);\n return $this->redirect(['view', 'id' => $model->id]);\n }\n }\n\n return $this->render('update', [\n 'model' => $model,\n 'modelline' => $modelline,\n ]);\n }", "public function edit(OrderDetails $orderDetails)\n {\n //\n }", "function update() {\n\t\n\t \t$sql = \"UPDATE evs_database.evs_identification \n\t \t\t\tSET\tidf_identification_detail_en=?, idf_identification_detail_th=?, idf_pos_id=?, idf_ctg_id=? \n\t \t\t\tWHERE idf_id=?\";\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, $this->idf_id));\n\t\t\n\t }", "public function updateOrder($param) { \n if (!$this->aaa->has_right('openruth', 500))\n $res->updateOrderError->_value = 'authentication_error';\n else {\n $agencyId = self::strip_agency($param->agencyId->_value);\n $targets = $this->config->get_value('ruth', 'ztargets');\n if ($tgt = $targets[$agencyId]) {\n $ord = &$order->ReservationUpdate->_value;\n $ord->LibraryNo->_value = $agencyId;\n $ord->DisposalID->_value = $param->orderId->_value;\n $ord->DisposalNote->_value = $param->orderNote->_value;\n $ord->LastUseDate->_value = self::to_zruth_date($param->orderLastInterestDate->_value);\n $ord->ServiceCounter->_value = $param->agencyCounter->_value;\n $xml = '<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?'.'>' . utf8_decode($this->objconvert->obj2xml($order));\n $z = new z3950();\n $z->set_target($tgt['host']);\n $z->set_database($tgt['database'].'-ophelia');\n $z->set_authentication($tgt['authentication']);\n if ($tgt['proxy']) {\n $z->set_proxy($tgt['proxy']);\n }\n $xml_ret = $z->z3950_xml_update($xml, $tgt['timeout']);\n//echo 'error: ' . $z->get_errno();\n//print_r($xml);\n//print_r($xml_ret);\n if ($z->get_errno() == 0 && $xml_ret['xmlUpdateDoc']) {\n $dom = new DomDocument();\n $dom->preserveWhiteSpace = false;\n if ($dom->loadXML($xml_ret['xmlUpdateDoc'])) {\n if ($err = $dom->getElementsByTagName('ErrorResponse')->item(0)) {\n verbose::log(ERROR, __FUNCTION__ . ' (' . __LINE__ . ') errno: ' . $err->getAttribute('Err'));\n if (!($res->updateOrderError->_value = $this->errs[$err->getAttribute('Err')])) \n $res->updateOrderError->_value = 'unspecified error (' . $err->getAttribute('Err') . '), order not possible';\n } else {\n $res->updateOrderOk->_value = $param->orderId->_value;\n }\n } else {\n verbose::log(ERROR, __FUNCTION__ . ' (' . __LINE__ . ') loadXML error of: ' . $xml_ret['xmlUpdateDoc']);\n $res->updateOrderError->_value = 'system error';\n }\n } else {\n self::log_z_error(__FUNCTION__, __LINE__, $agencyId, $z->get_errno(), $z->get_error_string());\n $res->updateOrderError->_value = 'system error';\n }\n } else\n $res->updateOrderError->_value = 'unknown agencyId';\n }\n\n $ret->updateOrderResponse->_value = $res;\n //var_dump($param); print_r($res); die();\n return $ret;\n }", "public function approve_request($id) {\r\n\t\treturn $this->db->update('orders', [\r\n\t\t\t'_assigned_staff'=>$this->input->post('staff'), \r\n\t\t\t'price'=>$this->input->post('amount'), \r\n\t\t\t'_status' => STATUS_PENDING_PAYMENT], ['_id' => $id]);\r\n\t}", "public function actionDelivery2nd($id)\n\t{\n\t\t$consegna = $this->loadModel(crypt::Decrypt($id));\n\t\t$consegna->consegnato = 0;\n\t\t$consegna->time_consegnato = 0;\n\t\t$consegna->in_consegna = 2;\n\t\t$consegna->update();\n\t\t$this->redirect(array('view','id'=>$id));\n\t}", "public function GetQTYPassbyID($delivery_order_detail_id)\n {\n return $this->GetDetailByID($delivery_order_detail_id)->qty_confirm;\n }", "public function updateOrder($data_insert,$order_id)\n\t {\n\t\t $this->db->where(\"order_id\", $order_id);\n\t\t $this->db->where(\"order_status\", 'Pending');\n\t\t if($this->session->userdata('userrole') != 'Admin'){\n\t\t\t$this->db->where(\"uid\",$this->session->userdata('userid'));\n\t\t }\n\t\t $this->db->update(\"client_orders\", $data_insert); \n\t\t //echo $this->db->last_query();die;\n\t\t $this->db->limit(1);\n\t\t return $order_id;\n\t }", "public function updateCaseStatusToDO($id,$data)\n {\n $this->db->where_in('order_id',$id);\n $this->db->update('payment_details',$data);\n return $this->db->affected_rows();\n }", "public function update(Request $request, $id)\n {\n $po = Purchaseorder::findOrFail($id);\n $po->isDelivery = Input::get('isDelivery');\n $po->save();\n return redirect()->route('stocks.index')->with('message','This invoice has been updated successfully!');\n }", "function update_customer($customer_id,$params){\n $this->company_db->update('tbl_customer', $params,array(\"id\"=>$customer_id)); \n }", "public function jsoOrderedit(Request $request,$invoice)\n {\n $this->validate($request, [\n 'invoiceid' => 'required',\n 'outletcode' => 'required',\n 'outletmobileno'=> 'required',\n //'detailorder'=> 'required',\n 'totalamount'=> 'required',\n ]);\n \n $sossoid=$request->user()->id;\n $distributerid=$request->user()->distributerid;\n \n if($sossoid && $distributerid){\n $ubloutletcode=\"UBL_\".$request->outletcode;\n $invoicecodenow='UBL_'.$request->invoiceid;\n $marchantinfo= Marchantlist::where('mobileno',$request->outletmobileno)->where('outletcode',$ubloutletcode)->get(['id','outletcode','mobileno','fbcreditlinebm' ,'currentavailable' ,'lastfbapicheck' ]);\n if(count($marchantinfo) > 0){\n $outletdatnow=$marchantinfo->first();\n $mainorderinfo = Ordercollection::where('company','ubl')->where('outletcode',$ubloutletcode)->where('invoiceid',$invoicecodenow)->where('okupdate','<','1')->get();\n if(count($mainorderinfo) > 0){\n $mainorderinfo=$mainorderinfo[0];\n $currentstate=($mainorderinfo->currentstate)+1;\n $last_dueamount = floatval($mainorderinfo->dueamount);\n $last_currentavailable=floatval($outletdatnow->currentavailable);\n $oparative_currentavailable=$last_currentavailable+$last_dueamount;\n\n\n $fullfblimit=$outletdatnow->fbcreditlinebm;\n $currentavailable=$oparative_currentavailable;\n if($request->dueamount){\n $fullorderamount=floatval($request->dueamount);\n }else{\n $fullorderamount=floatval($request->totalamount); \n }\n \n if($fullorderamount>=$currentavailable){\n $newcurrentavailable=0;\n }else{\n $newcurrentavailable=($currentavailable-$fullorderamount); \n }\n\n $verifiedcode=rand(100000,999999);\n $codeexpiredat=date(\"Y-m-d H:i:s\", strtotime(\"+2 days\"));\n\n $updateorders=Ordercollection::where('company','ubl')->where('outletcode',$ubloutletcode)->where('invoiceid',$invoicecodenow)->\n update(['invoiceid'=>$invoicecodenow,'jsoid'=>$request->user()->id,'totalamount'=>$request->totalamount,'paidamount'=>$request->paidamount,\n 'dueamount'=>$request->dueamount,'beforefairbacamount'=>$currentavailable,'afterfairbacamount'=>$newcurrentavailable,'currentstate'=>$currentstate,'updated_by'=>$request->user()->id,'verifiedmobilecode'=>$verifiedcode,'codeexpiredat'=>$codeexpiredat]);\n\n\n if($updateorders){\n $crentdttm=date('Y-m-d H:i:s'); \n $marchantinfoupdate= Marchantlist::where('mobileno',$request->outletmobileno)->where('outletcode',$ubloutletcode)\n ->where('id',$outletdatnow->id)\n ->update(['currentavailable'=>$newcurrentavailable,'lastfbapicheck'=>$crentdttm,'lastfbapicheck_by'=>$sossoid ]); \n\n\n if($marchantinfoupdate){\n $newsms=\"Dear+Merchant,for+your+UBL+order+reff.+invoice+\".$request->invoiceid.\"+your+loan+amount=\".$request->dueamount.\"FairBanc+credit+Available=\".$newcurrentavailable.\"Tk+and+Confirmation+OTP=\".$verifiedcode;\n $newurls='http://alphasms.biz/index.php?app=ws&u=indexer&h=351794a3122fab8ff8bbc78b8092797b&op=pv&to='.$request->outletmobileno.'&msg='.$newsms;\n\n \n $curl = curl_init();\n // Set some options - we are passing in a useragent too here\n curl_setopt_array($curl, array(\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_URL => $newurls,\n CURLOPT_USERAGENT => 'SMS mobile Request'\n ));\n // Send the request & save response to $resp\n $resp = curl_exec($curl);\n // Close request to clear up some resources\n curl_close($curl);\n\n /****JSO SMS*****/\n $newsmsJso=\"Your+are+delivering+invoice+\".$request->invoiceid.\"+Merchant+loan+amount=\".$request->dueamount.\"FairBanc+credit+Available=\".$newcurrentavailable.\"Tk\";\n $newurlsJSO='http://alphasms.biz/index.php?app=ws&u=indexer&h=351794a3122fab8ff8bbc78b8092797b&op=pv&to='.$request->user()->mobileno.'&msg='.$newsmsJso;\n\n \n $curl2 = curl_init();\n // Set some options - we are passing in a useragent too here\n curl_setopt_array($curl2, array(\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_URL => $newurlsJSO,\n CURLOPT_USERAGENT => 'SMS mobile Request'\n ));\n // Send the request & save response to $resp\n $resp2 = curl_exec($curl2);\n // Close request to clear up some resources\n curl_close($curl2);\n \n return response()->json([\n 'message' => 'Order OTP generation complete'\n ], 200);\n }\n }\n \n }else{\n return response()->json([\n 'response' => 'error',\n 'message' => 'No relavent invoice found at fairbanc'\n ], 400);\n }\n \n\n\n }else{\n return response()->json([\n 'response' => 'error',\n 'message' => 'Outlet not enlisted at fairbanc'\n ], 400);\n } \n \n \n } else{\n return response()->json([\n 'response' => 'error',\n 'message' => 'Not Eligible to order'\n ], 400);\n }\n return response()->json([\n 'response' => 'error',\n 'message' => 'Problem in data'\n ], 400); \n \n }", "public function updating(Order $Order)\n {\n //code...\n }", "public function update(Request $request, $id)\n {\n $rules = [\n 'supplierId' => 'required',\n 'product' => 'required',\n 'qty.*' => 'required|integer|between:0,10000',\n ];\n $messages = [\n 'unique' => ':attribute already exists.',\n 'required' => 'The :attribute field is required.',\n 'max' => 'The :attribute field must be no longer than :max characters.',\n ];\n $niceNames = [\n 'supplierId' => 'Supplier',\n 'product' => 'Product',\n 'qty.*' => 'Quantity'\n ];\n $validator = Validator::make($request->all(),$rules,$messages);\n $validator->setAttributeNames($niceNames); \n if ($validator->fails()) {\n return Redirect::back()->withErrors($validator)->withInput();\n }\n else{\n try{\n DB::beginTransaction();\n $delivery = DeliveryHeader::findOrFail($id);\n $created = explode('/',$request->date); // MM[0] DD[1] YYYY[2] \n $finalCreated = \"$created[2]-$created[0]-$created[1]\";\n $delivery->update([\n 'supplierId' => $request->supplierId,\n 'dateMake' => $finalCreated\n ]);\n $products = $request->product;\n $qtys = $request->qty;\n $orders = $request->order;\n sort($orders);\n foreach($products as $key=>$product){\n $inventory = Inventory::where('productId',$product)->first();\n $detail = DeliveryDetail::where('deliveryId',$delivery->id)->where('productId',$product)->first();\n $inventory->decrement('quantity',$detail->quantity);\n $detail->update([\n 'deliveryId' => $delivery->id,\n 'productId' => $product,\n 'quantity' => $qtys[$key],\n ]);\n $inventory->increment('quantity', $qtys[$key]);\n if($inventory->quantity<0){\n $request->session()->flash('error', 'Insufficient inventory resources. Check your inventory status.');\n return Redirect::back()->withInput();\n }\n }\n foreach($orders as $order){\n foreach($products as $key=>$product){\n $detail = PurchaseDetail::where('purchaseId',''.$order)->where('productId',$product)->where('isActive',1)->first();\n $detail->update([\n 'delivered' => 0\n ]);\n if(!empty($detail)){\n $qty = $detail->quantity;\n $delivered = $detail->delivered;\n if($qty != $delivered){\n while($qty!=$delivered && $qtys[$key]!=0){\n $delivered++;\n $qtys[$key]--;\n }\n $detail->update([\n 'delivered' => $delivered\n ]);\n }\n }\n }\n $details = PurchaseDetail::where('purchaseId',''.$order)->where('isActive',1)->get();\n foreach($details as $detail){\n if($detail->quantity!=$detail->delivered){\n $delivery = false;\n }\n }\n if($delivery){\n PurchaseHeader::where('id',''.$order)->update(['isDelivered'=>1]);\n }\n }\n Audit::create([\n 'userId' => Auth::id(),\n 'name' => \"Update Delivery\",\n 'json' => json_encode($request->all())\n ]);\n DB::commit();\n }catch(\\Illuminate\\Database\\QueryException $e){\n DB::rollBack();\n $errMess = $e->getMessage();\n return Redirect::back()->withErrors($errMess);\n }\n $request->session()->flash('success', 'Successfully updated.');\n return Redirect('delivery');\n }\n }", "public function update($id)\n\t{\n $input = \\Input::all();\n $order = \\Order::find($id);\n \n $personal_info = json_decode($order->personal_info, true);\n $imei = $input['imei'];\n \n foreach (array_slice(array_slice($input, 0, -1), 2) as $key => $value) {\n $personal_info[$key] = $value;\n }\n \n $order->personal_info = json_encode($personal_info);\n $order->imei = $imei;\n $order->save();\n \n // Log entry\n $log = new \\ActionLog;\n $log->user_id = \\Sentry::getUser()->id;\n $log->item_id = $order->id;\n $log->item_type = 'order';\n $log->title = 'Edited Order';\n $log->data = json_encode($personal_info);\n $log->save();\n \n return \\Redirect::to('admin/orders/' . $order->id)->with('message', 'Order updated!');\n\t}", "public function update(Request $request, $id)\n {\n //\n $current = Carbon::now('Asia/Manila');\n\n //\n $Order_ID = $request->Order_ID;\n $decision = $request->Decision_text;\n $cust_ID = $request->Currentcust_ID;\n $currentFname = $request->Current_FName;\n $currentLname = $request->Current_LName;\n $nFname = $request->nf_namefield;\n $nLname = $request->nl_namefield;\n\n $amt_Paid = $request->payment_field;\n $amt_Paid2 = $request->payment;\n $amt_Used = $request->PartialField;\n $change = $request->changeField;\n\n $value = collect([\n $Order_ID ,\n $decision ,\n $cust_ID ,\n $currentFname ,\n $currentLname ,\n $nLname ,\n $nLname ,\n $amt_Paid ,\n $amt_Paid2 ,\n $amt_Used ,\n $change\n ]);\n // dd($value);\n\n $NewSalesOrder_details = Neworder_details::find($Order_ID);\n if($amt_Paid2 >= $NewSalesOrder_details->BALANCE){\n if($amt_Used > 0){\n $Derived_Change = $amt_Paid2 - $amt_Used;\n $Balance = 0.00;//gets the balance even they paid greater but uses partial of the payment only\n $UpdateOrderDet = DB::select('CALL confirmOrder(?,?,?)',array($Order_ID,'P_FULL',$Balance));//updated the status of the order details as well sa the salesorder status\n\n $newInvoice = DB::select(\"CALL update_BalAndstat_ofInvoice(?,?,?,?);\",\n array($id,$current,'PF',0.00));\n //update the invoice\n\n $customerPayment = new CustomerPayment;\n $customerPayment->Amount = $amt_Paid2;\n $customerPayment->Amount_Used = $amt_Used;\n $customerPayment->Date_Obtained = $current;\n if($decision == \"N\"){\n $customerPayment->From_Id = null;\n $customerPayment->From_FName = $nFname;\n $customerPayment->From_LName = $nLname;\n }else{\n $customerPayment->From_Id = $cust_ID;\n $customerPayment->From_FName = $currentFname;\n $customerPayment->From_LName = $currentLname;\n }\n $customerPayment->Type = \"CASH\";\n $customerPayment->BALANCE = $NewSalesOrder_details->BALANCE;\n $customerPayment->save();\n\n //make a record of customer payment settlement record\n $createPaymentSettlement = DB::select('CALL create_RecordPaymentSettlement(?,?,?,?,?)',\n array($id,$customerPayment->Payment_ID,$amt_Paid2,$amt_Used,$Derived_Change));\n Session::put('CashPayment_CompletionSession','Successful');\n }//if they used partial payment only\n else if($amt_Used == 0 OR $amt_Used < 1){\n $Derived_Change = $NewSalesOrder_details->BALANCE - $amt_Paid2;\n $Balance = 0;//gets the balance even they paid greater but uses partial of the payment only\n $UpdateOrderDet = DB::select('CALL confirmOrder(?,?,?)',array($Order_ID,'P_FULL',$Balance));//updated the status of the order details as well sa the salesorder status\n\n $newInvoice = DB::select(\"CALL update_BalAndstat_ofInvoice(?,?,?,?);\",\n array($id,$current,'PF',0.00));\n //update the invoice\n\n $customerPayment = new CustomerPayment;\n $customerPayment->Amount = $amt_Paid2;\n $customerPayment->Amount_Used = $amt_Paid2;\n $customerPayment->Date_Obtained = $current;\n if($decision == \"N\"){\n $customerPayment->From_Id = null;\n $customerPayment->From_FName = $nFname;\n $customerPayment->From_LName = $nLname;\n }else{\n $customerPayment->From_Id = $cust_ID;\n $customerPayment->From_FName = $currentFname;\n $customerPayment->From_LName = $currentLname;\n }\n $customerPayment->Type = \"CASH\";\n $customerPayment->BALANCE = $NewSalesOrder_details->BALANCE;\n $customerPayment->save();\n\n //make a record of customer payment settlement record\n $createPaymentSettlement = DB::select('CALL create_RecordPaymentSettlement(?,?,?,?,?)',\n array($id,$customerPayment->Payment_ID,$amt_Paid2,$amt_Paid2,$Derived_Change));\n Session::put('CashPayment_CompletionSession','Successful');\n }\n }//end of if\n else if($amt_Paid2 < $NewSalesOrder_details->BALANCE){\n if($NewSalesOrder_details->Status == 'BALANCED' OR $NewSalesOrder_details->Status == 'A_UNPIAD'){\n $Status = \"\";\n $Stat = \"\";\n if($NewSalesOrder_details->Status == 'BALANCED'){\n $Status = \"P_PARTIAL\";\n $Stat = \"PP\";\n }else if($NewSalesOrder_details->Status == 'A_UNPAID'){\n $Status = \"A_P_PARTIAL\";\n $Stat = \"APP\";\n }\n\n if($amt_Paid2 >= $NewSalesOrder_details->BALANCE*0.20){\n if($amt_Used > 0){\n $Derived_Change = $amt_Paid2 - $amt_Used;\n $Balance = $NewSalesOrder_details->BALANCE - $amt_Used;//gets the balance even they paid greater but uses partial of the payment only\n $UpdateOrderDet = DB::select('CALL confirmOrder(?,?,?)',array($Order_ID,$Status,$Balance));//updated the status of the order details as well sa the salesorder status\n\n $newInvoice = DB::select(\"CALL update_BalAndstat_ofInvoice(?,?,?,?);\",\n array($id,$current,$Stat,$Derived_Change));\n //update the invoice\n\n $customerPayment = new CustomerPayment;\n $customerPayment->Amount = $amt_Paid2;\n $customerPayment->Amount_Used = $amt_Used;\n $customerPayment->Date_Obtained = $current;\n if($decision == \"N\"){\n $customerPayment->From_Id = null;\n $customerPayment->From_FName = $nFname;\n $customerPayment->From_LName = $nLname;\n }else{\n $customerPayment->From_Id = $cust_ID;\n $customerPayment->From_FName = $currentFname;\n $customerPayment->From_LName = $currentLname;\n }\n $customerPayment->Type = \"CASH\";\n $customerPayment->BALANCE = $NewSalesOrder_details->BALANCE;\n $customerPayment->save();\n\n //make a record of customer payment settlement record\n $createPaymentSettlement = DB::select('CALL create_RecordPaymentSettlement(?,?,?,?,?)',\n array($id,$customerPayment->Payment_ID,$amt_Paid2,$amt_Used,$Derived_Change));\n Session::put('CashPayment_CompletionSession','Successful');\n }//if they used partial payment only\n else if($amt_Used == 0 OR $amt_Used < 1){\n $Derived_Change = $NewSalesOrder_details->BALANCE - $amt_Paid2;\n $Balance = 0;//gets the balance even they paid greater but uses partial of the payment only\n $UpdateOrderDet = DB::select('CALL confirmOrder(?,?,?)',array($Order_ID,$Status, $Balance - $amt_Paid2));//updated the status of the order details as well sa the salesorder status\n\n $newInvoice = DB::select(\"CALL update_BalAndstat_ofInvoice(?,?,?,?);\",array($id,$current,$Stat,$Balance - $amt_Paid2));\n //update the invoice\n\n $customerPayment = new CustomerPayment;\n $customerPayment->Amount = $amt_Paid2;\n $customerPayment->Amount_Used = $amt_Paid2;\n $customerPayment->Date_Obtained = $current;\n if($decision == \"N\"){\n $customerPayment->From_Id = null;\n $customerPayment->From_FName = $nFname;\n $customerPayment->From_LName = $nLname;\n }else{\n $customerPayment->From_Id = $cust_ID;\n $customerPayment->From_FName = $currentFname;\n $customerPayment->From_LName = $currentLname;\n }\n $customerPayment->Type = \"CASH\";\n $customerPayment->BALANCE = $NewSalesOrder_details->BALANCE;\n $customerPayment->save();\n\n //make a record of customer payment settlement record\n $createPaymentSettlement = DB::select('CALL create_RecordPaymentSettlement(?,?,?,?,?)',\n array($id,$customerPayment->Payment_ID,$amt_Paid2,$amt_Paid2,$Derived_Change));\n Session::put('CashPayment_CompletionSession','Successful');\n }\n }else{\n Session::put('CashPayment_CompletionSession','Fail');\n return redirect()->back();\n }\n }else{\n //kapag hinid BALANCED or A_UNPAID\n }\n }\n return redirect()->back();\n }", "public function change_order_status_post()\n {\n $pdata = file_get_contents(\"php://input\");\n $data = json_decode($pdata,true);\n $id = $data['order_id'];\n $status = $data['status'];\n $user_id = $data['user_id'];\n // $this->response($user_id);\n $data = array(\n 'status' => $status\n );\n \n $where = array(\n 'id' => $id\n );\n $this->model->update('orders', $data, $where);\n $message = \"Your Order is $status\";\n \n $resp = array('rccode' => 200,'message' => $message);\n $this->response($resp);\n //}\n \n \n }", "public function changeStatus($orderId=null,$status=null){\n $allowedStatuses = ShopCore::$orderStatuses;\n if(!$orderId){\n $orderId = (int)$_POST['id'];\n }\n if(!$status){\n $status = $_POST['status'];\n }\n $order = new DBObject('sr_shop_order',$orderId);\n\n if(!$order->id){\n $this->sendJSON(array('success'=>false,'message'=>'Product not found'));\n }\n if(!$allowedStatuses[$status]){\n $this->sendJSON(array('success'=>false,'message'=>'Product not found'));\n }\n if($order->get('status')==$status){\n $this->get($orderId);\n return;\n }\n switch ($order->get('status')){\n case 'new':\n case 'processing':\n switch($status){\n case 'shipped':\n case 'done':\n // -w\n //-r\n $this->updateWarehouse($orderId,-1,-1);\n if($status=='done' && $order->get('customer_id')!='0'){\n $this->updateDiscount($order->get('customer_id'),$order->get('total'));\n }\n break;\n case 'cancelled':\n //-r\n $this->updateWarehouse($orderId,0,-1);\n break;\n }\n break;\n case 'shipped':\n case 'done':\n if($order->get('status')=='done' && $order->get('customer_id')!='0'){\n $this->updateDiscount($order->get('customer_id'),$order->get('total'),true);\n }\n switch($status){\n case 'new':\n case 'processing':\n // +w\n // +r\n $this->updateWarehouse($orderId,1,1);\n break;\n case 'cancelled':\n //+w\n $this->updateWarehouse($orderId,1,0);\n break;\n }\n break;\n\n case 'cancelled':\n switch($status){\n case 'new':\n case 'processing':\n // +r\n $this->updateWarehouse($orderId,0,1);\n break;\n default:\n if(!$allowedStatuses[$status]){\n $this->sendJSON(array('success'=>false,'message'=>'Action denied'));\n }\n break;\n }\n break;\n }\n $order->set('status',$status);\n $order->save();\n $this->get($orderId);\n }", "public function changeStatus($u_status,$delivery_id){\n $sql=\"UPDATE `deliveries` SET `delivery_status`='$u_status' WHERE delivery_id='$delivery_id'\";\n $result=$this->conn->query($sql);\n if($result==true){\n header(\"location:delivery.php?success=1&message=You successfully updated the status.\");\n }else{\n header(\"location:delivery.php?success=0&message=Error occured in delivery table. Try it agin.\");\n }\n }", "function update() {\n\n\t \t$sql = \"UPDATE evs_database.evs_key_component \n\t \t\t\tSET\tkcp_key_component_detail_en=?, kcp_key_component_detail_th=?, kcp_cpn_id=? \n\t \t\t\tWHERE kcp_id=?\";\n\t\t\n\t\t$this->db->query($sql, array( $this->kcp_key_component_detail_en, $this->kcp_key_component_detail_th, $this->kcp_cpn_id, $this->kcp_id));\n\t\t\n\t }", "public function doUpdateStatus()\n\t{\n\n\t\t\n\t\t$rules = array(\n\t\t\t'row_id' => 'required', \n\t\t\t'status' => 'required'\n\t\t);\n\t\t\n\t\t// run the validation rules \n\t\t$validator = Validator::make(Input::all(), $rules);\n\n\t\tif ($validator->fails()) {\n\t\t\t\n\t\t\treturn Redirect::to('order')\n\t\t\t\t->withErrors($validator);\n\t\t\t\n\t\t}\n\t\t\n\t\ttry {\n\t\t \n\t\t\t$object = Object::find(Input::get('row_id'));\n\t\t\t$object->fk_status = Input::get('status');\n\t\t\t$object->save();\n\t\t\t\n $logDetails = json_encode(['row_id' => Input::get('row_id'),\n\t\t\t\t\t\t\t\t\t 'status' => Input::get('status')]);\n\t\t\t\t\t\n\t\t\tActivity::log([\n\t\t\t\t'contentId' => Auth::User()->id,\n\t\t\t\t'contentType' => 'admin_pickup_status',\n\t\t\t\t'action' => 'Updated',\n\t\t\t\t'description' => 'Pickup Status Updated',\n\t\t\t\t'details' => $logDetails,\n\t\t\t\t'updated' => true,\n\t\t\t]);\n\t\t\t\n\t\t\t Session::flash('message', 'Order #' . Input::get('row_id') . ' updated');\n\t\t\treturn Redirect::to('order');\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t \n\t\t\tSession::flash('error', $e->getMessage() );\n\t\t\treturn Redirect::to('order');\n\t\t}\n\t\t\n\t\t\n\t}", "private function updateShippingData($purchase_id) {\n global $wpdb;\n\n $form_sql = \"SELECT * FROM `\" . WPSC_TABLE_SUBMITED_FORM_DATA . \"` WHERE `log_id` = '\" . (int)$purchase_id . \"'\";\n $input_data = $wpdb->get_results($form_sql, ARRAY_A);\n \n foreach($input_data as $input_row) {\n $rekeyed_input[$input_row['form_id']] = $input_row;\n }\n \n if($input_data != null) {\n $form_data = $wpdb->get_results(\"SELECT * FROM `\" . WPSC_TABLE_CHECKOUT_FORMS . \"` WHERE `active` = '1'\", ARRAY_A);\n \n foreach($form_data as $form_field) {\n $id = isset( $rekeyed_input[$form_field['id']]['id'] ) ? $rekeyed_input[$form_field['id']]['id'] : '';\n switch($form_field['unique_name']) {\n case 'shippingfirstname':\n if($this->addrs->isCompany)\n $value = $this->addrs->getCompanyName . ' (ref. ' . $this->addrs->getReference() . ')';\n else\n $value = $this->addrs->getFirstName();\n break;\n case 'shippinglastname':\n if($this->addrs->isCompany)\n $value = ' ';\n else\n $value = $this->addrs->getLastName();\n break;\n case 'shippingaddress':\n $value = trim($this->addrs->getStreet() . ' ' . $this->addrs->getHouseNumber() . ' ' . $this->addrs->getHouseExt());\n break;\n case 'shippingcity':\n $value = $this->addrs->getCity();\n break;\n case 'shippingcountry':\n $value = strtoupper($this->addrs->getCountryCode());\n break;\n case 'shippingpostcode':\n $value = $this->addrs->getZipCode();\n break;\n default:\n $value = '';\n break;\n }\n if($id && $value) {\n $wpdb->update(WPSC_TABLE_SUBMITED_FORM_DATA, array('value' => $value), array('id' => absint($id)));\n }\n }\n }\n }", "public function updated(CustomerInquiry $customerInquiry)\n {\n\n }", "function update_sub_Customer ($cust) {\n $data = array(\n 'cust_sub_id' => $cust['sub_id']\n );\n $this->db->where('cust_rp_id', $cust['cust_rp_id']);\n $this->db->update('customer', $data); \n }", "function edit_payment() {\r\n\r\n $data = json_decode(file_get_contents(\"php://input\"));\r\n\r\n $ID = $data->ID; \r\n $PAYFROM = $data->PAYFROM;\r\n $PAYTO = $data->PAYTO;\r\n $DATE = $data->DATE;\r\n $AMOUNT = $data->AMOUNT;\r\n $POTYPE = $data->POTYPE;\r\n $EXPITEM = $data->EXPITEM;\r\n $CUSTOMERID = $data->CUSTOMERID;\r\n $COMMENT = $data->COMMENT;\r\n $MODIFIEDBY = $data->MODIFIEDBY;\r\n $MODIFIEDDATE = date(\"Y-m-d\");\r\n\r\n $COMMENT = str_replace(\"'\",\"''\",$COMMENT);\r\n\r\n\r\n $qry = \"UPDATE VIEW_PAYMENT \r\n SET PAYFROM = '$PAYFROM', \r\n PAYTO = '$PAYTO', \r\n DATE = '$DATE', \r\n AMOUNT = '$AMOUNT',\r\n CUSTOMERID = '$CUSTOMERID', \r\n COMMENT = '$COMMENT', \r\n POTYPE = '$POTYPE', \r\n EXPITEM = '$EXPITEM', \r\n MODIFIEDBY = '$MODIFIEDBY', \r\n MODIFIEDDATE = '$MODIFIEDDATE' \r\n WHERE ID = '$ID'\";\r\n\r\n $result = mysql_query($qry);\r\n if(!$result){\r\n $arr = array('msg' => \"\", 'error' => 'Unknown Exception occurred. Please check the application log for more details.');\r\n $jsn = json_encode($arr);\r\n trigger_error(\"Issue with mysql_query. Please check the detailed log\", E_USER_NOTICE);\r\n trigger_error(mysql_error());\r\n print_r($jsn);\r\n }else{\r\n $arr = array('msg' => \" PAYMENT EDIT - Updated recored Successfully!!!\", 'error' => '');\r\n $jsn = json_encode($arr);\r\n print_r($jsn);\r\n }\r\n\r\n}", "public function update(Request $request, $printorder_id)\n {\n $this->validate($request, [\n 'lpo_number'=>'required',\n 'date_ordered'=>'required',\n 'tools_duration'=>'required',\n //'tool_name_and_code'=>'required',\n 'quantity_ordered'=>'required',\n ]);\n\n print_order::find($printorder_id)->update($request->all());\n return redirect()->route('printorderCRUD.index')\n ->with('success', 'Order updated successfully');\n }", "public function updateConfirm($booking_detail_id){\n \t$data = array(\n\t\t\t\"booking_detail_is_confirm\" => 1,\n\t\t\t\"booking_detail_request_change\" => 0,\n\t\t\t\"booking_detail_client_response\" => 0\n\t\t);\n\t\t$where = \"booking_detail_id = $booking_detail_id\";\n \treturn $this->db->update('booking_detail', $data, $where);\n }", "function wisataone_X1_update_order($data) {\n global $wpdb, $wisataone_X1_tblname;\n $wp_track_table = $wpdb->prefix . $wisataone_X1_tblname;\n\n $copy_data = (array) $data;\n $id = $data->id;\n unset($copy_data['id']);\n unset($copy_data['time_to_trip']);\n\n $updated = $wpdb->update($wp_track_table, $copy_data, array(\n 'id' => $id\n ));\n \n if ( false === $updated ) {\n $wpdb->show_errors();\n return false;\n } else {\n return true;\n }\n}", "public function updatePurchaseOrderData($invoiceArray,$purc_order_id, $notificationArray ){\n\t \t if(sizeof($invoiceArray) > 0 ){\n\t\t\t \t// update discount and frignt\n\t\t\t\t$this->db->where(\"purc_order_id\",$purc_order_id );\n\t\t\t\t$this->db->update(\"purchase_orders\", $invoiceArray);\n\t\t\t $this->db->limit(1);\n\t\t\t\t// add notification\n\t\t\t\tif(sizeof($notificationArray) > 0){\n\t\t\t\t\t$this->load->model('Orders_model', 'orders_model'); \t\t\n\t\t\t\t\t$notificationDataArray = array();\n\t\t\t\t\t$today = date(\"Y-m-d\");\n\t\t\t\t\t$notificationDataArray['uid'] = $this->session->userdata('userid');\n\t\t\t\t\t$notificationDataArray['message_text'] = 'Take follow-up of PO # '.$notificationArray['purchase_order_number'].' for receiving material.';\n\t\t\t\t\t$notificationDataArray['added_on'] = $today;\n\t\t\t\t\t$notificationDataArray['reminder_date'] = $notificationArray['expected_delivery'];\n\t\t\t\t\t$notificationDataArray['read_flag'] = 'Pending';\n\t\t\t\t\t$this->orders_model->add_notification($notificationDataArray);\n\t\t\t\t}\n\t\t\t\t\t\t \n\t\t\t $result = 1;\n\t\t\t}else{\n\t\t\t\t$result = 0;\n\t\t\t}\n\t\t\treturn $result;\n\t }", "public function updateinventorycasedetail($status, $id)\n {\n $this->db->where('id', $id)->update(\"case_details_inventory\", $status);\n }", "public function update_purchaseorder($ponbr) {\n\t\t\t$purchaseorder = $this->create_purchaseorderheader($ponbr);\n\t\t\t$purchaseorder['LineItem'] = $this->create_purchaseorderdetails($ponbr);\n\t\t\t$this->response = $this->curl_put($this->endpoints['purchase-order'], $purchaseorder, $json = true);\n\t\t\t$this->response['response']['PurchaseOrderNumber'] = isset($this->response['response']['PurchaseOrderNumber']) ? $this->response['response']['PurchaseOrderNumber'] : $purchaseorder['ID'];\n\t\t\t$this->process_response();\n\t\t\t//$this->response['response']['request'] = $purchaseorder;\n\t\t\treturn $this->response['response'];\n\t\t}", "public function update($id) {\n\n $message = Helper::usercan('purchases_update', Auth::user());\n\n if ($message) { return Redirect::back()->with('message', $message); }\n //Helper::usercan return won't let the following code to continue\n\n $incoming_purchase = array(\n \"shop_id\" => Input::get('shop_id'),\n \"purchase_date\" => Input::get('purchase_date'),\n \"is_reference\" => Input::get('is_reference', false),\n 'updated_at' => date(\"Y-m-d H:i:s\")\n );\n\n $purchaseDetails = $this->arrange_details(array(\n 'purchase_id' => $id,\n 'id' => Input::get('id'),\n 'purchased_products' => Input::get('product_id'),\n 'purchased_amount' => Input::get('amount'),\n 'purchased_total' => Input::get('total')\n ));\n\n $purchaseValidation = Validator::make($incoming_purchase, Purchase::$rules);\n\n $detailValidation = Validator::make($purchaseDetails, ProductPurchase::$rules);\n\n if ($purchaseValidation->fails() || $detailValidation->fails()) {\n $bag = $purchaseValidation->messages()->merge($detailValidation->messages());\n return Redirect::route('purchases.edit', $id)\n ->withInput()\n ->withErrors($bag)\n ->with('message', 'There were validation errors.');\n }\n\n $this->updatePurchaseDetails($id, $incoming_purchase, $purchaseDetails);\n\n return Redirect::route('purchases.index');\n }", "public function update_by_mock_invoice_id() {\n\n if ( isset( $_POST[ 'mockInvoiceId' ] ) ) {\n $mockInvoiceId = $this->input->post( 'mockInvoiceId' );\n unset( $_POST['mockInvoiceId'] );\n\n // Set any empty values to null\n array_replace_empty_with_null( $_POST );\n\n $updatedId = $this->mockinvoice_model->save( $_POST, $mockInvoiceId );\n }\n // Error handling - return some JSON if update successful\n if ( $updatedId ) {\n // Send back the POST details as JSON\n $this->json_library->print_array_json_unless_empty( $_POST );\n }\n }", "public function updatecasedetail($status, $id)\n {\n $this->db->where('id', $id)->update(\"case_detail\", $status);\n }", "function update_costumer($id_costumer,$params)\n {\n $this->db->where('id_costumer',$id_costumer);\n return $this->db->update('costumer',$params);\n }", "public function updateCaseStatusToDoAOR($id,$data)\n {\n $this->db->where_in('id',$id);\n $this->db->update('order_removal_shipment',$data);\n return $this->db->affected_rows();\n }", "public function update_capacity()\n {\n $capacity_id=@cmm_decode($this->input->post('encoded_id',TRUE));\n if($capacity_id==''){\n redirect(SITE_URL);\n exit;\n }\n // GETTING INPUT TEXT VALUES\n $data = array( \n 'name' =>$this->input->post('name',TRUE),\n 'unit_id' =>$this->input->post('unit',TRUE), \n 'modified_by' => $this->session->userdata('user_id'),\n 'modified_time' => date('Y-m-d H:i:s') \n );\n\n $where = array('capacity_id'=>$capacity_id);\n $res = $this->Common_model->update_data('capacity',$data,$where);\n if ($res)\n {\n $this->session->set_flashdata('response','<div class=\"alert alert-success alert-dismissable\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\"></button>\n <strong>Success!</strong> capacity has been updated successfully! </div>');\n }\n else\n {\n $this->session->set_flashdata('response','<div class=\"alert alert-danger alert-dismissable\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\"></button>\n <strong>Error!</strong> Something went wrong. Please check. </div>'); \n }\n\n redirect(SITE_URL.'capacity'); \n }", "public function update_order_by_id($entry_id, $order_data)\n\t{\n\t\t$this->EE->load->model(\"order_model\");\n\t\treturn $this->EE->order_model->update_order($entry_id, $order_data); \n\t\t\n\t}", "public function cashOnDelivery($data){\n $title = $this->fm->validation($data['title']);\n $description = $this->fm->validation($data['description']);\n $instructions = $this->fm->validation($data['instructions']);\n\n $title = mysqli_real_escape_string( $this->db->link, $data['title']);\n $description = mysqli_real_escape_string( $this->db->link, $data['description']);\n $instructions = mysqli_real_escape_string( $this->db->link, $data['instructions']);\n \n if (empty($title || $description || $instructions )) {\n $msg = \"<span class='error'>Size field must not be empty !</span>\";\n return $msg;\n } else {\n $query = \"UPDATE tbl_payment\n SET \n title = '$title',\n description = '$description',\n instructions = '$instructions' \n WHERE id = '3'\"; \n $updated_row = $this->db->update($query);\n\n if ($updated_row) {\n $msg = \"<span class='success'>Cash on delivery info updated.</span>\";\n return $msg;\n } else {\n $msg = \"<span class='error'>Cash on delivery payment info Not Updated !</span>\";\n return $msg;\n } \n }\n }", "function updateOrder($dataOrder){\n\tglobal $conn;\n\n\t$id = htmlspecialchars(base64_decode(base64_decode(base64_decode(base64_decode(base64_decode(base64_decode(base64_decode(base64_decode(base64_decode($dataOrder[\"id\"]))))))))));\n\n\t$jumlah_unit = htmlspecialchars(base64_decode(base64_decode(base64_decode(base64_decode(base64_decode(base64_decode(base64_decode(base64_decode($dataOrder[\"jumlah_unit\"])))))))));\n\n\t$jangka_waktu = htmlspecialchars(base64_decode(base64_decode(base64_decode(base64_decode(base64_decode(base64_decode(base64_decode(base64_decode($dataOrder[\"jangka_waktu\"])))))))));\n\n\t$total = htmlspecialchars(base64_decode(base64_decode(base64_decode(base64_decode(base64_decode(base64_decode(base64_decode(base64_decode($dataOrder[\"total\"])))))))));\n\n\t$query = \"UPDATE tb_order SET \n\tjumlah_unit = '$jumlah_unit', \n\tjangka_waktu = '$jangka_waktu',\n\ttotal = '$total'\n\tWHERE id = '$id'\n\t\";\n\tmysqli_query($conn, $query);\n\treturn mysqli_affected_rows($conn);\n}", "public function updated(Order $order)\n {\n foreach (OrderProduct::where('order_id',$order->id)->get() as $orderProduct) {\n $product = Product::find($orderProduct->product_id);\n $cardController = new GlobalCardController();\n $product->count = $cardController->countProduct($orderProduct->product_id);\n $product->save();\n }\n }", "public function updated(Order $Order)\n {\n //code...\n }", "public static function update_link($postdata,$id){\n\t $transactionResult = DB::transaction(function() use ($postdata,$id) {\n\t\t\tdate_default_timezone_set('Asia/Kolkata');\n\t\t $date = date('Y-m-d H:i:s');\n\t\t\n\t\t if(!empty($id)){\n\t\t\t\t$officer_id = $postdata['officer_id'];\n\t\t\t\t$link_officer_id = $postdata['link_officer_id'];\n\t\t\t\t$sql = DB::table('user_credential')->select('role','privilage_id')->where('officer_id',$officer_id)->get()->first();\n\t\t\t\t$update_info['role'] = $sql->role;\n\t\t\t\t$update_info['privilage_id'] = $sql->privilage_id;\n\t\t\t\tDB::table('user_credential')->where('officer_id',$link_officer_id)->update($update_info);\n\t\t\t\tDB::table('assign_link_officer')->where('assign_link_officer_id',$id)->update($postdata);\n\t\t\t\t\n\t\t\t\t$result['status'] = '1';\n\t\t\t}\n\t\t return $result;\n\t\t});\n\t\treturn $transactionResult;\n\t }", "public function completeProductOrder($order_product_id)\n\t{\n\t\t$query1=$this->db->query(\"SELECT pyr.confirm_id as payer_confirm_id FROM `payer` pyr where pyr.order_product_id=\".$order_product_id);\n\t\t$result1=$query1->result_array();\n\t\t$query2=$this->db->query(\"SELECT pye.confirm_id as payee_confirm_id FROM `payee` pye where pye.order_product_id=\".$order_product_id);\n\t\t$result2=$query2->result_array();\n\t\tif(isset($result1[0]) && isset($result2[0]))\n\t\t$this->db->query(\"UPDATE `order_product` SET order_product_status_id =6 where order_product_id = \".$order_product_id);\n\t\telse\n\t\t$this->db->query(\"UPDATE `order_product` SET order_product_status_id =5 where order_product_id = \".$order_product_id);\n\t\t$this->sendcompleteProductOrderMail($order_product_id);\n\t\t\n\t}", "function update_order($order_id){\n $date = date('Y-m-d H:i:s'); \n $data =['status'=>'completed','order_date'=>$date];\n $this->db->where(\"order_id\", $order_id);\n $this->db->update(\"orders\",$data);\n // echo $this->db->last_query();\n return $this->db->affected_rows();\n }", "public function update(Request $request, $porder_id)\n { try{\n $purchaseorder = Purchaseorder::find($porder_id);\n $purchaseorder-> product_brand = $request -> product_brand;\n $purchaseorder -> product_id = $request -> product_name;\n $purchaseorder -> quantity = $request -> quantity;\n $purchaseorder -> unit_price = $request -> unit_price;\n $purchaseorder -> tax = $request -> tax;\n $purchaseorder -> total = $request -> total;\n $purchaseorder -> dop = $request -> dop;\n $purchaseorder -> ordernumber = $request -> ordernumber;\n $purchaseorder -> save();\n DB::table('stocks')->insert([\n 'purchaseorder_id'=>$purchaseorder->porder_id,\n 'product_id'=>$request->product_name,\n 'quantity' => $request -> quantity,\n 'stock_quantity' => $request -> quantity,\n 'created_at' => date(\"Y-m-d H:i:s\")\n ]);\n $msg = config('app.purchase_update');\n } catch (Throwable $e) {\n $log = new ErrorLog();\n $log-> error_file = ($e->getFile());\n $log-> error_message = ($e->getMessage());\n $log-> error_line = ($e->getLine());\n $log-> error_trace = $e->getTraceAsString();\n $log->save();\n return view('administrator.purchaseorders.purchase');\n }\n if (session('key', $msg)) {\n Alert::success('Success!', session('key', $msg));\n }\n return redirect('administrator/purchaseorders')->with('success', config('app.success_purchaseorder'));\n \n }", "public function order_update_by_staff_post()\n {\n $response = new StdClass();\n $result = new StdClass();\n $order_id = $this->input->post('order_id');\n $admin_id = $this->input->post('admin_id');\n $table_no=$this->input->post('table_no');\n $menu_item_name=$this->input->post('menu_item_name');\n /*$new_menu_item_name=$this->input->post('new_menu_item_name');*/\n $quantity=$this->input->post('quantity');\n $menu_price=$this->input->post('menu_price');\n $total_item=$this->input->post('total_item');\n $total_price=$this->input->post('total_price');\n $gst_amount=$this->input->post('gst_amount');\n /* $gst_amount_price=$this->input->post('gst_amount_price');\n $net_pay_amount=$this->input->post('net_pay_amount');*/\n $order_status = $this->input->post('order_status');\n $order_change_by=$this->input->post('order_change_by');\n $slip_status=$this->input->post('slip_status');\n\n $data->order_id = $order_id;\n $data->admin_id = $admin_id;\n $data->table_no = $table_no;\n $data->menu_item_name = $menu_item_name;\n /*$data->new_menu_item_name = $new_menu_item_name;*/\n $data->quantity = $quantity;\n $data->menu_price = $menu_price;\n $data->total_item = $total_item;\n $data->total_price = $total_price;\n $data->gst_amount = $gst_amount;\n /* $gst_amount_price=$this->input->post('gst_amount_price');\n $net_pay_amount=$this->input->post('net_pay_amount');*/\n $data->order_status= $order_status;\n $data->order_change_by=$order_change_by;\n $data->slip_status=$slip_status;\n $result1 = $this->Supervisor->order_update_for_customer_by_staff($data);\n if(!empty($order_id))\n {\n $data1->status ='1';\n $data1->message = 'order successfully update';\n array_push($result,$data1);\n $response->data = $data1;\n }\n else\n {\n $response->status ='0';\n $response->message = 'register failed';\n }\n echo json_output($response);\n }", "public function editcorporate()\n {\n\n $order_id = I('post.order_id');\n $order_info = M('order_info')->where(['order_id' => $order_id])->find();\n\n $receiptno = unserialize($order_info['receiptno']);\n $totol_amount = $receiptno['total_order_amount'];\n\n $data['corporate_status_set'] = I('post.corporate_status_set');\n $data['corporate_amount'] = I('post.corporate_amount');\n\n $data['add_time'] = time();\n\n\n\n $receiptno = unserialize($order_info['receiptno']);\n\n if ($data['corporate_status_set'] == 'proceed') {\n\n $data['corporate_amount'] = $receiptno['total_order_amount'];\n if ($receiptno['payment_method'] == 'insurance_0') { //check if smart card selected in new order\n\n $update_data['order_step'] = 7; // Proceed with NO smart card to step7\n\n } else if ($receiptno['payment_method'] == 'insurance_1') {\n\n $update_data['order_step'] = 5; // Proceed with smart card to step5\n } else {\n\n $update_data['order_step'] = 5; // Proceed with smart card to step5\n }\n\n\n } elseif ($data['corporate_status_set'] == 'less approval') { // Less Approve option, so step5\n\n if ($receiptno['payment_method'] == 'insurance_0') { //check if smart card selected in new order\n $update_data['order_step'] = 6; // Proceed with NO smart card to step7\n\n } else if ($receiptno['payment_method'] == 'insurance_1') {\n\n $update_data['order_step'] = 5; // Proceed with smart card to step5\n } else {\n\n $update_data['order_step'] = 5; // Proceed with smart card to step5\n }\n } else {\n $update_data['order_step'] = -1; //Cancelled Order\n }\n //@todo simon.zhang\n //考虑topup的情况\n $payed_total = M('cash')->field('sum(pay_amount) as count')->where(['order_id' => $order_id, 'pay_amount' => ['neq', 0]])->find();\n\n $update_data['corporate'] = serialize($data);\n $update_data['balance'] = $totol_amount-$data['corporate_amount']-$payed_total['count'];\n $update_data['is_insurance_checked'] = 1;\n\n //M('order_info')->where(['order_id' => $order_id])->save($update_data);\n\n if (M('order_info')->where(['order_id' => $order_id])->save($update_data) !== FALSE) {\n insertlog($order_id,'Insurance Approval sucess! ');\n $this->success('save success', U('Index/index', array('order_step' => 4)));\n } else {\n $this->error('save fail', U('Order/insurance', array('order_id' => $order_id)));\n }\n\n /* ====== Step 4, Corporate Manager Section END ====== */\n\n }", "public function update($workOrderId, $reportId)\n {\n //\n }", "public function setMatchedOrderToCompleted($matchedOrderID){\n try{\n $stmt = $this->db->prepare(\"UPDATE MatchedOrder\n Set MatchedOrderStatus = 1\n WHERE MatchedID=:matchedOrderID\");\n if($stmt->execute(array(':matchedOrderID'=>$matchedOrderID))){\n return true;\n }else{\n return false;\n }\n }catch(PDOException $e){\n echo $e->getMessage();\n }\n}", "public function testUpdateOrder()\n {\n }", "public function updateDetail(OrderDetailRequest $request, $_hash, $_detail_hash)\n {\n return $this->buildApiResponse([\n 'order' => new OrderResource($this->orderRepository->updateDetail($request->get('product'), $_hash, $_detail_hash))\n ]);\n }", "function __approve_purchase($id) {\n\t\treturn $this -> db -> query('update purchase_order_tab set pstatus=3 where pid=' . $id);\n\t}", "public function setStatusDelivery($param) {\n $CB16PEDIDO = CB16PEDIDO::find()->where(\"CB16_ID = \".$param['pedido'].\" and CB16_STATUS >= 30\")->all()[0];\n if ($CB16PEDIDO) {\n $CB16PEDIDO->setAttribute('CB16_STATUS_DELIVERY', $param['new_status']);\n $CB16PEDIDO->save(); \n }\n }", "public function Update_CustomerDetails($data) { /* this fun is used to update customer details */\n extract($data);\n\n $sql = \"UPDATE customer_details SET customer_name = '$Updated_CustomerName',\n customer_email = '$Updated_CustomerEmail',customer_address = '$Updated_CustomerAddress',contact = '$contact',\n bank_name = '$Updated_Bank_name' ,bank_address = '$Updated_Bank_Address' ,\n account_no = '$Updated_Bank_AccNo' , IFSC_no = '$Updated_Bank_IFSC_Code' ,\n MICR_no = '$Updated_Bank_MICR_Code' ,PAN_no = '$Updated_PAN_No',\"\n . \"profit_for_odgreater='$UpdateSelect_profitCategoryOne',\"\n . \"profit_for_odsmall='$UpdateSelect_profitCategoryTwo',branch_name='$branch_name' WHERE cust_id ='$new_Cust_id'\";\n //echo $sql; die();\n $resultUpadateCustomerDetails = $this->db->query($sql);\n\n if ($resultUpadateCustomerDetails) {\n $response = array(\n 'status' => 1,\n 'status_message' => 'Records Updated Successfully..!');\n } else {\n $response = array(\n 'status' => 0,\n 'status_message' => 'Records Not Updated Successfully...!');\n }\n return $response;\n }", "public function update(Request $request, $id)\n {\n $order = Order::find($id);\n if ($order->status == 'checkouted'){\n $order->status = 'delivered';\n $order->save();\n }\n return redirect()->back();\n }", "public function editPurchaseOrder($id = null) {\n if (!empty($id)) {\n //Get Logged User Deatils\n $user = Auth::user();\n //Get Custome Details\n\n if (Auth::user()->hasRole('admin') || Auth::user()->hasRole('manager')) {\n $po_data = DB::table('purchase_order')->where('id', $id)->first();\n $customer = DB::table('customers')->where('id', $po_data->customer_id)->first();\n } else {\n $customer = DB::table('customers')->where('user_id', $user->id)->first();\n }\n //Get data of purchase order\n $purchaseOrder = DB::table('purchase_order')\n ->select(array('shipping_info.*', 'purchase_order.*'))\n ->leftJoin('shipping_info', 'shipping_info.id', '=', 'purchase_order.shipping_id')\n ->where('purchase_order.id', $id)\n ->first();\n\n //Get multi images by PO Id\n $poImages = DB::table('po_images')\n ->select(array('po_images.*'))\n ->where('po_images.po_id', $id)\n ->where('po_images.isDeleted', '0')\n ->get();\n\n if (Request::isMethod('post')) {\n\n $post = Input::all();\n\n unset($post['_token']);\n $rules = array(\n 'orderDate' => 'required',\n 'shippingMethod' => 'required',\n 'payment_terms' => 'required',\n 'require_date' => 'required',\n );\n $validator = Validator::make(Input::all(), $rules);\n if ($validator->fails()) {\n return redirect('/po/edit/' . $id)\n ->withErrors($validator)\n ->withInput(Input::all());\n }\n\n if (isset($post['addNew'])) {\n // Add New Shipping Information\n $shipAddId = DB::table('shipping_info')->insertGetId(\n array(\n 'customer_id' => $customer->id,\n 'comp_name' => $post['comp_name'],\n 'building_no' => $post['building_no'],\n 'street_addrs' => $post['street_addrs'],\n 'interior_no' => $post['interior_no'],\n 'city' => $post['city'],\n 'state' => $post['state'],\n 'zipcode' => $post['zipcode'],\n 'country' => $post['country'],\n 'phone_no' => $post['phone_no'],\n 'identifier' => $post['identifer'],\n 'type' => $post['shippingMethod'],\n 'date' => date('Y/m/d', strtotime($post['orderDate'])),\n 'invoice_id' => '',\n )\n );\n } else {\n $shipAddId = $purchaseOrder->shipping_id;\n DB::table('shipping_info')\n ->where('id', $shipAddId)\n ->update(\n array(\n 'type' => $post['shippingMethod']\n )\n );\n }\n\n //update Purchase Order\n $poId = DB::table('purchase_order')\n ->where('id', $id)\n ->update(\n array(\n 'shipping_id' => $post['oldIdentifire'],\n 'date' => date('Y/m/d', strtotime($post['orderDate'])),\n 'time' => date('H:i:s', strtotime($post['time'])),\n 'payment_terms' => $post['payment_terms'],\n 'require_date' => date('Y/m/d', strtotime($post['require_date'])),\n 'comments' => $post['comments']\n )\n );\n\n // Upload multiple Images\n // multiple image file object\n $multiFileArray = Input::file('uploadImage');\n if (isset($multiFileArray) && !empty($multiFileArray)) {\n foreach ($multiFileArray as $fileArray) {\n if (!empty($fileArray) && $fileArray->getError() != 4) {\n $fileName = $fileArray->getClientOriginalName();\n $destinationPath = getcwd() . '/files/poMultiImage';\n $imageFilename = str_replace(' ', '', $customer->comp_name) . time() . '_' . $fileName;\n $fileArray->move($destinationPath, $imageFilename);\n\n // Add multi file to DB\n DB::table('po_images')->insertGetId(\n array('fileName' => $imageFilename, 'po_id' => $id)\n );\n }\n }\n }\n // Upload multiple Images END\n ///////////////////////\n //add po order\n $orders = json_decode($post['orders'], true);\n \n $deleteOrderIds = explode(',', $post['deleteOrder']);\n\n if (count($deleteOrderIds) > 0) {\n foreach ($deleteOrderIds as $deleteOrder) {\n DB::table('order_list')->where('id', $deleteOrder)\n ->delete();\n }\n }\n $localSeqNo = 1;\n $adminSeqNo = 1;\n $lastCustSeqId = DB::table('order_list')->select('*')->where('customer_id', '=', $customer->id)->orderBy('localSequence', 'DESC')->first();\n $lastAdminSeqId = DB::table('order_list')->select('*')->orderBy('adminSequence', 'DESC')->first();\n if (!empty($lastCustSeqId)) {\n $localSeqNo = $lastCustSeqId->localSequence;\n }\n if (!empty($lastAdminSeqId)) {\n $adminSeqNo = $lastAdminSeqId->adminSequence;\n }\n foreach ($orders as $orderlist) {\n $orderlist['size_qty'] = json_encode($orderlist['size_qty']);\n if ($orderlist['part_id'] > 0) {\n $orderId = $orderlist['orderId'];\n unset($orderlist['orderId']);\n if ($orderId > 0) {\n //Update Order\n DB::table('order_list')\n ->where('id', $orderId)\n ->update($orderlist);\n } else {\n $localSeqNo++;\n $adminSeqNo++;\n //Add new Order\n $orderlist['customer_id'] = $customer->id;\n $orderlist['po_id'] = $id;\n $orderlist['adminSequence'] = $adminSeqNo;\n $orderlist['localSequence'] = $localSeqNo;\n $orderlist['created_by'] = $user->id;\n DB::table('order_list')->insert($orderlist);\n }\n }\n }\n Session::flash('message', \"PO Customer Updated Sucessfully.\");\n Session::flash('status', 'success');\n return redirect('/po');\n }\n\n //Get list of Parts order\n $orderList = DB::table('order_list')\n ->select(array('order_list.*', 'part_number.*', 'order_list.id as order_id', DB::raw('group_concat(size.labels) as size')))\n ->leftJoin('size_data', 'size_data.part_id', '=', 'order_list.part_id')\n ->leftJoin('size', 'size.id', '=', 'size_data.size_id')\n ->leftJoin('part_number', 'part_number.id', '=', 'order_list.part_id')\n ->where('order_list.po_id', $id)\n ->groupBy('order_list.id')\n ->get();\n// $size = DB::table('size_data')\n// ->leftJoin('part_number', 'part_number.id', '=', 'size_data.part_id')\n// ->select('size.id','size.labels')\n// ->where('size_data.part_id', '=', 'part_number')\n// ->get();\n //echo '<pre>';print_r($purchaseOrder);exit;\n //get shipping address details\n if (isset($customer->id)) {\n $shipping = DB::table('shipping_info')->where('customer_id', $customer->id)->get();\n } else {\n $shipping = array();\n }\n\n\n //get parts Data\n $sku = $this->getSKUPartsData();\n } else {\n return redirect('/po/add');\n }\n\n /* if (Auth::user()->hasRole('admin') || Auth::user()->hasRole('manager')) {\n $cData = $this->getCustomerData();\n return View::make(\"PurchaseOrderCustomer.addPurchaseOrder\", ['page_title' => 'Add Purchase Order'])\n ->with(\"shipping\", $shipping)\n ->with('sku', $sku)\n ->with('custData', $cData)\n ->with('autoId', $purchaseOrder->po_number)\n ->with('orderlist', $orderList)\n ->with('purchaseOrder', $purchaseOrder);\n // ->with('autoId', $autoId);\n } */\n\n return View::make(\"PurchaseOrderCustomer.addPurchaseOrder\", ['page_title' => 'Edit Purchase Order'], ['id' => $id])\n ->with('cust', $customer)\n ->with('orderlist', $orderList)\n ->with('purchaseOrder', $purchaseOrder)\n ->with('autoId', $purchaseOrder->po_number)\n ->with('sku', $sku)\n ->with('shipping', $shipping)\n ->with('poImages', $poImages);\n // ->with('identifireList', $identifireData);\n }", "function update_shipto($shipto_id,$params){\n $this->company_db->update('tbl_shipto', $params,array(\"id\"=>$shipto_id)); \n }", "public function updateProjectRequirementActual($id){\n\n $req = request()->all();\n\n DB::table('tblprojectrequirements')\n ->where('tblprojectrequirements.intRequirementId','=', $req['projectRequirementId'])\n ->update(['decActualPrice' => $req['actualPrice']]);\n\n\n header('Refresh:0;/Engineer/Engineer-Projects/'.$id.'/Actuals');\n }", "public function update($workorder_id) {\n if (!in_array('updateWorkorder', $this->permission)) {\n redirect('dashboard', 'refresh');\n }\n\n if (!$workorder_id) {\n redirect('dashboard', 'refresh');\n }\n\n $this->form_validation->set_rules('nomor_wo', 'Nomor WO', 'trim|required');\n $this->form_validation->set_rules('wo_name', 'Nama WO', 'trim|required');\n // $this->form_validation->set_rules('channel_name', 'Nama Channel', 'trim|required');\n // $this->form_validation->set_rules('produk_name', 'Nama Produk', 'trim|required');\n $this->form_validation->set_rules('marketing_name', 'Store', 'trim|required');\n $this->form_validation->set_rules('bobot', 'Bobot', 'trim|required');\n $this->form_validation->set_rules('input_date', 'Tanggal Input', 'trim|required');\n $this->form_validation->set_rules('deadline', 'Deadline', 'trim|required');\n $this->form_validation->set_rules('catatan', 'catatan', 'trim|required');\n $this->form_validation->set_rules('backend', 'backend', 'trim|required');\n $this->form_validation->set_rules('frontend', 'frontend', 'trim|required');\n $this->form_validation->set_rules('qa', 'qa', 'trim|required');\n\n if ($this->form_validation->run() == TRUE) {\n // true case\n\n $data = array(\n 'nomor_wo' => $this->input->post('nomor_wo'),\n 'wo_name' => $this->input->post('wo_name'),\n 'channel_name' => json_encode($this->input->post('channel')),\n 'produk_name' => json_encode($this->input->post('produk')),\n 'marketing_name' => $this->input->post('marketing_name'),\n 'bobot' => $this->input->post('bobot'),\n 'input_date' => $this->input->post('input_date'),\n 'deadline' => $this->input->post('deadline'),\n 'catatan' => $this->input->post('catatan'),\n 'backend_days' => $this->input->post('backend'),\n 'frontend_days' => $this->input->post('frontend'),\n 'qa_days' => $this->input->post('qa'),\n );\n\n\n if ($_FILES['workorder_image']['size'] > 0) {\n $upload_image = $this->upload_image();\n $upload_image = array('lampiran' => $upload_image);\n\n $this->model_workorder->update($upload_image, $workorder_id);\n }\n\n $update = $this->model_workorder->update($data, $workorder_id);\n if ($update == true) {\n $this->session->set_flashdata('success', 'Successfully updated');\n redirect('workorder/', 'refresh');\n } else {\n $this->session->set_flashdata('errors', 'Error occurred!!');\n redirect('workorder/update/' . $workorder_id, 'refresh');\n }\n } else {\n // attributes \n $attribute_data = $this->model_attributes->getActiveAttributeData();\n\n $attributes_final_data = array();\n foreach ($attribute_data as $k => $v) {\n $attributes_final_data[$k]['attribute_data'] = $v;\n\n $value = $this->model_attributes->getAttributeValueData($v['id']);\n\n $attributes_final_data[$k]['attribute_value'] = $value;\n }\n\n // false case\n $this->data['attributes'] = $attributes_final_data;\n $this->data['channel'] = $this->model_channel->getActiveChannel();\n $this->data['produk'] = $this->model_produk->getActiveProduk();\n\n\n $workorder_data = $this->model_workorder->getWorkorderData($workorder_id);\n $this->data['workorder_data'] = $workorder_data;\n $this->render_template('workorder/edit', $this->data);\n }\n }" ]
[ "0.6239357", "0.61952275", "0.61403126", "0.6098475", "0.60762167", "0.5972517", "0.59627414", "0.5945761", "0.5937861", "0.5937434", "0.58892447", "0.5870043", "0.5854425", "0.58513176", "0.58507764", "0.584786", "0.58433807", "0.58287627", "0.58181125", "0.5801499", "0.57917696", "0.57710385", "0.57498235", "0.57448494", "0.5734211", "0.57275915", "0.5703212", "0.56919", "0.5671133", "0.5671096", "0.5659128", "0.56523407", "0.5648269", "0.5631177", "0.56281865", "0.56226844", "0.5617523", "0.56017095", "0.55960554", "0.559233", "0.55852073", "0.5583422", "0.55818796", "0.5566858", "0.5563437", "0.5559527", "0.55537546", "0.5553511", "0.5547212", "0.55450904", "0.5542327", "0.55349696", "0.55270416", "0.5522459", "0.5522272", "0.55124587", "0.5510982", "0.55054367", "0.55046177", "0.5499333", "0.5496176", "0.54924023", "0.5484473", "0.54824233", "0.54809135", "0.54803807", "0.54774624", "0.54771864", "0.54769784", "0.5467071", "0.5464803", "0.5464185", "0.5462064", "0.5457621", "0.5457073", "0.54516864", "0.5448903", "0.54486597", "0.5447844", "0.544223", "0.54399574", "0.54382086", "0.5435001", "0.54326606", "0.5432552", "0.54304194", "0.54250526", "0.54125947", "0.5411908", "0.5411111", "0.54084784", "0.5408333", "0.54074", "0.54056156", "0.54029316", "0.5400044", "0.5390257", "0.5390239", "0.5388885", "0.5385629" ]
0.6363989
0
Get Quantity by ID
public function GetQTYByID($delivery_order_detail_id) { return $this->deliveryOrderDetail::find($delivery_order_detail_id)->qty; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getQuantity();", "public function getQuantity();", "public function getQuantity();", "public function getQty();", "public function getQty();", "public function getQuantity($id)\n {\n $quantity = DB::table('Order_Transaction')\n ->where('item_id', $this->id)\n ->sum('item_quantity_change');\n return $quantity;\n }", "public function getQuantity(): ?int;", "public function getQuantity(): float;", "public function getUnitQtyByUnitId ( $id )\n {\n $this->db->select( 'qty' );\n $this->db->where( \"id\", $id );\n $query = $this->db->get( 'tbld_unit' )->result_array();\n return $query;\n }", "private function _getQuantity($idTyre, $idStore, $idShop)\n\t{\n\t\t$qp = new QueryProcessor();\n\t\treturn $qp->query_stocks_quantity($idTyre, $idStore, $idShop);\n\t}", "function getStock($id){\n\n $query=$this->db\n ->select('cantidad_dispo')\n ->from('productos')\n ->where('idproducto='.$id)\n ->get();\n $product = $query->row();\n return $product->cantidad_dispo;\n\n }", "public function getQuantity(): int|null;", "public function getItem( $id );", "public function getItem ($id);", "function getItemById($id) {\n \n $connection = getConnection();\n \n // TODO Prevent SQL injection. Prepared statement?\n $data = mysqli_query($connection, \"SELECT * FROM inventory WHERE item_id = $id\");\n\n $result = mysqli_fetch_assoc($data);\n \n mysqli_close($connection);\n\n return $result;\n }", "public function find(int $id)\n {\n $query = \n \"SELECT orders.*, SUM(products.price * order_items.quantity) AS amount, COUNT(order_items.id) AS items\n FROM orders\n INNER JOIN order_items\n ON orders.id = order_items.order_id\n INNER JOIN products\n ON order_items.product_id = products.id\n WHERE orders.id = :id\";\n\n $this->db->prepare($query);\n\n $this->db->bind(\"id\", $id, \\PDO::PARAM_INT);\n\n return $this->db->single();\n\n }", "public function findPrice($tourId, $qty);", "function getPlayerWarehouseItem($player_id, $item_id)\n{\n global $db;\n return $db->where(\"player_id\", $player_id)\n ->where(\"item_id\", $item_id)\n ->getOne(\"warehouse\", \"quantity\");\n}", "public function selectQtyByID($unitId)\n\t{\t\n\t\t$this->db->where($this->pro->productunit.\"_id\",$unitId);\n\t\t$rs= $this->db->get($this->pro->prifix.$this->pro->productunit);\n\t\treturn $rs->row_array();\n\t}", "public function getQuantity()\n {\n return $this->quantity;\n }", "public function getQuantity() \n {\n return $this->_fields['Quantity']['FieldValue'];\n }", "function getItem($id){\n global $db;\n \n $stmt=$db->prepare(\"SELECT idItem, `name`, amount, unitPrice, salesPrice, parAmount FROM inventory WHERE idItem = :id\");\n \n\t\t$binds= array(\n\t\t\t\":id\"=>$id\n\t\t);\n\t\t\n if($stmt->execute($binds) && $stmt->rowCount()>0){\n $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\n return ($results);\n }\n else{\n return false;\n }\n }", "public function getItem($id)\n {\n return $this->where('id', $id)->first();\n }", "function get_stocked($obj, $id){\n\t$result_array = $obj->Query_reader->get_row_as_array('get_stocked',array('id' => $id));\n\treturn $result_array['total'];\n}", "public function getProductById(int $id);", "public function getQuantity()\n\t{\n\t\treturn $this->getKeyValue('quantity'); \n\n\t}", "function getAmount($idItem){\n global $db;\n \n $stmt=$db->prepare(\"SELECT amount FROM inventory WHERE idItem = :idItem\");\n \n $binds= array(\n \":idItem\"=> $idItem\n );\n \n $results=[];\n if($stmt->execute($binds) && $stmt->rowCount()>0){\n $results = $stmt->fetch(PDO::FETCH_ASSOC);\n return $results;\n }\n else{\n return false;\n }\n \n }", "abstract public function getOriginalQty();", "public function getItem($id, $param=\"idProductItem\"){\n $id = (int) $id;\n $data = array($param => $id);\n $rowset = $this->tableGateway->select($data);\n $row = $rowset->current();\n return $row;\n }", "public function getConcreteProduct(int $id): ApiItemTransfer;", "public function getQuantity()\n {\n return $this->quantity;\n }", "public function getQuantity(){\n return $this->quantity;\n }", "public function get($id = '')\n {\n $this->db->select('tblpurchaseorders.order_number');\n $this->db->from('tblitems_in');\n $this->db->join('tblpurchaseorders', 'tblpurchaseorders.id = tblitems_in.rel_id', 'left');\n $this->db->where('tblitems_in.id', $id);\n $tx = $this->db->get()->row();\n\n return $tx;\n }", "public function retrieveItem($id) {\n return $this->itemsDB->retrieve($id);\n }", "public function getQuantityByUnit()\n {\n return $this->quantity_by_unit;\n }", "function getProductbyId($id){\n\t\t$conn \t= connectDB();\n\t\t$sth \t= $conn->prepare(\"\tSELECT * \n\t\t\t\t\t\t\t\t\tFROM `product` \n\t\t\t\t\t\t\t\t\tWHERE `stock` > 0 AND `id` = ?\");\n\t\t$sth \t->execute(array($id));\n\n\t\treturn \t$sth;\n\t}", "static public function getItemById($id) {\n $rq = \"SELECT * FROM \" . PREFIX . \"shop.`item` \n WHERE `id` =\" . $id . \" LIMIT 1;\";\n\n $aItem = Sql::Get($rq, 1);\n // MemCacheManager::Set($sKey, $aItems, 900); //900s = 15 min\n\n return $aItem[0];\n }", "public static function find($id){\n return Purchase::find($id);\n }", "public function read($id) {\n return $this->product->find($id);\n\t}", "private function _setQuantity($idTyre, $idStore, $idShop)\n\t{\n\t\t$qp = new QueryProcessor();\n\t\treturn $qp->query_stocks_quantity($idTyre, $idStore, $idShop);\n\t}", "public static function GetQuantity($INVOICEDID,$incomingInvTyp)\r\n\t{\r\n\t\t$Query = \"SELECT qty FROM incominginventory WHERE incoming_inventory_id = $INVOICEDID\";\r\n \r\n //comment by gajendra\r\n //~ if($incomingInvTyp == \"E\")\r\n //~ {\r\n //~ $Query = \"SELECT ExciseQty FROM incominginventory WHERE entryDId = $INVOICEDID\";\r\n //~ }\r\n //~ else if($incomingInvTyp == \"N\")\r\n //~ {\r\n //~ $Query = \"SELECT NonExciseQty FROM incominginventory WHERE entryDId = $INVOICEDID\";\r\n //~ }\r\n //echo $Query;\r\n //end\r\n $Result = DBConnection::SelectQuery($Query);\r\n $Row = mysql_fetch_array($Result, MYSQL_ASSOC);\r\n $Qty = empty($Row['qty'])?'0':$Row['qty'];\r\n //comment by gajendra\r\n //~ if($incomingInvTyp == \"E\")\r\n //~ {\r\n //~ $Qty = $Row['ExciseQty'];\r\n //~ }\r\n //~ else if($incomingInvTyp == \"N\")\r\n //~ {\r\n //~ $Qty = $Row['NonExciseQty'];\r\n //~ }\r\n //end\r\n return $Qty;\r\n\t}", "public function getItemById($it_id)\n\t{\n\t\treturn \\ORM::for_table($this->table)->where('it_id', $it_id)->find_one();\n\t}", "public function findItem(string $rowId) : CartItem\n {\n return $this->model->get($rowId);\n }", "public function getProduct($id)\n {\n }", "public function quantity($search_id)\n\t{\n\t\tif(isset($this->cart[$search_id]))\n\t\t{\n\t\t\treturn $this->cart[$search_id];\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t}", "public function getById($id)\n {\n return $this->product->find($id);\n \n }", "public function getProductQuantity()\n {\n }", "public function getIncreaseByOne($id){\n $session = new Session();\n\n $oldCart = $session->has('cart')? $session->get('cart') : null;\n\n $cart = new Cart($oldCart);\n $cart->increaseByOne($id);\n\n if(count($cart->items) > 0){\n $session->set('cart', $cart);\n } else {\n $session->clear('cart');\n }\n\n $json_data = array(\n 'message' => 'reduce item success!',\n 'cart' => $cart\n );\n\n return response()->json($json_data);\n }", "public function getQuantity(): int\n {\n return $this->quantity;\n }", "public function get_quantity(){\n\t\treturn $this->quantity;\n\t}", "public function getQuantity()\n {\n return $this->quantity;\n }", "public function getQuantity()\n {\n return $this->quantity;\n }", "public function getQuantity()\n {\n return $this->quantity;\n }", "public function getQuantity()\n {\n return $this->quantity;\n }", "public function getQuantity()\n {\n return $this->quantity;\n }", "public function getQuantity()\n {\n return $this->quantity;\n }", "public function getQuantity()\n {\n return $this->quantity;\n }", "public function getQuantity()\n {\n return $this->quantity;\n }", "public function getQuantity()\n {\n return $this->quantity;\n }", "public function getQuantity()\n {\n return $this->quantity;\n }", "public function getQuantity()\n {\n return $this->quantity;\n }", "public function get_by_item_id($id = FALSE)\n {\n if (!$id)\n {\n $query = $this->db->get('stock');\n return $query->result_array();\n }\n\n //$this->db->where('stock > 0');\n $this->db->where('itemID', $id);\n $this->db->where('stock >0');\n $query = $this->db->get('stock');\n\n return $query->result_array();\n }", "public function getProductId(): int;", "function get_invoice_by_id ( $id )\n {\n if (!is_int($id))\n {\n throw new TypeError('$id should be an integer');\n }\n\n $invoice = $this->dsQuery ('Invoice',1,0, array (\n 'Id' => $id\n ), array (\n 'ContactId',\n 'DateCreated',\n 'InvoiceTotal',\n 'PayStatus',\n 'RefundStatus',\n 'Description',\n 'ProductSold'\n ));\n\n if (is_array($invoice))\n {\n return $invoice[0];\n }\n\n else return $invoice;\n }", "public function obtenerItem($id) {\n return $this\n ->reiniciar()\n ->donde([\n 'id'=>$id\n ])\n ->obtenerUno();\n }", "function _get_product_stock($product_id = 0)\r\n {\r\n return @$this->db->query(\"select sum(available_qty) as t from t_stock_info where product_id = ? and available_qty >= 0 \",$product_id)->row()->t;\r\n }", "public function itemQuery()\n {\n return $this->item($this->getInput('id'));\n }", "public function getQuantity()\n {\n return isset($this->quantity) ? $this->quantity : null;\n }", "public function getQty()\r\n {\r\n return $this->qty;\r\n }", "function getStockQuantity($stock_id,$mysqli){\n\t$query = \"SELECT quantity_in_store FROM stocks WHERE id = '$stock_id'\";\n\tif ($result = mysqli_query($mysqli,$query)){\n\t\treturn mysqli_fetch_assoc($result)['quantity_in_store'];\n\t}else{\n\t\tprintf(\"Notice: %s\", mysqli_error($mysqli));\n\t}\n\n}", "public function getQty()\n {\n return $this->qty;\n }", "public function getItemById($id)\n {\n $dataProvider = new CActiveDataProvider('ARTICULOS', array(\n 'criteria' => array(\n 'condition' => 'id='.$id,\n ),\n ));\n $return = $dataProvider->getData();\n return $return[0];\n }", "public function findCartBySessionId($id)\n {\n \t$cart = $this->model->whereSessionId($id)->first();\n \n \treturn $cart;\n }", "public function getQuantity()\n {\n return $this->_quantity;\n }", "public function getReduceByOne($id){\n $session = new Session();\n\n $oldCart = $session->has('cart')? $session->get('cart') : null;\n\n $cart = new Cart($oldCart);\n $cart->reduceByOne($id);\n\n if(count($cart->items) > 0){\n $session->set('cart', $cart);\n } else {\n $session->clear('cart');\n }\n\n $json_data = array(\n 'message' => 'reduce item success!',\n 'cart' => $cart\n );\n\n return response()->json($json_data);\n }", "public function findCartByUserId($id)\n {\n \t$cart = $this->model->whereUserId($id)->first();\n \n \treturn $cart;\n }", "public function getQuantity()\n {\n return parent::getQuantity();\n }", "public function getProductById($id){\n $query = $this->db->get_where('product',array('id' => $id));\n return $query->row(); \n }", "public function getItemId();", "public function findById($id)\n {\n \t$product = $this->model->whereId($id)->first();\n \n \treturn $product;\n }", "public function getItemById($id)\n {\n return $this->type->find($id);\n }", "public function getQuantityAvailable(): int;", "public function findValueProd($id){\n return Product::where('id',$id)->first()->value;\n }", "function getItem( $id = null ){\r\n\t\tif( $id === null ){\r\n\t\t\t$id = rsgInstance::getInt( 'id', null );\r\n\r\n\t\t\tif( $id === null ){\r\n\t\t\t\t// there is no item set, return the first value from getItems()\r\n\t\t\t\t$items = $this->items();\r\n\r\n\t\t\t\treturn array_shift( $items );\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$items = $this->items();\r\n\t\treturn $items[$id];\r\n\t}", "function get ($id) {\n // PARAM $id : order ID\n\n $order = $this->fetch(\n \"SELECT * FROM `orders` WHERE `order_id`=?\", [$id]\n );\n $order['items'] = $this->fetch(\n \"SELECT * FROM `orders_items` LEFT JOIN `products` USING (`product_id`) WHERE `orders_items`.order_id=?\", \n [$id], \"product_id\"\n );\n return $order;\n }", "public function getById(int $id)\n {\n return $this->products[$id];\n }", "public function getById(int $id)\n {\n return $this->products[$id];\n }", "public function stock(Request $request, $id)\n {\n $validator = Validator::make(\n $request->all(),\n [\n 'quantity' => 'required',\n ],\n [\n 'required' => 'Le champ :attribute est requis',\n ]\n );\n\n $errors = $validator->errors();\n if (count($errors) != 0) {\n return response()->json([\n 'success' => false,\n 'message' => $errors->first()\n ]);\n }\n\n $loggedUser = Auth::user();\n $loggedUserId = (int) $loggedUser->id;\n $quantity = $validator->validated()['quantity'];\n\n $producer = Producer::where(['user_id' => $loggedUserId, \"product_id\" => $id])->first();\n if (!$producer) {\n return response()->json([\n 'success' => false,\n 'message' => \"Action impossible\"\n ], 401);\n }\n\n $product = Products::whereId($id)->first();\n if (!$product) {\n return response()->json([\n 'success' => false,\n 'message' => \"Produit introuvable\"\n ]);\n }\n\n $product->quantity = $quantity;\n $product->save();\n return response()->json([\n 'success' => true,\n 'message' => \"Mise à jour effectuée\"\n ]);\n }", "function get( $id=\"\" )\n {\n $this->dbInit();\n $ret = false;\n \n if ( $id != \"\" )\n {\n $this->Database->array_query( $cart_array, \"SELECT * FROM eZTrade_OrderItem WHERE ID='$id'\" );\n if ( count( $cart_array ) > 1 )\n {\n die( \"Error: Cart's with the same ID was found in the database. This shouldent happen.\" );\n }\n else if( count( $cart_array ) == 1 )\n {\n $this->ID =& $cart_array[0][ \"ID\" ];\n $this->OrderID =& $cart_array[0][ \"OrderID\" ];\n $this->Count =& $cart_array[0][ \"Count\" ];\n $this->Price =& $cart_array[0][ \"Price\" ];\n $this->ProductID =& $cart_array[0][ \"ProductID\" ];\n\n $this->State_ = \"Coherent\";\n $ret = true;\n }\n }\n else\n {\n $this->State_ = \"Dirty\";\n }\n return $ret;\n }", "function get_sold($obj, $id){\n\t$result_array = $obj->Query_reader->get_row_as_array('get_sold',array('id' => $id));\n\treturn $result_array['total'];\n}", "public function get( $iId );", "public function getQuantity()\n {\n return $this->quantity;\n }", "public function showProductQty(){\n $sId = session_id();\n $query = \"SELECT * FROM tbl_cart WHERE sId = '$sId'\";\n $select_result = $this->db->select($query);\n\n if ($select_result) {\n $row = mysqli_num_rows($select_result);\n return $row;\n //return $select_result;\n }else {\n return 0;\n }\n\n }", "public function getItem($id) {\n foreach($this->all as $item) {\n if ($id == $item->getId()) {\n return $item;\n }\n }\n }", "public function quantityGet(){\n\t return $this->hasOne('App\\models\\ShopSimple\\ShopQuantity', 'product_id', 'shop_id')->withDefault(['name' => 'Unknown quantity']); //$this->belongsTo('App\\modelName', 'foreign_key_that_table', 'parent_id_this_table');}\n //->withDefault(['name' => 'Unknown']) this prevents the crash if this author id does not exist in table User (for example after fresh install and u forget to add users to user table)\n }", "function getUpdateItem($product_id){\n\tglobal $conn;\n\t$ip = getIp();\n\t$get_qty =mysqli_query($conn, \"SELECT * FROM `cart` WHERE `ip_add`='$ip' AND `p_id`='$product_id'\");\n\t$row_qty=mysqli_fetch_array($get_qty);\n\t$quantity= $row_qty[\"qty\"];\t\n\n\t$get_price =mysqli_query($conn, \"SELECT * FROM `products` WHERE `product_id`='$product_id' AND `stock`='0'\");\n\t$row_price = mysqli_fetch_array($get_price);\n\t$price= $row_price[\"product_price\"];\n\n\t//get the subtotal\n\t$sub_total=$price * $quantity;\n\n\treturn $sub_total;\n}", "function product_get_qty( $object, $field_name, $request ) {\n\treturn get_post_meta( $object[ 'id' ], 'product_qty', true );\n}", "public function getById(int $id);", "public function getCartItems($cart_id);", "static function getById($id)\n {\n global $objDatabase;\n\n if (!$id) return NULL;\n $arrSql = \\Text::getSqlSnippets(\n '`product`.`id`', FRONTEND_LANG_ID, 'Shop',\n array(\n 'name' => self::TEXT_NAME,\n 'short' => self::TEXT_SHORT,\n 'long' => self::TEXT_LONG,\n 'keys' => self::TEXT_KEYS,\n 'code' => self::TEXT_CODE,\n 'uri' => self::TEXT_URI,\n )\n );\n $query = \"\n SELECT `product`.`id`, `product`.`category_id`,\n `product`.`ord`, `product`.`active`, `product`.`weight`,\n `product`.`picture`,\n `product`.`normalprice`, `product`.`resellerprice`,\n `product`.`discountprice`, `product`.`discount_active`,\n `product`.`stock`, `product`.`stock_visible`,\n `product`.`distribution`,\n `product`.`date_start`, `product`.`date_end`,\n `product`.`manufacturer_id`,\n `product`.`b2b`, `product`.`b2c`,\n `product`.`vat_id`,\n `product`.`flags`,\n `product`.`usergroup_ids`,\n `product`.`group_id`, `product`.`article_id`, \n `product`.`minimum_order_quantity`, \".\n $arrSql['field'].\"\n FROM `\".DBPREFIX.\"module_shop\".MODULE_INDEX.\"_products` AS `product`\".\n $arrSql['join'].\"\n WHERE `product`.`id`=$id\";\n $objResult = $objDatabase->Execute($query);\n if (!$objResult) return self::errorHandler();\n if ($objResult->RecordCount() != 1) return false;\n $id = $objResult->fields['id'];\n $strCode = $objResult->fields['code'];\n if ($strCode === null) {\n $strCode = \\Text::getById($id, 'Shop', self::TEXT_CODE)->content();\n }\n $strName = $objResult->fields['name'];\n if ($strName === null) {\n $strName = \\Text::getById($id, 'Shop', self::TEXT_NAME)->content();\n }\n $strShort = $objResult->fields['short'];\n if ($strShort === null) {\n $strShort = \\Text::getById($id, 'Shop', self::TEXT_SHORT)->content();\n }\n $strLong = $objResult->fields['long'];\n if ($strLong === null) {\n $strLong = \\Text::getById($id, 'Shop', self::TEXT_LONG)->content();\n }\n $strUri = $objResult->fields['uri'];\n if ($strUri === null) {\n $strUri = \\Text::getById($id, 'Shop', self::TEXT_URI)->content();\n }\n $strKeys = $objResult->fields['keys'];\n if ($strKeys === null) {\n $strKeys = \\Text::getById($id, 'Shop', self::TEXT_KEYS)->content();\n }\n $objProduct = new Product(\n $strCode,\n $objResult->fields['category_id'],\n $strName,\n $objResult->fields['distribution'],\n $objResult->fields['normalprice'],\n $objResult->fields['active'],\n $objResult->fields['ord'],\n $objResult->fields['weight'],\n $objResult->fields['id']\n );\n $objProduct->pictures = $objResult->fields['picture'];\n $objProduct->resellerprice = floatval($objResult->fields['resellerprice']);\n $objProduct->short = $strShort;\n $objProduct->long = $strLong;\n $objProduct->stock($objResult->fields['stock']);\n $objProduct->stock_visible($objResult->fields['stock_visible']);\n $objProduct->discountprice = floatval($objResult->fields['discountprice']);\n $objProduct->discount_active($objResult->fields['discount_active']);\n $objProduct->b2b($objResult->fields['b2b']);\n $objProduct->b2c($objResult->fields['b2c']);\n $objProduct->date_start($objResult->fields['date_start']);\n $objProduct->date_end($objResult->fields['date_end']);\n $objProduct->manufacturer_id = $objResult->fields['manufacturer_id'];\n $objProduct->uri = $strUri;\n $objProduct->vat_id = $objResult->fields['vat_id'];\n $objProduct->flags = $objResult->fields['flags'];\n $objProduct->usergroup_ids = $objResult->fields['usergroup_ids'];\n $objProduct->group_id = $objResult->fields['group_id'];\n $objProduct->article_id = $objResult->fields['article_id'];\n $objProduct->keywords = $strKeys;\n $objProduct->minimum_order_quantity = $objResult->fields['minimum_order_quantity'];\n // Fetch the Product Attribute relations\n $objProduct->arrRelations =\n Attributes::getRelationArray($objProduct->id);\n//die(\"dfhreh: \".$objProduct->category_id());\n return $objProduct;\n }", "public function get($cartId);" ]
[ "0.7270577", "0.7270577", "0.7270577", "0.71677047", "0.71677047", "0.7029132", "0.67282504", "0.66976964", "0.66912776", "0.6642932", "0.66297615", "0.6619629", "0.6563117", "0.65591985", "0.6401259", "0.6374267", "0.63473177", "0.63461494", "0.6324369", "0.631707", "0.62900877", "0.6267549", "0.6229229", "0.6226378", "0.6197572", "0.6196273", "0.6194672", "0.6187608", "0.61666006", "0.61623996", "0.6160567", "0.6147453", "0.6138476", "0.6112719", "0.6107078", "0.6106089", "0.6101354", "0.60744315", "0.6063626", "0.6053826", "0.6045036", "0.603356", "0.6027329", "0.6026921", "0.60229516", "0.60186833", "0.6017919", "0.59820664", "0.59814906", "0.59796304", "0.5968599", "0.5968599", "0.5968599", "0.5968599", "0.5968599", "0.5968599", "0.5968599", "0.5968599", "0.5968599", "0.5968599", "0.5968599", "0.5967745", "0.59656537", "0.5964854", "0.5949342", "0.59444857", "0.59433615", "0.5940504", "0.59383714", "0.5935924", "0.5934608", "0.5932418", "0.5913897", "0.59133077", "0.58989525", "0.5889418", "0.5884372", "0.58727336", "0.5864636", "0.58622104", "0.585947", "0.5855713", "0.58288294", "0.5819804", "0.5817722", "0.57930607", "0.57930607", "0.57897145", "0.5787201", "0.57816166", "0.5781083", "0.5771538", "0.57710296", "0.57677776", "0.5757537", "0.57485515", "0.5746031", "0.57355165", "0.5730104", "0.5729906", "0.5728585" ]
0.0
-1
Get Quantity after Quality Controll Pass by Delivery Order Detail ID
public function GetQTYPassbyID($delivery_order_detail_id) { return $this->GetDetailByID($delivery_order_detail_id)->qty_confirm; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function UpdateQCPass($delivery_order_detail_id)\n {\n $QC_pass_update_qty = $this->deliveryOrderDetail::where('warehouse_out_id', $delivery_order_detail_id)->pluck('qty_confirm')->toArray(); \n return $QC_pass_update_qty;\n }", "public function GetQTYByID($delivery_order_detail_id)\n {\n return $this->deliveryOrderDetail::find($delivery_order_detail_id)->qty;\n }", "public function getQty();", "public function getQty();", "public function getQuantity();", "public function getQuantity();", "public function getQuantity();", "private function getOrderQuantityForCsaProduct()\n {\n $orderQuantity = DB::table('order_date_item_links')\n ->leftJoin('order_items', 'order_items.id', '=', 'order_date_item_links.order_item_id')\n ->leftJoin('order_dates', 'order_dates.id', '=', 'order_date_item_links.order_date_id')\n ->select(['order_dates.date', DB::raw('COUNT(order_date_item_links.quantity) AS quantity')])\n ->where('order_items.product_id', $this->getProduct()->id)\n ->groupBy('order_dates.date')\n ->orderBy('quantity', 'desc')\n ->pluck('quantity')\n ->first();\n\n return $orderQuantity;\n }", "public function getDeliveryOrder();", "public function getCheckoutPurchaseOrderNo();", "public function getTotalDeliveredQuantity()\n {\n return $this->totalDeliveredQuantity;\n }", "public function calculateQtyToShip();", "function getOrderPurchaseDetails($order_id)\n\t\t{\n\t\t\t//get order details\n\t\t\t$orders = $this->_BLL_obj->manage_content->getValue_where('order_info', '*', 'order_id', $order_id);\n\t\t\t$user_id = $orders[0]['user_id'];\n\t\t\t//get product details from order id\n\t\t\t$order_details = $this->_BLL_obj->manage_content->getValue_where('product_inventory_info', '*', 'order_id', $order_id);\n\t\t\tif(!empty($order_details[0]))\n\t\t\t{\n\t\t\t\t//total_overridng fee distributed\n\t\t\t\t$dis_over = 0;\n\t\t\t\t$user_level = 0;\n\t\t\t\t\n\t\t\t\tforeach($order_details as $order)\n\t\t\t\t{\n\t\t\t\t\t/* code for distribute overriding fee */\n\t\t\t\t\t//get transaction id for overriding fee\n\t\t\t\t\t$over_id = uniqid('trans');\n\t\t\t\t\t//calling overriding fee function\n\t\t\t\t\t$distributed_overriding = $this->distributeOverridingFee($user_id, $order['price'], $dis_over, $user_level, $over_id,$order_id);\n\t\t\t\t\tif($distributed_overriding != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t//insert values to fee transaction info table\n\t\t\t\t\t\t$insert_over = $this->_BLL_obj->manage_content->insertValue('fee_transaction_info', array('transaction_id','order_id','product_id','fee_type'), array($over_id,$order_id,$order['product_id'],'OF'));\n\t\t\t\t\t\t//new system value\n\t\t\t\t\t\t$new_system_value = $this->getSystemMoneyValue() - $distributed_overriding;\n\t\t\t\t\t\t//insert distributed amount to system money info\n\t\t\t\t\t\t$insert_dist_amount = $this->_BLL_obj->manage_content->insertValue('system_money_info', array('specification','debit','system_balance'), array($over_id,$distributed_overriding,$new_system_value));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t/* code for personal commision calculation */\n\t\t\t\t\t//get transaction id for personal comm calculation\n\t\t\t\t\t$per_id = uniqid('trans');\n\t\t\t\t\t//calling personal commision function\n\t\t\t\t\t$per_comm = $this->calculatePersonalCommision($user_id, $order['price'], $per_id,$order_id);\n\t\t\t\t\t//checking for non empty personal commision\n\t\t\t\t\tif($per_comm != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t//insert values to fee transaction info table\n\t\t\t\t\t\t$insert_personal = $this->_BLL_obj->manage_content->insertValue('fee_transaction_info', array('transaction_id','order_id','product_id','fee_type'), array($per_id,$order_id,$order['product_id'],'PC'));\n\t\t\t\t\t\t//new system value\n\t\t\t\t\t\t$new_system_value_per = $this->getSystemMoneyValue() - $per_comm;\n\t\t\t\t\t\t//insert distributed amount to system money info\n\t\t\t\t\t\t$insert_per_amount = $this->_BLL_obj->manage_content->insertValue('system_money_info', array('specification','debit','system_balance'), array($per_id,$per_comm,$new_system_value_per));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t/* code for point value calculation */\n\t\t\t\t\t//get transaction id for point value distribution\n\t\t\t\t\t$pv_id = uniqid('trans');\n\t\t\t\t\t//get product details\n\t\t\t\t\t$product_details = $this->_BLL_obj->manage_content->getValue_where('product_info', '*', 'product_id', $order['product_id']);\n\t\t\t\t\t//total point value\n\t\t\t\t\t$total_pv = $product_details[0]['point_value'] * $order['quantity'];\n\t\t\t\t\t//insert values to fee transaction info table\n\t\t\t\t\t$insert_point = $this->_BLL_obj->manage_content->insertValue('fee_transaction_info', array('transaction_id','order_id','product_id','fee_type'), array($pv_id,$order_id,$order['product_id'],'PV'));\n\t\t\t\t\t//insert pv to system\n\t\t\t\t\t$system_pv = $this->insertSystemPV($pv_id, $total_pv);\n\t\t\t\t\t//calling point value distributive function\n\t\t\t\t\t$this->distributePointValue($user_id, $total_pv, $pv_id, $order_id);\n\t\t\t\t\t\n\t\t\t\t\t/* code for member level upgradation of user and their parent */\n\t\t\t\t\t//calling fucntion for it\n\t\t\t\t\t$this->checkingLevelOfUserAndParent($user_id);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function get_quantity(){\n\t\treturn $this->quantity;\n\t}", "public function getQuantity()\n {\n return $this->quantity;\n }", "public function getQuantity() \n {\n return $this->_fields['Quantity']['FieldValue'];\n }", "public function getTotalQtyOrdered();", "public function getQuantity()\n\t{\n\t\treturn $this->getKeyValue('quantity'); \n\n\t}", "public function getQuantity()\n {\n return $this->quantity;\n }", "public function getQuantity(){\n return $this->quantity;\n }", "function getDeliveryByOrderId($order_id) {\n\t\t\n\t\t$list = $this->getDeliveryListByOrderId($order_id);\n\t\t\n\t\t$delivery = $list[0];\n\t\t$delivery['value'] = $delivery['value_net'] + $delivery['vat'];\n\t\t\n\t\treturn $delivery;\n\t}", "public function getQty()\r\n {\r\n return $this->qty;\r\n }", "public function getFabricQuantity() {\r\n \r\n return doubleVal($this->quantity / 100);\r\n }", "public function getMultipleOrderQuantity()\n {\n return $this->multipleOrderQuantity;\n }", "public function getQty()\n {\n return $this->qty;\n }", "public function getQuantity()\n {\n return $this->quantity;\n }", "public function getQuantity()\n {\n return $this->quantity;\n }", "public function getQuantity()\n {\n return $this->quantity;\n }", "public function getQuantity()\n {\n return $this->quantity;\n }", "public function getQuantity()\n {\n return $this->quantity;\n }", "public function getQuantity()\n {\n return $this->quantity;\n }", "public function getQuantity()\n {\n return $this->quantity;\n }", "public function getQuantity()\n {\n return $this->quantity;\n }", "public function getQuantity()\n {\n return $this->quantity;\n }", "public function getQuantity()\n {\n return $this->quantity;\n }", "public function getQuantity()\n {\n return $this->quantity;\n }", "public function getQuantity(): ?int;", "public function getQuantity()\n {\n return $this->_quantity;\n }", "protected function _getProductQtd()\n {\n if ($this->has('id')) {\n $orderDetailsTable = TableRegistry::get('OrderDetails');\n $order_details = $orderDetailsTable->find()->where(['order_id' => $this->id])->count();\n return $order_details;\n }\n }", "public function getQuantity(): float;", "public function getProductQuantity()\n {\n }", "function getQuotationItems($qid)\n {\n $where = \"id='\".$qid.\"'\";\n $result = $this->dList($where);\n $itemArr = $this->getValues($result[0][4],$this->logUser);\n\t$cusItemArr = $this->toArray($result[0][4]);\n\t$n=0;$this->grandTotal=0;$this->itemData='';\n\tforeach ($itemArr as &$value) {\n\t\t$arr[$n][0] = $value[0];\n\t\t$arr[$n][0]['cp'] = $cusItemArr[$value[0]['id']]['cp'];\n\t\t$arr[$n][0]['order'] = $cusItemArr[$value[0]['id']]['order'];\n\t\t$this->itemData[$value[0]['id']]['cp']=$arr[$n][0]['cp'] ;\n\t\tif($cusItemArr[$value[0]['id']]['cp'] && $arr[$n][0]['qty']){\n\t\t\n\t\t$arr[$n][0]['totle'] = $cusItemArr[$value[0]['id']]['cp'] * $arr[$n][0]['qty'];\n\t\t }elseif($cusItemArr[$value[0]['id']]['cp'])\n\t\t {\n\t\t\t $arr[$n][0]['totle'] = $cusItemArr[$value[0]['id']]['cp'];\n\t\t }else\n\t\t {\n\t\t\t switch($arr[$n][0]['type']){\n\t\t\t\tcase\"M\": {\n\t\t\t $arr[$n][0]['totle'] = ($arr[$n][0]['qty'])? $arr[$n][0][6] * $arr[$n][0]['qty'] : $arr[$n][0][6];\n\t\t\t\t} break;\n\t\t\t\tcase\"S\":{\n\t\t\t $arr[$n][0]['totle'] = ($arr[$n][0]['qty']) ? $arr[$n][0][10] * $arr[$n][0]['qty'] : $arr[$n][0][10];\n\t\t\t\t}break;\n\t\t\t\tcase\"C\":{\n\t\t\t $arr[$n][0]['totle'] = ($arr[$n][0]['qty']) ? $arr[$n][0][10] * $arr[$n][0]['qty'] : $arr[$n][0][10];\n\t\t\t\t}break;\n\t\t\t }\n\t\t }\n\t\t$this->grandTotal+=$arr[$n][0]['totle'];\n\t\t$n++;\n\t}\n\n if(!empty($arr))\n {usort($arr, array(\"Quotation\", \"compare\"));}\n\n\t return $arr;\n }", "public function getDeliveryNumber() {\n return $this->params[\"original\"][\"delivery_number\"];\n }", "public function getQuantity()\n {\n $channelInventorySourceIds = $this->channel->inventory_sources->where('status', 1)->pluck('id');\n\n $qty = 0;\n\n foreach ($this->product->inventories as $inventory) {\n if (is_numeric($channelInventorySourceIds->search($inventory->inventory_source_id))) {\n $qty += $inventory->qty;\n }\n }\n\n $orderedInventory = $this->product->ordered_inventories\n ->where('channel_id', $this->channel->id)->first();\n\n if ($orderedInventory) {\n $qty -= $orderedInventory->qty;\n }\n\n return $qty;\n }", "public function getQuantity()\n {\n return isset($this->quantity) ? $this->quantity : null;\n }", "public function getQuantity()\n {\n return parent::getQuantity();\n }", "public function getOrderDetailId()\n {\n return $this->order_detail_id;\n }", "public function getPurchaseOrderNumber();", "public function getQuantity($id)\n {\n $quantity = DB::table('Order_Transaction')\n ->where('item_id', $this->id)\n ->sum('item_quantity_change');\n return $quantity;\n }", "abstract public function getOriginalQty();", "public function getQty()\n\t{\n\t\treturn $this->qty;\n\t}", "public function getQuantity(): int\n {\n return $this->quantity;\n }", "function getShippingByOrder($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_shipping'\");\n\t\t$shiptot = 0;\n\t\twhile($rst_arr = tep_db_fetch_array($sel_ord_query)) {\n\t\t\t$shiptot += $rst_arr[\"value\"];\n\t\t}\n\t\treturn $shiptot;\n\t}", "public function getQuantity()\n {\n return $this->quantity;\n }", "function getQuantityOfSpecificProdCodeCart($currentProdCode){\n \n foreach($_SESSION['cortTable'] as $currentProduct){\n \n if ($currentProduct['prodCode'] == $currentProdCode and $currentProduct['deleted'] == false) {\n \n return $currentProduct['quantity'];\n }\n }\n return 0;\n }", "function getReceived(){\n $total = 0;\n $all = $this->product->include_join_fields()->get()->all;\n foreach ($all as $product){\n \n $total+= $product->join_qty;\n \n }\n return $total;\n }", "public function getQuantityByUnit()\n {\n return $this->quantity_by_unit;\n }", "public function getOrderNumber();", "public function getOrderNumber();", "public function getQuantity(): int|null;", "public static function getTotalValueOfOrder()\n {\n \ttry\n \t{\n\t \t$storage = My_Zend_Globals::getStorage();\n\t \n\t \t$table = self::_TABLE_PRODUCT_ORDER_DETAIL;\n\t \n\t \t//Query data from database\n\t \t$select = $storage->select()\n\t\t\t\t\t \t->from($table,'sum(amount_total)')\n\t\t\t\t\t \t->where('order_status = ?', 2);\n\t \t \n\t \t$total = $storage->fetchCol($select);\n\t \t \n\t \t$total = intval($total['total']);\n\t \t\n\t \treturn $total;\n \t}\n \tcatch(Exception $e)\n \t{\n \t\treturn false;\n \t}\t \t\n }", "public function getOrderDetail()\n {\n return $this->orderDetail;\n }", "public function orderDeliverySuccess($id){\n $products = Orderdetail::where('order_id',$id)->get();\n foreach ($products as $product){\n Product::where('id', $product->product_id)->update([\n 'product_quantity' => DB::raw('product_quantity-'.$product->qty)\n ]);\n }\n\n $deliverySuccess = Order::findOrFail($id);\n $deliverySuccess->status = 3;\n $deliverySuccess->save();\n\n Toastr::success('Order delivery done');\n return redirect()->route('delivered.order');\n\n }", "function getDetailTotal($journalId) {\n $sql = null;\n $total = 0;\n if ($this->getVendor() == self::MYSQL) {\n $sql = \"\n SELECT (`journalDetail`.`journalDetailAmount` * `exchange`.`exchangeRate`) AS `total`\n FROM `journalDetail`\n JOIN `exchange`\n USING (`companyId`,`currencyId`)\n WHERE `journalDetail`.`companyId` = '\" . $this->getCompanyId() . \"'\n AND `journalDetail`.`journalId` = '\" . $journalId . \"'\n AND `journalDetail`.`isActive` = 1\";\n } else\n if ($this->getVendor() == self::MSSQL) {\n $sql = \"\n SELECT ([journalDetail].[journalDetailAmount] * [exchange].[exchangeRate]) AS [total]\n FROM [journalDetail]\n JOIN [exchange]\n AND [journalDetail].[companyId] = [exchange].[companyId]\n AND [journalDetail].[countryId] = [exchange].[countryId]\n WHERE [journalDetail].[companyId] = '\" . $this->getCompanyId() . \"'\n AND [journalDetail].[journalId] = '\" . $journalId . \"'\";\n } else\n if ($this->getVendor() == self::ORACLE) {\n $sql = \"\n SELECT (JOURNALDETAIL.JOURNALDETAILAMOUNT * EXCHANGE.EXCHANGERATE) AS total\n FROM JOURNALDETAIL\n JOIN EXCHANGE\n ON JOURNALDETAIL.COMPANYID = EXCHANGE.COMPANYID\n AND JOURNALDETAIL.COUNTRYID = EXCHANGE.COUNTRYID\n WHERE JOURNALDETAIL.COMPANYID ='\" . $this->getCompanyId() . \"'\n AND JOURNALDETAIL.JOURNALID ='\" . $journalId . \"'\";\n }\n\n try {\n $result = $this->q->fast($sql);\n } catch (\\Exception $e) {\n $this->q->rollback();\n echo json_encode(array(\"success\" => false, \"message\" => $e->getMessage()));\n exit();\n }\n if ($result) {\n if ($this->q->numberRows($result, $sql) > 0) {\n $row = $this->q->fetchArray($result);\n $total = $row['total'];\n }\n }\n return $total;\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 }", "function getGstByOrder($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_gst_total'\");\n\t\t$gsttot = 0;\n\t\twhile($rst_arr = tep_db_fetch_array($sel_ord_query)) {\n\t\t\t$gsttot += $rst_arr[\"value\"];\n\t\t}\n\t\treturn $gsttot;\n\t}", "public function getQuantityInCase() \n {\n return $this->_fields['QuantityInCase']['FieldValue'];\n }", "function getMembershipPurchaseDetails($order_id)\n\t\t{\n\t\t\t//get order details\n\t\t\t$order_details = $this->_BLL_obj->manage_content->getValue_where('membership_order_info', '*', 'membership_order_id', $order_id);\n\t\t\t$user_id = $order_details[0]['user_id'];\n\t\t\t//get user parent\n\t\t\t$user_mlm = $this->_BLL_obj->manage_content->getValue_where('user_mlm_info','*', 'user_id', $user_id);\n\t\t\tif(!empty($user_mlm[0]['parent_id']))\n\t\t\t{\n\t\t\t\t//get parent details\n\t\t\t\t$parent_mlm = $this->_BLL_obj->manage_content->getValueMultipleCondtn('user_mlm_info','*', array('id'), array($user_mlm[0]['parent_id']));\n\t\t\t\tif($parent_mlm[0]['member_level'] != 0)\n\t\t\t\t{\n\t\t\t\t\t//get transaction id for referral fee distribution\n\t\t\t\t\t$ref_id = uniqid('trans');\n\t\t\t\t\t//calling referral fee distribution function\n\t\t\t\t\t$ref_fee = $this->calculateReferralFee($parent_mlm[0]['user_id'], $order_details, $ref_id);\n\t\t\t\t\tif($ref_fee != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t//insert values to fee transaction info table\n\t\t\t\t\t\t$insert_referral = $this->_BLL_obj->manage_content->insertValue('fee_transaction_info', array('transaction_id','order_id','product_id','fee_type'), array($ref_id,$order_details[0]['membership_order_id'],$order_details[0]['membership_id'],'RF'));\n\t\t\t\t\t\t//new system value\n\t\t\t\t\t\t$new_system_value_per = $this->getSystemMoneyValue() - $ref_fee;\n\t\t\t\t\t\t//insert distributed amount to system money info\n\t\t\t\t\t\t$insert_per_amount = $this->_BLL_obj->manage_content->insertValue('system_money_info', array('specification','debit','system_balance'), array($ref_id,$ref_fee,$new_system_value_per));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}", "function get_deals_subtotal( $_deals, $quantity ) {\n\t\t\tglobal $cmdeals;\n\t\t\t\n\t\t\t$price \t\t\t= $_deals->get_sale();\n\t\t\t\t\t\t\t\n $row_price \t\t= $price * $quantity;\n $return = cmdeals_price( $row_price );\n\t\t\t\n\t\t\treturn $return; \n\t\t\t\n\t\t}", "private function updatePurchasesDetailQuantity()\n {\n\t\t $query=\"update purchasedetail set remaining = purchasedetail.quantity - ( select IFNULL(sum(quantity),0) FROM orderdetail where orderdetail.purchasedetailid =purchasedetail.purchasedetailid)\";\n //echo $query; \n\n\t\t error_log($query);\n\t\t $r = $this->mysqli->query($query) or die($this->mysqli->error.__LINE__);\n\n\n\t\t // $query = \"update product set inventory = IFNULL(( (select sum(quantity) as sumquantity from purchasedetail where productcode=product.productcode) ) - (SELECT sum(quantity) as totalvalue FROM orderdetail WHERE purchasedetailid in ( select purchasedetailid from purchasedetail where productcode=product.productcode)),0)\";\n\n$query = \"update product set inventory = (IFNULL((select sum(quantity) as sumquantity from purchasedetail where productcode=product.productcode),0)) - (IFNULL((SELECT sum(quantity) as totalvalue FROM orderdetail WHERE purchasedetailid in ( select purchasedetailid from purchasedetail where productcode=product.productcode)),0))\";\n //echo $query; \n\t\t error_log($query);\n\t\t $r = $this->mysqli->query($query) or die($this->mysqli->error.__LINE__);\n\n\n }", "public function view_order_details($order_id)\n\t{\n $log=new Log(\"OrderDetailsRCV.log\");\n $query = $this->db->query(\"SELECT oc_po_order.*,\".DB_PREFIX.\"user.firstname,\".DB_PREFIX.\"user.lastname\n\t\t\t\tFROM oc_po_order\n\t\t\t\t\tLEFT JOIN \".DB_PREFIX.\"user\n\t\t\t\t\t\tON \".DB_PREFIX.\"user.user_id = oc_po_order.user_id\n\t\t\t\t\t\t\tWHERE id = \" . $order_id . \" AND delete_bit = \" . 1);\n $log->write($query);\n $order_info = $query->row;\n\t\t//ON (oc_po_receive_details.product_id = oc_po_product.id)\n\t\t$query = $this->db->query(\"SELECT\n\t\toc_po_product.*,oc_po_receive_details.quantity as rd_quantity,oc_po_receive_details.price,oc_po_supplier.first_name,oc_po_supplier.last_name,oc_po_supplier.id as supplier_id,oc_po_receive_details.order_id\n\t\tFROM\n\t\t\toc_po_receive_details\n\t\tINNER JOIN oc_po_product \n\t\t\tON (oc_po_receive_details.order_id = oc_po_product.order_id)\n\t\tLEFT JOIN oc_po_supplier \n\t\t\tON (oc_po_receive_details.supplier_id = oc_po_supplier.id)\n\t\t\t\tWHERE (oc_po_receive_details.order_id =\".$order_id.\")\");\n $log->write($query);\n\tif($this->db->countAffected() > 0)\n\t{\n\t\t$products = $query->rows;\n\t\t$quantities = array();\n\t\t$all_quantities = array();\n\t\t$prices = array();\n\t\t$all_prices = array();\n\t\t$suppliers = array();\n\t\t$all_suppliers = array();\n\t\t$supplier_names = array();\n\t\t$all_supplier_names = array();\n\t\t$index = 0;\n\t\t$index1 = 0;\n\t\tfor($i =0; $i<count($products); $i++)\n\t\t{\n\t\t\tif($products[$i] != \"\")\n\t\t\t{\n\t\t\t\tfor($j = 0; $j<count($products); $j++)\n\t\t\t\t{\n\t\t\t\t\tif($products[$j] != \"\")\n\t\t\t\t\t{\n\t\t\t\t\t\tif($products[$i]['id'] == $products[$j]['id'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$quantities[$index] = $products[$j]['rd_quantity'];\n\t\t\t\t\t\t\t$supplier_names[$index] = $products[$j]['first_name'] .\" \". $products[$j]['last_name'];\n\t\t\t\t\t\t\t$suppliers[$index] = $products[$j]['supplier_id'];\n\t\t\t\t\t\t\t$prices[$index] = $products[$j]['price'];\n\t\t\t\t\t\t\tif($j!=$i)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$products[$j] = \"\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$index++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$index = 0;\n\t\t\t\t$all_quantities[$index1] = $quantities;\n\t\t\t\t$all_suppliers[$index1] = $suppliers;\n\t\t\t\t$all_prices[$index1] = $prices;\n\t\t\t\t$all_supplier_names[$index1] = $supplier_names;\n\t\t\t\tunset($quantities);\n\t\t\t\tunset($suppliers);\n\t\t\t\tunset($prices);\n\t\t\t\tunset($supplier_names);\n\t\t\t\t$quantities = array();\n\t\t\t\t$suppliers = array();\n\t\t\t\t$prices = array();\n\t\t\t\t$supplier_names = array();\n\t\t\t\t$index1++;\n\t\t\t}\n\t\t}\n\t\t$products = array_values(array_filter($products));\n\t\tfor($i = 0; $i<count($products); $i++)\n\t\t{\n\t\t\tunset($products[$i]['rd_quantity']);\n\t\t\tunset($products[$i]['first_name']);\n\t\t\tunset($products[$i]['last_name']);\n\t\t\t$products[$i]['quantities'] = $all_quantities[$i];\n\t\t\t$products[$i]['suppliers'] = $all_suppliers[$i];\n\t\t\t$products[$i]['prices'] = $all_prices[$i];\n\t\t\t$products[$i]['supplier_names'] = $all_supplier_names[$i];\n\t\t}\n\t}\n\telse\n\t{\n\t\t$query = $this->db->query(\"SELECT * FROM oc_po_product WHERE order_id = \" . $order_info['id']);\n\t\t$products = $query->rows;\n\t}\n\t\t$i = 0;\n\t\tforeach($products as $product)\n\t\t{\n\t\t\t$query = $this->db->query(\"SELECT * FROM oc_po_attribute_group WHERE product_id = \". $product['id']);\n\t\t\t$attribute_groups[$i] = $query->rows;\n\t\t\t$i++;\n\t\t}\n\t\t\n\t\t$i = 0;\n\t\tforeach($attribute_groups as $attribute_group)\n\t\t{\n\t\t\tfor($j = 0; $j<count($attribute_group);$j++)\n\t\t\t{\n\t\t\t\t$query = $this->db->query(\"SELECT * FROM oc_po_attribute_category WHERE attribute_group_id = \". $attribute_group[$j]['id']);\n\t\t\t\t$attribute_categories[$i] = $query->row;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\t\tfor($i=0;$i<count($products); $i++)\n\t\t{\n\t\t\tfor($j=0; $j<count($attribute_groups[$i]);$j++)\n\t\t\t{\n\t\t\t\t$products[$i]['attribute_groups'][$j] = $attribute_groups[$i][$j]['name'];\n\t\t\t}\n\t\t}\n\t\t$start_loop = 0;\n\t\t//$attribute_categories = array_values(array_filter($attribute_categories));\n\t\t//print_r($attribute_categories);\n\t\t//exit;\n\t\tfor($i=0; $i<count($products); $i++)\n\t\t{\n\t\t\tfor($j=$start_loop; $j<($start_loop + count($products[$i]['attribute_groups']));$j++)\n\t\t\t{\n\t\t\t\t$products[$i]['attribute_category'][$j] = $attribute_categories[$j]['name'];\n\t\t\t}\n\t\t\t$start_loop = $j;\n\t\t}\n\t\t$order_information['products'] = $products;\n\t\t$order_information['order_info'] = $order_info;\n\t\treturn $order_information;\n\t}", "public function get_qty() {\n\t\treturn get_post_meta( $this->get_id(), 'qty', true );\n\t}", "public function get_addon_delivery($id)\n {\n $this->db->select('this_delivery, product_code, description, unit_price');\n $this->db->from('sales_order_medication_deliveries');\n $this->db->where(['delivery_id' => $id]);\n $this->db->join('sales_order_medications', 'sales_order_medications.id = medication_order_item_id');\n $this->db->join('inventory_medications', 'inventory_medications.id = medication_id');\n return $this->db->get()->result_array();\n }", "function getOrderDetails($id)\n {\n }", "public function getAdditionalBundleQty($args)\n {\n $repo = $this->entityManager->getRepository('ZSELEX_Entity_Bundle');\n $qty = $args ['qty'];\n $type = $args ['type'];\n $shop_id = $args ['shop_id'];\n\n $additional = $repo->getAll(array(\n 'entity' => 'ZSELEX_Entity_ServiceBundle',\n 'where' => array(\n 'a.bundle_type' => 'additional',\n 'a.shop' => $shop_id\n ),\n 'joins' => array(\n 'JOIN a.bundle b'\n ),\n 'fields' => array(\n 'a.quantity',\n 'b.bundle_id'\n )\n ));\n\n // echo \"<pre>\"; print_r($additional); echo \"</pre>\"; exit;\n // $qty = 0;\n if ($additional) {\n foreach ($additional as $key) {\n\n $additional_qty = $repo->get(array(\n 'entity' => 'ZSELEX_Entity_BundleItem',\n 'where' => array(\n 'a.servicetype' => $type,\n 'a.bundle' => $key ['bundle_id']\n ),\n 'fields' => array(\n 'a.qty',\n 'a.qty_based'\n )\n ));\n //echo \"<pre>\"; print_r($additional_qty); echo \"</pre>\"; exit;\n // if ($additional_qty) {\n if ($additional_qty && $additional_qty ['qty_based']) {\n $qty += $additional_qty ['qty'] * $key ['quantity'];\n }\n }\n }\n\n //echo \"qty :\".$qty; exit;\n\n return $qty;\n }", "public function quantity()\n {\n $quantity = DB::table('Order_Transaction')\n ->where('item_id', $this->id)\n ->sum('item_quantity_change');\n return $quantity;\n }", "public function testGetOrderDetail(){\n \t\n \tPayU::$apiLogin = PayUTestUtil::API_LOGIN;\n \tPayU::$apiKey = PayUTestUtil::API_KEY;\n \t\n \tEnvironment::setReportsCustomUrl(PayUTestUtil::REPORTS_CUSTOM_URL);\n \t\n \n \t$authorizationResponse = PayUTestUtil::processTransaction(TransactionType::AUTHORIZATION_AND_CAPTURE, '*');\n \t\n \t$parameters = array(\n \t\t\tPayUParameters::ORDER_ID => $authorizationResponse->transactionResponse->orderId,\n \t);\n \t\n \t$response = PayUReports::getOrderDetail($parameters);\n \t\n \t$this->assertNotNull($response);\n \t$this->assertEquals($authorizationResponse->transactionResponse->orderId, $response->id);\n \t \n }", "public function recuperaQTY()\n {\n $results = $this->client->FERecuperaQTYRequest(\n array('argAuth'=>array('Token' => $this->TA->credentials->token,\n 'Sign' => $this->TA->credentials->sign,\n 'cuit' => self::CUIT)));\n \n $e = $this->_checkErrors($results, 'FERecuperaQTYRequest');\n \n return $e == false ? $results->FERecuperaQTYRequestResult->qty->value : false;\n }", "function getSubtotalByOrder($orders_id) {\n\t\t$sel_subtotal_query = tep_db_query(\"SELECT value FROM \" . TABLE_ORDERS_TOTAL . \" WHERE orders_id = '\".$orders_id.\"' AND class = 'ot_subtotal'\");\t\t\n\t\t$rst_sub = tep_db_fetch_array($sel_subtotal_query);\t\n\t\tif(tep_db_num_rows($sel_subtotal_query)>0) {\n\t\t\treturn $rst_sub[\"value\"];\n\t\t} else {\n\t\t\t$sel_grand_query = tep_db_query(\"SELECT value FROM \" . TABLE_ORDERS_TOTAL . \" WHERE orders_id = '\".$orders_id.\"' AND class = 'ot_grand_subtotal'\");\t\t\n\t\t\t$rst_grand = tep_db_fetch_array($sel_grand_query);\t\n\t\t\tif(tep_db_num_rows($sel_grand_query)>0) {\n\t\t\t\treturn $rst_grand[\"value\"];\n\t\t\t}\n\t\t}\n\t}", "public function getReturnedQty()\n {\n return $this->returned_qty;\n }", "private function getInvoiceAmount()\n {\n $sql = 'SELECT invoice_amount FROM s_order WHERE id = ?';\n\n return Shopware()->Db()->fetchOne($sql, ['15315351']);\n }", "public static function GetQuantity($INVOICEDID,$incomingInvTyp)\r\n\t{\r\n\t\t$Query = \"SELECT qty FROM incominginventory WHERE incoming_inventory_id = $INVOICEDID\";\r\n \r\n //comment by gajendra\r\n //~ if($incomingInvTyp == \"E\")\r\n //~ {\r\n //~ $Query = \"SELECT ExciseQty FROM incominginventory WHERE entryDId = $INVOICEDID\";\r\n //~ }\r\n //~ else if($incomingInvTyp == \"N\")\r\n //~ {\r\n //~ $Query = \"SELECT NonExciseQty FROM incominginventory WHERE entryDId = $INVOICEDID\";\r\n //~ }\r\n //echo $Query;\r\n //end\r\n $Result = DBConnection::SelectQuery($Query);\r\n $Row = mysql_fetch_array($Result, MYSQL_ASSOC);\r\n $Qty = empty($Row['qty'])?'0':$Row['qty'];\r\n //comment by gajendra\r\n //~ if($incomingInvTyp == \"E\")\r\n //~ {\r\n //~ $Qty = $Row['ExciseQty'];\r\n //~ }\r\n //~ else if($incomingInvTyp == \"N\")\r\n //~ {\r\n //~ $Qty = $Row['NonExciseQty'];\r\n //~ }\r\n //end\r\n return $Qty;\r\n\t}", "function wv_commission_get_order_item_record($oid) {\n\n global $wpdb;\n $sql_order_itemid = \"SELECT DISTINCT WOIM.order_item_id FROM `\" . $wpdb->prefix . \"woocommerce_order_items` AS WOI INNER JOIN `\" . $wpdb->prefix . \"woocommerce_order_itemmeta` AS WOIM ON WOI.order_item_id = WOIM.order_item_id WHERE WOI.order_item_type = 'line_item' AND WOI.order_id =$oid\";\n $arr_order_itemid = $wpdb->get_results($sql_order_itemid);\n\n if (count($arr_order_itemid) > 0) {\n $i = 1;\n foreach ($arr_order_itemid as $item) {\n\n $order_item_id = $item->order_item_id;\n $productid = $this->wv_commission_get_woo_orderitem_metavalue($order_item_id, '_product_id');\n //output HTML here.\n ?>\n <tr>\n <!-- \n In case of more than 1 item, order id should show only one times : use= rowspan :\n --> \n <?php if ($i == 1) { ?>\n <td rowSpan=\"<?php echo count($arr_order_itemid); ?>\" >#<?php echo $oid; ?></td>\n <?php } ++$i; ?>\n <!-- order date -->\n <td><?php echo get_post_time(\"dM,Y\", FALSE, $oid); ?></td>\n \n <!-- product id -->\n <td><?php echo get_the_title($productid); ?></td>\n \n <!-- vendor -->\n <td><?php echo $this->wv_get_username_by_userid(get_post_meta($oid, 'woo_order_vendor_id_' . $productid, TRUE)); ?></td>\n \n <!-- commission --> \n <td>\n <?php\n echo get_woocommerce_currency_symbol(). get_post_meta($oid, 'woo_order_commision_' . $productid, TRUE);\n ?>\n </td>\n \n <!-- Status -->\n <td>\n <?php \n //change status functionality\n $sts = $this->wv_get_commission_status($oid,$productid);\n $newsts= ($sts==1)?0:1;\n ?>\n <a title=\"Change Status\" href=\"<?php echo admin_url(\"admin.php?page=woo_vendors&tab=commission&action=sts&oid=$oid&pid=$productid&sts=$newsts\"); ?>\" onclick=\"return confirm('Are you sure want to change status ?');\">\n <?php \n echo $newsts= ($sts==1)?\"paid\":\"due\";;\n ?>\n </a> \n </td>\n \n <!-- Commission Date -->\n <td>\n <?php \n //get commission date\n echo $this->wv_get_commission_date($oid,$productid);\n ?> \n </td>\n </tr>\n <?php\n }\n }//end of the count.\n }", "public function SumItemPriceByDeliveryOrderID($delivery_order_id)\n {\n $price = $this->deliveryOrderDetail::where('warehouse_out_id', $delivery_order_id)->pluck('sub_total')->toArray(); \n $sum_price = array_sum($price);\n return $sum_price;\n }", "function line_demand_total($line_orders) {\n $line_demand_total = array_reduce(\n $line_orders,\n function ($sum, $line) {\n return $sum + intval($line[QUANTITY]);\n },\n 0);\n return $line_demand_total;\n}", "public function view_order_details_mo($order_id)\n\t{\n $log=new Log(\"OrderDetailsRcvMo.log\");\n\t\t$query = $this->db->query(\"SELECT oc_po_order.*,\".DB_PREFIX.\"user.firstname,\".DB_PREFIX.\"user.lastname\n\t\t\t\tFROM oc_po_order\n\t\t\t\t\tLEFT JOIN \".DB_PREFIX.\"user\n\t\t\t\t\t\tON \".DB_PREFIX.\"user.user_id = oc_po_order.user_id\n\t\t\t\t\t\t\tWHERE id = \" . $order_id . \" AND delete_bit = \" . 1);\n $log->write($query);\n\t\t$order_info = $query->row;\n\t\t//ON (oc_po_receive_details.product_id = oc_po_product.id)\n $allprod=\"SELECT\n\t\toc_po_product.*,oc_po_receive_details.quantity as rd_quantity,oc_po_receive_details.price,oc_po_supplier.first_name,oc_po_supplier.last_name,oc_po_supplier.id as supplier_id,oc_po_receive_details.order_id\n\t\tFROM\n\t\t\toc_po_receive_details\n\t\tINNER JOIN oc_po_product \n\t\t\tON (oc_po_receive_details.order_id = oc_po_product.order_id)\n\t\tLEFT JOIN oc_po_supplier \n\t\t\tON (oc_po_receive_details.supplier_id = oc_po_supplier.id)\n\t\t\t\tWHERE oc_po_product.item_status <> 0 AND (oc_po_receive_details.order_id =\".$order_id.\")\";\n\t\t$log->write($allprod);\n $query = $this->db->query($allprod);\n \n $log->write($query);\n\tif($this->db->countAffected() > 0)\n\t{\n\t\t$products = $query->rows;\n\t\t$quantities = array();\n\t\t$all_quantities = array();\n\t\t$prices = array();\n\t\t$all_prices = array();\n\t\t$suppliers = array();\n\t\t$all_suppliers = array();\n\t\t$supplier_names = array();\n\t\t$all_supplier_names = array();\n\t\t$index = 0;\n\t\t$index1 = 0;\n\t\tfor($i =0; $i<count($products); $i++)\n\t\t{\n\t\t\tif($products[$i] != \"\")\n\t\t\t{\n\t\t\t\tfor($j = 0; $j<count($products); $j++)\n\t\t\t\t{\n\t\t\t\t\tif($products[$j] != \"\")\n\t\t\t\t\t{\n\t\t\t\t\t\tif($products[$i]['id'] == $products[$j]['id'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$quantities[$index] = $products[$j]['rd_quantity'];\n\t\t\t\t\t\t\t$supplier_names[$index] = $products[$j]['first_name'] .\" \". $products[$j]['last_name'];\n\t\t\t\t\t\t\t$suppliers[$index] = $products[$j]['supplier_id'];\n\t\t\t\t\t\t\t$prices[$index] = $products[$j]['price'];\n\t\t\t\t\t\t\tif($j!=$i)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$products[$j] = \"\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$index++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$index = 0;\n\t\t\t\t$all_quantities[$index1] = $quantities;\n\t\t\t\t$all_suppliers[$index1] = $suppliers;\n\t\t\t\t$all_prices[$index1] = $prices;\n\t\t\t\t$all_supplier_names[$index1] = $supplier_names;\n\t\t\t\tunset($quantities);\n\t\t\t\tunset($suppliers);\n\t\t\t\tunset($prices);\n\t\t\t\tunset($supplier_names);\n\t\t\t\t$quantities = array();\n\t\t\t\t$suppliers = array();\n\t\t\t\t$prices = array();\n\t\t\t\t$supplier_names = array();\n\t\t\t\t$index1++;\n\t\t\t}\n\t\t}\n\t\t$products = array_values(array_filter($products));\n\t\tfor($i = 0; $i<count($products); $i++)\n\t\t{\n\t\t\tunset($products[$i]['rd_quantity']);\n\t\t\tunset($products[$i]['first_name']);\n\t\t\tunset($products[$i]['last_name']);\n\t\t\t$products[$i]['quantities'] = $all_quantities[$i];\n\t\t\t$products[$i]['suppliers'] = $all_suppliers[$i];\n\t\t\t$products[$i]['prices'] = $all_prices[$i];\n\t\t\t$products[$i]['supplier_names'] = $all_supplier_names[$i];\n\t\t}\n\t}\n\telse\n\t{\n\t\t$query = $this->db->query(\"SELECT * FROM oc_po_product WHERE order_id = \" . $order_info['id']);\n\t\t$products = $query->rows;\n\t}\n\t\t$i = 0;\n\t\tforeach($products as $product)\n\t\t{\n\t\t\t$query = $this->db->query(\"SELECT * FROM oc_po_attribute_group WHERE product_id = \". $product['id']);\n\t\t\t$attribute_groups[$i] = $query->rows;\n\t\t\t$i++;\n\t\t}\n\t\t\n\t\t$i = 0;\n\t\tforeach($attribute_groups as $attribute_group)\n\t\t{\n\t\t\tfor($j = 0; $j<count($attribute_group);$j++)\n\t\t\t{\n\t\t\t\t$query = $this->db->query(\"SELECT * FROM oc_po_attribute_category WHERE attribute_group_id = \". $attribute_group[$j]['id']);\n\t\t\t\t$attribute_categories[$i] = $query->row;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\t\tfor($i=0;$i<count($products); $i++)\n\t\t{\n\t\t\tfor($j=0; $j<count($attribute_groups[$i]);$j++)\n\t\t\t{\n\t\t\t\t$products[$i]['attribute_groups'][$j] = $attribute_groups[$i][$j]['name'];\n\t\t\t}\n\t\t}\n\t\t$start_loop = 0;\n\t\t//$attribute_categories = array_values(array_filter($attribute_categories));\n\t\t//print_r($attribute_categories);\n\t\t//exit;\n\t\tfor($i=0; $i<count($products); $i++)\n\t\t{\n\t\t\tfor($j=$start_loop; $j<($start_loop + count($products[$i]['attribute_groups']));$j++)\n\t\t\t{\n\t\t\t\t$products[$i]['attribute_category'][$j] = $attribute_categories[$j]['name'];\n\t\t\t}\n\t\t\t$start_loop = $j;\n\t\t}\n\t\t$order_information['products'] = $products;\n\t\t$order_information['order_info'] = $order_info;\n\t\treturn $order_information;\n\t}", "public function getInvoiceOrder();", "public function getQtyRefunded() {\n return $this->item->getQtyRefunded();\n }", "function get_sum_purchases($order_id){\r\n\tglobal $dbc;\r\n\t\r\n\t$query = 'SELECT COUNT(*) AS total '.\r\n\t\t\t 'FROM order_merch_item '.\r\n\t\t\t 'WHERE order_id = \\''. $order_id .'\\' '.\r\n\t\t\t 'AND purch_merch_id IS NOT NULL ;';\r\n\t\r\n\t$result = mysqli_query($dbc, $query);\r\n\tif(!$result){\r\n\t\tdie('Error - '. mysqli_errno($dbc));\r\n\t}\r\n\telse{\r\n\t\t$row = mysqli_fetch_object($result);\r\n\t\treturn $row->total;\r\n\t}\r\n\t\r\n}", "public function testGetOrderDetailWithInvalidId(){\n \t \n \tPayU::$apiLogin = PayUTestUtil::API_LOGIN;\n \tPayU::$apiKey = PayUTestUtil::API_KEY;\n \t \n \tEnvironment::setReportsCustomUrl(PayUTestUtil::REPORTS_CUSTOM_URL);\n \n \t$parameters = array(\n \t\t\tPayUParameters::ORDER_ID => '123111123',\n \t);\n \t \n \t$response = PayUReports::getOrderDetail($parameters);\n }", "public function beforeDeleteOrder(\\Enlight_Hook_HookArgs $arguments)\n {\n $request = $arguments->getSubject()->Request();\n $parameter = $request->getParams();\n $paymentMethods = \\Shopware_Plugins_Frontend_RpayRatePay_Bootstrap::getPaymentMethods();\n if (!in_array($parameter['payment'][0]['name'], $paymentMethods)) {\n return false;\n }\n $sql = 'SELECT COUNT(*) FROM `s_order_details` AS `detail` '\n . 'INNER JOIN `rpay_ratepay_order_positions` AS `position` '\n . 'ON `position`.`s_order_details_id` = `detail`.`id` '\n . 'WHERE `detail`.`orderID`=? AND '\n . '(`position`.`delivered` > 0 OR `position`.`cancelled` > 0 OR `position`.`returned` > 0)';\n $count = Shopware()->Db()->fetchOne($sql, [$parameter['id']]);\n if ($count > 0) {\n Logger::singleton()->warning('RatePAY-Bestellung k&ouml;nnen nicht gelöscht werden, wenn sie bereits bearbeitet worden sind.');\n $arguments->stop();\n } else {\n /** @var Order $order */\n $order = Shopware()->Models()->find('Shopware\\Models\\Order\\Order', $parameter['id']);\n\n $sqlShipping = 'SELECT invoice_shipping, invoice_shipping_net, invoice_shipping_tax_rate FROM s_order WHERE id = ?';\n $shippingCosts = Shopware()->Db()->fetchRow($sqlShipping, [$parameter['id']]);\n\n $items = [];\n $i = 0;\n /** @var Detail $item */\n foreach ($order->getDetails() as $item) {\n $items[$i]['articlename'] = $item->getArticlename();\n $items[$i]['orderDetailId'] = $item->getId();\n $items[$i]['ordernumber'] = $item->getArticlenumber();\n $items[$i]['quantity'] = $item->getQuantity();\n $items[$i]['priceNumeric'] = $item->getPrice();\n $items[$i]['tax_rate'] = $item->getTaxRate();\n $taxRate = $item->getTaxRate();\n\n // Shopware does have a bug - so the tax_rate might be the wrong value.\n // Issue: https://issues.shopware.com/issues/SW-24119\n $taxRate = $item->getTax() == null ? 0 : $taxRate; // this is a little fix\n $items[$i]['tax_rate'] = $taxRate;\n\n $i++;\n }\n $eventManager = Shopware()->Events();\n foreach($items as $index => $item) {\n $items[$index] = $eventManager->filter('RatePAY_filter_order_items', $item);\n }\n if (!empty($shippingCosts)) {\n $items['Shipping']['articlename'] = 'Shipping';\n $items['Shipping']['ordernumber'] = 'shipping';\n $items['Shipping']['quantity'] = 1;\n $items['Shipping']['priceNumeric'] = $shippingCosts['invoice_shipping'];\n\n // Shopware does have a bug - so the tax_rate might be the wrong value.\n // Issue: https://issues.shopware.com/issues/SW-24119\n // we can not simple calculate the shipping tax cause the values in the database are not properly rounded.\n // So we do not get the correct shipping tax rate if we calculate it.\n $calculatedTaxRate = Math::taxFromPrices(floatval($shippingCosts['invoice_shipping_net']), floatval($shippingCosts['invoice_shipping']));\n $shippingTaxRate = $calculatedTaxRate > 0 ? $shippingCosts['invoice_shipping_tax_rate'] : 0;\n\n $items['Shipping']['tax_rate'] = $shippingTaxRate;\n }\n\n $attributes = $order->getAttribute();\n $backend = (bool)($attributes->getRatepayBackend());\n\n $netPrices = $order->getNet() === 1;\n\n $modelFactory = new \\Shopware_Plugins_Frontend_RpayRatePay_Component_Mapper_ModelFactory(null, $backend, $netPrices, $order->getShop());\n $modelFactory->setTransactionId($parameter['transactionId']);\n $modelFactory->setTransactionId($order->getTransactionID());\n $operationData['orderId'] = $order->getId();\n $operationData['items'] = $items;\n $operationData['subtype'] = 'cancellation';\n $result = $modelFactory->callPaymentChange($operationData);\n\n if ($result !== true) {\n Logger::singleton()->warning('Bestellung k&ouml;nnte nicht gelöscht werden, da die Stornierung bei RatePAY fehlgeschlagen ist.');\n $arguments->stop();\n }\n }\n }", "public function recievequantity(Request $request)\n {\n //status = 2(recived purchase request)\n \n Purchaserecord::where('id', '=', $request->requestid)\n ->update(['status' => 2, 'recievedate' => $request->recievedate, 'recievequantity' => $request->recievequantity]);\n $dataPurchaserecord = Purchaserecord::where('id', '=', $request->requestid)->take(1)->get();\n //dd($dataPurchaserecord);\n foreach($dataPurchaserecord as $PurchaseRecord){\n $dataProductQuantity = Skuproductvariantsoption::where('id', '=', $PurchaseRecord->skuid)->take(1)->get();\n foreach($dataProductQuantity as $ProductQuantity) {\n $Quantity = $ProductQuantity->warehousequantity + $request->recievequantity;\n $updateProductQuantity = Skuproductvariantsoption::where('id', '=', $PurchaseRecord->skuid)\n ->update(['warehousequantity' => $Quantity]);\n } \n }\n return response()->json();\n }", "public function order_details(){\n\t\t\t\n\t\t\t$this->input->post(NULL, TRUE); // returns all POST items with XSS filter\n\t\t\t\n\t\t\t//escaping the post values\n\t\t\t$pid = html_escape($this->input->post('id'));\n\t\t\t$id = preg_replace('#[^0-9]#i', '', $pid); // filter everything but numbers\n\t\t\t\n\t\t\t$detail = $this->db->select('*')->from('orders')->where('id',$id)->get()->row();\n\t\t\t\n\t\t\tif($detail){\n\t\t\t\t\n\t\t\t\t\t$data['id'] = $detail->id;\n\t\t\t\t\t\n\t\t\t\t\t$data['last_updated'] = date(\"F j, Y, g:i a\", strtotime($detail->last_updated));\n\t\t\t\t\t\n\t\t\t\t\t$data['order_date'] = date(\"F j, Y\", strtotime($detail->order_date));\n\t\t\t\t\t$numOfItems = '';\n\t\t\t\t\tif($detail->num_of_items == 1){\n\t\t\t\t\t\t$numOfItems = $detail->num_of_items.' item';\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$numOfItems = $detail->num_of_items.' items';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$data['headerTitle'] = 'Order: '.$detail->reference.' <span class=\"badge bg-green\" >'.$numOfItems.'</span>';\t\n\t\t\t\t\t\n\t\t\t\t\t$data['orderDate'] = '<i class=\"fa fa-calendar-o\" aria-hidden=\"true\"></i> '.date(\"F j, Y\", strtotime($detail->order_date));\n\t\t\t\t\t$data['reference'] = $detail->reference;\n\t\t\t\t\t$data['order_description'] = $detail->order_description;\n\t\t\t\t\t$data['total_price'] = number_format($detail->total_price, 2);\n\t\t\t\t\t$data['totalPrice'] = $detail->total_price;\n\t\t\t\t\t//$data['tax'] = $detail->tax;\n\t\t\t\t\t//$data['shipping_n_handling_fee'] = $detail->shipping_n_handling_fee;\n\t\t\t\t\t//$data['payment_gross'] = $detail->payment_gross;\n\t\t\t\t\t$data['num_of_items'] = $detail->num_of_items;\n\t\t\t\t\t$data['customer_email'] = $detail->customer_email;\n\t\t\t\t\t\n\t\t\t\t\t$user_array = $this->Users->get_user($detail->customer_email);\n\t\t\t\t\t\n\t\t\t\t\t$fullname = '';\n\t\t\t\t\tif($user_array){\n\t\t\t\t\t\tforeach($user_array as $user){\n\t\t\t\t\t\t\t$fullname = $user->first_name.' '.$user->last_name;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$data['customer'] = $fullname .' ('.$detail->customer_email.')';\n\t\t\t\t\t\n\t\t\t\t\t//SELECT CUSTOMER DROPDOWN\n\t\t\t\t\t\n\t\t\t\t\t$customer_options = '<option value=\"\" >Select User</option>';\n\t\t\t\t\t\t\t\n\t\t\t\t\t$this->db->from('users');\n\t\t\t\t\t$this->db->order_by('id');\n\t\t\t\t\t$result = $this->db->get();\n\t\t\t\t\tif($result->num_rows() > 0) {\n\t\t\t\t\t\tforeach($result->result_array() as $row){\n\t\t\t\t\t\t\t//AUTO SELECT DEFAULT\n\t\t\t\t\t\t\t$d = (strtolower($row['email_address']) == strtolower($detail->customer_email))?'selected':'';\n\t\t\t\t\t\t\t$customer_options .= '<option value=\"'.$row['email_address'].'\" '.$d.'>'.ucwords($row['first_name'].' '.$row['last_name']).' ('.$row['email_address'].')</option>';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$data['customer_options'] = $customer_options;\n\t\t\t\t\t//*********END SELECT DESTINATION COUNTRY DROPDOWN**********//\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t//GET PAYMENT STATUS FROM TRANSACTION DB\n\t\t\t\t\t$transaction_array = $this->Transactions->get_transaction($detail->reference);\n\t\t\t\t\t$payment_status = '';\n\t\t\t\t\t$edit_payment_status = '';\n\t\t\t\t\t$order_amount = '';\n\t\t\t\t\t$shipping_and_handling_costs = '';\n\t\t\t\t\t$total_amount = '';\n\t\t\t\t\t$transaction_id = '';\n\t\t\t\t\t\n\t\t\t\t\tif($transaction_array){\n\t\t\t\t\t\tforeach($transaction_array as $transaction){\n\t\t\t\t\t\t\t$transaction_id = $transaction->id;\n\t\t\t\t\t\t\t$payment_status = $transaction->status;\n\t\t\t\t\t\t\t$edit_payment_status = $transaction->status;\n\t\t\t\t\t\t\t$order_amount = $transaction->order_amount;\n\t\t\t\t\t\t\t$shipping_and_handling_costs = $transaction->shipping_and_handling_costs;\n\t\t\t\t\t\t\t$total_amount = $transaction->total_amount;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif($payment_status == '1'){\n\t\t\t\t\t\t$payment_status = '<span class=\"badge bg-green\">Paid</span>';\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$payment_status = '<span class=\"badge bg-yellow\">Pending</span>';\n\t\t\t\t\t}\n\t\t\t\t\t$data['payment_status'] = $payment_status;\n\t\t\t\t\t$data['edit_payment_status'] = $edit_payment_status;\n\t\t\t\t\t\n\t\t\t\t\t$data['transaction_id'] = $transaction_id;\n\t\t\t\t\t\n\t\t\t\t\t//SELECT PAYMENT STATUS DROPDOWN\n\t\t\t\t\t$payment_status_options = '<option value=\"\" >Select Payment Status</option>';\n\t\t\t\t\t\t\t\n\t\t\t\t\tfor($i=0; $i<=1; $i++){\n\t\t\t\t\t\t//AUTO SELECT DEFAULT\n\t\t\t\t\t\t$sel = ($i == $edit_payment_status) ? 'selected' : '';\n\t\t\t\t\t\t\n\t\t\t\t\t\t//READABLE DISPLAY\n\t\t\t\t\t\t$string = ($i == '0') ? 'Pending' : 'Paid';\n\t\t\t\t\t\t\n\t\t\t\t\t\t$payment_status_options .= '<option value=\"'.$i.'\" '.$sel.'>'.$string.'</option>';\n\t\t\t\t\t}\n\t\t\t\t\t$data['payment_status_options'] = $payment_status_options;\n\t\t\t\t\t//*********END SELECT PAYMENT STATUS DROPDOWN**********//\n\t\t\t\t\t\n\t\t\t\t\t//GET PAYMENT STATUS FROM TRANSACTION DB\n\t\t\t\t\t$payment_array = $this->Payments->get_payment($detail->reference);\n\t\t\t\t\t$payment_method = '';\n\t\t\t\t\t$payment_id = '';\n\t\t\t\t\tif($payment_array){\n\t\t\t\t\t\tforeach($payment_array as $payment){\n\t\t\t\t\t\t\t$payment_method = $payment->payment_method;\n\t\t\t\t\t\t\t$payment_id = $payment->id;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$data['payment_id'] = $payment_id;\n\t\t\t\t\t\n\t\t\t\t\t//VIEW\n\t\t\t\t\t$data['view_payment_method'] = 'Payment Method: '.$payment_method;\n\t\t\t\t\t\n\t\t\t\t\t//SELECT PAYMENT METHOD DROPDOWN\n\t\t\t\t\t$payment_method_options = '<option value=\"\" >Select Payment Method</option>';\n\t\t\t\t\t\t\t\n\t\t\t\t\t$this->db->from('payment_methods');\n\t\t\t\t\t$this->db->order_by('id');\n\t\t\t\t\t$result = $this->db->get();\n\t\t\t\t\tif($result->num_rows() > 0) {\n\t\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\t//AUTO SELECT DEFAULT\n\t\t\t\t\t\t\t$default = (strtolower($row['method_name']) == strtolower($payment_method))?'selected':'';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$payment_method_options .= '<option value=\"'.$row['method_name'].'\" '.$default.'>'.$row['method_name'].'</option>';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$data['payment_method_options'] = $payment_method_options;\n\t\t\t\t\t//*********END SELECT PAYMENT METHOD DROPDOWN**********//\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$data['order_amount'] = $order_amount;\n\t\t\t\t\t$data['shipping_and_handling_costs'] = $shipping_and_handling_costs;\n\t\t\t\t\t$data['total_amount'] = $total_amount;\n\t\t\t\t\t\n\t\t\t\t\t//GET SHIPPING STATUS FROM DB\n\t\t\t\t\t$shipping_array = $this->Shipping->get_shipping($detail->reference);\n\t\t\t\t\t$shipping_status = '';\n\t\t\t\t\t$edit_shipping_status = '';\n\t\t\t\t\t$shipping_id = '';\n\t\t\t\t\t$method = '';\n\t\t\t\t\t$shipping_fee = '';\n\t\t\t\t\t$tax = '';\n\t\t\t\t\t$origin_city = '';\n\t\t\t\t\t$origin_country = '';\n\t\t\t\t\t$destination_city = '';\n\t\t\t\t\t$destination_country = '';\n\t\t\t\t\t$customer_contact_phone = '';\n\t\t\t\t\t$estimated_delivery_date = '';\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif($shipping_array){\n\t\t\t\t\t\tforeach($shipping_array as $shipping){\n\t\t\t\t\t\t\t$shipping_id = $shipping->id;\n\t\t\t\t\t\t\t$shipping_status = $shipping->status;\n\t\t\t\t\t\t\t$edit_shipping_status = $shipping->status;\n\t\t\t\t\t\t\t$method = $shipping->shipping_method;\n\t\t\t\t\t\t\t$shipping_fee = $shipping->shipping_fee;\n\t\t\t\t\t\t\t$tax = $shipping->tax;\n\t\t\t\t\t\t\t$origin_city = $shipping->origin_city;\n\t\t\t\t\t\t\t$origin_country = $shipping->origin_country;\n\t\t\t\t\t\t\t$destination_city = $shipping->destination_city;\n\t\t\t\t\t\t\t$destination_country = $shipping->destination_country;\n\t\t\t\t\t\t\t$customer_contact_phone = $shipping->customer_contact_phone;\n\t\t\t\t\t\t\t$estimated_delivery_date = $shipping->estimated_delivery_date;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif($shipping_status == '1'){\n\t\t\t\t\t\t$shipping_status = '<span class=\"badge bg-green\">Shipped</span>';\n\t\t\t\t\t\t\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$shipping_status = '<span class=\"badge bg-yellow\">Pending</span>';\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$view_delivery_date = '';\n\t\t\t\t\t$edit_delivery_date = '';\n\t\t\t\t\tif($estimated_delivery_date == '0000-00-00 00:00:00'){\n\t\t\t\t\t\t$view_delivery_date = 'Not Set';\n\t\t\t\t\t\t$edit_delivery_date = '';\n\t\t\t\t\t\t\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$view_delivery_date = date(\"F j, Y g:i A\", strtotime($estimated_delivery_date));\n\t\t\t\t\t\t$edit_delivery_date = date(\"Y-m-d g:i A\", strtotime($estimated_delivery_date));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$data['delivery_date'] = $view_delivery_date;\n\t\t\t\t\t$data['edit_delivery_date'] = $edit_delivery_date;\n\t\t\t\t\t\n\t\t\t\t\t$data['edit_shipping_status'] = $edit_shipping_status;\n\t\t\t\t\t$data['shipping_status'] = $shipping_status;\n\t\t\t\t\t$data['shipping_fee'] = $shipping_fee;\n\t\t\t\t\t$data['tax'] = $tax;\n\t\t\t\t\t$data['shipping_id'] = $shipping_id; \n\t\t\t\t\t\t\n\t\t\t\t\t//SELECT SHIPPING METHODS DROPDOWN\n\t\t\t\t\t//$shipping_methods = '<div class=\"form-group\">';\n\t\t\t\t\t//$shipping_methods .= '<select name=\"shipping_method\" id=\"shipping_method\" class=\"form-control\">';\n\t\t\t\t\t\t\n\t\t\t\t\t$shipping_methods = '<option value=\"\" >Select Shipping Method</option>';\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t$this->db->from('shipping_methods');\n\t\t\t\t\t$this->db->order_by('id');\n\t\t\t\t\t$result = $this->db->get();\n\t\t\t\t\tif($result->num_rows() > 0) {\n\t\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\t$d = (strtolower($row['shipping_company']) == strtolower($method))?'selected':'';\n\t\t\t\t\t\n\t\t\t\t\t\t\t$shipping_methods .= '<option value=\"'.ucwords($row['id']).'\" '.$d.'>'.ucwords($row['shipping_company']).'</option>';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t//$shipping_methods .= '</select>';\n\t\t\t\t\t//$shipping_methods .= '</div>';\t\n\t\t\t\t\t$data['shipping_method_options'] = $shipping_methods;\n\t\t\t\t\t//*********END SELECT SHIPPING METHODS DROPDOWN**********//\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$data['origin_city'] = $origin_city;\n\t\t\t\t\t$data['origin_country'] = $origin_country;\n\t\t\t\t\t\t\n\t\t\t\t\t//SELECT ORIGIN COUNTRY DROPDOWN\n\t\t\t\t\t\n\t\t\t\t\t$origin_country_options = '<option value=\"\" >Select Origin Country</option>';\n\t\t\t\t\t\t\t\n\t\t\t\t\t$this->db->from('countries');\n\t\t\t\t\t$this->db->order_by('id');\n\t\t\t\t\t$result = $this->db->get();\n\t\t\t\t\tif($result->num_rows() > 0) {\n\t\t\t\t\t\tforeach($result->result_array() as $row){\n\t\t\t\t\t\t\t//AUTO SELECT DEFAULT\n\t\t\t\t\t\t\t$d = (strtolower($row['name']) == strtolower($origin_country))?'selected':'';\n\t\t\t\t\t\t\t$origin_country_options .= '<option value=\"'.$row['name'].'\" '.$d.'>'.ucwords($row['name']).'</option>';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$data['origin_country_options'] = $origin_country_options;\n\t\t\t\t\t//*********END SELECT DESTINATION COUNTRY DROPDOWN**********//\n\t\t\t\t\t\n\t\t\t\t\t$data['destination_city'] = $destination_city;\n\t\t\t\t\t$data['destination_country'] = $destination_country;\n\t\t\t\t\t\t\n\t\t\t\t\t//SELECT DESTINATION COUNTRY DROPDOWN\n\t\t\t\t\t\n\t\t\t\t\t$destination_country_options = '<option value=\"\" >Select Destination Country</option>';\n\t\t\t\t\t\t\t\n\t\t\t\t\t$this->db->from('countries');\n\t\t\t\t\t$this->db->order_by('id');\n\t\t\t\t\t$result = $this->db->get();\n\t\t\t\t\tif($result->num_rows() > 0) {\n\t\t\t\t\t\tforeach($result->result_array() as $row){\n\t\t\t\t\t\t\t//AUTO SELECT DEFAULT\n\t\t\t\t\t\t\t$d = (strtolower($row['name']) == strtolower($destination_country))?'selected':'';\n\t\t\t\t\t\t\t$destination_country_options .= '<option value=\"'.$row['name'].'\" '.$d.'>'.ucwords($row['name']).'</option>';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$data['destination_country_options'] = $destination_country_options;\n\t\t\t\t\t//*********END SELECT DESTINATION COUNTRY DROPDOWN**********//\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$data['customer_contact_phone'] = $customer_contact_phone;\n\t\t\t\t\t\n\t\t\t\t\t//SELECT SHIPPING STATUS DROPDOWN\n\t\t\t\t\t$shipping_status_options = '<option value=\"\" >Select Shipping Status</option>';\n\t\t\t\t\t\t\t\n\t\t\t\t\tfor($i=0; $i<=1; $i++){\n\t\t\t\t\t\t//AUTO SELECT DEFAULT\n\t\t\t\t\t\t$sel = ($i == $edit_shipping_status) ? 'selected' : '';\n\t\t\t\t\t\t\n\t\t\t\t\t\t//READABLE DISPLAY\n\t\t\t\t\t\t$status_string = ($i == '0') ? 'Pending' : 'Shipped';\n\t\t\t\t\t\t\n\t\t\t\t\t\t$shipping_status_options .= '<option value=\"'.$i.'\" '.$sel.'>'.$status_string.'</option>';\n\t\t\t\t\t}\n\t\t\t\t\t$data['shipping_status_options'] = $shipping_status_options;\n\t\t\t\t\t//*********END SELECT SHIPPING STATUS DROPDOWN**********//\n\t\t\t\t\t\n\t\t\t\t\t$data['model'] = 'orders';\n\t\t\t\t\t$data['success'] = true;\n\n\t\t\t}else {\n\t\t\t\t$data['success'] = false;\n\t\t\t}\n\t\t\techo json_encode($data);\n\t\t}", "public function orderInfo($increment_id){\n $result = $this->data['client']->salesOrderInfo($this->data['session'], $increment_id);\n \n return $result;\n}", "public function getDetails($id){\n return $this->slc(\"*\", \"orders\", array(\"order_id\" => $id), TRUE)[0];\n }", "static function cntDelivs($arOrder){//������ ���� � ��������� �������� ��� �������\n return CDeliverySDEK::countDelivery($arOrder);\n }", "public function ItemPriceOnDODetail($params)\n {\n return $this->deliveryOrderDetail::where($params)->get() == null ? false : $this->deliveryOrderDetail::where($params)->pluck(); \n }", "public static function getOrderedProductsQuantity(): string\n {\n $query = new Query();\n $total = $query->select([\n 'COUNT(*) as total'\n ])\n ->from(['sale_items'])\n ->where([\n 'customer_auth_id' => Yii::$app->user->identity->id,\n 'sale_id' => 0\n ])\n ->scalar();\n\n return $total;\n }", "function count_cartdetails($sessionID, $debug = false) {\n\t\t$q = (new QueryBuilder())->table('cartdet');\n\t\t$q->field('COUNT(*)');\n\t\t$q->where('sessionid', $sessionID);\n\t\t$sql = DplusWire::wire('database')->prepare($q->render());\n\n\t\tif ($debug) {\n\t\t\treturn $q->generate_sqlquery($q->params);\n\t\t} else {\n\t\t\t$sql->execute($q->params);\n\t\t\treturn $sql->fetchColumn();\n\t\t}\n\t}", "public function orderFinalAmountElements($purc_order_id){\n\t\t$this->db->select('SUM((POP.`purchase_qty`) * (POP.`purchase_rate`)) AS subTotal, PO.tax_per, PO.excise, PO.forwardingAmt, PO.otherAdjustment, PO.discountAmt');\n\t\t$this->db->from('purchase_order_products AS POP');\n\t\t$this->db->join(\"purchase_orders AS PO\", \"POP.purc_order_id = PO.purc_order_id\");\n\t\t$this->db->where(\"POP.`purc_order_id` \", $purc_order_id);\n\t\t\n\t\t$query_final_order_payments = $this->db->get();\n\t\t// echo $this->db->last_query();die;\n\t\tif($query_final_order_payments->num_rows()>0)\n\t\t{\n\t\t\treturn $query_final_order_payments->result_array();\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t}" ]
[ "0.6993254", "0.66919684", "0.6274439", "0.6274439", "0.62058437", "0.62058437", "0.62058437", "0.60886276", "0.60517347", "0.6035431", "0.60198647", "0.6012195", "0.6004806", "0.59635437", "0.5959889", "0.5950716", "0.59344816", "0.59200543", "0.59117097", "0.58798677", "0.5830372", "0.5825031", "0.5823543", "0.5808159", "0.5794838", "0.57890093", "0.57890093", "0.57890093", "0.57890093", "0.57890093", "0.57890093", "0.57890093", "0.57890093", "0.57890093", "0.57890093", "0.57890093", "0.5774174", "0.57632154", "0.5759311", "0.57589775", "0.57318336", "0.57262", "0.5720611", "0.570564", "0.5705578", "0.570383", "0.5689909", "0.56737006", "0.5669332", "0.5666561", "0.56641597", "0.5645967", "0.56298935", "0.56215984", "0.56165826", "0.5607867", "0.5575296", "0.55718577", "0.55718577", "0.5570033", "0.5563233", "0.55491483", "0.55405855", "0.5528001", "0.5516936", "0.55127907", "0.55055994", "0.55035084", "0.54976183", "0.5489969", "0.5482044", "0.54814816", "0.54741126", "0.5458404", "0.5457184", "0.54471076", "0.54426116", "0.5431143", "0.5430689", "0.54300696", "0.54274195", "0.54227245", "0.54177624", "0.54169977", "0.5403359", "0.54021096", "0.54006755", "0.5380654", "0.53719854", "0.5369352", "0.5367966", "0.53662443", "0.53655076", "0.53632146", "0.5356329", "0.53444296", "0.5343803", "0.5343698", "0.53428334", "0.5341865" ]
0.7172905
0
Increase QTY on Item
public function DecreaseItemQTY($DO_Detail_id) { $DO_Detail = $this->GetDetailByID($DO_Detail_id); $qty_confirm = $DO_Detail->qty_confirm == null ? $DO_Detail->qty : $DO_Detail->qty_confirm; $item = $this->item::find($DO_Detail->item_id); if ($item == null) { throw new \Exception("Item Tidak Ditemukan"); } if ($item->qty < $qty_confirm) { throw new \Exception("Quantity Melebihi Jumlah Stok Harap Perhatikan QC Pass"); } $qty_update = $item->qty - $qty_confirm; $item->update(['qty' => $qty_update]); return array('success' => true, 'message' => 'QTY '.$item->name.' Berhasil bertambah'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testItemQtyUpdate()\n {\n $item = $this->addItem();\n $itemHash = $item->getHash();\n $this->addItem();\n $this->addItem();\n $this->addItem();\n $this->addItem();\n $this->addItem();\n $this->addItem();\n\n $this->assertEquals(7, $item->qty);\n $this->assertEquals($itemHash, $item->getHash());\n\n $options = [\n 'a' => 2,\n 'b' => 1\n ];\n\n $item = $this->addItem(1, 1, false, $options);\n $this->addItem(1, 1, false, array_reverse($options));\n\n $this->assertEquals(2, $item->qty);\n }", "public function changeQtyAction()\n {\n if (!$this->_isActive()\n || !$this->_getHelper()->isChangeItemQtyAllowed()) {\n $this->norouteAction();\n return;\n }\n\n if ($this->_expireAjax()) {\n return;\n }\n\n $result = array();\n\n $quoteItem = $this->getOnepage()->getQuote()->getItemById(\n $this->getRequest()->getPost('item_id')\n );\n\n if ($quoteItem) {\n $quoteItem->setQty(\n $this->getRequest()->getPost('qty')\n );\n\n try {\n if ($quoteItem->getHasError() === true) {\n $result['error'] = $quoteItem->getMessage(true);\n } else {\n $this->_recalculateTotals();\n $result['success'] = true;\n }\n } catch (Mage_Core_Exception $e) {\n $result['error'] = $e->getMessage();\n } catch (Exception $e) {\n Mage::logException($e);\n $result['error'] = Mage::helper('ecomdev_checkitout')->__('There was an error during changing product qty');\n }\n } else {\n $result['error'] = Mage::helper('ecomdev_checkitout')->__('Product was not found');\n }\n\n $this->_addHashInfo($result);\n\n $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));\n }", "function set_qty_item( $params ) {\n\t\textract( $params );\n\n\t\t$this->db->query( \"LOCK TABLES cart_items WRITE, stock WRITE\" );\n\n\t\t// Changing the current qty means putting back first the previous qty to stock then removing the new one\n\t\t$aqty = $this->db->query( \"SELECT qty, sku FROM cart_items WHERE id='\".$id.\"'\" )->row_array();\n\t\t$this->db->query( \"UPDATE stock SET qty=qty+{$aqty['qty']}-\".$qty.\" WHERE sku='{$aqty['sku']}'\" );\n\n\t\t$res = $this->db->query( \"UPDATE cart_items SET qty='\".$qty.\"' WHERE id='\".$id.\"' AND user='\".$user_no.\"'\" );\n\n\t\t$this->db->query( \"UNLOCK TABLES\" );\n\t\treturn $res;\n\t}", "public function incrQty($increment) {\n $this->setQty($this->getQty() + $increment);\n }", "public function setQty($qty);", "public function setQty($prod_id, $newQty)\n {\n // if the item already exists\n if (array_key_exists($prod_id, $this->items)) {\n $this->items[$prod_id] = $newQty;\n } else {\n $this->items = $this->items + array($prod_id => $newQty);\n }\n\n if ($this->items[$prod_id] <= 0) {\n unset($this->items[$prod_id]);\n }\n $this->calcTotal();\n }", "abstract public function getOriginalQty();", "public function UpdateQty($qty = 0)\n\t{\n\t\t$sql = 'UPDATE coursetickets SET tqty = tqty ' . ($qty >= 0 ? '+ ' : '- ') . abs($qty) . ' WHERE tid = '. (int)$this->id;\t\n\t\t\t\t\n\t\tif ($result = $this->db->Query($sql))\n\t\t{\n\t\t\tif ($this->db->AffectedRows())\n\t\t\t{\n\t\t\t\t$this->Get($this->id);\n\t\t\t\t\n\t\t\t\tif ($this->details['tqty'] <= 0)\n\t\t\t\t{\t$this->UpdateStatus('sold_out');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function updateItemQty(){\n $update = 0;\n // Get cart item info\n $rowid = $this->input->get('rowid');\n $qty = $this->input->get('qty');\n\n // Update item in the cart\n if(!empty($rowid) && !empty($qty)){\n $data = array(\n 'rowid' => $rowid,\n 'qty' => $qty\n );\n $update = $this->cart->update($data);\n }\n\n // Return response\n echo $update?'ok':'err';\n }", "public function updateQuantity($item, $qty)\n {\n // Remove the item from the array\n $this->removeItem($item);\n\n // Push new item into $items array\n for ($i = 0; $i < $qty; $i++) {\n $this->addItem($item);\n }\n\n }", "public function testUpdateQuantity()\n {\n $cart = new Cart(['foo']);\n $this->assertEquals(['foo'], $cart->getItems());\n\n $cart->updateQuantity('foo', 6);\n $this->assertEquals(['foo', 'foo', 'foo', 'foo', 'foo', 'foo'], $cart->getItems());\n\n $cart->updateQuantity('foo', 4);\n $this->assertEquals(['foo', 'foo', 'foo', 'foo'], $cart->getItems());\n\n $cart = new Cart(['foo', 'bar', 'foobar']);\n $cart->updateQuantity('foo', 4);\n $this->assertEquals(['bar', 'foo', 'foo', 'foo', 'foo', 'foobar'], $cart->getItems());\n }", "public function updateQuantity(int $quantity)\n {\n $newQuantity = $quantity - $this->quantity();\n $item = $this->items->first();\n $item->quantity = $item->quantity + $newQuantity;\n $item->save();\n }", "public function getQty();", "public function getQty();", "public function testUpdateItem()\n {\n $item = $this->addItem();\n\n $this->laracart->updateItem($item->getHash(), 'qty', 4);\n\n $this->assertEquals(4, $item->qty);\n }", "public function calculateQtyToShip();", "public function qtyUpdate(Request $request, $id, $qty)\n {\n $user = Auth::id();\n $cart = Cart::where('id', $id)->where('user_id', $user)->first();\n $product = Product::find($cart->product_id);\n if ($product->stock < $qty && $cart->type == 2) {\n return response()->json('stock-out');\n }\n else {\n if ($qty == 0) {\n $cart->delete();\n }\n else {\n $cart->qty = $qty;\n $cart->subtotal = $qty * $cart->price;\n $cart->save();\n }\n }\n }", "public function updateItem($id, $qty) {\n if ($qty === 0) {\n $this->deleteItem($id);\n } else if ( ($qty > 0) && ($qty != $this->items[$id])) {\n $this->items[$id] = $qty;\n }\n }", "public function getTotalQtyOrdered();", "public function updateQuantity() {\n\t\t$count = 0;\n\t\tforeach ($_SESSION['cart'] as $cartRow) {\n\t\t\tif ($cartRow['id'] == $this->productId) {\n\t\t\t\t$_SESSION['cart'][$count]['quantity'] = $this->quantity;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$count += 1;\n\t\t}\n\t}", "public function updateItemQuantity( $map ) {\r\n\t\t\t$params = array('session_cookie'=>$map['session_cookie'],'option_id'=>$map['option_id'],'restid'=>$map['restid']);\r\n\t\t\t$this->db->where($params);\r\n\t\t\t$qty = array('quantity'=>$map['quantity']);\r\n\t\t\t$this->db->update(TABLES::$ORDER_CART,$qty);\r\n\t\t}", "public function increaseItem($rowId){\n // kemudian ambil semua isi product\n // ambil session login id\n // cek eloquent id\n $idProduct = substr($rowId, 4, 5);\n $product = ProductModel::find($idProduct);\n $cart = \\Cart::session(Auth()->id())->getContent();\n $checkItem = $cart->whereIn('id', $rowId);\n \n // kita cek apakah value quantity yang ingin kita tambah sama dengan quantity product yang tersedia\n if($product->qty == $checkItem[$rowId]->quantity){\n session()->flash('error', 'Kuantiti terbatas');\n }\n else{\n \\Cart::session(Auth()->id())->update($rowId, [\n 'quantity' => [\n 'relative' => true,\n 'value' => 1\n ]\n ]);\n }\n\n }", "public function readdItems($input) {\n $orderItems = \\App\\OrderItem::where('order_id', $input['order_id'])->get();\n foreach ($orderItems as $orderItem) {\n \\App\\Product::where('id', $orderItem->product_id)->increment('qty', $orderItem->qty);\n }\n }", "public function update_quantity()\n\t{\n\t\t$item = ORM::factory('cart_item', $this->input->post('id'));\n\t\t$quantity = $this->input->post('quantity');\n\t\t$this->cart->update_quantity($item->product, $item->variant, $quantity);\n\t\t\n\t\turl::redirect('cart');\n\t}", "public function update($id, $newQty){\n $cart = Session::get('cart');\n // calculations of add/reduce\n $lessQty = $this->items[$id]['qty'] -= $newQty;\n $moreQty = $newQty -= $cart->items[$id]['qty'];\n $lessTotal = $this->items[$id]['price'] * $lessQty;\n $moreTotal = $this->items[$id]['price'] * $moreQty;\n // if == 0, destroy\n if($newQty == 0) {\n $cart->totalQty -= $lessQty;\n $cart->totalPrice -= $lessTotal;\n unset($cart->items[$id]);\n Session::put('cart', $cart);\n } else { // else reduce values\n if($cart->items[$id]['qty'] > $newQty) {\n $cart->totalQty -= $lessQty;\n $cart->totalPrice -= $lessTotal;\n $cart->items[$id]['qty'] -= $lessQty;\n Session::put('cart', $cart);\n } else { // or add values\n $cart->totalQty += $moreQty;\n $cart->totalPrice += $moreTotal;\n $cart->items[$id]['qty'] += $moreQty;\n Session::put('cart', $cart);\n }\n }\n if($cart->totalQty <= 0){\n Session::forget('cart');\n }\n }", "public function getQty()\r\n {\r\n return $this->qty;\r\n }", "public function _updateCatalogQty($product_id){\n\t\t$results = Mage::getResourceModel('inventorydropship/inventorydropship')->getSumTotalAvailableQtyByProduct($product_id);\n\t\t$newQty = $results[0]['total_avail_qty'];\n\t\t$product = Mage::getModel('catalog/product')->load($product_id);\n\t\t$stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product_id);\n\t\t$stockItem->setQty($newQty);\n\t\t$stockItem->save();\n\t\t$product->save();\n\t}", "public function update(): void\n {\n // Update quality\n if ($this->item->sell_in > 10) {\n $this->item->quality++;\n }\n\n if ($this->item->sell_in <= 10 && $this->item->sell_in > 5) {\n $this->item->quality += 2;\n }\n\n if ($this->item->sell_in <= 5 && $this->item->sell_in > 0) {\n $this->item->quality += 3;\n }\n\n // Update Sell in\n $this->updateSellIn();\n\n if ($this->item->sell_in < 0) {\n $this->item->quality = 0;\n }\n\n $this->checkAndUpdateQualityByRange();\n }", "public function _updateOnHoldAndAvailableQty($product_id,$qtyShipped){\n\t\t$warehouseOr = Mage::getModel('inventoryplus/warehouse_order')->getCollection()\n ->addFieldToFilter('order_id', $this->_orderOb->getId())\n ->addFieldToFilter('product_id', $product_id)\n\t\t\t\t\t\t\t->setPageSize(1)\n\t\t\t\t\t\t\t->setCurPage(1)\n ->getFirstItem();\n\t\tif($warehouseOr->getId()){\t\t\t\t\t\n\t\t\t$OnHoldQty = $warehouseOr->getQty() - $qtyShipped;\n\t\t\t$warehouseId = $warehouseOr->getWarehouseId();\n\t\t\tif ($OnHoldQty >= 0) {\n\t\t\t\t$warehouseOr->setQty($OnHoldQty)\n\t\t\t\t\t\t->save();\n\t\t\t} else {\n\t\t\t\t$warehouseOr->setQty(0)\n\t\t\t\t\t\t->save();\n\t\t\t}\n\t\t\t$warehousePr = Mage::getModel('inventoryplus/warehouse_product')->getCollection()\n ->addFieldToFilter('warehouse_id', $warehouseId)\n ->addFieldToFilter('product_id', $product_id)\n\t\t\t\t\t\t\t->setPageSize(1)\n\t\t\t\t\t\t\t->setCurPage(1)\n ->getFirstItem();\n\t\t\tif($warehousePr->getId()){\n\t\t\t\t$newAvailQty = $warehousePr->getAvailableQty()\t+ $qtyShipped;\n\t\t\t\t$warehousePr->setAvailableQty($newAvailQty);\n\t\t\t\t$warehousePr->save();\n\t\t\t}\n\t\t}\n\t}", "public function getQty()\n {\n return $this->qty;\n }", "public function getQty()\n\t{\n\t\treturn $this->qty;\n\t}", "public function UpdateBookingQty($qty = 0)\n\t{\n\t\t$sql = 'UPDATE coursetickets SET tbooked=tbooked ' . ($qty >= 0 ? '+ ' : '- ') . abs($qty) . ' WHERE tid='. (int)$this->id;\t\n\t\t\t\t\n\t\tif ($result = $this->db->Query($sql))\n\t\t{\n\t\t\tif ($this->db->AffectedRows())\n\t\t\t{\n\t\t\t\t$this->Get($this->id);\n\t\t\t\t\n\t\t\t\tif (!$this->IsBookable())\n\t\t\t\t{\t$this->UpdateStatus('sold_out');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function setQuantity($value)\n {\n $this->quantity = $value;\n $this->recalculate();\n }", "public function increaseItem($name, $itemName) {\n $this->data[$name][$itemName] = (isset($this->data[$name][$itemName]) && is_int($this->data[$name][$itemName]) ? ++$this->data[$name][$itemName] : 1);\n }", "protected function updateQuantityRelative($item, $key, $value)\n {\n if (preg_match('/\\-/', $value) == 1) {\n $value = (int)str_replace('-', '', $value);\n\n // we will not allowed to reduced quantity to 0, so if the given value\n // would result to item quantity of 0, we will not do it.\n if (($item[$key] - $value) > 0) {\n $item[$key] -= $value;\n }\n } elseif (preg_match('/\\+/', $value) == 1) {\n $item[$key] += (int)str_replace('+', '', $value);\n } else {\n $item[$key] += (int)$value;\n }\n\n return $item;\n }", "protected function updateQuantityRelative($item, $key, $value)\n {\n if (preg_match('/\\-/', $value) == 1) {\n $value = (int)str_replace('-', '', $value);\n\n // we will not allowed to reduced quantity to 0, so if the given value\n // would result to item quantity of 0, we will not do it.\n if (($item[$key] - $value) > 0) {\n $item[$key] -= $value;\n }\n } elseif (preg_match('/\\+/', $value) == 1) {\n $item[$key] += (int)str_replace('+', '', $value);\n } else {\n $item[$key] += (int)$value;\n }\n\n return $item;\n }", "public function update_qty_item($itemqty, $arrayDelete){\n\t\t\tforeach ($_SESSION['terminal_list'][$arrayDelete] as $key => $value) {\n\t\t\t\t$_SESSION['terminal_list'][$arrayDelete][$key]->quantity = $itemqty;\n\t\t\t}\n\t\t\treturn 'sucess';\t\n\t}", "function update_product_qty($qty,$p_id){\n global $db;\n $qty = (int) $qty;\n $id = (int)$p_id;\n $sql = \"UPDATE products SET quantity=quantity -'{$qty}' WHERE id = '{$id}'\";\n $result = $db->query($sql);\n return($db->affected_rows() === 1 ? true : false);\n\n }", "public function testItemPriceAndQty()\n {\n $item = $this->addItem(3, 10);\n\n $this->assertEquals(3, $item->qty);\n $this->assertEquals(10, $item->price(false));\n $this->assertEquals(30, $item->subTotal(false));\n }", "public function setQuantity($val)\n {\n $val = $val < 1 ? 1 : $val;\n $this->setField('Quantity', $val);\n }", "public function orderProduct($qty, $updateRealStock = false) {\n \n $stockQuantity = $this->quantity;\n \n if ($stockQuantity >= $qty) {\n // stock is ok\n $stockQuantity -= $qty;\n }\n else {\n // stock is lower\n if ($this->when_out_of_stock == 1) {\n // allow order with 0 stock\n $stockQuantity = 0;\n $this->save();\n return $qty;\n }\n elseif ($stockQuantity > 0) {\n // allow max when i have\n $qty = ((int)($stockQuantity / $this->minimum_quantity)) * $this->minimum_quantity;\n $stockQuantity = $stockQuantity - $qty;\n }\n else {\n $qty = 0;\n }\n }\n \n if ($updateRealStock) {\n $this->quantity = $stockQuantity;\n $this->save();\n }\n \n return $qty;\n }", "public function getBaseTotalQtyOrdered();", "function _addItem ($quantity, $rate, $weight, $length, $width, $height, $description, $readytoship=0) {\r\n $index = $this->items_qty;\r\n $this->item_quantity[$index] = (string)$quantity;\r\n $this->item_weight[$index] = ( $weight ? (string)$weight : '0' );\r\n $this->item_length[$index] = ( $length ? (string)$length : '0' );\r\n $this->item_width[$index] = ( $width ? (string)$width : '0' );\r\n $this->item_height[$index] = ( $height ? (string)$height : '0' );\r\n $this->item_description[$index] = $description;\r\n $this->item_readytoship[$index] = $readytoship;\r\n $this->items_qty ++;\r\n $this->items_price += $quantity * $rate;\r\n }", "public function add($item, $id, $qty){\n $temp = ['qty' => $qty, 'price' => $item->price, 'item' => $item];\n if($this->items){\n if(array_key_exists($id, $this->items)){\n $temp = $this->items[$id];\n $temp['qty'] += $qty;\n }\n }\n $this->items[$id] = $temp;\n $this->totalQty += $qty;\n $this->totalPrice += $temp['price'] * $qty;\n }", "public function updateCartQuantity()\n {\n if(isset($_GET[\"quantity\"]) && $_GET[\"quantity\"] > 0) {\n $_SESSION[\"products\"][$_GET[\"update_quantity\"]][\"product_qty\"] = $_GET[\"quantity\"];\n }\n\n $total_product = count($_SESSION[\"products\"]);\n die(json_encode(['products' => $total_product]));\n }", "public function editCartQuant($username, $sku, $amount){\n $cartQuery = mysqli_fetch_array($this->connection->query(\"SELECT cart FROM users WHERE username = '$username'\"));\n $cart = $cartQuery['cart'];\n $currentInventoryQuant = mysqli_fetch_array($this->connection->query(\"SELECT quantity FROM items WHERE sku = '$sku'\"));\n\n //Update overall inventory\n $updatedInventory = $cart[$sku-1] - $amount;\n $updatedInventory = $currentInventoryQuant[0] + $updatedInventory;\n $query = \"UPDATE items SET quantity = '$updatedInventory' WHERE sku = '$sku'\";\n $this->connection->query($query);\n\n //Send an updated query using the new cartQuery array\n $cart[$sku-1] = $amount;\n $query = \"UPDATE users SET cart = '$cart' WHERE username = '$username'\";\n $this->connection->query($query);\n return true;\n }", "private function updateQty($object)\n\t{\n\t\t$common = new Qss_Model_Extra_Extra();\n $MaLenhSX = @(string)$object->getFieldByCode('MaLenhSX')->szValue;\n $mSanXuat = Qss_Model_Db::Table('OSanXuat');\n $mSanXuat->where(sprintf(' MaLenhSX = \"%1$s\"', $MaLenhSX));\n $oSanXuat = $mSanXuat->fetchOne();\n//\t\t$ThaoDo = @(int)$common->getDataset(array('module'=>'OSanXuat'\n//\t\t\t\t\t, 'where'=>array('MaLenhSX'=>$MaLenhSX), 'return'=>1))->ThaoDo;\n $ThaoDo = @(int)$oSanXuat->ThaoDo;\n\n\t\tif($ThaoDo == 1)\n\t\t{\n\t\t\t// Neu thao do, set so luong ve disabled\n\t\t\t// Cong don so luong phu pham, hoac set ve 0 neu khong co phu pham\n//\t\t\t$PhuPham = $common->getDataset(array('module'=>'OSanLuong'\n//\t\t\t\t\t\t, 'where'=>array('IFID_M717'=>$object->i_IFID)));\n $mPhuPham = Qss_Model_Db::Table('OSanLuong');\n $mPhuPham->where(sprintf('IFID_M717 = %1$d', $object->i_IFID));\n\n\t\t\t$SoLuongPhuPham = 0;\n\t\t\t$insert = array();\n\t\t\t\n\t\t\tforeach($mPhuPham->fetchAll() as $p)\n\t\t\t{\n\t\t\t\t$SoLuongPhuPham += $p->SoLuong;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t$insert['OThongKeSanLuong'][0]['SoLuong'] = $SoLuongPhuPham;\n\t\t\t\n\t\t\t$service = $this->services->Form->Manual('M717',$object->i_IFID,$insert,false);\n\t\t\tif($service->isError())\n\t\t\t{\n\t\t\t\t$this->setError();\n\t\t\t\t$this->setMessage($service->getMessage(Qss_Service_Abstract::TYPE_TEXT));\n\t\t\t}\n\t\t}\n\t}", "public function increase($warehouseId, $productId, $qty, $updateCatalog = true)\n {\n return $this->change($warehouseId, $productId, abs($qty), $updateCatalog);\n }", "public function increaseQuantity(Cart $cartObj)\n {\n $productObj = new Product($cartObj->getProductId());\n $query = $this->pdo->prepare(\"UPDATE orders_products SET quantity = quantity+ :quantity\n WHERE product_id =:product_id AND orders_products.order_id = :order_id\");\n $query->execute(array('product_id'=>$productObj->getId(),\n 'order_id'=>$cartObj->getOrderId(),\n 'quantity'=>$cartObj->getQuantity()));\n $productObj->increaseQuantity($productObj->getId(), 1);\n unset($query);\n }", "public static function addItem($id_product, $id_item, $qty)\n {\n }", "public function decrement_quantity(){\n\t\t$mysql = mysql_connection::get_instance();\n\t\t\n\t\t$stmt = $mysql->prepare('UPDATE `items` SET `item_quantity` = `item_quantity` - 1 WHERE `item_id` = ?');\n\t\t$stmt->bind_param('i', $this->id);\n\t\t$stmt->execute();\n\t\t$stmt->close();\n\t}", "public function updateQtyItem(UpdateCartRequest $request)\n {\n $data = Cart::updateQtyItem($request);\n if ($data['success']) {\n return response()->json($data);\n } else {\n return response()->json([\n 'success' => false,\n 'msg' => 'Đã xảy ra lỗi. Vui lòng thử lại.'\n ]);\n }\n }", "public function getQuantity();", "public function getQuantity();", "public function getQuantity();", "public function setQuantity($value) \n {\n $this->_fields['Quantity']['FieldValue'] = $value;\n return $this;\n }", "public function setQuantity($value)\n {\n $this->quantity = $value;\n $this->recalculatePriceTotal();\n }", "function pewc_set_product_weight_meta( $cart_item_data, $item, $group_id, $field_id, $value ) {\n\n\t$item_weight = ! empty( $cart_item_data['product_extras']['weight'] ) ? $cart_item_data['product_extras']['weight'] : 0;\n\tif( $item['field_type'] == 'calculation' && ( ! empty( $item['formula_action'] ) && $item['formula_action'] == 'weight' ) ) {\n\t\t$cart_item_data['product_extras']['weight'] = $item_weight + $value;\n\t}\n\n\treturn $cart_item_data;\n\n}", "public function addItem($prod_id)\n {\n // if the item already exists\n if (array_key_exists($prod_id, $this->items)) {\n $this->items[$prod_id] += 1;\n } else {\n $this->items = $this->items + array($prod_id => 1);\n }\n\n $this->calcTotal();\n }", "public function getQuantity(): float;", "public function updateStockMovement($item_id, $quantity,$oldquantity){\n $this->insertStockMovement($item_id, $quantity, false, $oldquantity);\n }", "public function calculateItemQuantity($data){\n\t\textract($data);\n\t\tif ($mode == 'order' || $mode == 'pull') {\n\t\t\t$sell_qty = $this->Item->OrderItem->field('sell_quantity', array('id' => $rowId));\n\t\t\treturn $this->itemRecord['Item']['quantity'] + ($pullQty * $sell_qty);\n\t\t} elseif ($mode == 'replenishment') {\n\t\t\t// we need the quantity per unit for this replenishment item\n\t\t\t$po_qty = $this->Item->ReplenishmentItem->field('po_quantity', array('id' => $rowId));\n\t\t\treturn $this->itemRecord['Item']['quantity'] + ($pullQty * $po_qty);\n\t\t}\n }", "function FormatQTY($item, $qty) \n {\n \n $q1=db::table('measurement_units')->select('measurement_units.*','measurements.description')\n ->leftJoin('measurements','measurements.id','measurement_units.measurementID')\n ->orderby('quantity', 'desc')->where('productID',$item)->get();\n $qty1=$qty;\n\t $data='';\n foreach ($q1 as $b){\n\t $formatqty= $b->quantity;\n\t if($formatqty==0)$formatqty=1;\n \t $q = intval($qty / $formatqty);\n $qty = $qty % $formatqty;\n \tif($q<>0){\n \t $data.= ' '.Abs($q).$b->description;\n \t } \n\t }\n\t return (int)$qty1 <0 ? '('.$data.')':$data;\n }", "function subtrac_product_qty($id,$qty)\r\n{\r\n\t$sql = 'UPDATE products SET product_qty = product_qty - '.$qty.' WHERE `product_id` ='.$id.' and product_qty > 0';\r\n\t$results = mysql_query($sql);\r\n}", "public function getNewQuantity()\n {\n return $this->newQuantity;\n }", "public function changeQuantityAction()\r\n {\r\n if ($this->Request()->getParam('sArticle') && $this->Request()->getParam('sQuantity')) {\r\n $this->View()->sBasketInfo = $this->basket->sUpdateArticle($this->Request()->getParam('sArticle'), $this->Request()->getParam('sQuantity'));\r\n }\r\n $this->forward($this->Request()->getParam('sTargetAction', 'index'));\r\n }", "public function addItem(string $sku, int $qty): Cart;", "public function getQuantity()\n {\n return parent::getQuantity();\n }", "function updateItemQuantity($index, $amount)\n {\n $_SESSION['cart'][$index]['quantity'] += $amount;\n $_SESSION['cart'][$index]['total'] += $_SESSION['cart'][$index]['price'] * $amount;\n if ($_SESSION['cart'][$index]['quantity'] == 0) {\n unset($_SESSION['cart'][$index]);\n $_SESSION['cart'] = array_values($_SESSION['cart']);\n }\n }", "private function makeItemPurchase() : void\n {\n $this->item->available = $this->item->available - 1;\n $this->coinService->setCoinCount(\n $this->coinService->getCurrenCoinCount() - $this->item->cost\n );\n $this->item->save();\n }", "public function updateQuantity()\n {\n $this->load('itemAddressFiles');\n $quantity = 0;\n foreach ($this->itemAddressFiles as $addressFileLink) {\n $quantity += $addressFileLink->count;\n }\n $quantity += $this->mail_to_me;\n $this->quantity = $quantity;\n $this->save();\n $this->_calculateTotal();\n }", "public function update(): void\n {\n // Update quality\n $this->item->quality--;\n\n // Update Sell in\n $this->updateSellIn();\n\n // Check if we need to decrease quality again\n if ($this->item->sell_in < 0) {\n $this->item->quality--;\n }\n\n $this->checkAndUpdateQualityByRange();\n }", "public function updateQty($unitId,$data)\n\t{\t\n\t\t$this->db->where($this->pro->productunit.\"_id\",$unitId);\n\t\treturn $this->db->update($this->pro->prifix.$this->pro->productunit,$data);\n\t}", "public function getQuantity()\n {\n return $this->quantity;\n }", "public function add_inventory($productName,$quantity){\r\n // math\r\n $conn = new mysqli($GLOBALS['servername'], $GLOBALS['username'], $GLOBALS['password'], $GLOBALS['dbname']);\r\n $preSql = \"Select quantity from inventory where productName = '$productName'\";\r\n $preResult = $conn->query($preSql);\r\n $preRow = $preResult->fetch_assoc();\r\n $total = $preRow[\"quantity\"] + $quantity;\r\n // query\r\n $sql = \"Update inventory SET quantity = '$total' WHERE productName = '$productName'\";\r\n $conn->query($sql);\r\n }", "public function change_cart_quantity( $cart_key, $quantity, $old_quantity ) {\n\t\tif ( ! isset( WC()->cart->cart_contents[ $cart_key ] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$item = WC()->cart->cart_contents[ $cart_key ];\n\n\t\t$original_quantity = $old_quantity;\n\t\t$new_quantity = $quantity;\n\n\t\t// If we are not really changing quantity, return\n\t\tif ( $original_quantity === $new_quantity ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$product_id = $item['product_id'];\n\t\t$variation = '';\n\t\t$product = null;\n\n\t\tif ( ! empty( $item['variation_id'] ) ) {\n\t\t\t$product = wc_get_product( $item['variation_id'] );\n\t\t\tif ( method_exists( $product, 'get_name' ) ) {\n\t\t\t\t$variation = $product->get_name();\n\t\t\t} else {\n\t\t\t\t$variation = $product->post->post_title;\n\t\t\t}\n\t\t} else {\n\t\t\t$product = wc_get_product( $product_id );\n\t\t}\n\n\t\t$categories = (array) get_the_terms( $product_id, 'product_cat' );\n\t\t$category_names = wp_list_pluck( $categories, 'name' );\n\t\t$first_category = reset( $category_names );\n\n\t\tif ( $original_quantity < $new_quantity ) {\n\t\t\t$atts = array(\n\t\t\t\t't' => 'event', \t\t\t\t\t\t\t// Type of hit\n\t\t\t\t'ec' => 'Cart', \t\t\t\t\t\t// Event Category\n\t\t\t\t'ea' => 'Increased Cart Quantity', \t\t\t\t\t// Event Action\n\t\t\t\t'el' => htmlentities( get_the_title( $product_id ), ENT_QUOTES, 'UTF-8' ), // Event Label (product title)\n\t\t\t\t'ev' => absint( $new_quantity - $original_quantity ), \t\t// Event Value (quantity)\n\t\t\t\t'pa' => 'add', \t\t\t\t\t\t\t// Product Action\n\t\t\t\t'pal' => '', \t\t\t\t\t\t // Product Action List\n\t\t\t\t'pr1id' => $product_id, \t\t\t\t\t\t// Product ID\n\t\t\t\t'pr1nm' => get_the_title( $product_id ), \t\t\t// Product Name\n\t\t\t\t'pr1ca' => $first_category, \t\t\t\t\t\t// Product Category\n\t\t\t\t'pr1va' => $variation, \t\t\t\t\t\t\t// Product Variation Title\n\t\t\t\t'pr1pr' => $product->get_price(), \t\t\t// Product Price\n\t\t\t\t'pr1qt' => absint( $new_quantity - $original_quantity ), // Product Quantity\t\n\t\t\t);\n\n\t\t\tif ( monsterinsights_get_option( 'userid', false ) && is_user_logged_in() ) {\n\t\t\t\t$atts['uid'] = get_current_user_id(); // UserID tracking\n\t\t\t}\n\n\t\t\tmonsterinsights_mp_track_event_call( $atts );\n\t\t} else {\n\t\t\t$atts = array(\n\t\t\t\t't' => 'event', \t\t\t\t\t\t\t// Type of hit\n\t\t\t\t'ec' => 'Cart', \t\t\t\t\t\t// Event Category\n\t\t\t\t'ea' => 'Decreased Cart Quantity', \t\t\t\t\t// Event Action\n\t\t\t\t'el' => htmlentities( get_the_title( $product_id ), ENT_QUOTES, 'UTF-8' ), // Event Label (product title)\n\t\t\t\t'ev' => absint( $new_quantity - $original_quantity ), \t\t// Event Value (quantity)\n\t\t\t\t'cos' => $this->get_funnel_step( 'added_to_cart' ), \t\t// Checkout Step: Add to cart\n\t\t\t\t'pa' => 'remove', \t\t\t\t\t\t\t// Product Action\n\t\t\t\t'pal' => '', \t\t\t\t\t\t\t// Product Action List:\n\t\t\t\t'pr1id' => $product_id, \t\t\t\t\t\t// Product ID\n\t\t\t\t'pr1nm' => get_the_title( $product_id ), \t\t\t// Product Name\n\t\t\t\t'pr1ca' => $first_category, \t\t\t\t\t\t// Product Category\n\t\t\t\t'pr1va' => $variation, \t\t\t\t\t\t\t// Product Variation Title\n\t\t\t\t'pr1pr' => $product->get_price(), \t\t\t// Product Price\n\t\t\t\t'pr1qt' => absint( $new_quantity - $original_quantity ), // Product Quantity\t\t\n\t\t\t);\n\n\t\t\tif ( monsterinsights_get_option( 'userid', false ) && is_user_logged_in() ) {\n\t\t\t\t$atts['uid'] = get_current_user_id(); // UserID tracking\n\t\t\t}\n\n\t\t\tmonsterinsights_mp_track_event_call( $atts );\n\t\t}\n\t}", "public function setQtyAttribute($input)\n {\n if ($input != '') {\n $this->attributes['qty'] = $input;\n } else {\n $this->attributes['qty'] = null;\n }\n }", "public static function updateDesiredQntPickingWaveState($item): void\n {\n $pickingWaveState = PickingWavesState::where([['picking_wave_id', $item['picking_wave_id']], ['product_id', $item['id']]])->first();\n\n if ($pickingWaveState != null) {\n PickingWavesState::where([['picking_wave_id', $item['picking_wave_id']], ['product_id', $item['id']]])\n ->update(['desired_qnt' => $pickingWaveState->desired_qnt + $item['quantity']]);\n } else {\n self::insertPickingWaveState($item);\n }\n }", "public function onBeforeWrite() {\n parent::onBeforeWrite();\n\n // See if this order was just marked paid, if so reduce quantities for\n // items.\n if($this->isChanged(\"Status\") && $this->Status == \"paid\") {\n foreach($this->Items() as $item) {\n $product = $item->MatchProduct;\n\n if($product->ID && $product->Quantity) {\n $new_qty = $product->Quantity - $item->Quantity;\n $product->Quantity = ($new_qty > 0) ? $new_qty : 0;\n $product->write();\n }\n }\n }\n }", "public static function update_item($key, $quantity) {\n $quantity = (int) $quantity;\n if (isset($_SESSION['bookCart'][$key])) {\n if ($quantity <= 0) {\n unset($_SESSION['bookCart'][$key]);\n } else {\n $_SESSION['bookCart'][$key]['qty'] = $quantity;\n $total = $_SESSION['bookCart'][$key]['cost'] *\n $_SESSION['bookCart'][$key]['qty'];\n $_SESSION['bookCart'][$key]['total'] = $total;\n }\n }\n }", "public function updateKitInventory() {\n\t\textract($this->request->data);\n\t\t//this->request->data contains\n\t\t//array(\n\t\t//\t'pullQty' => '1',\n\t\t//\t'itemId' => '90',\n\t\t//\t'rowId' => '52d08471-8838-4330-b765-00ed47139427',\n\t\t//\t'onHand' => 'undefined',\n\t\t//\t'mode' => 'pull'\n\t\t//)\n\t\t//setup return array\n\t\t$orderItemType = $this->Item->OrderItem->field('catalog_type', array('id' => $rowId));\n\t\tif($orderItemType & (ON_DEMAND | INVENTORY_KIT)){\n\t\t\t$orderItemCatId = $this->Item->OrderItem->field('catalog_id', array('id' => $rowId));\n\t\t\t$this->requestAction(array('controller' => 'Catalogs', 'action' => 'kitAdjustment', $orderItemCatId, abs($pullQty), $orderItemType));\n\t\t\t$onHand = $this->Item->field('quantity', array('id' => $itemId));\n\t\t}\n\t\treturn $onHand;\n\t}", "public function updateQuantity(Request $request)\n {\n $cart = $request->session()->get('pos.cart', collect([]));\n $cart = $cart->map(function ($object, $key) use ($request) {\n if($key == $request->key){\n $product = \\App\\Product::find($object['id']);\n $product_stock = $product->stocks->where('id', $object['stock_id'])->first();\n\n if($product_stock->qty >= $request->quantity){\n $object['quantity'] = $request->quantity;\n }else{\n return array('success' => 0, 'message' => translate(\"This product doesn't have more stock.\"), 'view' => view('pos.cart')->render());\n }\n }\n return $object;\n });\n $request->session()->put('pos.cart', $cart);\n\n return array('success' => 1, 'message' => '', 'view' => view('pos.cart')->render());\n }", "function change_quantity($pid,$q){\n\t// scart-products_addorder.php?action=checkout -- id=\"submit_editqty\" \n\t$cart = $_SESSION['custCart_ID']; // the SESSION and COOKIE customer cart items array\n\t$pid=intval($pid);\n\t$max=count($_SESSION[$cart]);\n\tif(product_exists($pid)) {\n\t for($i=0;$i<$max;$i++){\n\t\tif($pid==$_SESSION[$cart][$i]['bookid']){\n\t\t $_SESSION[$cart][$i]['qty']=$q;\n\t\t // break;\n\t\t}\n\t }\n\t print '<script type=\"text/javascript\">';\n\t print 'alert(\"Quantity Updated!\\n--- New Quantity = '.$q.'!\\n\\n\")';\n\t print '</script>';\n return $pid; // pid existing return empty array no message\n\t}\n\n}", "public function getQuantity()\n {\n return $this->quantity;\n }", "public function getQtyOrdered() {\n return $this->item->getQtyOrdered();\n }", "public function setQty($qty)\r\n {\r\n $this->qty = $qty;\r\n\r\n return $this;\r\n }", "function updateSnowQuantity($snowCode,$change){\n $getUserTypeQuery = \"SELECT qtyAvailable FROM snows WHERE code='\".$snowCode.\"'\";\n require_once 'model/dbConnector.php';\n $oldQuantity = executeQuerySelect($getUserTypeQuery)[0]['qtyAvailable'];\n $newQuantity = $oldQuantity-$change;\n $rentInsertQuery2 = \"UPDATE snows SET qtyAvailable=\".$newQuantity.\" WHERE code='\".$snowCode.\"'\";\n $queryResult2 = executeQueryInsert($rentInsertQuery2);\n}", "public function astra_addon_add_offcanvas_quantity_fields( $html, $cart_item, $cart_item_key ) {\n\n\t\t\t$_product = apply_filters(\n\t\t\t\t'woocommerce_cart_item_product',\n\t\t\t\t$cart_item['data'],\n\t\t\t\t$cart_item,\n\t\t\t\t$cart_item_key\n\t\t\t);\n\t\t\t$product_price = apply_filters(\n\t\t\t\t'woocommerce_cart_item_price',\n\t\t\t\tWC()->cart->get_product_price( $cart_item['data'] ),\n\t\t\t\t$cart_item,\n\t\t\t\t$cart_item_key\n\t\t\t);\n\n\t\t\t$product_subtotal = apply_filters(\n\t\t\t\t'woocommerce_cart_item_subtotal',\n\t\t\t\tWC()->cart->get_product_subtotal( $_product, $cart_item['quantity'] ),\n\t\t\t\t$cart_item,\n\t\t\t\t$cart_item_key\n\t\t\t);\n\n\t\t\tif ( $_product->is_sold_individually() ) {\n\t\t\t\t$product_quantity = sprintf( '1 <input type=\"hidden\" name=\"cart[%s][qty]\" value=\"1\" />', $cart_item_key );\n\t\t\t} else {\n\t\t\t\t$product_quantity = trim(\n\t\t\t\t\twoocommerce_quantity_input(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'input_name' => \"cart[{$cart_item_key}][qty]\",\n\t\t\t\t\t\t\t'input_value' => $cart_item['quantity'],\n\t\t\t\t\t\t\t'max_value' => $_product->get_max_purchase_quantity(),\n\t\t\t\t\t\t\t'min_value' => '0',\n\t\t\t\t\t\t\t'product_name' => $_product->get_name(),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t$_product,\n\t\t\t\t\t\tfalse\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn $product_quantity . '<div class=\"ast-mini-cart-price-wrap\">' . $product_subtotal . '</div>';\n\t\t}", "private function _setQuantity($idTyre, $idStore, $idShop)\n\t{\n\t\t$qp = new QueryProcessor();\n\t\treturn $qp->query_stocks_quantity($idTyre, $idStore, $idShop);\n\t}", "private function increaseQuality(Item $item): void\n {\n $this->itemManipulator->increaseQuality($item, $this->itemKnowledge->getQualityIncrement($item));\n }", "protected function buildQtyItemsFields(): void\n {\n //====================================================================//\n // Order Line Quantity\n $this->fieldsFactory()->create(SPL_T_INT)\n ->identifier(\"quantity\")\n ->inList(\"lines\")\n ->name(\"[L] Quantity\")\n ->description(\"[L] Absolute Ordered Quantity\")\n ->group(\"Items\")\n ->microData(\n \"http://schema.org/QuantitativeValue\",\n $this->connector->hasLogisticMode() ? \"toShip\" : \"value\"\n )\n ->association(\"title@lines\", \"quantity@lines\", \"price@lines\")\n ->isReadOnly()\n ;\n //====================================================================//\n // Order Line Quantity with Refunds\n $this->fieldsFactory()->create(SPL_T_INT)\n ->identifier(\"quantity_with_refunds\")\n ->inList(\"lines\")\n ->name(\"[L] Qty with refunds\")\n ->description(\"[L] Ordered Quantity minus Refunded Quantities\")\n ->group(\"Items\")\n ->microData(\n \"http://schema.org/QuantitativeValue\",\n $this->connector->hasLogisticMode() ? \"value\" : \"toShip\"\n )\n ->association(\"title@lines\", \"quantity@lines\", \"price@lines\")\n ->isReadOnly()\n ;\n //====================================================================//\n // Order Line Refunded Quantity\n $this->fieldsFactory()->create(SPL_T_INT)\n ->identifier(\"quantity_refunded\")\n ->inList(\"lines\")\n ->name(\"[L] Refunded Qty\")\n ->description(\"[L] Refunded/Returned Quantities\")\n ->group(\"Items\")\n ->microData(\"http://schema.org/QuantitativeValue\", \"refunded\")\n ->association(\"title@lines\", \"quantity@lines\", \"price@lines\")\n ->isReadOnly()\n ;\n }", "public function productquantity() {\n\n $this->checkPlugin();\n\n if ($_SERVER['REQUEST_METHOD'] === 'PUT') {\n //update products\n $requestjson = file_get_contents('php://input');\n $requestjson = json_decode($requestjson, true);\n\n if (!empty($requestjson) && count($requestjson) > 0) {\n $this->updateProductsQuantity($requestjson);\n } else {\n $this->response->setOutput(json_encode(array('success' => false)));\n }\n } else {\n $json['success'] = false;\n $json['error'] = \"Invalid request method, use PUT method.\";\n $this->sendResponse($json);\n }\n }", "public function addNakshi($item, $id){\n\n $storedItem = ['qty' => 0, 'productPrice' => $item->productPrice, 'item' => $item];\n if($this->items){\n if(array_key_exists($id, $this->items)){\n $storedItem = $this->items[$id];\n }\n }\n\n $storedItem['qty']++;\n $storedItem['productPrice'] = $item->productPrice * $storedItem['qty'];\n $this->items[$id] = $storedItem;\n $this->totalQty++;\n $this->totalPrice += $item->productPrice;\n }", "public function hookactionUpdateQuantity($params)\n {\n $id_product = (int)$params['id_product'];\n $id_product_attribute = (int)$params['id_product_attribute'];\n \n $context = Context::getContext();\n $id_shop = (int)$context->shop->id;\n $id_lang = (int)$context->language->id;\n $product = new Product($id_product, false, $id_lang, $id_shop, $context);\n \n if (empty($product)) {\n return;\n }\n \n $product_name = Product::getProductName($id_product, $id_product_attribute, $id_lang);\n $product_has_attributes = $product->hasAttributes();\n $productInfo = array(\n 'product_name' => $product_name,\n 'product_id' => $id_product\n );\n $check_oos = ($product_has_attributes && $id_product_attribute)\n || (!$product_has_attributes && !$id_product_attribute);\n $product_quantity = (int)$params['quantity'];\n if (Module::isInstalled('mailalerts')) {\n // For out of stock notification to admin\n $isActivate = $this->isRulesetActive('out_of_stock_alerts');\n if ($check_oos\n && $product->active == 1\n && $isActivate != null\n && $isActivate != ''\n && $this->smsAPI != null\n && $this->smsAPI != ''\n && $product_quantity <= $this->outStock) {\n $legendstemp = $this->replaceProductLegends(\n $isActivate[0]['template'],\n $productInfo\n );\n // Use send SMS API here\n $legendstemp = preg_replace('/<br(\\s+)?\\/?>/i', \"\\n\", $legendstemp);\n $postAPIdata = array(\n 'label' => $isActivate[0]['label'],\n 'sms_text' => $legendstemp,\n 'source' => '21000',\n 'sender_id' => $isActivate[0]['senderid'],\n 'mobile_number' => $this->adminMobile\n );\n \n $this->sendSMSByAPI($postAPIdata);\n Onehopsmsservice::onehopSaveLog('OutStock', $legendstemp, $this->adminMobile);\n }\n \n // For back in stock\n $isActivate = $this->isRulesetActive('back_of_stock_alerts');\n if ($isActivate != null\n && $isActivate != ''\n && $this->smsAPI != null\n && $this->smsAPI != ''\n && $product_quantity > 0) {\n $bosSql = 'SELECT DISTINCT adr.phone_mobile, oos.id_customer';\n $bosSql .= ' FROM '._DB_PREFIX_. 'mailalert_customer_oos as oos';\n $bosSql .= ' INNER JOIN '._DB_PREFIX_. 'address as adr ON oos.id_customer = adr.id_customer';\n $bosSql .= ' WHERE oos.id_product = \"' . (int)$id_product . '\" AND deleted = 0';\n $bosResults = Db::getInstance()->ExecuteS($bosSql);\n \n if ($bosResults) {\n foreach ($bosResults as $customerVal) {\n $customerInfo = array(\n 'id_customer' => $customerVal['id_customer'],\n 'phone_mobile' => $customerVal['phone_mobile']\n );\n $legendstemp = $this->replaceProductCustomerLegends(\n $isActivate[0]['template'],\n $customerInfo,\n $productInfo\n );\n $legendstemp = preg_replace('/<br(\\s+)?\\/?>/i', \"\\n\", $legendstemp);\n // Use send SMS API here\n $postAPIdata = array(\n 'label' => $isActivate[0]['label'],\n 'sms_text' => $legendstemp,\n 'source' => '21000',\n 'sender_id' => $isActivate[0]['senderid'],\n 'mobile_number' => $customerVal['phone_mobile']\n );\n $this->sendSMSByAPI($postAPIdata);\n $delQuery = 'DELETE FROM ' . _DB_PREFIX_ . 'mailalert_customer_oos';\n $delQuery .= ' WHERE id_customer = \"' . (int)$customerVal['id_customer'] . '\"';\n Db::getInstance()->execute($delQuery);\n Onehopsmsservice::onehopSaveLog('BackStock', $legendstemp, $customerVal['phone_mobile']);\n }\n }\n }\n }\n }", "public function setQty(int $qty) : CartItem\n {\n $this->qty = $qty;\n\n return $this;\n }", "public static function UpdateQuantity($p_proId, $sl)\n {\n $sql = \"update products set Quantity= Quantity-$sl where ProID = $p_proId\";\n DataProvider::execQuery($sql);\n }", "public function getQuantity(): int\n {\n return $this->quantity;\n }", "function addToInventory($userid, $ingredient, $qty, $units){\n\t if(($userid != NULL) &&($ingredient != NULL) && ($qty != NULL)&& ($units != NULL))\n\t { \n\t if($qty <= 0)\n\t\t return;\n\t\t $count = @mysql_query(\"SELECT COUNT(*) as count FROM Inventory WHERE (UserID = '$userid' \n\t\t AND IngredientName = '$ingredient' AND Units ='$units')\");\n\t\t $countdata = mysql_fetch_assoc($count);\n\t\t if($countdata['count'] >= 1)\n\t\t\t @mysql_query(\"UPDATE Inventory SET Quantity = Quantity + '$qty' WHERE (UserID ='$userid' \n\t\t\t AND IngredientName = '$ingredient' AND Units ='$units')\");\n\t\t else\n\t\t @mysql_query(\"INSERT INTO Inventory VALUES ('$userid','$ingredient','$qty','$units')\");\n\t\t}\n\t}", "public function setTotalQtyOrdered($totalQtyOrdered);", "public function update($items = array())\n {\n if ($this->_checkCartUpdate($items) === TRUE)\n {\n\t\t\t$this->_session['products'][$items['token']]['qty'] = $items['qty'];\n $this->trigger(CartEvent::EVENT_UPDATE_QUANTITY_POST, $items['token'], $this->_session['products'][$items['token']], $this);\n }\n }", "public function setQuantity($var)\n {\n GPBUtil::checkInt64($var);\n $this->quantity = $var;\n\n return $this;\n }" ]
[ "0.73477876", "0.72841936", "0.72334087", "0.7104021", "0.70794016", "0.7075447", "0.69225645", "0.6855489", "0.683042", "0.6815829", "0.67333376", "0.671976", "0.6699082", "0.6699082", "0.6598562", "0.65907705", "0.6575502", "0.6563681", "0.6521636", "0.6496291", "0.64797235", "0.64741766", "0.64478207", "0.644459", "0.64348465", "0.63744515", "0.6356211", "0.63416845", "0.6329886", "0.63136214", "0.62849724", "0.6278467", "0.62756413", "0.627542", "0.6268437", "0.6268437", "0.626273", "0.6240779", "0.6235834", "0.6234895", "0.6220866", "0.6202625", "0.6182605", "0.61782694", "0.6169511", "0.6158578", "0.6156588", "0.61501974", "0.6144686", "0.61432767", "0.6127944", "0.6117783", "0.61134934", "0.61134934", "0.61134934", "0.6102003", "0.6088302", "0.60875374", "0.6086717", "0.60743284", "0.60694295", "0.60634476", "0.6061699", "0.6061107", "0.60414416", "0.6032165", "0.60306334", "0.60286534", "0.6018893", "0.600885", "0.60004157", "0.5996042", "0.59839785", "0.5971487", "0.5967794", "0.594346", "0.5937023", "0.5923319", "0.59188175", "0.59072775", "0.58891547", "0.5886437", "0.58754677", "0.5868058", "0.5860047", "0.5853247", "0.58523613", "0.5851742", "0.58501613", "0.58308077", "0.58035445", "0.57959044", "0.5789813", "0.57852966", "0.57762843", "0.57739484", "0.5770719", "0.57656205", "0.57591593", "0.5759144", "0.5756789" ]
0.0
-1
======================================================================= Getters & setters =======================================================================
public function getUserItem($table, $cookie = '') { $model = str_replace(' ', '', ucwords(str_replace('_', ' ', $table))) . 'Manager'; $tables = [$table => ['user_id', 'item_id'], 'products' => ['*'], 'product_categorie' => ['*'], 'categories' => ['categorie']]; $data = ['join' => 'INNER JOIN', 'rel' => [['item_id', 'pdtID'], ['pdtID', 'pdtID'], ['catID', 'catID']], 'where' => ['user_id' => ['value' => $cookie, 'tbl' => $table]]]; $uc = (new $model())->getAllItem($data, $tables); return $uc->count() > 0 ? $uc->get_results() : []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function __init__() { }", "private function __construct() {\n \n }", "private function __construct() {\n \n }", "private function __construct() {\n \n }", "public function __construct() {\n \n }", "public function __construct() {\r\n\t\t// TODO Auto-generated constructor\r\n\t}", "public function __construct() {\r\n\t\t// TODO Auto-generated constructor\r\n\t}", "public function __construct() {\r\n\t\t// TODO Auto-generated constructor\r\n\t}", "function __construct() {\n \n }", "function __construct() {\n \n }", "function __construct() {\n \n }", "function __construct() {\n \n }", "function __construct() {\n \n }", "protected function __construct() {\n \n }", "protected function __construct(){}", "protected function __construct(){}", "protected function __construct(){}", "private function __construct()\t{}", "protected function __construct () {}", "private function __construct()\r\n {\r\n }", "private function __construct()\r\n {\r\n }", "final private function __construct() {\n\t\t\t}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "public function __construct() {\n\t\t// TODO Auto-generated constructor\n\t}", "public function __construct() {\n\t\t// TODO Auto-generated constructor\n\t}", "public function __construct() {\n\t\t// TODO Auto-generated constructor\n\t}", "public function __construct() {\n\t\t// TODO Auto-generated constructor\n\t}", "public function __construct() {\n\t\t// TODO Auto-generated constructor\n\t}", "public function __construct() {\n\t\t// TODO Auto-generated constructor\n\t}", "public function __construct() {\n\t\t// TODO Auto-generated constructor\n\t}", "public function __construct() {\r\n\t\t//\r\n\t}", "public function __construct()\n\t\t{\n\t\t\t//\n\t\t}", "function __construct(){\n \n }", "private function __construct() {\r\n\t\r\n\t}", "final private function __construct()\n {\n }", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "protected function __construct() { }", "protected function __construct() { }", "protected function __construct() { }", "protected function __construct() { }", "protected function __construct() { }", "protected function __construct() { }", "public function __construct()\r\n\t\t{\r\n\t\t}", "public function __construct() {\n\t\t//\n\t}", "public function __construct() {\n\t\t//\n\t}", "public function __construct() {\n\t\t//\n\t}", "public function __construct() {\n\t\t//\n\t}", "public function __construct()\n\t{\n\t\t// TODO Auto-generated constructor\n\t}", "protected function __construct() {\n\t\t\n\t}", "protected function __construct() {\n\t\t\n\t}", "public function __construct() {\n\n\t\t}", "public function __construct() {\r\n\r\n\t\t}", "public function __init(){}", "private function __construct() {\r\n\t\t\r\n\t}", "private function __construct() {\r\n }", "function __construct (){\n\t\t}", "private function __construct() {\n\t\t}", "public function __construct() { \n\t\t\n\n\t\t}", "public function __construct( )\r\n\t{\r\n\t\t// TODO Auto-generated constructor\r\n\t}", "public function __toString()\n {\n // TODO: Implement __toString() method.\n }", "function __construct() { }", "function __construct() { }", "function __construct() { }", "public function __construct() {\n }", "public function __construct()\r\n {\r\n // TODO Auto-generated constructor\r\n }" ]
[ "0.6642188", "0.65707546", "0.65707546", "0.65707546", "0.6515573", "0.64931697", "0.64931697", "0.64931697", "0.6488131", "0.6488131", "0.6488131", "0.6488131", "0.6488131", "0.64761835", "0.64269805", "0.64269805", "0.64269805", "0.6397241", "0.63850236", "0.6374074", "0.6374074", "0.6373282", "0.63652396", "0.63652396", "0.63652396", "0.63652396", "0.63652396", "0.63652396", "0.63652396", "0.63652396", "0.63652396", "0.63652396", "0.63652396", "0.63652396", "0.63652396", "0.63652396", "0.63652396", "0.63652396", "0.63632524", "0.63632524", "0.63632524", "0.63632524", "0.63632524", "0.63632524", "0.63632524", "0.6358764", "0.63325274", "0.6326226", "0.6311849", "0.6308229", "0.62882555", "0.62882555", "0.62882555", "0.62882555", "0.62882555", "0.62882555", "0.62882555", "0.62882555", "0.62882555", "0.62882555", "0.62882555", "0.62882555", "0.62882555", "0.62882555", "0.62882555", "0.62882555", "0.62882555", "0.6286038", "0.6286038", "0.6286038", "0.6286038", "0.6286038", "0.6279831", "0.6279831", "0.6279831", "0.6279831", "0.6279831", "0.6279831", "0.6268939", "0.6265657", "0.6265657", "0.6265657", "0.6265657", "0.62595236", "0.62553775", "0.62553775", "0.6249018", "0.62441885", "0.6240007", "0.62370443", "0.622579", "0.6219212", "0.62154114", "0.61972564", "0.6193704", "0.6187355", "0.61859834", "0.61859834", "0.61859834", "0.6185273", "0.61817014" ]
0.0
-1
Generate query that selects ids of visible URLs.
protected function getVisibleOnlySubQuery(SelectQuery $query) { // TODO: The following query requires optimization $subSelect = $query->subSelect(); $subSelect ->selectDistinct('ezurl_object_link.url_id') ->from('ezurl_object_link') ->innerJoin( 'ezcontentobject_attribute', $query->expr->lAnd( $query->expr->eq('ezurl_object_link.contentobject_attribute_id', 'ezcontentobject_attribute.id'), $query->expr->eq('ezurl_object_link.contentobject_attribute_version', 'ezcontentobject_attribute.version') ) ) ->innerJoin( 'ezcontentobject_tree', $query->expr->lAnd( $query->expr->eq('ezcontentobject_tree.contentobject_id', 'ezcontentobject_attribute.contentobject_id'), $query->expr->eq('ezcontentobject_tree.contentobject_version', 'ezcontentobject_attribute.version') ) ) ->where( $query->expr->eq( 'ezcontentobject_tree.is_invisible', $query->bindValue(0, null, PDO::PARAM_INT) ) ); return $subSelect; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAllIds();", "public abstract function get_ids();", "function get_urls($count, $start, $urls, $filter) {\n\tif ($start < $count) {\n\t\t$sparql = new EasyRdf_Sparql_Client(esc_attr(get_option( 'endpoint')));\n\t\t$result = $sparql->query(\n\t\t\t'SELECT distinct ?url ?date WHERE {\n\t\t\t\t ?url rdf:type <http://schema.org/CreativeWork>;\n\t\t\t\t '.$filter.'\n\t\t\t\t}\n\t\t\t\tORDER BY DESC(?date)\n\t\t\t\tLIMIT 50\n\t\t\t\tOFFSET ' . $start\n\t\t);\n\t\tforeach ($result as $row) {\n\t\t\techo '<br/>adding to array: '. $row->url;\n\t\t\tarray_push($urls, $row->url);\n\t\t}\n\t\tget_urls($count, $start += 50, $urls, $filter);\n\t} else {\n\t\tprocess_urls($urls);\t\n\t}\n\t\n\t\n}", "public function findDistinctUrlPics()\n {\n return $this->createStandardQueryBuilder()->distinct('pics.url')->sort('public_date', 1)->getQuery()->execute();\n }", "public function getPageUris();", "public function getIds();", "public function getIds();", "protected function get_retrieved_ids() {\n $ids = $this->parse_ids($items);\n \n $sidx = $eidx = 0;\n if (is_array($this->page_size)) {\n $sidx = $this->page_size[0];\n $eidx = $this->page_size[1];\n if ($sidx < 0)\n $sidx = 0;\n if ($eidx < $sidx)\n $eidx = $sidx;\n if ($eidx >= count($ids))\n $eidx = count($ids) - 1;\n \n $len = $eidx - $sidx + 1;\n if ($sidx >= count($ids))\n $ids = array();\n else\n $ids = array_slice($ids, $sidx, $len);\n }\n\n list($start_count, $max_count) = $this->get_page_limit($this->page_size);\n $num_to_display = $max_count - $start_count + 1;\n $ids = array_slice($ids, $start_count, $num_to_display);\n\n // This is supposed to come at the end of the retrieval, but I don't know where to put it yet.\n // This is legacy code anyway and is going byebye soon.\n //$output[\"eod\"] = $start_count < $max_count;\n //$output[\"counts\"][\"displayed\"] = $start_count;\n //if (!$output[\"eod\"])\n // $output[\"counts\"][\"displayed\"]--;\n return $ids;\n }", "public function getVisibleInSiteVisibilities()\n {\n return Mage::getSingleton('catalog/product_visibility')->getVisibleInSiteIds();\n }", "function get_all_page_ids()\n {\n }", "function __criteria_selector_ids($criteria, $statuses, $number = 0,\n $first = 0) {\n\n $paging = $this->__paging($number, $first);\n\n $statuses = $this->__statuses($statuses);\n\n $filters = array();\n\n for ($i = 0; $i < count($criteria); $i++) {\n\n $ad_group_id = $criteria[$i]['ad_group_id'];\n $criterion_id = $criteria[$i]['criterion_id'];\n\n $filters[] = '<idFilters>\n <adGroupId>'.$this->__xml($ad_group_id).'</adGroupId>\n <criterionId>'.\n $this->__xml($criterion_id)\n .'</criterionId>\n </idFilters>';\n\n }\n\n return '<selector>'.\n implode(' ', $filters).$paging.$statuses\n .'</selector>';\n\n}", "public function scopeFetchIds()\n {\n return $this->pluck(\"id\");\n }", "function __campaign_selector_ids($campaign_ids, $number, $first) {\n\n $paging = $this->__paging($number, $first);\n\n return '<selector>\n <ids>'.$this->__xml(implode(' ', $campaign_ids)).'</ids>\n '.$paging.'\n </selector>';\n\n}", "public function getAllIds(): array;", "function visibleUserIds() {\n if($this->visible_user_ids === false) {\n $this->visible_user_ids = Users::findVisibleUserIds($this);\n } // if\n return $this->visible_user_ids;\n }", "function visibleCompanyIds() {\n if($this->visible_company_ids === false) {\n $this->visible_company_ids = Users::findVisibleCompanyIds($this);\n } // if\n return $this->visible_company_ids;\n }", "protected function getPageIds()\n {\n return (array)explode(',', $this->getData('pages'));\n }", "public function getPageEntryIds();", "function findPageUrls();", "public function findIds($query = null, $page = null, $options = null);", "public function getQueryUrls($limit=NULL) {\n $a = self::getQueryUrl();\n $b = self::getHashes();\n\t$QueryUrls = array();\n\t$limit = (NULL!==$limit && is_numeric($limit)) ? (int)$limit : 0; \n\t$c = 0;\n\t//Foreach hash key value...\n\tforeach ( $b as $k => $v ) { \n\t //...that is a string with length > 0...\n\t\tif ( is_string($v) AND strlen($v) > 0 ) {\n\t\t\t//...format a query string. \n\t\t\t$rs = sprintf(tbr::QUERY_STRING, $v, $a);\n\t\t\t//Then, foreach available toolbar hostname...\n\t\t\tforeach ( $this->GTB_SERVER['host'] as $host ) {\n\t\t\t\t//...append any available top level domain... \n\t\t\t\tforeach ($this->GTB_SERVER['tld'] as $tld) {\n\t\t\t\t\t$tbUri = 'http://'. $host . $tld . tbr::SERVER_PATH . $rs;\n\t\t\t\t\tif ( $c < $limit || $limit == 0 ) {\n\t\t\t\t\t\t$QueryUrls[] = $tbUri;\n\t\t\t\t\t}\n\t\t\t\t\t$c++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} \n\treturn (sizeof($QueryUrls)>0) ? $QueryUrls : FALSE;\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public static function sitemap () {\n\t\t$res = self::query ('id')\n\t\t\t->order ('id asc')\n\t\t\t->fetch_orig ();\n\t\t\n\t\t$urls = array ();\n\t\tforeach ($res as $item) {\n\t\t\t$urls[] = '/wiki/' . $item->id;\n\t\t}\n\t\treturn $urls;\n\t}", "public function urlList(): Collection\n {\n return $this->range()->mapWithKeys(function (int $page) {\n return [$page => $this->url($page)];\n });\n }", "static function publishable_ids()\r\n {\r\n $xrate = current(current(WEBPAGE::$dbh->getAll(sprintf\r\n (\r\n \"select rate from tblCurrenciesExchangeRates where date = '%s' and currency_id = %s\", \r\n date('Y-m-d'),WEBPAGE::$conf['app']['xrate_local']))));\r\n $margin = $xrate * WEBPAGE::$conf['mod_sponsorship']['min_donation'];\r\n return WEBPAGE::$dbh->getAssoc(sprintf\r\n (\r\n \"select distinct\r\n lm.id, 1 + %s - datediff(curdate(),ckd.date) time_left,\r\n coalesce(rc.donations,0.00) donations,\r\n br.borrowers borrowers,\r\n lm.amount - coalesce(rc.donations,0.00) pending\r\n from\r\n (\r\n tblLoansMaster lm,\r\n (\r\n select\r\n lmd.master_id, lsh.date\r\n from\r\n tblLoanStatusHistory lsh,\r\n tblLoansMasterDetails lmd\r\n where\r\n lmd.loan_id = lsh.loan_id and\r\n lsh.status = 'G' and\r\n lsh.date < CURDATE() and\r\n lsh.date >= DATE_ADD(CURDATE(), INTERVAL -%s DAY)\r\n ) ckd\r\n )\r\n left join\r\n (\r\n select master_id,sum(donation) donations from tblLoansMasterSponsors group by master_id\r\n ) rc on rc.master_id = lm.id\r\n left join\r\n (\r\n select master_id,count(loan_id) borrowers from tblLoansMasterDetails lmd group by master_id\r\n ) br on br.master_id = lm.id\r\n where\r\n lm.borrower_type = 'B' and\r\n lm.check_status = 'R' and\r\n ckd.master_id = lm.id and\r\n br.borrowers >= %s and\r\n br.borrowers <= %s and\r\n coalesce(rc.donations,0.00) < lm.amount - %s\r\n order by\r\n lm.id\",\r\n WEBPAGE::$conf['mod_sponsorship']['publishing_margin'],\r\n WEBPAGE::$conf['mod_sponsorship']['publishing_margin'],\r\n WEBPAGE::$conf['mod_sponsorship']['publishing_min_borrowers'],\r\n WEBPAGE::$conf['mod_sponsorship']['publishing_max_borrowers'],\r\n $margin)\r\n );\r\n }", "public function ids() {\n\t\t$q = $this->query();\n\t\t$q->select(Salesperson::aliasproperty('id'));\n\t\treturn $q->find()->toArray();\n\t}", "public function GetViewAllURL();", "function getUrls(){\n $urls = $this->all('schema:url');\n return $urls;\n }", "public static function getAvailable()\n {\n $associated_ids = DB::table('campaigns')->pluck('website_id');\n return DB::table('websites')->whereNotIn('id', $associated_ids)\n ->pluck('url', 'id')\n ->toArray();\n }", "public function getIdentities()\n {\n return [\\Algolia\\AlgoliaSearch\\Model\\LandingPage::CACHE_TAG . '_' . $this->getPage()->getId()];\n }", "protected function getAllVisible()\n {\n $col = 'visible';\n $result = $this->db->newQuery('select', $this->table)\n ->addWhere()\n ->Equals($col)\n ->makeStatement()\n ->Bind($col, [$col => 1])\n ->FetchAll();\n\n return ($result) ?: null;\n }", "function getStreamUrls($ids)\n\t{\n\t\tif(!isset($ids) || $ids == \"\"){ exit(\"Error: missing objec ID\"); }\n\t\tif(!is_array($ids))\n\t\t{\n\t\t\t$ids = explode(\",\",$ids);\n\t\t}\n\t\t\n\t\t$post = array('Operation'=>'getStreamUrls');\n\t\tfor($i=1; $i<=count($ids); $i++)\n\t\t{\n\t\t\t$post['trackIdList.member.'.$i] = $ids[$i-1];\n\t\t}\n\t\t\n\t\treturn $this->request($this->cirrus,$post);\n\t\t\t\n\t}", "public function getUriList();", "public function getFilteredIds()\n {\n return $this->filteredIds;\n }", "public function getIds() {\n $sources = array();\n \n $sources[] = $this->id;\n \n foreach ($this->points as &$g) {\n $sources[] = $g->id;\n }\n foreach ($this->lines as &$g) {\n $sources[] = $g->id;\n }\n foreach ($this->polygons as &$g) {\n $sources[] = $g->id;\n }\n if ( !empty($this->address) ) {\n $sources[] = $this->address->id;\n }\n foreach ($this->relationships as &$r) {\n $sources[] = $r->id;\n }\n \n return array_filter($sources);\n }", "public function getUrlId();", "function getPagesQuery($table=' tx_tdcalendar_events'){\n\t\t$pages = $this->pidList;\n\t\tif(!$pages)return;\n\t\treturn ' AND '.$table.'.pid IN ('.$pages.') ';\n\t}", "function grafico_1_2_queryUrl( $desde, $hasta, $ua, $id){\n\t// FUNCIONA PERFECTAMENTE, se elije o 3 (oposicion) o 4 (oficialismo) como ID\n\t// y coincide con la cantidad de notas\n\t$query = \"select actor.nombre, actor.apellido, actor.id_campo, noticia.id_medio, noticia.titulo, noticia.url, noticia.id from noticiascliente \n\t\tinner join noticiasactor on noticiascliente.id_noticia = noticiasactor.id_noticia \n\t\tinner join noticia on noticiasactor.id_noticia = noticia.id \n\t\tinner join actor on noticiasactor.id_actor = actor.id \n\t\twhere \n\t\tnoticiascliente.id_cliente = \" . $ua . \" and \n\t\tnoticiascliente.elim = 0 and \n\t\tnoticia.fecha between '\" . $desde . \" 00:00:01' and '\" . $hasta . \" 23:59:59' \n\t\tand ( actor.id_campo like '%\" . $id . \"%' )\n\t\tORDER BY `actor`.`nombre` ASC\";\n\t/*$query = \"select actor.nombre, actor.apellido, actor.id_campo, noticia.id_medio, noticia.titulo, noticia.url, noticia.id from noticiascliente \n\t\tinner join noticiasactor on noticiascliente.id_noticia = noticiasactor.id_noticia \n\t\tinner join noticias on noticiasactor.id_noticia = noticias.id \n\t\tinner join actor on noticiasactor.id_actor = actor.id \n\t\twhere \n\t\tnoticiascliente.id_cliente = \" . $ua . \" and \n\t\tnoticiascliente.elim = 0 and \n\t\tnoticias.fecha between '\" . $desde . \" 00:00:01' and '\" . $hasta . \" 23:59:59' \n\t\tand ( actor.id_campo like '%\" . $id . \"%' )\n\t\tORDER BY `actor`.`nombre` ASC\";*/\n\t\n\t$main = R::getAll($query);\n\t\n\t$columnas = [\n\t\t(object) ['title' => 'id' ],\n\t\t(object) ['title' => 'actor'],\n\t\t(object) ['title' => 'titulo'],\n\t\t(object) ['title' => 'medio'],\n\t\t(object) ['title' => 'link'] \n\t];\n\t\n\t$filas = [];\n\tforeach($main as $k=>$v){\n\t\t$medio = R::findOne('medio','id LIKE ?',[ $v['id_medio'] ])['medio'];\n\t\t// cargo la fila\n\t\t$filas[] = [\n\t\t\t$v['id'],\n\t\t\t$v['nombre'] . ' ' . $v['apellido'],\n\t\t\t$v['titulo'],\n\t\t\t$medio,\n\t\t\t$v['url']\n\t\t];\n\t}\n\treturn [\n\t\t'columnas' => $columnas,\n\t\t'filas' => $filas\n\t\t];\n\t\n}", "public function getSearchRootPageIdList() {}", "public function getSearchRootPageIdList() {}", "public function public_ids_get()\n {\n $from = \"0\";\n $size = \"10\";\n $lastModified = NULL;\n \n $temp = $this->input->get('from', TRUE);\n if(!is_null($temp) & is_numeric($temp))\n $from = $temp;\n \n $temp = $this->input->get('size', TRUE);\n if(!is_null($temp) & is_numeric($temp))\n $size = $temp;\n \n $temp = $this->input->get('lastModified', TRUE);\n if(!is_null($temp) & is_numeric($temp))\n $lastModified = intval($temp);\n \n $cutil = new CILServiceUtil();\n $result = $cutil->getAllPublicIds($from, $size,$lastModified);\n $this->response($result);\n \n }", "public function getIds()\n {\n\n }", "public function get_http_album_query_ids($url_param_name)\n {\n if ($this->allow_group_disks) {\n $suite_array = $this->get_group_disks_ids();\n } else {\n $suite_array = array($this->id);\n }\n\n return http_build_query(array($url_param_name => $suite_array));\n }", "protected function get_site_ids()\n {\n }", "public function getPageIds()\n {\n $arr = array();\n foreach($this->elements as $displayElement){\n if($displayElement->getType() == 'element'){\n $page = $displayElement->getElement()->getPage();\n while($page != null) { \n $arr[] = $page->getId();\n $page = $page->getParent();\n }\n }\n if($displayElement->getType() == 'page'){\n $page = $displayElement->getPage();\n while($page != null) { \n $arr[] = $page->getId();\n $page = $page->getParent();\n }\n }\n }\n\n return array_unique($arr);\n }", "public function getJoinPagesForQuery() {}", "public function getJoinPagesForQuery() {}", "protected function _getFilterEntityIds()\n {\n return $this->getLayer()->getProductCollection()->getAllIdsCache();\n }", "public function getGridUrl()\n {\n // it maybe nice for filter several grids on one page\n // if needed return false. it will allow multiple grid urls... till url max length reached\n return $this->getUrl('*/*/*', array('_current'=>true));\n }", "public function getQuestionIds()\r\n{\r\n $query_string = \"SELECT questionid FROM questions \";\r\n $query_string .= \"WHERE question = :question AND questionid != :questionid\";\r\n\r\n return $query_string;\r\n}", "public function getSpotsIds() {\n $query = \"SELECT \" . $this->prefix . \"id FROM ' . $this->prefix . 'spot WHERE spot_track_id=\" . $this->track_id . \" ORDER BY spot_last_update DESC LIMIT \" . $this->limit_spots;\n\n $result = db_query($query);\n\n $spot_ids = array();\n while($row = mysqli_fetch_array($result)){\n $spot_ids[] = $row['spot_id'];\n }\n\n return $spot_ids;\n }", "function getAllUserIds($filter) {\n\t//SELECT id FROM students\n\t$sql = \"SELECT id FROM users WHERE $filter = 1\";\n\t$userIds = queryColumn($sql);\n\n\treturn $userIds;\n}", "function cicleinscription_get_all_courses_visible($cicleinscriptionid){\n\tglobal $DB;\n\t$sort = 'c.fullname ASC';\n\t$visibility = 1;\n\t\n\t$courses = $DB->get_records_sql(\"\n\t\tSELECT\n\t\t\tc.id,\n\t\t\tc.shortname,\n\t\t\tc.fullname,\n\t\t\tcc.name as catname,\n\t\t\tcc.id as catid\n\t\tFROM\n\t\t\t{course} c\n\t\tINNER JOIN\n\t\t\t{course_categories} cc\n\t\tON c.category = cc.id\n\t\tWHERE\n\t\t\tc.id NOT IN (\n\t\t\tSELECT \n\t\t\t\tcourseid\n\t\t\tFROM \n\t\t\t\t{ci_course_prematriculation}\n\t\t\tWHERE \n\t\t\t\tcicleinscriptionid = ?)\n\t\tAND\n\t\t\tc.visible = ?\n\t\tORDER BY {$sort}\", array($cicleinscriptionid, $visibility));\n\t\n\treturn $courses;\n}", "public function getIds()\n {\n return $this->restrictedCountryIds;\n }", "public function getExcludedIds();", "public function getBubbleIds()\n {\n $organisations = $this->organisations->pluck('id')->toArray();\n $ids = [];\n\n /**\n * Get screen channels\n */\n $channels = ScreenChannel::where('screen_id', $this->id)\n ->with('channel')\n ->get();\n\n if (!$channels || !sizeof($channels)) {\n return $ids;\n }\n\n $channelWithoutFilters = $channels\n ->filter(function ($channel) {\n return !isset($channel->settings->filters) ||\n !is_array($channel->settings->filters) ||\n !sizeof($channel->settings->filters);\n })\n ->unique()\n ->values();\n $channelWithFilters = $channels\n ->filter(function ($channel) use ($channelWithoutFilters) {\n return !$channelWithoutFilters->contains($channel);\n })\n ->unique()\n ->values();\n\n /**\n * Get ids from channels without filters\n */\n if (sizeof($channelWithoutFilters)) {\n $byOrganisation = $channelWithoutFilters->filter(function ($channel) {\n return $channel->bubblesAreByOrganisation();\n });\n $anyOrganisation = $channelWithoutFilters->filter(function ($channel) {\n return !$channel->bubblesAreByOrganisation();\n });\n $bubbleIds = new Collection();\n if (sizeof($byOrganisation)) {\n $byOrganisationBubblesIds = Panneau::resource('bubbles')\n ->query([\n 'channel_id' => $byOrganisation->pluck('id')->toArray(),\n 'organisation_id' => $organisations,\n ])\n ->lists('bubbles.id');\n $bubbleIds = $bubbleIds->merge($byOrganisationBubblesIds);\n }\n if (sizeof($anyOrganisation)) {\n $anyOrganisationBubblesIds = Panneau::resource('bubbles')\n ->query([\n 'channel_id' => $anyOrganisation->pluck('id')->toArray(),\n ])\n ->lists('bubbles.id');\n $bubbleIds = $bubbleIds->merge($anyOrganisationBubblesIds);\n }\n foreach ($bubbleIds as $id) {\n $ids[] = $id;\n }\n }\n\n /**\n * Get ids from channels with filters\n */\n if (sizeof($channelWithFilters)) {\n foreach ($channelWithFilters as $channel) {\n $params = [\n 'channel_id' => $channel->channel_id,\n ];\n $filters = $channel->settings->filters;\n\n foreach ($filters as $filter) {\n if (isset($filter->value) && isset($filter->name) && !empty($filter->name)) {\n if (!isset($params['filter_' . $filter->name])) {\n $params['filter_' . $filter->name] = [];\n }\n if (is_array($filter->value)) {\n $notEmptyValues = array_where($filter->value, function ($key, $value) {\n return !empty($value);\n });\n if (sizeof($notEmptyValues)) {\n $params['filter_' . $filter->name] = array_unique(\n array_merge($params['filter_' . $filter->name], $notEmptyValues)\n );\n }\n } elseif (!empty($filter->value)) {\n $params['filter_' . $filter->name][] = $filter->value;\n }\n }\n }\n\n $notEmptyParams = array_where($params, function ($key, $value) {\n return !empty($value);\n });\n\n if ($channel->bubblesAreByOrganisation() && sizeof($organisations)) {\n $notEmptyParams['organisation_id'] = $organisations;\n }\n\n $bubbleIds = Panneau::resource('bubbles')\n ->query($notEmptyParams)\n ->lists('bubbles.id');\n foreach ($bubbleIds as $id) {\n $ids[] = $id;\n }\n }\n }\n\n /**\n * Get ids from playlists\n */\n $screenId = $this->id;\n $playlists = Playlist::whereHas('screens', function ($query) use ($screenId) {\n $query->where('screens.id', $screenId);\n })\n /*->join(\n 'screens_playlists_pivot',\n 'screens_playlists_pivot.playlist_id',\n '=',\n 'playlists.id'\n )\n ->where('screens_playlists_pivot.screen_id', $this->id)*/\n ->get();\n foreach ($playlists as $playlist) {\n $timeline = $playlist->getTimeline();\n foreach ($timeline->bubbleIds as $bubbleId) {\n $ids[] = $bubbleId;\n }\n }\n\n $ids = array_unique($ids);\n sort($ids);\n\n return $ids;\n }", "public function ids( array $params = array() );", "public static function get_comparison_list() {\n $config = self::get_config();\n $page = $config['page'];\n $ids = empty( $_GET['ids'] ) ? array() : esc_attr( $_GET['ids'] );\n\n if ( is_page( $page ) && ! empty( $ids ) ) {\n $ids = array_map( 'intval', explode( ',', $ids ) );\n return $ids;\n }\n\n $compare = Inventor_Visitor::get_data('compare');\n\n if ( is_array( $compare ) && ! empty( $compare ) ) {\n return $compare;\n }\n\n return array();\n }", "protected function getAvailableWebsiteIds()\n {\n $websiteIds = [];\n $websites = $this->storeManager->getWebsites();\n foreach ($websites as $website) {\n $websiteIds[] = $website->getId();\n }\n return $websiteIds;\n }", "function taminoGetIds() {\n $rval = $this->tamino->xquery($this->xquery);\n if ($rval) { // tamino Error\n print \"<p>LinkCollection Error: failed to retrieve linkRecord id list.<br>\";\n print \"(Tamino error code $rval)</p>\";\n } else { \n // convert xml ids into a php array \n $this->ids = array();\n $this->xml_result = $this->tamino->xml->getBranches(\"ino:response/xq:result\");\n if ($this->xml_result) {\n\t// Cycle through all of the branches \n\tforeach ($this->xml_result as $branch) {\n\t if ($att = $branch->getTagAttribute(\"id\", \"xq:attribute\")) {\n\t array_push($this->ids, $att);\n\t }\n\t} /* end foreach */\n } \n }\n\n }", "public function findAllRetainedIds()\n\t{\n\t\t$qb = $this->createQueryBuilder('s');\n\n\t\t$qb->select('s.id')\n\t\t ->where('s.level NOT LIKE :syn')\n\t\t ->setParameter('syn', '%syn%')\n ->orderBy('s.id', 'ASC')\n\t\t;\n\n\t\treturn $qb->getQuery()->getResult();\n\t}", "public function getStoragePageIds() {}", "function getStoragePageIds() ;", "public function getUrls(): array;", "public function getUrls(): array;", "public function get_scan_urls() {\r\n\t\t// Calculate URLs to Check.\r\n\t\t$args = array(\r\n\t\t\t'orderby' => 'rand',\r\n\t\t\t'posts_per_page' => '1',\r\n\t\t\t'ignore_sticky_posts' => true,\r\n\t\t\t'post_status' => 'publish',\r\n\t\t);\r\n\r\n\t\t$urls = array();\r\n\r\n\t\t$urls[] = home_url();\r\n\r\n\t\t$post_types = get_post_types();\r\n\t\t$post_types = array_diff( $post_types, array( 'attachment', 'nav_menu_item', 'revision' ) );\r\n\r\n\t\tforeach ( $post_types as $post_type ) {\r\n\t\t\t$args['post_type'] = $post_type;\r\n\t\t\t$posts = get_posts( $args );\r\n\t\t\tif ( $posts ) {\r\n\t\t\t\t$urls[] = get_permalink( $posts[0] );\r\n\t\t\t}\r\n\r\n\t\t\t$archive_link = get_post_type_archive_link( $post_type );\r\n\t\t\tif ( $archive_link ) {\r\n\t\t\t\t$urls[] = $archive_link;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$post = get_post( get_option( 'page_for_posts' ) );\r\n\t\tif ( get_option( 'show_on_front' ) && $post ) {\r\n\t\t\t$urls[] = get_permalink( $post->ID );\r\n\t\t}\r\n\r\n\t\t$urls = array_unique( $urls );\r\n\r\n\t\t$urls_list = array();\r\n\t\t// Duplicate every URL 3 times. This will be enough to generate all the files for most of the sites.\r\n\t\tfor ( $i = 0; $i < 3; $i++ ) {\r\n\t\t\t$urls_list = array_merge( $urls_list, $urls );\r\n\t\t}\r\n\r\n\t\tsort( $urls_list );\r\n\t\treturn $urls_list;\r\n\t}", "public function getIdsList() {\n return $this->_get(1);\n }", "public function get_allowed_article_ids_query() {\n\t\tif ($this->is_current_user_admin() || apply_filters('minerva_restrict_access_allowed', false)) {\n\t\t\treturn null; // admins can watch all content\n\t\t}\n\n\t\t$allowed_ids = $this->get_allowed_article_ids_for_user();\n\n\t\treturn !empty($allowed_ids) ? $allowed_ids : array(-1);\n\t}", "public static function filter_query_ids( $ids, $params ) {\n $config = self::get_config();\n $page = $config['page'];\n $context = empty( $params['context'] ) ? null : $params['context'];\n\n if ( $context == 'map' && ! empty( $page ) && ! empty( $params['post-id'] ) && $params['post-id'] == $page ) {\n $referer = isset( $_SERVER['HTTP_REFERER'] ) ? esc_attr( $_SERVER['HTTP_REFERER'] ) : null;\n\n if( ! empty( $referer ) ) {\n // Get IDs from the referer URL\n $parts = parse_url( $referer );\n parse_str( $parts['query'], $query );\n $ids = empty( $query['ids'] ) ? array() : esc_attr( $query['ids'] );\n\n if ( ! empty( $ids ) ) {\n $ids = array_map( 'intval', explode( ',', $ids ) );\n return $ids;\n }\n } else {\n // Get IDs from comparison list\n $compare = self::get_comparison_list();\n\n if ( ! empty( $compare ) ) {\n return $compare;\n }\n }\n }\n\n return $ids;\n }", "public function getAllSitesIds() \n\t{\n\t\tif (empty($this->site_ids)) \n\t\t{\n\t\t\t$sites = $this->service->management_profiles->listManagementProfiles(\"~all\", \"~all\");\n\t\t\tforeach($sites['items'] as $site) \n\t\t\t{\n\t\t\t\t$this->site_ids[$site['websiteUrl']] = 'ga:' . $site['id'];\n\t\t\t}\n\t\t}\n\n\t\treturn $this->site_ids;\n\t}", "private function getShowParameters()\n {\n $showingAll = false;\n $start = -100;\n $count = -1;\n\n if ($this->getRequest()->query->has('all')) {\n $start = 0;\n $count = -1;\n $showingAll = true;\n }\n\n return array($start, $count, $showingAll);\n }", "public function getIdList() {\n migrate_instrument_start(\"Retrieve $this->listUrl\");\n if (empty($this->httpOptions)) {\n $json = file_get_contents($this->listUrl);\n }\n else {\n $response = drupal_http_request($this->listUrl, $this->httpOptions);\n $json = $response->data;\n }\n migrate_instrument_stop(\"Retrieve $this->listUrl\");\n if ($json) {\n $data = drupal_json_decode($json);\n if ($data) {\n return $this->getIDsFromJSON($data);\n }\n }\n Migration::displayMessage(t('Loading of !listurl failed:',\n array('!listurl' => $this->listUrl)));\n return NULL;\n }", "function homepage_video_id_list($limit) {\n\n global $data_base;\n\n $request = $data_base->prepare(\"\n SELECT *\n FROM imago_info_video\n WHERE type = 'tvshow'\n ORDER BY publication_date DESC\n LIMIT $limit\n \");\n\n $request->execute();\n\n return $request->fetchAll(PDO::FETCH_ASSOC);\n }", "function getSitesList(){\n $result = db_select('fossee_website_index','n')\n ->fields('n',array('site_code','site_name'))\n ->range(0,50)\n //->condition('n.uid',$uid,'=')\n ->execute();\n\n return $result;\n\n}", "public function getListQuery();", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Url::find(),\n /*\n 'pagination' => [\n 'pageSize' => 50\n ],\n 'sort' => [\n 'defaultOrder' => [\n 'idurl' => SORT_DESC,\n ]\n ],\n */\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "private function getIndividualGenreQueries() {\n\t\t$individualGenreQueries = [];\n\t\tforeach($this->genres as $genreKey => $value) {\n\t\t\t$individualGenreQueries[$genreKey] = $this->getQueryStringUsingGenreString($value);\n\t\t}\n\t\treturn $individualGenreQueries;\n\t}", "function find_public_photos($ids_of_private_photos, $ids_of_all_users_photos_on_page)\n{\n $public_photos = [];\n\n foreach ($ids_of_all_users_photos_on_page as $photo_id)\n if (!in_array($photo_id, $ids_of_private_photos))\n array_push($public_photos, $photo_id);\n\n return $public_photos;\n}", "public function actionShowList($visible = true)\n {\n $ids = Yii::$app->request->post('ids');\n $success = false;\n\n if (!empty($ids)) {\n foreach ($ids as $id) {\n $model = $this->findModel($id);\n $success = $model->setVisible($visible);\n }\n }\n\n Yii::$app->response->format = Response::FORMAT_JSON;\n return [\n 'success' => $success,\n ];\n }", "public function getDefinitionIds()\r\n{\r\n $query_string = \"SELECT wordid FROM glossary \";\r\n $query_string .= \"WHERE word = :word AND wordid != :wordid\";\r\n\r\n return $query_string;\r\n}", "function getIdsByRestrictions(IRestrictor $restrictor, $limit = NULL, $offset = NULL);", "public function getPageVisible() {}", "protected function generateUrls()\n\t{\n\t\t// Video URL array\n\t\t$videoUrl = $this->videoUrl;\n\n\t\t// Array for URLs\n\t\t$urls\t= [];\n\n\t\t$query\t= '';\n\n\t\t$keywords = $this->keywords;\n\n\t\t// Check if there is at least one keyword\n\t\tif(count($keywords) < 1) return false;\n\n\t\t// Setup dev key\n\t\t$devKey = (! is_null($this->developerKey)) ? '&key=' . $this->developerKey : null;\n\n\t\t// Loop keywords\n\t\tforeach($keywords as $keyword)\n\t\t{\n\t\t\t// Check keyword string length\n\t\t\tif(strlen($keyword) < 4) continue;\n\n\t\t\tforeach($this->modList as $modword)\n\t\t\t{\n\t\t\t\t$query = str_replace('-', ' ', Str::slug($modword . ' ' . $keyword));\n\n\t\t\t\t$urls[] = $videoUrl . urlencode($query) . $devKey;\n\t\t\t}\n\t\t}\n\n\t\t// Update the URLs\n\t\t$this->urls = $urls;\n\n\t\treturn $urls;\n\t}", "public function getWebsitesView()\n {\n $res = $this->searchView();\n if ($res) {\n array_push($this->site_ids, array('access' => 'view', 'ids' => array()));\n if ($res['count'] > 0) {\n foreach ($res as $r) {\n if (is_array($r)) {\n array_push($this->site_ids[0]['ids'], $this->getSiteId($r[strtolower($this->to_get_view)][0]));\n }\n }\n }\n }\n }", "public function getItemIds();", "protected function getAllProductIds()\n {\n $om = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n $connection = $om->get('Magento\\Framework\\App\\ResourceConnection')->getConnection();\n // TODO: use getTable()\n \n $visibilityAttrId = 99; // TODO: get it dynamically: visibility\n $select = $connection->select()\n ->from(['main_table' => 'catalog_product_entity'], ['entity_id'])\n ->join(\n 'catalog_product_entity_int as avisib',\n 'main_table.entity_id = avisib.entity_id AND avisib.attribute_id = '.$visibilityAttrId,\n []\n )\n ->where('avisib.value IN(?)', [\n \\Magento\\Catalog\\Model\\Product\\Visibility::VISIBILITY_IN_SEARCH,\n \\Magento\\Catalog\\Model\\Product\\Visibility::VISIBILITY_BOTH\n ]);\n \n return $connection->fetchCol($select);\n }", "public function displayUrlList() {\n $urllist = Urllist::where('processed', '=', FALSE)->paginate(4);\n return view(\"extract\")->with('urllist',$urllist);\n }", "public function getURLQuery() {\n\t\t$query = array();\n\t\tif (Request::getGET('type') == 'login-confirmation') {\n\t\t\t$query['type'] = 'login-confirmation';\n\t\t\tif (Request::getGET('mode') == 'iframe')\n\t\t\t\t$query['mode'] = 'iframe';\n\t\t}\n\t\treturn $query;\n\t}", "public function getWebsiteIds()\n {\n if (!$this->hasWebsiteIds()) {\n $websiteIds = $this->_getResource()->getWebsiteIds($this->getId());\n $this->setData('website_ids', (array)$websiteIds);\n }\n return $this->_getData('website_ids');\n }", "public function users_to_query()\n\t{\n\t\treturn array($this->get_data('from_user_id'));\n\t}", "public function getPageIds() {\r\n return array_keys($this->pageConfig);\r\n }", "public static function view_url_parameters() {\n return new external_function_parameters(\n array(\n 'urlid' => new external_value(PARAM_INT, 'url instance id')\n )\n );\n }", "public function getIdentities()\n {\n return [\\Ss\\Collection\\Model\\Collection::CACHE_TAG . '_' . 'list'];\n }", "public function getObjectIds();" ]
[ "0.57226473", "0.56430113", "0.56376964", "0.5622885", "0.5577215", "0.5573022", "0.5573022", "0.5567047", "0.55164045", "0.5475172", "0.5458649", "0.54094493", "0.54025745", "0.5379266", "0.5355952", "0.53531164", "0.5322503", "0.52361983", "0.52046734", "0.52028686", "0.51884615", "0.5167252", "0.5167252", "0.5167252", "0.5167252", "0.5167252", "0.5167252", "0.5167252", "0.5167252", "0.5156577", "0.5155316", "0.51253134", "0.5112529", "0.5106062", "0.50981504", "0.5097118", "0.50965285", "0.5096494", "0.5068697", "0.50633067", "0.5060773", "0.50592256", "0.50545067", "0.5053299", "0.5047858", "0.50211906", "0.50211906", "0.50021905", "0.49946398", "0.4981652", "0.49780872", "0.49726617", "0.4971226", "0.4971226", "0.49560505", "0.49382868", "0.49373063", "0.493461", "0.49310702", "0.49275523", "0.49027324", "0.4899771", "0.48992178", "0.48919216", "0.4884618", "0.4879022", "0.48774508", "0.4873178", "0.48697332", "0.4860892", "0.4854218", "0.4854218", "0.48339602", "0.48128268", "0.48119348", "0.48115778", "0.48000288", "0.47912535", "0.47871593", "0.47853103", "0.47735447", "0.47705513", "0.47593087", "0.47587553", "0.47527316", "0.47471577", "0.4740541", "0.4737931", "0.47336978", "0.47275653", "0.47193387", "0.47083002", "0.47011346", "0.46903366", "0.46836412", "0.46827722", "0.46809715", "0.4670988", "0.46689698", "0.46627113", "0.46615893" ]
0.0
-1
Upgrade the module from an old version This function can be called multiple times.
function files_upgrade($oldversion) { /* Upgrade dependent on old version number */ $dbconn = xarDBGetConn(); $xartable = xarDBGetTables(); switch ($oldversion) { case '0.6.0': xarRegisterMask('SubmitFiles', 'All', 'Files', 'Item', '', 'ACCESS_COMMENT'); xarRegisterMask('ModerateFiles', 'All', 'Files', 'Item', '', 'ACCESS_MODERATE'); case '0.6.1': xarModSetVar('files','max_upload',3); xarModSetVar('files','allow_multiple',true); xarModSetVar('files','filetypes','jpg,jpeg,png,gif,pdf,txt,zip,gz'); case '0.6.2': break; } /* Update successful */ return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function upgrade () {\r\n }", "public function upgrade($oldversion)\n {\n $this->throwForbiddenUnless(SecurityUtil::checkPermission('Downloads::', '::', ACCESS_ADMIN), LogUtil::getErrorMsgPermission());\n\n switch ($oldversion) {\n case '2.4':\n case '2.4.0':\n // upgrade from old module\n // convert modvars from yes|no to true|false && be sure all defaults are set\n $oldVars = ModUtil::getVar('downloads'); // must use lowercase name here for old mod\n $checkedVars = $this->getCheckedVars();\n $defaultVars = Downloads_Util::getModuleDefaults();\n $newVars = array();\n $this->delVars(); // delete any with current modname\n ModUtil::delVar('downloads'); // again use lowercase for old mod\n foreach ($defaultVars as $var => $val) {\n if (isset($oldVars[$var])) {\n if (in_array($var, $checkedVars)) {\n // update value to boolean\n $newVars[$var] = ($oldVars[$var] == 'yes') ? true : false;\n } else {\n // use old value\n $newVars[$var] = $oldVars[$var];\n }\n } else {\n // not set\n $newVars[$var] = $val;\n }\n }\n if (substr($newVars['upload_folder'], -1) == '/') {\n // remove trailing slash\n $newVars['upload_folder'] = substr($newVars['upload_folder'], 0, -1);\n }\n $this->setVars($newVars);\n\n $prefix = $this->serviceManager['prefix'];\n $connection = $this->entityManager->getConnection();\n $sqlStatements = array();\n // N.B. statements generated with PHPMyAdmin\n $sqlStatements[] = 'RENAME TABLE ' . $prefix . '_downloads_downloads' . \" TO downloads_downloads\";\n // note: because 'update' and 'date' are reserved SQL words, the fields are renamd to uupdate and ddate, respectively\n $sqlStatements[] = \"ALTER TABLE `downloads_downloads` \nCHANGE `pn_lid` `lid` INT(11) NOT NULL AUTO_INCREMENT, \nCHANGE `pn_cid` `cid` INT(11) NOT NULL DEFAULT '0', \nCHANGE `pn_status` `status` SMALLINT(6) NOT NULL DEFAULT '0', \nCHANGE `pn_update` `uupdate` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', \nCHANGE `pn_title` `title` VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '', \nCHANGE `pn_url` `url` VARCHAR(254) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '', \nCHANGE `pn_filename` `filename` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, \nCHANGE `pn_description` `description` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, \nCHANGE `pn_date` `ddate` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', \nCHANGE `pn_email` `email` VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '', \nCHANGE `pn_hits` `hits` INT(11) NOT NULL DEFAULT '0', \nCHANGE `pn_submitter` `submitter` VARCHAR(60) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '',\nCHANGE `pn_filesize` `filesize` double NOT NULL DEFAULT '0', \nCHANGE `pn_version` `version` VARCHAR(5) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '', \nCHANGE `pn_homepage` `homepage` VARCHAR(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '', \nCHANGE `pn_modid` `modid` INT(11) NOT NULL DEFAULT '0', \nCHANGE `pn_objectid` `objectid` VARCHAR(5) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0'\";\n $sqlStatements[] = \"ALTER TABLE `downloads_downloads` \nDROP INDEX `pn_title`, \nADD FULLTEXT `title` (`title`, `description`)\";\n $sqlStatements[] = 'RENAME TABLE ' . $prefix . '_downloads_categories' . \" TO downloads_categories\";\n $sqlStatements[] = \"ALTER TABLE `downloads_categories` \nCHANGE `pn_cid` `cid` INT( 11 ) NOT NULL AUTO_INCREMENT ,\nCHANGE `pn_pid` `pid` INT( 11 ) NOT NULL DEFAULT '0',\nCHANGE `pn_title` `title` VARCHAR( 100 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0',\nCHANGE `pn_description` `description` VARCHAR( 254 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT ''\";\n foreach ($sqlStatements as $sql) {\n $stmt = $connection->prepare($sql);\n try {\n $stmt->execute();\n } catch (Exception $e) {\n \n }\n }\n // update url field for each row to include upload dir\n // and rename from ID to name\n $this->updateRows();\n\n // drop old modrequest table\n $sql = \"DROP TABLE `{$prefix}_downloads_modrequest`\";\n $stmt = $connection->prepare($sql);\n $stmt->execute();\n\n HookUtil::registerSubscriberBundles($this->version->getHookSubscriberBundles());\n\n case '3.0.0':\n // no changes\n case '3.1.0':\n // no changes\n case '3.1.1':\n // no changes\n case '3.1.2':\n // run the update rows routine again because some rows were not properly updated in the 3.0.0 routine\n $this->updateRows();\n case '3.1.3':\n // upgrade entity with screenshot column\n DoctrineHelper::updateSchema($this->entityManager, array('Downloads_Entity_Download'));\n case '3.1.4':\n //future developments\n }\n\n return true;\n }", "function module_upgrade () {\n \n // Make sure core is installed\n if (!module_core_installed()) {\n error_register('Please run the install script');\n return false;\n }\n foreach (module_list() as $module) {\n \n // Get current schema and code revisions\n $old_revision = module_get_schema_revision($module);\n $new_revision = module_get_code_revision($module);\n \n // Upgrade the module to the current revision\n $installer = $module . '_install';\n if (function_exists($installer)) {\n call_user_func($installer, $old_revision);\n }\n \n // Update the revision number in the database\n module_set_schema_revision($module, $new_revision);\n }\n return true;\n}", "protected function _upgrade()\n {\n $this->helper->pluginBroker->callHook(\n 'upgrade', array('old_version' => self::$oldVersion), 'Neatline'\n );\n }", "function sitemgr_upgrade1_2()\n{\n\t$GLOBALS['egw_setup']->db->update('egw_sitemgr_modules',array('module_name' => 'news_admin'),array('module_name' => 'news'),__LINE__,__FILE__);\n\n\t$GLOBALS['setup_info']['sitemgr']['currentver'] = '1.3.001';\n\treturn $GLOBALS['setup_info']['sitemgr']['currentver'];\n}", "public function upgrade($oldversion, $newversion)\n\t{\n\t\t$filename = cms_join_path($this->get_module_path(), 'method.upgrade.php');\n\t\tif (@is_file($filename))\n\t\t{\n\t\t\t{\n\t\t\t\t$gCms = cmsms(); //Backwards compatibility\n\t\t\t\t$db = cms_db();\n\t\t\t\t$config = cms_config();\n\t\t\t\t$smarty = cms_smarty();\n\n\t\t\t\tinclude($filename);\n\t\t\t}\n\t\t}\n\t}", "function upgrade_module_1_1_0($module)\n{\n /*\n * Do everything you want right there,\n * You could add a column in one of your module's tables\n */\n\n return true;\n}", "function upgrade_activity_modules($return) {\n\n global $CFG, $db;\n\n if (!$mods = get_list_of_plugins('mod') ) {\n error('No modules installed!');\n }\n\n $updated_modules = false;\n $strmodulesetup = get_string('modulesetup');\n\n foreach ($mods as $mod) {\n\n if ($mod == 'NEWMODULE') { // Someone has unzipped the template, ignore it\n continue;\n }\n\n $fullmod = $CFG->dirroot .'/mod/'. $mod;\n\n unset($module);\n\n if ( is_readable($fullmod .'/version.php')) {\n include_once($fullmod .'/version.php'); // defines $module with version etc\n } else {\n notify('Module '. $mod .': '. $fullmod .'/version.php was not readable');\n continue;\n }\n\n $oldupgrade = false;\n $newupgrade = false;\n if ( is_readable($fullmod .'/db/' . $CFG->dbtype . '.php')) {\n include_once($fullmod .'/db/' . $CFG->dbtype . '.php'); // defines old upgrading function\n $oldupgrade = true;\n }\n if ( is_readable($fullmod . '/db/upgrade.php')) {\n include_once($fullmod . '/db/upgrade.php'); // defines new upgrading function\n $newupgrade = true;\n }\n\n if (!isset($module)) {\n continue;\n }\n\n if (!empty($module->requires)) {\n if ($module->requires > $CFG->version) {\n $info = new object();\n $info->modulename = $mod;\n $info->moduleversion = $module->version;\n $info->currentmoodle = $CFG->version;\n $info->requiremoodle = $module->requires;\n if (!$updated_modules) {\n print_header($strmodulesetup, $strmodulesetup,\n build_navigation(array(array('name' => $strmodulesetup, 'link' => null, 'type' => 'misc'))), '',\n upgrade_get_javascript(), false, '&nbsp;', '&nbsp;');\n }\n upgrade_log_start();\n notify(get_string('modulerequirementsnotmet', 'error', $info));\n $updated_modules = true;\n continue;\n }\n }\n\n $module->name = $mod; // The name MUST match the directory\n\n include_once($fullmod.'/lib.php'); // defines upgrading and/or installing functions\n\n if ($currmodule = get_record('modules', 'name', $module->name)) {\n if ($currmodule->version == $module->version) {\n // do nothing\n } else if ($currmodule->version < $module->version) {\n /// If versions say that we need to upgrade but no upgrade files are available, notify and continue\n if (!$oldupgrade && !$newupgrade) {\n notify('Upgrade files ' . $mod . ': ' . $fullmod . '/db/' . $CFG->dbtype . '.php or ' .\n $fullmod . '/db/upgrade.php were not readable');\n continue;\n }\n if (!$updated_modules) {\n print_header($strmodulesetup, $strmodulesetup,\n build_navigation(array(array('name' => $strmodulesetup, 'link' => null, 'type' => 'misc'))), '',\n upgrade_get_javascript(), false, '&nbsp;', '&nbsp;');\n }\n upgrade_log_start();\n print_heading($module->name .' module needs upgrading');\n\n /// Run de old and new upgrade functions for the module\n $oldupgrade_function = $module->name . '_upgrade';\n $newupgrade_function = 'xmldb_' . $module->name . '_upgrade';\n\n /// First, the old function if exists\n $oldupgrade_status = true;\n if ($oldupgrade && function_exists($oldupgrade_function)) {\n $db->debug = true;\n $oldupgrade_status = $oldupgrade_function($currmodule->version, $module);\n if (!$oldupgrade_status) {\n notify ('Upgrade function ' . $oldupgrade_function .\n ' did not complete successfully.');\n }\n } else if ($oldupgrade) {\n notify ('Upgrade function ' . $oldupgrade_function . ' was not available in ' .\n $mod . ': ' . $fullmod . '/db/' . $CFG->dbtype . '.php');\n }\n\n /// Then, the new function if exists and the old one was ok\n $newupgrade_status = true;\n if ($newupgrade && function_exists($newupgrade_function) && $oldupgrade_status) {\n $db->debug = true;\n $newupgrade_status = $newupgrade_function($currmodule->version, $module);\n } else if ($newupgrade && $oldupgrade_status) {\n notify ('Upgrade function ' . $newupgrade_function . ' was not available in ' .\n $mod . ': ' . $fullmod . '/db/upgrade.php');\n }\n\n $db->debug=false;\n /// Now analyze upgrade results\n if ($oldupgrade_status && $newupgrade_status) { // No upgrading failed\n // OK so far, now update the modules record\n $module->id = $currmodule->id;\n if (! update_record('modules', $module)) {\n error('Could not update '. $module->name .' record in modules table!');\n }\n remove_dir($CFG->dataroot . '/cache', true); // flush cache\n notify(get_string('modulesuccess', '', $module->name), 'notifysuccess');\n echo '<hr />';\n } else {\n notify('Upgrading '. $module->name .' from '. $currmodule->version .' to '. $module->version .' FAILED!');\n }\n\n /// Update the capabilities table?\n if (!update_capabilities('mod/'.$module->name)) {\n error('Could not update '.$module->name.' capabilities!');\n }\n events_update_definition('mod/'.$module->name);\n\n $updated_modules = true;\n\n } else {\n upgrade_log_start();\n error('Version mismatch: '. $module->name .' can\\'t downgrade '. $currmodule->version .' -> '. $module->version .' !');\n }\n\n } else { // module not installed yet, so install it\n if (!$updated_modules) {\n print_header($strmodulesetup, $strmodulesetup,\n build_navigation(array(array('name' => $strmodulesetup, 'link' => null, 'type' => 'misc'))), '',\n upgrade_get_javascript(), false, '&nbsp;', '&nbsp;');\n }\n upgrade_log_start();\n print_heading($module->name);\n $updated_modules = true;\n $db->debug = true;\n @set_time_limit(0); // To allow slow databases to complete the long SQL\n\n /// Both old .sql files and new install.xml are supported\n /// but we priorize install.xml (XMLDB) if present\n if (file_exists($fullmod . '/db/install.xml')) {\n $status = install_from_xmldb_file($fullmod . '/db/install.xml'); //New method\n } else {\n $status = modify_database($fullmod .'/db/'. $CFG->dbtype .'.sql'); //Old method\n }\n\n $db->debug = false;\n\n /// Continue with the installation, roles and other stuff\n if ($status) {\n if ($module->id = insert_record('modules', $module)) {\n\n /// Capabilities\n if (!update_capabilities('mod/'.$module->name)) {\n error('Could not set up the capabilities for '.$module->name.'!');\n }\n\n /// Events\n events_update_definition('mod/'.$module->name);\n\n /// Run local install function if there is one\n $installfunction = $module->name.'_install';\n if (function_exists($installfunction)) {\n if (! $installfunction() ) {\n notify('Encountered a problem running install function for '.$module->name.'!');\n }\n }\n\n notify(get_string('modulesuccess', '', $module->name), 'notifysuccess');\n echo '<hr />';\n } else {\n error($module->name .' module could not be added to the module list!');\n }\n } else {\n error($module->name .' tables could NOT be set up successfully!');\n }\n }\n\n /// Check submodules of this module if necessary\n\n $submoduleupgrade = $module->name.'_upgrade_submodules';\n if (function_exists($submoduleupgrade)) {\n $submoduleupgrade();\n }\n\n\n /// Run any defaults or final code that is necessary for this module\n\n if ( is_readable($fullmod .'/defaults.php')) {\n // Insert default values for any important configuration variables\n unset($defaults);\n include($fullmod .'/defaults.php'); // include here means execute, not library include\n if (!empty($defaults)) {\n foreach ($defaults as $name => $value) {\n if (!isset($CFG->$name)) {\n set_config($name, $value);\n }\n }\n }\n }\n }\n\n upgrade_log_finish(); // finish logging if started\n\n if ($updated_modules) {\n print_continue($return);\n print_footer('none');\n die;\n }\n}", "function __upgrade($version_from){\n\nglobal $__settings, $error, $software, $softpanel, $globals, $setupcontinue;\n\t\n\t// Change the permissions\n\t@schmod($__settings['softpath'].'/packages/', $globals['odc']);\n\t@schmod($__settings['softpath'].'/updates/', $globals['odc']);\n\t\n\t// Create the folders if missing\n/*\tif(!sis_dir($__settings['softpath'].'/files/avatars/')){\t\t\n\t\t@smkdir($__settings['softpath'].'/files/avatars/', $globals['odc']);\n\t\t@smkdir($__settings['softpath'].'/files/cache/', $globals['odc']);\n\t\t@smkdir($__settings['softpath'].'/files/incoming/', $globals['odc']);\n\t\t@smkdir($__settings['softpath'].'/files/thumbnails/', $globals['odc']);\n\t\t@smkdir($__settings['softpath'].'/files/trash/', $globals['odc']);\n\t\t\n\t\t//CHMOD\n\t\t@schmod($__settings['softpath'].'/files/', $globals['odc'], 1);\n\t\t\n\t}*/\n\t\n/*\t$auto_upgrading = sis_autoupgrading();\n\t\n\tif(!optGET('noauto')){\n\t\t// To upgrade without the UPGRADE URL\n\t\t$get = swget($__settings['softurl'].'/index.php/tools/required/upgrade?force=1');\n\t}\n\t\n\t// If it was sucessful dont give the Setuplocation\n\tif(preg_match('/Upgrade(\\s*?)to(\\s*?)<b>'.$software['ver'].'<\\/b>(\\s*?)complete!/is', $get)){\n\t\t$setupcontinue = '';\n\t}elseif(!empty($auto_upgrading)){\n\t\t$error[] = '{{err_auto_upgrade}}';\n\t}*/\n\t\n}", "private function update_modules()\n\t{\n\t\tee()->db->select('module_name, module_version');\n\t\t$query = ee()->db->get('modules');\n\n\t\tforeach ($query->result() as $row)\n\t\t{\n\t\t\t$module = strtolower($row->module_name);\n\n\t\t\t// Only update first-party modules\n\t\t\tif ( ! in_array($module, $this->native_modules))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Send version to update class and let it do any required work\n\t\t\tif (in_array($module, $this->native_modules))\n\t\t\t{\n\t\t\t\t$path = EE_APPPATH.'/modules/'.$module.'/';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$path = PATH_THIRD.$module.'/';\n\t\t\t}\n\n\t\t\tif (file_exists($path.'upd.'.$module.'.php'))\n\t\t\t{\n\t\t\t\t$this->load->add_package_path($path);\n\n\t\t\t\t$class = ucfirst($module).'_upd';\n\n\t\t\t\tif ( ! class_exists($class))\n\t\t\t\t{\n\t\t\t\t\trequire $path.'upd.'.$module.'.php';\n\t\t\t\t}\n\n\t\t\t\t$UPD = new $class;\n\t\t\t\t$UPD->_ee_path = EE_APPPATH;\n\n\t\t\t\tif ($UPD->version > $row->module_version && method_exists($UPD, 'update') && $UPD->update($row->module_version) !== FALSE)\n\t\t\t\t{\n\t\t\t\t\tee()->db->update('modules', array('module_version' => $UPD->version), array('module_name' => ucfirst($module)));\n\t\t\t\t}\n\n\t\t\t\t$this->load->remove_package_path($path);\n\t\t\t}\n\t\t}\n\t}", "public function upgrade__0_1_9__0_1_10()\n {\n }", "public function upgrade($oldVersion)\n {\n /*\n $logger = $this->container->get('logger');\n \n // Upgrade dependent on old version number\n switch ($oldVersion) {\n case '1.0.0':\n // do something\n // ...\n // update the database schema\n try {\n $this->schemaTool->update($this->listEntityClasses());\n } catch (\\Exception $exception) {\n $this->addFlash('error', $this->__('Doctrine Exception') . ': ' . $exception->getMessage());\n $logger->error('{app}: Could not update the database tables during the upgrade. Error details: {errorMessage}.', ['app' => 'MUFilesModule', 'errorMessage' => $exception->getMessage()]);\n \n return false;\n }\n }\n */\n \n // update successful\n return true;\n }", "public function upgrade__0_1_5__0_1_6()\n {\n }", "function upgrade_420()\n {\n }", "public function upgrade() {\n//\t\tupdate it's database table, you will need to run this:\n//\t\t\n//\t\t$est = AttributeType::getByHandle('attribute_handle');\n//\t\t$path = $est->getAttributeTypeFilePath(FILENAME_ATTRIBUTE_DB);\n//\t\tPackage::installDB($path);\n\n\t\tparent::upgrade();\n\t\t//$pkg = Package::getByHandle($this->pkgHandle);\n\t\t//$this->installAdditionalPageAttributes($pkg);\n\t}", "function upgrade_101()\n {\n }", "function upgrade_600()\n {\n }", "public function upgrade($old_version)\r\n\t{\r\n\t\t// Upgrade Logic\r\n\t\treturn true;\r\n\t}", "function upgrade_590()\n {\n }", "function upgrade_372()\n {\n }", "public function upgrade($oldversion)\n {\n switch ($oldversion)\n {\n case '2.0':\n // Module variables initialisation\n ModUtil::setVar('ShoutIt', 'shoutit_refresh_rate', '10');\n \n // Register hook\n HookUtil::registerSubscriberBundles($this->version->getHookSubscriberBundles());\n }\n return true;\n }", "function Legal_upgrade($oldversion)\n{\n // Upgrade dependent on old version number\n switch($oldversion) {\n case 1.1:\n\t\t\tpnModSetVar('legal', 'termsofuse', true);\n\t\t\tpnModSetVar('legal', 'privacypolicy', true);\n\t\t\tpnModSetVar('legal', 'accessibilitystatement', true);\n\t pnModSetVar('legal', 'refundpolicy', true);\n \treturn Legal_upgrade(1.2);\n break;\n }\n\n // Update successful\n return true;\n}", "function upgrade_300()\n {\n }", "function upgrade_110()\n {\n }", "function upgrade_290()\n {\n }", "function upgrade_210()\n {\n }", "abstract protected function doUpdate($oldVersion);", "function upgrade_270()\n {\n }", "function upgrade_330()\n {\n }", "protected function contentUpgrade_4_0_0($oldVersion)\n {\n $prefix = $this->serviceManager['prefix'];\n $connection = Doctrine_Manager::getInstance()->getConnection('default');\n $sqlStatements = array();\n // N.B. statements generated with PHPMyAdmin\n $sqlStatements[] = 'RENAME TABLE ' . $prefix . '_content_content' . \" TO content_content\";\n $sqlStatements[] = 'RENAME TABLE ' . $prefix . '_content_history' . \" TO content_history\";\n $sqlStatements[] = 'RENAME TABLE ' . $prefix . '_content_page' . \" TO content_page\";\n $sqlStatements[] = 'RENAME TABLE ' . $prefix . '_content_pagecategory' . \" TO content_pagecategory\";\n $sqlStatements[] = 'RENAME TABLE ' . $prefix . '_content_searchable' . \" TO content_searchable\";\n $sqlStatements[] = 'RENAME TABLE ' . $prefix . '_content_translatedcontent' . \" TO content_translatedcontent\";\n $sqlStatements[] = 'RENAME TABLE ' . $prefix . '_content_translatedpage' . \" TO content_translatedpage\";\n \n foreach ($sqlStatements as $sql) {\n $stmt = $connection->prepare($sql);\n try {\n $stmt->execute();\n } catch (Exception $e) {\n } \n }\n\n // update tables with new indexes\n if (!DBUtil::changeTable('content_page')) {\n return false;\n }\n if (!DBUtil::changeTable('content_content')) {\n return false;\n }\n if (!DBUtil::changeTable('content_translatedpage')) {\n return false;\n }\n if (!DBUtil::changeTable('content_translatedcontent')) {\n return false;\n }\n if (!DBUtil::changeTable('content_history')) {\n return false;\n }\n\n // Register for hook subscribing\n HookUtil::registerSubscriberBundles($this->version->getHookSubscriberBundles());\n\n // upgrade Content's layoutTypes\n self::updateLayout();\n // upgrade the Content module's ContentTypes\n self::updateContentType();\n // upgrade other module's ContentTypes if available\n ModUtil::apiFunc('Content', 'admin', 'upgradecontenttypes');\n\n // register handlers\n EventUtil::registerPersistentModuleHandler('Content', 'module.content.gettypes', array('Content_Util', 'getTypes'));\n\n // clear compiled templates and Content cache\n ModUtil::apiFunc('view', 'user', 'clear_compiled');\n ModUtil::apiFunc('view', 'user', 'clear_cache', array('module' => 'Content'));\n return true;\n }", "public function hookUpgrade($args) {\n\t\t$oldVersion = $args['old_version'];\n $newVersion = $args['new_version'];\n $doMigrate = false;\n\n $versions = array();\n foreach (glob(IIIF_API_BRIDGE_DIRECTORY . '/libraries/IiifApiBridge/Migration/*.php') as $migrationFile) {\n $className = 'IiifApiBridge_Migration_' . basename($migrationFile, '.php');\n include $migrationFile;\n $versions[$className::$version] = new $className();\n }\n uksort($versions, 'version_compare');\n\n foreach ($versions as $version => $migration) {\n if (version_compare($version, $oldVersion, '>')) {\n $doMigrate = true;\n }\n if ($doMigrate) {\n $migration->up();\n if (version_compare($version, $newVersion, '>')) {\n break;\n }\n }\n }\n\t}", "abstract public function updateToPreviousVersion( $previous );", "function do_core_upgrade($reinstall = \\false)\n {\n }", "protected function upgrade() {\r\n\t\tif (!$version = $this->ci->options->get('gw_users_version', false)) {\r\n\t\t\t$this->setup();\r\n\t\t}\r\n\t}", "public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context)\n {\n }", "function upgrade_350()\n {\n }", "public function upgrade($oldVersion)\n {\n // update successful\n return true;\n }", "function upgrade_431()\n {\n }", "public function upgrade(){\n \n global $DB;\n \n $return = true;\n $version = $this->version; # This is the current DB version we will be using to upgrade from \n\n \n if ($version < 2013102401)\n {\n \n $DB->insert_record(\"lbp_plugin_report_elements\", array(\"pluginid\" => $this->id, \"getstringname\" => \"reports:bcgt_target_grades:aspgrades\", \"getstringcomponent\" => \"block_bcgt\"));\n $this->version = 2013102401;\n $this->updatePlugin();\n \\mtrace(\"## Inserted plugin_report_element data for plugin: {$this->title}\");\n \n }\n \n if ($version < 2014012402)\n {\n $DB->insert_record(\"lbp_plugin_report_elements\", array(\"pluginid\" => $this->id, \"getstringname\" => \"reports:bcgt_target_grades:percentwithaspgrades\", \"getstringcomponent\" => \"block_bcgt\"));\n $this->version = 2014012402;\n $this->updatePlugin();\n \\mtrace(\"## Inserted plugin_report_element data for plugin: {$this->title}\");\n }\n \n \n return $return; # Never actually seems to change..\n \n \n }", "function upgrade_module_1_3_2($module)\n{\n $sql = array();\n $sql[] = 'DELETE FROM `'._DB_PREFIX_.'facebookpixels` WHERE pixel_extras_type = 4;';\n $sql[] = 'UPDATE `'._DB_PREFIX_.'facebookpixels` SET pixel_extras_type = 4 WHERE pixel_extras_type = 5';\n $sql[] = 'UPDATE `'._DB_PREFIX_.'facebookpixels` SET pixel_extras_type = 5 WHERE pixel_extras_type = 6';\n foreach ($sql as $query) {\n DB::getInstance()->execute(pSQL($query));\n }\n // All done if we get here the upgrade is successfull\n return $module;\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 upgrade_all()\n {\n }", "function upgrade_module_0_9_7($module) {\n\t\tConfiguration::deleteByName('PAYPLUG_ORDER_STATE_REFUND');\n\n\t\tPayplug::updateConfiguration('PAYPLUG_SANDBOX', '0');\n\n\t\t$install = new InstallPayplug();\n\t\t$install->createOrderState();\n\n\t\t$module->registerHook('header');\n\n\t\t$install->installPayplugLock();\n\n\t\treturn true; // Return true if success.\n\t}", "public function upgrade($oldversion)\n {\n // Update successful\n return true;\n }", "function upgrade_130()\n {\n }", "function maybe_upgrade_db() {\n\t\tif ( ! isset( $this->options['db_version'] ) || $this->options['db_version'] < $this->db_version ) {\n\t\t\t$current_db_version = isset( $this->options['db_version'] ) ? $this->options['db_version'] : 0;\n\n\t\t\tdo_action( 'p2_upgrade_db_version', $current_db_version );\n\t\t\tfor ( ; $current_db_version <= $this->db_version; $current_db_version++ ) {\n\t\t\t\tdo_action( \"p2_upgrade_db_version_$current_db_version\" );\n\t\t\t}\n\n\t\t\t// Flush rewrite rules once, so callbacks don't have to.\n\t\t\tflush_rewrite_rules();\n\n\t\t\t$this->set_option( 'db_version', $this->db_version );\n\t\t\t$this->save_options();\n\t\t}\n\t}", "function upgrade_230()\n {\n }", "function upgrade_280()\n {\n }", "function upgrade_100()\n {\n }", "function upgrade_450()\n {\n }", "function upgrade_340()\n {\n }", "function update($oldversion) {\n\t\t/** globalising of the needed variables, objects and arrays */\n\t\tglobal $db, $apcms;\n\t\t\n\t\t\n\t\treturn true;\n\t\t\n\t}", "function finalizeModuleUpgrade() {\n $modules_table = TABLE_PREFIX . 'modules';\n $config_options_table = TABLE_PREFIX . 'config_options';\n\n try {\n\n // Remove merged modules\n DB::execute(\"DELETE FROM $modules_table WHERE name IN (?)\", array('incoming_mail', 'milestones', 'mobile_access', 'resources'));\n\n // Update incoming mail related settings\n DB::execute(\"UPDATE $config_options_table SET module = ? WHERE module = ?\", 'system', 'incoming_mail');\n\n // Uninstall backup module\n DB::execute(\"DELETE FROM $modules_table WHERE name = ?\", 'backup');\n DB::execute(\"DELETE FROM $config_options_table WHERE module = ?\", 'backup');\n\n // Enable only first party modules\n DB::execute(\"DELETE FROM $modules_table WHERE name NOT IN (?)\", array('system', 'discussions', 'milestones', 'files', 'todo', 'calendar', 'notebooks', 'tasks', 'tracking', 'project_exporter', 'status', 'documents', 'source', 'invoicing'));\n DB::execute(\"UPDATE $modules_table SET is_enabled = ?\", true);\n } catch(Exception $e) {\n return $e->getMessage();\n } // try\n\n return true;\n }", "public function upgradeAction()\r\n\t{\r\n\t try {\r\n \t // run the upgrade command\r\n \t $packageName = $this->_runCommand(\r\n \t $command = Faett_Core_Interfaces_Service::COMMAND_UPGRADE\r\n \t );\r\n // attach a message to the session\r\n \t\tMage::getSingleton('adminhtml/session')->addSuccess(\r\n \t\t Mage::helper('adminhtml')->__(\r\n \t\t '201.success.package-upgrade', $packageName\r\n \t\t )\r\n \t\t);\r\n\t } catch(Faett_Manager_Exceptions_InvalidCommandException $ice) {\r\n Mage::getSingleton('adminhtml/session')->addError(\r\n \t\t $ice->getMessage()\r\n \t\t);\r\n\t } catch(Exception $e) {\r\n Mage::getSingleton('adminhtml/session')->addError(\r\n \t\t Mage::helper('manager')->__(\r\n \t\t '900.pear.exception',\r\n \t\t $e->getMessage()\r\n \t\t )\r\n \t\t);\r\n\t }\r\n // redirect to the licence overview\r\n $this->_redirect('*/*/');\r\n\t}", "function upgrade_250()\n {\n }", "function pmb_upgrade($nom_meta_base_version,$version_cible){\n\t$current_version = 0.0;\n\tif ( (!isset($GLOBALS['meta'][$nom_meta_base_version]) )\n\t\t\t|| (($current_version = $GLOBALS['meta'][$nom_meta_base_version])!=$version_cible)){\n\t\tinclude_spip('base/pmb');\n include_spip('base/create');\n\t\tinclude_spip('base/abstract_sql');\n\t\tcreer_base();\n\t\tecrire_meta($nom_meta_base_version,$current_version=$version_cible,'non');\n\t}\n}", "function qtype_IPAtranscription_upgrade($oldversion=0) {\n global $CFG;\n\n ////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.\n\n return true;\n}", "public function upgrade__0_3_13__0_3_14()\n {\n $this->upgrade__0_3_0__0_3_1();\n $this->upgrade__0_3_1__0_3_2();\n $this->upgrade__0_3_4__0_3_5();\n $this->upgrade__0_3_5__0_3_6();\n $this->upgrade__0_3_6__0_3_7();\n $this->upgrade__0_3_7__0_3_8();\n $this->upgrade__0_3_8__0_3_9();\n $this->upgrade__0_3_9__0_3_10();\n $this->upgrade__0_3_10__0_3_11();\n $this->upgrade__0_3_11__0_3_12();\n $this->upgrade__0_3_12__0_3_13();\n }", "function generator_decla_upgrade($nom_meta_base_version, $version_cible) {\n\t\n\t$maj = array();\n\n\tinclude_spip('base/upgrade');\n\tmaj_plugin($nom_meta_base_version, $version_cible, $maj);\n}", "protected function assignVersion()\n {\n\n }", "function upgrade_370()\n {\n }", "function upgrade_260()\n {\n }", "function upgrade_252()\n {\n }", "function permissions_upgrade($oldversion)\n{\n // Update successful\n return true;\n}", "private function _update_package_to_version_141()\n {\n $this->EE->db->delete('actions',\n array('class' => ucfirst($this->get_package_name())));\n }", "public function upgrade(array $stepParams = [])\n\t{\n\t}", "public function update($current = '')\r\n {\r\n // Are they the same?\r\n if (version_compare($current, $this->version) >= 0) {\r\n return false;\r\n }\r\n\r\n // Two Digits? (needs to be 3)\r\n if (strlen($current) == 2) $current .= '0';\r\n\r\n $update_dir = PATH_THIRD.strtolower($this->module_name).'/updates/';\r\n\r\n // Does our folder exist?\r\n if (@is_dir($update_dir) === true) {\r\n // Loop over all files\r\n $files = @scandir($update_dir);\r\n\r\n if (is_array($files) == true) {\r\n foreach ($files as $file) {\r\n if (strpos($file, '.php') === false) continue;\r\n if (strpos($file, '_') === false) continue; // For legacy: XXX.php\r\n if ($file == '.' OR $file == '..' OR strtolower($file) == '.ds_store') continue;\r\n\r\n // Get the version number\r\n $ver = substr($file, 0, -4);\r\n $ver = str_replace('_', '.', $ver);\r\n\r\n // We only want greater ones\r\n if (version_compare($current, $ver) >= 0) continue;\r\n\r\n require $update_dir . $file;\r\n $class = 'TaggerUpdate_' . str_replace('.', '', $ver);\r\n $UPD = new $class();\r\n $UPD->update();\r\n }\r\n }\r\n }\r\n\r\n // Upgrade The Module\r\n $module = $module = ee('Model')->make('Module')->filter('module_name', ucfirst($this->module_name))->first();\r\n $module->module_version = $this->version;\r\n $module->save();\r\n\r\n return true;\r\n }", "function upgrade_400()\n {\n }", "public function updateVersionMatrix() {}", "public function updateVersionMatrix() {}", "function db_upgrade_all($iOldDBVersion) {\n /// This function does anything necessary to upgrade\n /// older versions to match current functionality\n global $modifyoutput;\n Yii::app()->loadHelper('database');\n\n $sUserTemplateRootDir = Yii::app()->getConfig('usertemplaterootdir');\n $sStandardTemplateRootDir = Yii::app()->getConfig('standardtemplaterootdir');\n echo str_pad(gT('The LimeSurvey database is being upgraded').' ('.date('Y-m-d H:i:s').')',14096).\".<br /><br />\". gT('Please be patient...').\"<br /><br />\\n\";\n\n $oDB = Yii::app()->getDb();\n $oDB->schemaCachingDuration=0; // Deactivate schema caching\n $oTransaction = $oDB->beginTransaction();\n try\n {\n if ($iOldDBVersion < 111)\n {\n // Language upgrades from version 110 to 111 because the language names did change\n\n $aOldNewLanguages=array('german_informal'=>'german-informal',\n 'cns'=>'cn-Hans',\n 'cnt'=>'cn-Hant',\n 'pt_br'=>'pt-BR',\n 'gr'=>'el',\n 'jp'=>'ja',\n 'si'=>'sl',\n 'se'=>'sv',\n 'vn'=>'vi');\n foreach ($aOldNewLanguages as $sOldLanguageCode=>$sNewLanguageCode)\n {\n alterLanguageCode($sOldLanguageCode,$sNewLanguageCode);\n }\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>111),\"stg_name='DBVersion'\");\n }\n\n if ($iOldDBVersion < 112) {\n // New size of the username field (it was previously 20 chars wide)\n $oDB->createCommand()->alterColumn('{{users}}','users_name',\"string(64) NOT NULL\");\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>112),\"stg_name='DBVersion'\");\n }\n\n if ($iOldDBVersion < 113) {\n //Fixes the collation for the complete DB, tables and columns\n\n if (Yii::app()->db->driverName=='mysql')\n {\n $sDatabaseName=getDBConnectionStringProperty('dbname');\n fixMySQLCollations();\n modifyDatabase(\"\",\"ALTER DATABASE `$sDatabaseName` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;\");echo $modifyoutput; flush();@ob_flush();\n }\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>113),\"stg_name='DBVersion'\");\n }\n\n if ($iOldDBVersion < 114) {\n $oDB->createCommand()->alterColumn('{{saved_control}}','email',\"string(320) NOT NULL\");\n $oDB->createCommand()->alterColumn('{{surveys}}','adminemail',\"string(320) NOT NULL\");\n $oDB->createCommand()->alterColumn('{{users}}','email',\"string(320) NOT NULL\");\n $oDB->createCommand()->insert('{{settings_global}}',array('stg_name'=>'SessionName','stg_value'=>randomChars(64,'ABCDEFGHIJKLMNOPQRSTUVWXYZ!\"$%&/()=?`+*~#\",;.:abcdefghijklmnopqrstuvwxyz123456789')));\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>114),\"stg_name='DBVersion'\");\n }\n\n if ($iOldDBVersion < 126) {\n\n addColumn('{{surveys}}','printanswers',\"string(1) default 'N'\");\n addColumn('{{surveys}}','listpublic',\"string(1) default 'N'\");\n\n upgradeSurveyTables126();\n upgradeTokenTables126();\n\n // Create quota table\n $oDB->createCommand()->createTable('{{quota}}',array(\n 'id' => 'pk',\n 'sid' => 'integer',\n 'qlimit' => 'integer',\n 'name' => 'string',\n 'action' => 'integer',\n 'active' => 'integer NOT NULL DEFAULT 1'\n ));\n\n // Create quota_members table\n $oDB->createCommand()->createTable('{{quota_members}}',array(\n 'id' => 'pk',\n 'sid' => 'integer',\n 'qid' => 'integer',\n 'quota_id' => 'integer',\n 'code' => 'string(5)'\n ));\n $oDB->createCommand()->createIndex('sid','{{quota_members}}','sid,qid,quota_id,code',true);\n\n\n // Create templates_rights table\n $oDB->createCommand()->createTable('{{templates_rights}}',array(\n 'uid' => 'integer NOT NULL',\n 'folder' => 'string NOT NULL',\n 'use' => 'integer',\n 'PRIMARY KEY (uid, folder)'\n ));\n\n // Create templates table\n $oDB->createCommand()->createTable('{{templates}}',array(\n 'folder' => 'string NOT NULL',\n 'creator' => 'integer NOT NULL',\n 'PRIMARY KEY (folder)'\n ));\n\n // Rename Norwegian language codes\n alterLanguageCode('no','nb');\n\n addColumn('{{surveys}}','htmlemail',\"string(1) default 'N'\");\n addColumn('{{surveys}}','tokenanswerspersistence',\"string(1) default 'N'\");\n addColumn('{{surveys}}','usecaptcha',\"string(1) default 'N'\");\n addColumn('{{surveys}}','bounce_email','text');\n addColumn('{{users}}','htmleditormode',\"string(7) default 'default'\");\n addColumn('{{users}}','superadmin',\"integer NOT NULL default '0'\");\n addColumn('{{questions}}','lid1',\"integer NOT NULL default '0'\");\n\n alterColumn('{{conditions}}','value',\"string\",false,'');\n alterColumn('{{labels}}','title',\"text\");\n\n $oDB->createCommand()->update('{{users}}',array('superadmin'=>1),\"create_survey=1 AND create_user=1 AND move_user=1 AND delete_user=1 AND configurator=1\");\n $oDB->createCommand()->update('{{conditions}}',array('method'=>'=='),\"(method is null) or method='' or method='0'\");\n\n dropColumn('{{users}}','move_user');\n\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>126),\"stg_name='DBVersion'\");\n }\n\n if ($iOldDBVersion < 127) {\n modifyDatabase(\"\",\"create index answers_idx2 on {{answers}} (sortorder)\"); echo $modifyoutput;\n modifyDatabase(\"\",\"create index assessments_idx2 on {{assessments}} (sid)\"); echo $modifyoutput;\n modifyDatabase(\"\",\"create index assessments_idx3 on {{assessments}} (gid)\"); echo $modifyoutput;\n modifyDatabase(\"\",\"create index conditions_idx2 on {{conditions}} (qid)\"); echo $modifyoutput;\n modifyDatabase(\"\",\"create index conditions_idx3 on {{conditions}} (cqid)\"); echo $modifyoutput;\n modifyDatabase(\"\",\"create index groups_idx2 on {{groups}} (sid)\"); echo $modifyoutput;\n modifyDatabase(\"\",\"create index question_attributes_idx2 on {{question_attributes}} (qid)\"); echo $modifyoutput;\n modifyDatabase(\"\",\"create index questions_idx2 on {{questions}} (sid)\"); echo $modifyoutput;\n modifyDatabase(\"\",\"create index questions_idx3 on {{questions}} (gid)\"); echo $modifyoutput;\n modifyDatabase(\"\",\"create index questions_idx4 on {{questions}} (type)\"); echo $modifyoutput;\n modifyDatabase(\"\",\"create index quota_idx2 on {{quota}} (sid)\"); echo $modifyoutput;\n modifyDatabase(\"\",\"create index saved_control_idx2 on {{saved_control}} (sid)\"); echo $modifyoutput;\n modifyDatabase(\"\",\"create index user_in_groups_idx1 on {{user_in_groups}} (ugid, uid)\"); echo $modifyoutput;\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>127),\"stg_name='DBVersion'\");\n }\n\n if ($iOldDBVersion < 128) {\n upgradeTokens128();\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>128),\"stg_name='DBVersion'\");\n }\n\n if ($iOldDBVersion < 129) {\n addColumn('{{surveys}}','startdate',\"datetime\");\n addColumn('{{surveys}}','usestartdate',\"string(1) NOT NULL default 'N'\");\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>129),\"stg_name='DBVersion'\");\n }\n\n if ($iOldDBVersion < 130)\n {\n addColumn('{{conditions}}','scenario',\"integer NOT NULL default '1'\");\n $oDB->createCommand()->update('{{conditions}}',array('scenario'=>'1'),\"(scenario is null) or scenario=0\");\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>130),\"stg_name='DBVersion'\");\n }\n\n if ($iOldDBVersion < 131)\n {\n addColumn('{{surveys}}','publicstatistics',\"string(1) NOT NULL default 'N'\");\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>131),\"stg_name='DBVersion'\");\n }\n\n if ($iOldDBVersion < 132)\n {\n addColumn('{{surveys}}','publicgraphs',\"string(1) NOT NULL default 'N'\");\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>132),\"stg_name='DBVersion'\");\n }\n\n if ($iOldDBVersion < 133)\n {\n addColumn('{{users}}','one_time_pw','binary');\n // Add new assessment setting\n addColumn('{{surveys}}','assessments',\"string(1) NOT NULL default 'N'\");\n // add new assessment value fields to answers & labels\n addColumn('{{answers}}','assessment_value',\"integer NOT NULL default '0'\");\n addColumn('{{labels}}','assessment_value',\"integer NOT NULL default '0'\");\n // copy any valid codes from code field to assessment field\n switch (Yii::app()->db->driverName){\n case 'mysql':\n case 'mysqli':\n $oDB->createCommand(\"UPDATE {{answers}} SET assessment_value=CAST(`code` as SIGNED) where `code` REGEXP '^-?[0-9]+$'\")->execute();\n $oDB->createCommand(\"UPDATE {{labels}} SET assessment_value=CAST(`code` as SIGNED) where `code` REGEXP '^-?[0-9]+$'\")->execute();\n // copy assessment link to message since from now on we will have HTML assignment messages\n $oDB->createCommand(\"UPDATE {{assessments}} set message=concat(replace(message,'/''',''''),'<br /><a href=\\\"',link,'\\\">',link,'</a>')\")->execute();\n break;\n case 'sqlsrv':\n case 'dblib':\n case 'mssql':\n try{\n $oDB->createCommand(\"UPDATE {{answers}} SET assessment_value=CAST([code] as int) WHERE ISNUMERIC([code])=1\")->execute();\n $oDB->createCommand(\"UPDATE {{labels}} SET assessment_value=CAST([code] as int) WHERE ISNUMERIC([code])=1\")->execute();\n } catch(Exception $e){};\n // copy assessment link to message since from now on we will have HTML assignment messages\n alterColumn('{{assessments}}','link',\"text\",false);\n alterColumn('{{assessments}}','message',\"text\",false);\n $oDB->createCommand(\"UPDATE {{assessments}} set message=replace(message,'/''','''')+'<br /><a href=\\\"'+link+'\\\">'+link+'</a>'\")->execute();\n break;\n case 'pgsql':\n $oDB->createCommand(\"UPDATE {{answers}} SET assessment_value=CAST(code as integer) where code ~ '^[0-9]+'\")->execute();\n $oDB->createCommand(\"UPDATE {{labels}} SET assessment_value=CAST(code as integer) where code ~ '^[0-9]+'\")->execute();\n // copy assessment link to message since from now on we will have HTML assignment messages\n $oDB->createCommand(\"UPDATE {{assessments}} set message=replace(message,'/''','''')||'<br /><a href=\\\"'||link||'\\\">'||link||'</a>'\")->execute();\n break;\n default: die('Unknown database type');\n }\n // activate assessment where assessment rules exist\n $oDB->createCommand(\"UPDATE {{surveys}} SET assessments='Y' where sid in (SELECT sid FROM {{assessments}} group by sid)\")->execute();\n // add language field to assessment table\n addColumn('{{assessments}}','language',\"string(20) NOT NULL default 'en'\");\n // update language field with default language of that particular survey\n $oDB->createCommand(\"UPDATE {{assessments}} SET language=(select language from {{surveys}} where sid={{assessments}}.sid)\")->execute();\n // drop the old link field\n dropColumn('{{assessments}}','link');\n\n // Add new fields to survey language settings\n addColumn('{{surveys_languagesettings}}','surveyls_url',\"string\");\n addColumn('{{surveys_languagesettings}}','surveyls_endtext','text');\n // copy old URL fields ot language specific entries\n $oDB->createCommand(\"UPDATE {{surveys_languagesettings}} set surveyls_url=(select url from {{surveys}} where sid={{surveys_languagesettings}}.surveyls_survey_id)\")->execute();\n // drop old URL field\n dropColumn('{{surveys}}','url');\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>133),\"stg_name='DBVersion'\");\n }\n\n if ($iOldDBVersion < 134)\n {\n // Add new tokens setting\n addColumn('{{surveys}}','usetokens',\"string(1) NOT NULL default 'N'\");\n addColumn('{{surveys}}','attributedescriptions','text');\n dropColumn('{{surveys}}','attribute1');\n dropColumn('{{surveys}}','attribute2');\n upgradeTokenTables134();\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>134),\"stg_name='DBVersion'\");\n }\n\n if ($iOldDBVersion < 135)\n {\n alterColumn('{{question_attributes}}','value','text');\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>135),\"stg_name='DBVersion'\");\n }\n\n if ($iOldDBVersion < 136) //New Quota Functions\n {\n addColumn('{{quota}}','autoload_url',\"integer NOT NULL default 0\");\n // Create quota table\n $aFields = array(\n 'quotals_id' => 'pk',\n 'quotals_quota_id' => 'integer NOT NULL DEFAULT 0',\n 'quotals_language' => \"string(45) NOT NULL default 'en'\",\n 'quotals_name' => 'string',\n 'quotals_message' => 'text NOT NULL',\n 'quotals_url' => 'string',\n 'quotals_urldescrip' => 'string',\n );\n $oDB->createCommand()->createTable('{{quota_languagesettings}}',$aFields);\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>136),\"stg_name='DBVersion'\");\n }\n\n if ($iOldDBVersion < 137) //New Quota Functions\n {\n addColumn('{{surveys_languagesettings}}','surveyls_dateformat',\"integer NOT NULL default 1\");\n addColumn('{{users}}','dateformat',\"integer NOT NULL default 1\");\n $oDB->createCommand()->update('{{surveys}}',array('startdate'=>NULL),\"usestartdate='N'\");\n $oDB->createCommand()->update('{{surveys}}',array('expires'=>NULL),\"useexpiry='N'\");\n dropColumn('{{surveys}}','useexpiry');\n dropColumn('{{surveys}}','usestartdate');\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>137),\"stg_name='DBVersion'\");\n }\n\n if ($iOldDBVersion < 138) //Modify quota field\n {\n alterColumn('{{quota_members}}','code',\"string(11)\");\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>138),\"stg_name='DBVersion'\");\n }\n\n if ($iOldDBVersion < 139) //Modify quota field\n {\n upgradeSurveyTables139();\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>139),\"stg_name='DBVersion'\");\n }\n\n if ($iOldDBVersion < 140) //Modify surveys table\n {\n addColumn('{{surveys}}','emailresponseto','text');\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>140),\"stg_name='DBVersion'\");\n }\n\n if ($iOldDBVersion < 141) //Modify surveys table\n {\n addColumn('{{surveys}}','tokenlength','integer NOT NULL default 15');\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>141),\"stg_name='DBVersion'\");\n }\n\n if ($iOldDBVersion < 142) //Modify surveys table\n {\n upgradeQuestionAttributes142();\n $oDB->createCommand()->alterColumn('{{surveys}}','expires',\"datetime\");\n $oDB->createCommand()->alterColumn('{{surveys}}','startdate',\"datetime\");\n $oDB->createCommand()->update('{{question_attributes}}',array('value'=>0),\"value='false'\");\n $oDB->createCommand()->update('{{question_attributes}}',array('value'=>1),\"value='true'\");\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>142),\"stg_name='DBVersion'\");\n }\n\n if ($iOldDBVersion < 143)\n {\n addColumn('{{questions}}','parent_qid','integer NOT NULL default 0');\n addColumn('{{answers}}','scale_id','integer NOT NULL default 0');\n addColumn('{{questions}}','scale_id','integer NOT NULL default 0');\n addColumn('{{questions}}','same_default','integer NOT NULL default 0');\n dropPrimaryKey('answers');\n addPrimaryKey('answers', array('qid','code','language','scale_id'));\n\n $aFields = array(\n 'qid' => \"integer NOT NULL default 0\",\n 'scale_id' => 'integer NOT NULL default 0',\n 'sqid' => 'integer NOT NULL default 0',\n 'language' => 'string(20) NOT NULL',\n 'specialtype' => \"string(20) NOT NULL default ''\",\n 'defaultvalue' => 'text',\n );\n $oDB->createCommand()->createTable('{{defaultvalues}}',$aFields);\n addPrimaryKey('defaultvalues', array('qid','specialtype','language','scale_id','sqid'));\n\n // -Move all 'answers' that are subquestions to the questions table\n // -Move all 'labels' that are answers to the answers table\n // -Transscribe the default values where applicable\n // -Move default values from answers to questions\n upgradeTables143();\n\n dropColumn('{{answers}}','default_value');\n dropColumn('{{questions}}','lid');\n dropColumn('{{questions}}','lid1');\n\n $aFields = array(\n 'sesskey' => \"string(64) NOT NULL DEFAULT ''\",\n 'expiry' => \"datetime NOT NULL\",\n 'expireref' => \"string(250) DEFAULT ''\",\n 'created' => \"datetime NOT NULL\",\n 'modified' => \"datetime NOT NULL\",\n 'sessdata' => 'text'\n );\n $oDB->createCommand()->createTable('{{sessions}}',$aFields);\n addPrimaryKey('sessions',array('sesskey'));\n $oDB->createCommand()->createIndex('sess2_expiry','{{sessions}}','expiry');\n $oDB->createCommand()->createIndex('sess2_expireref','{{sessions}}','expireref');\n // Move all user templates to the new user template directory\n echo \"<br>\".sprintf(gT(\"Moving user templates to new location at %s...\"),$sUserTemplateRootDir).\"<br />\";\n $hTemplateDirectory = opendir($sStandardTemplateRootDir);\n $aFailedTemplates=array();\n // get each entry\n while($entryName = readdir($hTemplateDirectory)) {\n if (!in_array($entryName,array('.','..','.svn')) && is_dir($sStandardTemplateRootDir.DIRECTORY_SEPARATOR.$entryName) && !isStandardTemplate($entryName))\n {\n if (!rename($sStandardTemplateRootDir.DIRECTORY_SEPARATOR.$entryName,$sUserTemplateRootDir.DIRECTORY_SEPARATOR.$entryName))\n {\n $aFailedTemplates[]=$entryName;\n };\n }\n }\n if (count($aFailedTemplates)>0)\n {\n echo \"The following templates at {$sStandardTemplateRootDir} could not be moved to the new location at {$sUserTemplateRootDir}:<br /><ul>\";\n foreach ($aFailedTemplates as $sFailedTemplate)\n {\n echo \"<li>{$sFailedTemplate}</li>\";\n }\n echo \"</ul>Please move these templates manually after the upgrade has finished.<br />\";\n }\n // close directory\n closedir($hTemplateDirectory);\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>143),\"stg_name='DBVersion'\");\n }\n\n if ($iOldDBVersion < 145)\n {\n addColumn('{{surveys}}','savetimings',\"string(1) NULL default 'N'\");\n addColumn('{{surveys}}','showXquestions',\"string(1) NULL default 'Y'\");\n addColumn('{{surveys}}','showgroupinfo',\"string(1) NULL default 'B'\");\n addColumn('{{surveys}}','shownoanswer',\"string(1) NULL default 'Y'\");\n addColumn('{{surveys}}','showqnumcode',\"string(1) NULL default 'X'\");\n addColumn('{{surveys}}','bouncetime','integer');\n addColumn('{{surveys}}','bounceprocessing',\"string(1) NULL default 'N'\");\n addColumn('{{surveys}}','bounceaccounttype',\"string(4)\");\n addColumn('{{surveys}}','bounceaccounthost',\"string(200)\");\n addColumn('{{surveys}}','bounceaccountpass',\"string(100)\");\n addColumn('{{surveys}}','bounceaccountencryption',\"string(3)\");\n addColumn('{{surveys}}','bounceaccountuser',\"string(200)\");\n addColumn('{{surveys}}','showwelcome',\"string(1) default 'Y'\");\n addColumn('{{surveys}}','showprogress',\"string(1) default 'Y'\");\n addColumn('{{surveys}}','allowjumps',\"string(1) default 'N'\");\n addColumn('{{surveys}}','navigationdelay',\"integer default 0\");\n addColumn('{{surveys}}','nokeyboard',\"string(1) default 'N'\");\n addColumn('{{surveys}}','alloweditaftercompletion',\"string(1) default 'N'\");\n\n\n $aFields = array(\n 'sid' => \"integer NOT NULL\",\n 'uid' => \"integer NOT NULL\",\n 'permission' => 'string(20) NOT NULL',\n 'create_p' => \"integer NOT NULL default 0\",\n 'read_p' => \"integer NOT NULL default 0\",\n 'update_p' => \"integer NOT NULL default 0\",\n 'delete_p' => \"integer NOT NULL default 0\",\n 'import_p' => \"integer NOT NULL default 0\",\n 'export_p' => \"integer NOT NULL default 0\"\n );\n $oDB->createCommand()->createTable('{{survey_permissions}}',$aFields);\n addPrimaryKey('survey_permissions', array('sid','uid','permission'));\n\n upgradeSurveyPermissions145();\n\n // drop the old survey rights table\n $oDB->createCommand()->dropTable('{{surveys_rights}}');\n\n // Add new fields for email templates\n addColumn('{{surveys_languagesettings}}','email_admin_notification_subj',\"string\");\n addColumn('{{surveys_languagesettings}}','email_admin_responses_subj',\"string\");\n addColumn('{{surveys_languagesettings}}','email_admin_notification',\"text\");\n addColumn('{{surveys_languagesettings}}','email_admin_responses',\"text\");\n\n //Add index to questions table to speed up subquestions\n $oDB->createCommand()->createIndex('parent_qid_idx','{{questions}}','parent_qid');\n\n addColumn('{{surveys}}','emailnotificationto',\"text\");\n\n upgradeSurveys145();\n dropColumn('{{surveys}}','notification');\n alterColumn('{{conditions}}','method',\"string(5)\",false,'');\n\n $oDB->createCommand()->renameColumn('{{surveys}}','private','anonymized');\n $oDB->createCommand()->update('{{surveys}}',array('anonymized'=>'N'),\"anonymized is NULL\");\n alterColumn('{{surveys}}','anonymized',\"string(1)\",false,'N');\n\n //now we clean up things that were not properly set in previous DB upgrades\n $oDB->createCommand()->update('{{answers}}',array('answer'=>''),\"answer is NULL\");\n $oDB->createCommand()->update('{{assessments}}',array('scope'=>''),\"scope is NULL\");\n $oDB->createCommand()->update('{{assessments}}',array('name'=>''),\"name is NULL\");\n $oDB->createCommand()->update('{{assessments}}',array('message'=>''),\"message is NULL\");\n $oDB->createCommand()->update('{{assessments}}',array('minimum'=>''),\"minimum is NULL\");\n $oDB->createCommand()->update('{{assessments}}',array('maximum'=>''),\"maximum is NULL\");\n $oDB->createCommand()->update('{{groups}}',array('group_name'=>''),\"group_name is NULL\");\n $oDB->createCommand()->update('{{labels}}',array('code'=>''),\"code is NULL\");\n $oDB->createCommand()->update('{{labelsets}}',array('label_name'=>''),\"label_name is NULL\");\n $oDB->createCommand()->update('{{questions}}',array('type'=>'T'),\"type is NULL\");\n $oDB->createCommand()->update('{{questions}}',array('title'=>''),\"title is NULL\");\n $oDB->createCommand()->update('{{questions}}',array('question'=>''),\"question is NULL\");\n $oDB->createCommand()->update('{{questions}}',array('other'=>'N'),\"other is NULL\");\n\n alterColumn('{{answers}}','answer',\"text\",false);\n alterColumn('{{answers}}','assessment_value','integer',false , '0');\n alterColumn('{{assessments}}','scope',\"string(5)\",false , '');\n alterColumn('{{assessments}}','name',\"text\",false);\n alterColumn('{{assessments}}','message',\"text\",false);\n alterColumn('{{assessments}}','minimum',\"string(50)\",false , '');\n alterColumn('{{assessments}}','maximum',\"string(50)\",false , '');\n // change the primary index to include language\n if (Yii::app()->db->driverName=='mysql') // special treatment for mysql because this needs to be in one step since an AUTOINC field is involved\n {\n modifyPrimaryKey('assessments', array('id', 'language'));\n }\n else\n {\n dropPrimaryKey('assessments');\n addPrimaryKey('assessments',array('id','language'));\n }\n\n\n alterColumn('{{conditions}}','cfieldname',\"string(50)\",false , '');\n dropPrimaryKey('defaultvalues');\n alterColumn('{{defaultvalues}}','specialtype',\"string(20)\",false , '');\n addPrimaryKey('defaultvalues', array('qid','specialtype','language','scale_id','sqid'));\n\n alterColumn('{{groups}}','group_name',\"string(100)\",false , '');\n alterColumn('{{labels}}','code',\"string(5)\",false , '');\n dropPrimaryKey('labels');\n alterColumn('{{labels}}','language',\"string(20)\",false , 'en');\n addPrimaryKey('labels', array('lid', 'sortorder', 'language'));\n alterColumn('{{labelsets}}','label_name',\"string(100)\",false , '');\n alterColumn('{{questions}}','parent_qid','integer',false ,'0');\n alterColumn('{{questions}}','title',\"string(20)\",false , '');\n alterColumn('{{questions}}','question',\"text\",false);\n try { setTransactionBookmark(); $oDB->createCommand()->dropIndex('questions_idx4','{{questions}}'); } catch(Exception $e) { rollBackToTransactionBookmark();}\n\n alterColumn('{{questions}}','type',\"string(1)\",false , 'T');\n try{ $oDB->createCommand()->createIndex('questions_idx4','{{questions}}','type');} catch(Exception $e){};\n alterColumn('{{questions}}','other',\"string(1)\",false , 'N');\n alterColumn('{{questions}}','mandatory',\"string(1)\");\n alterColumn('{{question_attributes}}','attribute',\"string(50)\");\n alterColumn('{{quota}}','qlimit','integer');\n\n $oDB->createCommand()->update('{{saved_control}}',array('identifier'=>''),\"identifier is NULL\");\n alterColumn('{{saved_control}}','identifier',\"text\",false);\n $oDB->createCommand()->update('{{saved_control}}',array('access_code'=>''),\"access_code is NULL\");\n alterColumn('{{saved_control}}','access_code',\"text\",false);\n alterColumn('{{saved_control}}','email',\"string(320)\");\n $oDB->createCommand()->update('{{saved_control}}',array('ip'=>''),\"ip is NULL\");\n alterColumn('{{saved_control}}','ip',\"text\",false);\n $oDB->createCommand()->update('{{saved_control}}',array('saved_thisstep'=>''),\"saved_thisstep is NULL\");\n alterColumn('{{saved_control}}','saved_thisstep',\"text\",false);\n $oDB->createCommand()->update('{{saved_control}}',array('status'=>''),\"status is NULL\");\n alterColumn('{{saved_control}}','status',\"string(1)\",false , '');\n $oDB->createCommand()->update('{{saved_control}}',array('saved_date'=>'1980-01-01 00:00:00'),\"saved_date is NULL\");\n alterColumn('{{saved_control}}','saved_date',\"datetime\",false);\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>''),\"stg_value is NULL\");\n alterColumn('{{settings_global}}','stg_value',\"string\",false , '');\n\n alterColumn('{{surveys}}','admin',\"string(50)\");\n $oDB->createCommand()->update('{{surveys}}',array('active'=>'N'),\"active is NULL\");\n\n alterColumn('{{surveys}}','active',\"string(1)\",false , 'N');\n\n alterColumn('{{surveys}}','startdate',\"datetime\");\n alterColumn('{{surveys}}','adminemail',\"string(320)\");\n alterColumn('{{surveys}}','anonymized',\"string(1)\",false , 'N');\n\n alterColumn('{{surveys}}','faxto',\"string(20)\");\n alterColumn('{{surveys}}','format',\"string(1)\");\n alterColumn('{{surveys}}','language',\"string(50)\");\n alterColumn('{{surveys}}','additional_languages',\"string\");\n alterColumn('{{surveys}}','printanswers',\"string(1)\",true , 'N');\n alterColumn('{{surveys}}','publicstatistics',\"string(1)\",true , 'N');\n alterColumn('{{surveys}}','publicgraphs',\"string(1)\",true , 'N');\n alterColumn('{{surveys}}','assessments',\"string(1)\",true , 'N');\n alterColumn('{{surveys}}','usetokens',\"string(1)\",true , 'N');\n alterColumn('{{surveys}}','bounce_email',\"string(320)\");\n alterColumn('{{surveys}}','tokenlength','integer',true , 15);\n\n $oDB->createCommand()->update('{{surveys_languagesettings}}',array('surveyls_title'=>''),\"surveyls_title is NULL\");\n alterColumn('{{surveys_languagesettings}}','surveyls_title',\"string(200)\",false);\n alterColumn('{{surveys_languagesettings}}','surveyls_endtext',\"text\");\n alterColumn('{{surveys_languagesettings}}','surveyls_url',\"string\");\n alterColumn('{{surveys_languagesettings}}','surveyls_urldescription',\"string\");\n alterColumn('{{surveys_languagesettings}}','surveyls_email_invite_subj',\"string\");\n alterColumn('{{surveys_languagesettings}}','surveyls_email_remind_subj',\"string\");\n alterColumn('{{surveys_languagesettings}}','surveyls_email_register_subj',\"string\");\n alterColumn('{{surveys_languagesettings}}','surveyls_email_confirm_subj',\"string\");\n alterColumn('{{surveys_languagesettings}}','surveyls_dateformat','integer',false , 1);\n\n $oDB->createCommand()->update('{{users}}',array('users_name'=>''),\"users_name is NULL\");\n $oDB->createCommand()->update('{{users}}',array('full_name'=>''),\"full_name is NULL\");\n alterColumn('{{users}}','users_name',\"string(64)\",false , '');\n alterColumn('{{users}}','full_name',\"string(50)\",false);\n alterColumn('{{users}}','lang',\"string(20)\");\n alterColumn('{{users}}','email',\"string(320)\");\n alterColumn('{{users}}','superadmin','integer',false , 0);\n alterColumn('{{users}}','htmleditormode',\"string(7)\",true,'default');\n alterColumn('{{users}}','dateformat','integer',false , 1);\n try{\n setTransactionBookmark();\n $oDB->createCommand()->dropIndex('email','{{users}}');\n }\n catch(Exception $e)\n {\n // do nothing\n rollBackToTransactionBookmark();\n }\n\n $oDB->createCommand()->update('{{user_groups}}',array('name'=>''),\"name is NULL\");\n $oDB->createCommand()->update('{{user_groups}}',array('description'=>''),\"description is NULL\");\n alterColumn('{{user_groups}}','name',\"string(20)\",false);\n alterColumn('{{user_groups}}','description',\"text\",false);\n\n try { $oDB->createCommand()->dropIndex('user_in_groups_idx1','{{user_in_groups}}'); } catch(Exception $e) {}\n try { addPrimaryKey('user_in_groups', array('ugid','uid')); } catch(Exception $e) {}\n\n addColumn('{{surveys_languagesettings}}','surveyls_numberformat',\"integer NOT NULL DEFAULT 0\");\n\n $oDB->createCommand()->createTable('{{failed_login_attempts}}',array(\n 'id' => \"pk\",\n 'ip' => 'string(37) NOT NULL',\n 'last_attempt' => 'string(20) NOT NULL',\n 'number_attempts' => \"integer NOT NULL\"\n ));\n upgradeTokens145();\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>145),\"stg_name='DBVersion'\");\n }\n\n if ($iOldDBVersion < 146) //Modify surveys table\n {\n upgradeSurveyTimings146();\n // Fix permissions for new feature quick-translation\n try { setTransactionBookmark(); $oDB->createCommand(\"INSERT into {{survey_permissions}} (sid,uid,permission,read_p,update_p) SELECT sid,owner_id,'translations','1','1' from {{surveys}}\")->execute(); echo $modifyoutput; flush();@ob_flush();} catch(Exception $e) { rollBackToTransactionBookmark();}\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>146),\"stg_name='DBVersion'\");\n }\n\n if ($iOldDBVersion < 147)\n {\n addColumn('{{users}}','templateeditormode',\"string(7) NOT NULL default 'default'\");\n addColumn('{{users}}','questionselectormode',\"string(7) NOT NULL default 'default'\");\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>147),\"stg_name='DBVersion'\");\n }\n\n if ($iOldDBVersion < 148)\n {\n addColumn('{{users}}','participant_panel',\"integer NOT NULL default 0\");\n\n $oDB->createCommand()->createTable('{{participants}}',array(\n 'participant_id' => 'string(50) NOT NULL',\n 'firstname' => 'string(40) default NULL',\n 'lastname' => 'string(40) default NULL',\n 'email' => 'string(80) default NULL',\n 'language' => 'string(40) default NULL',\n 'blacklisted' => 'string(1) NOT NULL',\n 'owner_uid' => \"integer NOT NULL\"\n ));\n addPrimaryKey('participants', array('participant_id'));\n\n $oDB->createCommand()->createTable('{{participant_attribute}}',array(\n 'participant_id' => 'string(50) NOT NULL',\n 'attribute_id' => \"integer NOT NULL\",\n 'value' => 'string(50) NOT NULL'\n ));\n addPrimaryKey('participant_attribute', array('participant_id','attribute_id'));\n\n $oDB->createCommand()->createTable('{{participant_attribute_names}}',array(\n 'attribute_id' => 'autoincrement',\n 'attribute_type' => 'string(4) NOT NULL',\n 'visible' => 'string(5) NOT NULL',\n 'PRIMARY KEY (attribute_id,attribute_type)'\n ));\n\n $oDB->createCommand()->createTable('{{participant_attribute_names_lang}}',array(\n 'attribute_id' => 'integer NOT NULL',\n 'attribute_name' => 'string(30) NOT NULL',\n 'lang' => 'string(20) NOT NULL'\n ));\n addPrimaryKey('participant_attribute_names_lang', array('attribute_id','lang'));\n\n $oDB->createCommand()->createTable('{{participant_attribute_values}}',array(\n 'attribute_id' => 'integer NOT NULL',\n 'value_id' => 'pk',\n 'value' => 'string(20) NOT NULL'\n ));\n\n $oDB->createCommand()->createTable('{{participant_shares}}',array(\n 'participant_id' => 'string(50) NOT NULL',\n 'share_uid' => 'integer NOT NULL',\n 'date_added' => 'datetime NOT NULL',\n 'can_edit' => 'string(5) NOT NULL'\n ));\n addPrimaryKey('participant_shares', array('participant_id','share_uid'));\n\n $oDB->createCommand()->createTable('{{survey_links}}',array(\n 'participant_id' => 'string(50) NOT NULL',\n 'token_id' => 'integer NOT NULL',\n 'survey_id' => 'integer NOT NULL',\n 'date_created' => 'datetime NOT NULL'\n ));\n addPrimaryKey('survey_links', array('participant_id','token_id','survey_id'));\n // Add language field to question_attributes table\n addColumn('{{question_attributes}}','language',\"string(20)\");\n upgradeQuestionAttributes148();\n fixSubquestions();\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>148),\"stg_name='DBVersion'\");\n }\n\n if ($iOldDBVersion < 149)\n {\n $aFields = array(\n 'id' => 'integer',\n 'sid' => 'integer',\n 'parameter' => 'string(50)',\n 'targetqid' => 'integer',\n 'targetsqid' => 'integer'\n );\n $oDB->createCommand()->createTable('{{survey_url_parameters}}',$aFields);\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>149),\"stg_name='DBVersion'\");\n }\n\n if ($iOldDBVersion < 150)\n {\n addColumn('{{questions}}','relevance','TEXT');\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>150),\"stg_name='DBVersion'\");\n }\n\n if ($iOldDBVersion < 151)\n {\n addColumn('{{groups}}','randomization_group',\"string(20) NOT NULL default ''\");\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>151),\"stg_name='DBVersion'\");\n }\n\n if ($iOldDBVersion < 152)\n {\n $oDB->createCommand()->createIndex('question_attributes_idx3','{{question_attributes}}','attribute');\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>152),\"stg_name='DBVersion'\");\n }\n\n if ($iOldDBVersion < 153)\n {\n $oDB->createCommand()->createTable('{{expression_errors}}',array(\n 'id' => 'pk',\n 'errortime' => 'string(50)',\n 'sid' => 'integer',\n 'gid' => 'integer',\n 'qid' => 'integer',\n 'gseq' => 'integer',\n 'qseq' => 'integer',\n 'type' => 'string(50)',\n 'eqn' => 'text',\n 'prettyprint' => 'text'\n ));\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>153),\"stg_name='DBVersion'\");\n }\n\n if ($iOldDBVersion < 154)\n {\n $oDB->createCommand()->addColumn('{{groups}}','grelevance',\"text\");\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>154),\"stg_name='DBVersion'\");\n }\n\n if ($iOldDBVersion < 155)\n {\n addColumn('{{surveys}}','googleanalyticsstyle',\"string(1)\");\n addColumn('{{surveys}}','googleanalyticsapikey',\"string(25)\");\n try { setTransactionBookmark(); $oDB->createCommand()->renameColumn('{{surveys}}','showXquestions','showxquestions');} catch(Exception $e) { rollBackToTransactionBookmark();}\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>155),\"stg_name='DBVersion'\");\n }\n\n\n if ($iOldDBVersion < 156)\n {\n try\n {\n $oDB->createCommand()->dropTable('{{survey_url_parameters}}');\n }\n catch(Exception $e)\n {\n // do nothing\n }\n $oDB->createCommand()->createTable('{{survey_url_parameters}}',array(\n 'id' => 'pk',\n 'sid' => 'integer NOT NULL',\n 'parameter' => 'string(50) NOT NULL',\n 'targetqid' => 'integer',\n 'targetsqid' => 'integer'\n ));\n\n $oDB->createCommand()->dropTable('{{sessions}}');\n if (Yii::app()->db->driverName=='mysql')\n {\n $oDB->createCommand()->createTable('{{sessions}}',array(\n 'id' => 'string(32) NOT NULL',\n 'expire' => 'integer',\n 'data' => 'longtext'\n ));\n }\n else\n {\n $oDB->createCommand()->createTable('{{sessions}}',array(\n 'id' => 'string(32) NOT NULL',\n 'expire' => 'integer',\n 'data' => 'text'\n ));\n }\n\n addPrimaryKey('sessions', array('id'));\n addColumn('{{surveys_languagesettings}}','surveyls_attributecaptions',\"TEXT\");\n addColumn('{{surveys}}','sendconfirmation',\"string(1) default 'Y'\");\n\n upgradeSurveys156();\n\n // If a survey has an deleted owner, re-own the survey to the superadmin\n $oDB->schema->refresh();\n Survey::model()->refreshMetaData();\n $surveys = Survey::model();\n $surveys = $surveys->with(array('owner'))->findAll();\n foreach ($surveys as $row)\n {\n if (!isset($row->owner->attributes))\n {\n Survey::model()->updateByPk($row->sid,array('owner_id'=>1));\n }\n }\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>156),\"stg_name='DBVersion'\");\n $oTransaction->commit();\n $oTransaction=$oDB->beginTransaction();\n }\n\n if ($iOldDBVersion < 157)\n {\n // MySQL DB corrections\n try { setTransactionBookmark(); $oDB->createCommand()->dropIndex('questions_idx4','{{questions}}'); } catch(Exception $e) { rollBackToTransactionBookmark();}\n\n alterColumn('{{answers}}','assessment_value','integer',false , '0');\n dropPrimaryKey('answers');\n alterColumn('{{answers}}','scale_id','integer',false , '0');\n addPrimaryKey('answers', array('qid','code','language','scale_id'));\n alterColumn('{{conditions}}','method',\"string(5)\",false , '');\n alterColumn('{{participants}}','owner_uid','integer',false);\n alterColumn('{{participant_attribute_names}}','visible','string(5)',false);\n alterColumn('{{questions}}','type',\"string(1)\",false , 'T');\n alterColumn('{{questions}}','other',\"string(1)\",false , 'N');\n alterColumn('{{questions}}','mandatory',\"string(1)\");\n alterColumn('{{questions}}','scale_id','integer',false , '0');\n alterColumn('{{questions}}','parent_qid','integer',false ,'0');\n\n alterColumn('{{questions}}','same_default','integer',false , '0');\n alterColumn('{{quota}}','qlimit','integer');\n alterColumn('{{quota}}','action','integer');\n alterColumn('{{quota}}','active','integer',false , '1');\n alterColumn('{{quota}}','autoload_url','integer',false , '0');\n alterColumn('{{saved_control}}','status',\"string(1)\",false , '');\n try { setTransactionBookmark(); alterColumn('{{sessions}}','id',\"string(32)\",false); } catch(Exception $e) { rollBackToTransactionBookmark();}\n alterColumn('{{surveys}}','active',\"string(1)\",false , 'N');\n alterColumn('{{surveys}}','anonymized',\"string(1)\",false,'N');\n alterColumn('{{surveys}}','format',\"string(1)\");\n alterColumn('{{surveys}}','savetimings',\"string(1)\",false , 'N');\n alterColumn('{{surveys}}','datestamp',\"string(1)\",false , 'N');\n alterColumn('{{surveys}}','usecookie',\"string(1)\",false , 'N');\n alterColumn('{{surveys}}','allowregister',\"string(1)\",false , 'N');\n alterColumn('{{surveys}}','allowsave',\"string(1)\",false , 'Y');\n alterColumn('{{surveys}}','autonumber_start','integer' ,false, '0');\n alterColumn('{{surveys}}','autoredirect',\"string(1)\",false , 'N');\n alterColumn('{{surveys}}','allowprev',\"string(1)\",false , 'N');\n alterColumn('{{surveys}}','printanswers',\"string(1)\",false , 'N');\n alterColumn('{{surveys}}','ipaddr',\"string(1)\",false , 'N');\n alterColumn('{{surveys}}','refurl',\"string(1)\",false , 'N');\n alterColumn('{{surveys}}','publicstatistics',\"string(1)\",false , 'N');\n alterColumn('{{surveys}}','publicgraphs',\"string(1)\",false , 'N');\n alterColumn('{{surveys}}','listpublic',\"string(1)\",false , 'N');\n alterColumn('{{surveys}}','htmlemail',\"string(1)\",false , 'N');\n alterColumn('{{surveys}}','sendconfirmation',\"string(1)\",false , 'Y');\n alterColumn('{{surveys}}','tokenanswerspersistence',\"string(1)\",false , 'N');\n alterColumn('{{surveys}}','assessments',\"string(1)\",false , 'N');\n alterColumn('{{surveys}}','usecaptcha',\"string(1)\",false , 'N');\n alterColumn('{{surveys}}','usetokens',\"string(1)\",false , 'N');\n alterColumn('{{surveys}}','tokenlength','integer',false, '15');\n alterColumn('{{surveys}}','showxquestions',\"string(1)\", true , 'Y');\n alterColumn('{{surveys}}','showgroupinfo',\"string(1) \", true , 'B');\n alterColumn('{{surveys}}','shownoanswer',\"string(1) \", true , 'Y');\n alterColumn('{{surveys}}','showqnumcode',\"string(1) \", true , 'X');\n alterColumn('{{surveys}}','bouncetime','integer');\n alterColumn('{{surveys}}','showwelcome',\"string(1)\", true , 'Y');\n alterColumn('{{surveys}}','showprogress',\"string(1)\", true , 'Y');\n alterColumn('{{surveys}}','allowjumps',\"string(1)\", true , 'N');\n alterColumn('{{surveys}}','navigationdelay','integer', false , '0');\n alterColumn('{{surveys}}','nokeyboard',\"string(1)\", true , 'N');\n alterColumn('{{surveys}}','alloweditaftercompletion',\"string(1)\", true , 'N');\n alterColumn('{{surveys}}','googleanalyticsstyle',\"string(1)\");\n\n alterColumn('{{surveys_languagesettings}}','surveyls_dateformat','integer',false , 1);\n try { setTransactionBookmark(); alterColumn('{{survey_permissions}}','sid',\"integer\",false); } catch(Exception $e) { rollBackToTransactionBookmark();}\n try { setTransactionBookmark(); alterColumn('{{survey_permissions}}','uid',\"integer\",false); } catch(Exception $e) { rollBackToTransactionBookmark();}\n alterColumn('{{survey_permissions}}','create_p', 'integer',false , '0');\n alterColumn('{{survey_permissions}}','read_p', 'integer',false , '0');\n alterColumn('{{survey_permissions}}','update_p','integer',false , '0');\n alterColumn('{{survey_permissions}}','delete_p' ,'integer',false , '0');\n alterColumn('{{survey_permissions}}','import_p','integer',false , '0');\n alterColumn('{{survey_permissions}}','export_p' ,'integer',false , '0');\n\n alterColumn('{{survey_url_parameters}}','targetqid' ,'integer');\n alterColumn('{{survey_url_parameters}}','targetsqid' ,'integer');\n\n alterColumn('{{templates_rights}}','use','integer',false );\n\n alterColumn('{{users}}','create_survey','integer',false, '0');\n alterColumn('{{users}}','create_user','integer',false, '0');\n alterColumn('{{users}}','participant_panel','integer',false, '0');\n alterColumn('{{users}}','delete_user','integer',false, '0');\n alterColumn('{{users}}','superadmin','integer',false, '0');\n alterColumn('{{users}}','configurator','integer',false, '0');\n alterColumn('{{users}}','manage_template','integer',false, '0');\n alterColumn('{{users}}','manage_label','integer',false, '0');\n alterColumn('{{users}}','dateformat','integer',false, 1);\n alterColumn('{{users}}','participant_panel','integer',false , '0');\n alterColumn('{{users}}','parent_id','integer',false);\n try { setTransactionBookmark(); alterColumn('{{surveys_languagesettings}}','surveyls_survey_id',\"integer\",false); } catch(Exception $e) { rollBackToTransactionBookmark(); }\n alterColumn('{{user_groups}}','owner_id',\"integer\",false);\n dropPrimaryKey('user_in_groups');\n alterColumn('{{user_in_groups}}','ugid',\"integer\",false);\n alterColumn('{{user_in_groups}}','uid',\"integer\",false);\n\n // Additional corrections for Postgres\n try{ setTransactionBookmark(); $oDB->createCommand()->createIndex('questions_idx3','{{questions}}','gid');} catch(Exception $e) { rollBackToTransactionBookmark(); };\n try{ setTransactionBookmark(); $oDB->createCommand()->createIndex('conditions_idx3','{{conditions}}','cqid');} catch(Exception $e) { rollBackToTransactionBookmark(); };\n try{ setTransactionBookmark(); $oDB->createCommand()->createIndex('questions_idx4','{{questions}}','type');} catch(Exception $e) { rollBackToTransactionBookmark(); };\n try{ setTransactionBookmark(); $oDB->createCommand()->dropIndex('user_in_groups_idx1','{{user_in_groups}}');} catch(Exception $e) { rollBackToTransactionBookmark(); };\n try{ setTransactionBookmark(); $oDB->createCommand()->dropIndex('{{user_name_key}}','{{users}}');} catch(Exception $e) { rollBackToTransactionBookmark(); };\n try{ setTransactionBookmark(); $oDB->createCommand()->createIndex('users_name','{{users}}','users_name',true);} catch(Exception $e) { rollBackToTransactionBookmark(); };\n try{ setTransactionBookmark(); addPrimaryKey('user_in_groups', array('ugid','uid'));} catch(Exception $e) { rollBackToTransactionBookmark(); };\n\n alterColumn('{{participant_attribute}}','value',\"string(50)\", false);\n try{ setTransactionBookmark(); alterColumn('{{participant_attribute_names}}','attribute_type',\"string(4)\", false);} catch(Exception $e) { rollBackToTransactionBookmark(); };\n try{ setTransactionBookmark(); dropColumn('{{participant_attribute_names_lang}}','id');} catch(Exception $e) { rollBackToTransactionBookmark(); };\n try{ setTransactionBookmark(); addPrimaryKey('participant_attribute_names_lang',array('attribute_id','lang'));} catch(Exception $e) { rollBackToTransactionBookmark(); };\n try{ setTransactionBookmark(); $oDB->createCommand()->renameColumn('{{participant_shares}}','shared_uid','share_uid');} catch(Exception $e) { rollBackToTransactionBookmark(); };\n alterColumn('{{participant_shares}}','date_added',\"datetime\", false);\n alterColumn('{{participants}}','firstname',\"string(40)\");\n alterColumn('{{participants}}','lastname',\"string(40)\");\n alterColumn('{{participants}}','email',\"string(80)\");\n alterColumn('{{participants}}','language',\"string(40)\");\n alterColumn('{{quota_languagesettings}}','quotals_name',\"string\");\n try{ setTransactionBookmark(); alterColumn('{{survey_permissions}}','sid','integer',false); } catch(Exception $e) { rollBackToTransactionBookmark(); };\n try{ setTransactionBookmark(); alterColumn('{{survey_permissions}}','uid','integer',false); } catch(Exception $e) { rollBackToTransactionBookmark(); };\n alterColumn('{{users}}','htmleditormode',\"string(7)\",true,'default');\n\n // Sometimes the survey_links table was deleted before this step, if so\n // we recreate it (copied from line 663)\n if (!tableExists('{survey_links}')) {\n $oDB->createCommand()->createTable('{{survey_links}}',array(\n 'participant_id' => 'string(50) NOT NULL',\n 'token_id' => 'integer NOT NULL',\n 'survey_id' => 'integer NOT NULL',\n 'date_created' => 'datetime NOT NULL'\n ));\n addPrimaryKey('survey_links', array('participant_id','token_id','survey_id'));\n }\n alterColumn('{{survey_links}}','date_created',\"datetime\",true);\n alterColumn('{{saved_control}}','identifier',\"text\",false);\n alterColumn('{{saved_control}}','email',\"string(320)\");\n alterColumn('{{surveys}}','adminemail',\"string(320)\");\n alterColumn('{{surveys}}','bounce_email',\"string(320)\");\n alterColumn('{{users}}','email',\"string(320)\");\n\n try{ setTransactionBookmark(); $oDB->createCommand()->dropIndex('assessments_idx','{{assessments}}');} catch(Exception $e) { rollBackToTransactionBookmark(); };\n try{ setTransactionBookmark(); $oDB->createCommand()->createIndex('assessments_idx3','{{assessments}}','gid');} catch(Exception $e) { rollBackToTransactionBookmark(); };\n\n try{ setTransactionBookmark(); $oDB->createCommand()->dropIndex('ixcode','{{labels}}');} catch(Exception $e) { rollBackToTransactionBookmark(); };\n try{ setTransactionBookmark(); $oDB->createCommand()->dropIndex('{{labels_ixcode_idx}}','{{labels}}');} catch(Exception $e) { rollBackToTransactionBookmark(); };\n try{ setTransactionBookmark(); $oDB->createCommand()->createIndex('labels_code_idx','{{labels}}','code');} catch(Exception $e) { rollBackToTransactionBookmark(); };\n\n\n\n if (Yii::app()->db->driverName=='pgsql')\n {\n try{ setTransactionBookmark(); $oDB->createCommand(\"ALTER TABLE ONLY {{user_groups}} ADD PRIMARY KEY (ugid); \")->execute;} catch(Exception $e) { rollBackToTransactionBookmark(); };\n try{ setTransactionBookmark(); $oDB->createCommand(\"ALTER TABLE ONLY {{users}} ADD PRIMARY KEY (uid); \")->execute;} catch(Exception $e) { rollBackToTransactionBookmark(); };\n }\n\n // Additional corrections for MSSQL\n alterColumn('{{answers}}','answer',\"text\",false);\n alterColumn('{{assessments}}','name',\"text\",false);\n alterColumn('{{assessments}}','message',\"text\",false);\n alterColumn('{{defaultvalues}}','defaultvalue',\"text\");\n alterColumn('{{expression_errors}}','eqn',\"text\");\n alterColumn('{{expression_errors}}','prettyprint',\"text\");\n alterColumn('{{groups}}','description',\"text\");\n alterColumn('{{groups}}','grelevance',\"text\");\n alterColumn('{{labels}}','title',\"text\");\n alterColumn('{{question_attributes}}','value',\"text\");\n alterColumn('{{questions}}','preg',\"text\");\n alterColumn('{{questions}}','help',\"text\");\n alterColumn('{{questions}}','relevance',\"text\");\n alterColumn('{{questions}}','question',\"text\",false);\n alterColumn('{{quota_languagesettings}}','quotals_quota_id',\"integer\",false);\n alterColumn('{{quota_languagesettings}}','quotals_message',\"text\",false);\n alterColumn('{{saved_control}}','refurl',\"text\");\n alterColumn('{{saved_control}}','access_code',\"text\",false);\n alterColumn('{{saved_control}}','ip',\"text\",false);\n alterColumn('{{saved_control}}','saved_thisstep',\"text\",false);\n alterColumn('{{saved_control}}','saved_date',\"datetime\",false);\n alterColumn('{{surveys}}','attributedescriptions',\"text\");\n alterColumn('{{surveys}}','emailresponseto',\"text\");\n alterColumn('{{surveys}}','emailnotificationto',\"text\");\n\n alterColumn('{{surveys_languagesettings}}','surveyls_description',\"text\");\n alterColumn('{{surveys_languagesettings}}','surveyls_welcometext',\"text\");\n alterColumn('{{surveys_languagesettings}}','surveyls_email_invite',\"text\");\n alterColumn('{{surveys_languagesettings}}','surveyls_email_remind',\"text\");\n alterColumn('{{surveys_languagesettings}}','surveyls_email_register',\"text\");\n alterColumn('{{surveys_languagesettings}}','surveyls_email_confirm',\"text\");\n alterColumn('{{surveys_languagesettings}}','surveyls_attributecaptions',\"text\");\n alterColumn('{{surveys_languagesettings}}','email_admin_notification',\"text\");\n alterColumn('{{surveys_languagesettings}}','email_admin_responses',\"text\");\n alterColumn('{{surveys_languagesettings}}','surveyls_endtext',\"text\");\n alterColumn('{{user_groups}}','description',\"text\",false);\n\n\n\n alterColumn('{{conditions}}','value','string',false,'');\n alterColumn('{{participant_shares}}','can_edit',\"string(5)\",false);\n\n alterColumn('{{users}}','password',\"binary\",false);\n dropColumn('{{users}}','one_time_pw');\n addColumn('{{users}}','one_time_pw','binary');\n\n\n $oDB->createCommand()->update('{{question_attributes}}',array('value'=>'1'),\"attribute = 'random_order' and value = '2'\");\n\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>157),\"stg_name='DBVersion'\");\n }\n\n if ($iOldDBVersion < 158)\n {\n LimeExpressionManager::UpgradeConditionsToRelevance();\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>158),\"stg_name='DBVersion'\");\n }\n\n if ($iOldDBVersion < 159)\n {\n alterColumn('{{failed_login_attempts}}', 'ip', \"string(40)\",false);\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>159),\"stg_name='DBVersion'\");\n }\n\n if ($iOldDBVersion < 160)\n {\n alterLanguageCode('it','it-informal');\n alterLanguageCode('it-formal','it');\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>160),\"stg_name='DBVersion'\");\n }\n if ($iOldDBVersion < 161)\n {\n addColumn('{{survey_links}}','date_invited','datetime NULL default NULL');\n addColumn('{{survey_links}}','date_completed','datetime NULL default NULL');\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>161),\"stg_name='DBVersion'\");\n }\n if ($iOldDBVersion < 162)\n {\n /* Fix participant db types */\n alterColumn('{{participant_attribute}}', 'value', \"text\", false);\n alterColumn('{{participant_attribute_names_lang}}', 'attribute_name', \"string(255)\", false);\n alterColumn('{{participant_attribute_values}}', 'value', \"text\", false);\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>162),\"stg_name='DBVersion'\");\n }\n if ($iOldDBVersion < 163)\n {\n //Replace by <script type=\"text/javascript\" src=\"{TEMPLATEURL}template.js\"></script> by {TEMPLATEJS}\n\n $replacedTemplate=replaceTemplateJS();\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>163),\"stg_name='DBVersion'\");\n\n }\n\n if ($iOldDBVersion < 164)\n {\n upgradeTokens148(); // this should have bee done in 148 - that's why it is named this way\n // fix survey tables for missing or incorrect token field\n upgradeSurveyTables164();\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>164),\"stg_name='DBVersion'\");\n\n // Not updating settings table as upgrade process takes care of that step now\n }\n\n if ($iOldDBVersion < 165)\n {\n $oDB->createCommand()->createTable('{{plugins}}', array(\n 'id' => 'pk',\n 'name' => 'string NOT NULL',\n 'active' => 'boolean'\n ));\n $oDB->createCommand()->createTable('{{plugin_settings}}', array(\n 'id' => 'pk',\n 'plugin_id' => 'integer NOT NULL',\n 'model' => 'string',\n 'model_id' => 'integer',\n 'key' => 'string',\n 'value' => 'text'\n ));\n alterColumn('{{surveys_languagesettings}}','surveyls_url',\"text\");\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>165),\"stg_name='DBVersion'\");\n }\n\n if ($iOldDBVersion < 166)\n {\n $oDB->createCommand()->renameTable('{{survey_permissions}}', '{{permissions}}');\n dropPrimaryKey('permissions');\n alterColumn('{{permissions}}', 'permission', \"string(100)\", false);\n $oDB->createCommand()->renameColumn('{{permissions}}','sid','entity_id');\n alterColumn('{{permissions}}', 'entity_id', \"string(100)\", false);\n addColumn('{{permissions}}','entity',\"string(50)\");\n $oDB->createCommand(\"update {{permissions}} set entity='survey'\")->query();\n addColumn('{{permissions}}','id','pk');\n $oDB->createCommand()->createIndex('idxPermissions','{{permissions}}','entity_id,entity,permission,uid',true);\n\n upgradePermissions166();\n dropColumn('{{users}}','create_survey');\n dropColumn('{{users}}','create_user');\n dropColumn('{{users}}','delete_user');\n dropColumn('{{users}}','superadmin');\n dropColumn('{{users}}','configurator');\n dropColumn('{{users}}','manage_template');\n dropColumn('{{users}}','manage_label');\n dropColumn('{{users}}','participant_panel');\n $oDB->createCommand()->dropTable('{{templates_rights}}');\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>166),\"stg_name='DBVersion'\");\n }\n\n if ($iOldDBVersion < 167)\n {\n addColumn('{{surveys_languagesettings}}', 'attachments', 'text');\n addColumn('{{users}}', 'created', 'datetime');\n addColumn('{{users}}', 'modified', 'datetime');\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>167),\"stg_name='DBVersion'\");\n }\n\n if ($iOldDBVersion < 168)\n {\n addColumn('{{participants}}', 'created', 'datetime');\n addColumn('{{participants}}', 'modified', 'datetime');\n addColumn('{{participants}}', 'created_by', 'integer');\n $oDB->createCommand('update {{participants}} set created_by=owner_uid')->query();\n alterColumn('{{participants}}', 'created_by', \"integer\", false);\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>168),\"stg_name='DBVersion'\");\n }\n\n if ($iOldDBVersion < 169)\n {\n // Add new column for question index options.\n addColumn('{{surveys}}', 'questionindex', 'integer not null default 0');\n // Set values for existing surveys.\n $oDB->createCommand(\"update {{surveys}} set questionindex = 0 where allowjumps <> 'Y'\")->query();\n $oDB->createCommand(\"update {{surveys}} set questionindex = 1 where allowjumps = 'Y'\")->query();\n\n // Remove old column.\n dropColumn('{{surveys}}', 'allowjumps');\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>169),\"stg_name='DBVersion'\");\n }\n\n if ($iOldDBVersion < 170)\n {\n // renamed advanced attributes fields dropdown_dates_year_min/max\n $oDB->createCommand()->update('{{question_attributes}}',array('attribute'=>'date_min'),\"attribute='dropdown_dates_year_min'\");\n $oDB->createCommand()->update('{{question_attributes}}',array('attribute'=>'date_max'),\"attribute='dropdown_dates_year_max'\");\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>170),\"stg_name='DBVersion'\");\n }\n\n if ($iOldDBVersion < 171)\n {\n try {\n dropColumn('{{sessions}}','data');\n }\n catch (Exception $e) {\n \n }\n switch (Yii::app()->db->driverName){\n case 'mysql':\n case 'mysqli':\n addColumn('{{sessions}}', 'data', 'longbinary');\n break;\n case 'sqlsrv':\n case 'dblib':\n case 'mssql':\n addColumn('{{sessions}}', 'data', 'VARBINARY(MAX)');\n break;\n case 'pgsql':\n addColumn('{{sessions}}', 'data', 'BYTEA');\n break;\n default: die('Unknown database type');\n }\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>171),\"stg_name='DBVersion'\");\n }\n if ($iOldDBVersion < 172)\n {\n switch (Yii::app()->db->driverName){\n case 'pgsql':\n // Special treatment for Postgres as it is too dumb to convert a string to a number without explicit being told to do so ... seriously?\n alterColumn('{{permissions}}', 'entity_id', \"INTEGER USING (entity_id::integer)\", false);\n break;\n case 'sqlsrv':\n case 'dblib':\n case 'mssql':\n try{ setTransactionBookmark(); $oDB->createCommand()->dropIndex('permissions_idx2','{{permissions}}');} catch(Exception $e) { rollBackToTransactionBookmark(); };\n try{ setTransactionBookmark(); $oDB->createCommand()->dropIndex('idxPermissions','{{permissions}}');} catch(Exception $e) { rollBackToTransactionBookmark(); };\n alterColumn('{{permissions}}', 'entity_id', \"INTEGER\", false);\n $oDB->createCommand()->createIndex('permissions_idx2','{{permissions}}','entity_id,entity,permission,uid',true);\n break;\n default:\n alterColumn('{{permissions}}', 'entity_id', \"INTEGER\", false);\n }\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>172),\"stg_name='DBVersion'\");\n }\n if ($iOldDBVersion < 173)\n {\n addColumn('{{participant_attribute_names}}','defaultname',\"string(50) NOT NULL default ''\");\n upgradeCPDBAttributeDefaultNames173();\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>173),\"stg_name='DBVersion'\");\n }\n if ($iOldDBVersion < 174)\n {\n alterColumn('{{participants}}', 'email', \"string(254)\");\n alterColumn('{{saved_control}}', 'email', \"string(254)\");\n alterColumn('{{surveys}}', 'adminemail', \"string(254)\");\n alterColumn('{{surveys}}', 'bounce_email', \"string(254)\");\n switch (Yii::app()->db->driverName){\n case 'sqlsrv':\n case 'dblib':\n case 'mssql': dropUniqueKeyMSSQL('email','{{users}}');\n }\n alterColumn('{{users}}', 'email', \"string(254)\");\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>174),\"stg_name='DBVersion'\");\n }\n if ($iOldDBVersion < 175)\n {\n switch (Yii::app()->db->driverName){\n case 'pgsql':\n // Special treatment for Postgres as it is too dumb to convert a boolean to a number without explicit being told to do so\n alterColumn('{{plugins}}', 'active', \"INTEGER USING (active::integer)\", false);\n break;\n default:\n alterColumn('{{plugins}}', 'active', \"integer\",false,'0');\n }\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>175),\"stg_name='DBVersion'\");\n }\n if ($iOldDBVersion < 176)\n {\n upgradeTokens176();\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>176),\"stg_name='DBVersion'\");\n }\n if ($iOldDBVersion < 177)\n {\n if ( Yii::app()->getConfig('auth_webserver') === true ) {\n // using auth webserver, now activate the plugin with default settings.\n if (!class_exists('Authwebserver', false)) {\n $plugin = Plugin::model()->findByAttributes(array('name'=>'Authwebserver'));\n if (!$plugin) {\n $plugin = new Plugin();\n $plugin->name = 'Authwebserver';\n $plugin->active = 1;\n $plugin->save();\n $plugin = App()->getPluginManager()->loadPlugin('Authwebserver', $plugin->id);\n $aPluginSettings = $plugin->getPluginSettings(true);\n $aDefaultSettings = array();\n foreach ($aPluginSettings as $key => $settings) {\n if (is_array($settings) && array_key_exists('current', $settings) ) {\n $aDefaultSettings[$key] = $settings['current'];\n }\n }\n $plugin->saveSettings($aDefaultSettings);\n } else {\n $plugin->active = 1;\n $plugin->save();\n }\n }\n }\n upgradeSurveys177();\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>177),\"stg_name='DBVersion'\");\n }\n if ($iOldDBVersion < 178)\n {\n if (Yii::app()->db->driverName=='mysql' || Yii::app()->db->driverName=='mysqli')\n {\n modifyPrimaryKey('questions', array('qid','language'));\n }\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>178),\"stg_name='DBVersion'\");\n }\n if ($iOldDBVersion < 179)\n {\n upgradeSurveys177(); // Needs to be run again to make sure\n upgradeTokenTables179();\n alterColumn('{{participants}}', 'email', \"string(254)\", false);\n alterColumn('{{participants}}', 'firstname', \"string(150)\", false);\n alterColumn('{{participants}}', 'lastname', \"string(150)\", false);\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>179),\"stg_name='DBVersion'\");\n }\n if ($iOldDBVersion < 180)\n {\n $aUsers = User::model()->findAll();\n $aPerm = array(\n 'entity_id' => 0,\n 'entity' => 'global',\n 'uid' => 0,\n 'permission' => 'auth_db',\n 'create_p' => 0,\n 'read_p' => 1,\n 'update_p' => 0,\n 'delete_p' => 0,\n 'import_p' => 0,\n 'export_p' => 0\n );\n\n foreach ($aUsers as $oUser)\n {\n if (!Permission::model()->hasGlobalPermission('auth_db','read',$oUser->uid))\n {\n $oPermission = new Permission;\n foreach ($aPerm as $k => $v)\n {\n $oPermission->$k = $v;\n }\n $oPermission->uid = $oUser->uid;\n $oPermission->save();\n }\n }\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>180),\"stg_name='DBVersion'\");\n \n }\n if ($iOldDBVersion < 181)\n {\n upgradeTokenTables181();\n upgradeSurveyTables181();\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>181),\"stg_name='DBVersion'\");\n } \n if ($iOldDBVersion < 182)\n {\n fixKCFinder182();\n $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>182),\"stg_name='DBVersion'\");\n } \n $oTransaction->commit();\n // Activate schema caching\n $oDB->schemaCachingDuration=3600;\n // Load all tables of the application in the schema\n $oDB->schema->getTables();\n // clear the cache of all loaded tables\n $oDB->schema->refresh();\n }\n catch(Exception $e)\n {\n $oTransaction->rollback();\n // Activate schema caching\n $oDB->schemaCachingDuration=3600;\n // Load all tables of the application in the schema\n $oDB->schema->getTables();\n // clear the cache of all loaded tables\n $oDB->schema->refresh();\n echo '<br /><br />'.gT('An non-recoverable error happened during the update. Error details:').\"<p>\".htmlspecialchars($e->getMessage()).'</p><br />';\n return false;\n }\n fixLanguageConsistencyAllSurveys();\n echo '<br /><br />'.sprintf(gT('Database update finished (%s)'),date('Y-m-d H:i:s')).'<br /><br />';\n return true;\n}", "function xmldb_studynotes_upgrade($oldversion = 0) {\n\n\tglobal $CFG, $THEME, $db;\n\n\t$result = true;\n\n\tif ($result && $oldversion < 2009032400) {\n\n\t\terror(\"Version too old to be upgraded. Please delete the module and re-install it.\");\n\t}\n\n\n\tif ($result && $oldversion < 2009041603) {\n\n\t\t/// Define table studynotes_uploads to be created\n\t\t$table = new XMLDBTable('studynotes_uploads');\n\n\t\t/// Adding fields to table studynotes_uploads\n\t\t$table->addFieldInfo('id', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, XMLDB_SEQUENCE, null, null, null);\n\t\t$table->addFieldInfo('type', XMLDB_TYPE_INTEGER, '4', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0');\n\t\t$table->addFieldInfo('user_id', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, null);\n\t\t$table->addFieldInfo('topic_id', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, null);\n\t\t$table->addFieldInfo('filename', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null, null, null);\n\t\t$table->addFieldInfo('created', XMLDB_TYPE_DATETIME, null, null, XMLDB_NOTNULL, null, null, null, '0');\n\t\t$table->addFieldInfo('modified', XMLDB_TYPE_DATETIME, null, null, XMLDB_NOTNULL, null, null, null, '0');\n\n\t\t/// Adding keys to table studynotes_uploads\n\t\t$table->addKeyInfo('primary', XMLDB_KEY_PRIMARY, array ('id'));\n\n\t\t/// Launch create table for studynotes_uploads\n\t\t$result = $result && create_table($table);\n\t}\n\n\t/// Rename field\n\tif ($result && $oldversion < 2009042400) {\n\n\t\t$table = new XMLDBTable('studynotes_cards');\n\t\t$field = new XMLDBField('user');\n\t\t$field->setAttributes(XMLDB_TYPE_INTEGER, '11', XMLDB_UNSIGNED, null, null, null, null, '0', null);\n\n\t\t/// Launch rename field\n\t\t$result = $result && rename_field($table, $field, 'user_id');\n\t}\n\n\t/// Rename field\n\tif ($result && $oldversion < 2009042400) {\n\n\t\t$table = new XMLDBTable('studynotes_cards');\n\t\t$field = new XMLDBField('index');\n\t\t$field->setAttributes(XMLDB_TYPE_INTEGER, '11', XMLDB_UNSIGNED, null, null, null, null, '0', null);\n\n\t\tif($CFG->dbfamily==\"mysql\"||$CFG->dbfamily==\"mysqli\") {\n\t\t\tif(field_exists($table, $field)) {\n\t\t\t\t$query=\"ALTER TABLE {$CFG->prefix}studynotes_cards CHANGE `index` index_num BIGINT( 11 ) UNSIGNED NOT NULL\";\n\t\t\t\t$db->Execute($query);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t/// Launch rename field\n\t\t\t$result = $result && rename_field($table, $field, 'index_num');\n\t\t}\n\t}\n\n\t/// Rename field\n\tif ($result && $oldversion < 2009042400) {\n\n\t\t$table = new XMLDBTable('studynotes_cards');\n\t\t$field = new XMLDBField('level');\n\t\t$field->setAttributes(XMLDB_TYPE_INTEGER, '11', XMLDB_UNSIGNED, null, null, null, null, '0', null);\n\n\t\t/// Launch rename field\n\t\t$result = $result && rename_field($table, $field, 'level_num');\n\t}\n\n\t/// Rename field\n\tif ($result && $oldversion < 2009042400) {\n\n\t\t$table = new XMLDBTable('studynotes_flashcards');\n\t\t$field = new XMLDBField('user');\n\t\t$field->setAttributes(XMLDB_TYPE_INTEGER, '11', XMLDB_UNSIGNED, null, null, null, null, '0', null);\n\n\t\t/// Launch rename field\n\t\t$result = $result && rename_field($table, $field, 'user_id');\n\t}\n\n\t/// Rename field\n\tif ($result && $oldversion < 2009042400) {\n\n\t\t$table = new XMLDBTable('studynotes_flashcards');\n\t\t$field = new XMLDBField('number');\n\t\t$field->setAttributes(XMLDB_TYPE_INTEGER, '11', XMLDB_UNSIGNED, null, null, null, null, '0', null);\n\n\t\t/// Launch rename field\n\t\t$result = $result && rename_field($table, $field, 'num');\n\t}\n\n\t/// Rename field\n\tif ($result && $oldversion < 2009042400) {\n\n\t\t$table = new XMLDBTable('studynotes_flashcards');\n\t\t$field = new XMLDBField('level');\n\t\t$field->setAttributes(XMLDB_TYPE_INTEGER, '11', XMLDB_UNSIGNED, null, null, null, null, '0', null);\n\n\t\t/// Launch rename field\n\t\t$result = $result && rename_field($table, $field, 'level_num');\n\t}\n\n\t/// Rename field\n\tif ($result && $oldversion < 2009042400) {\n\n\t\t$table = new XMLDBTable('studynotes_groups');\n\t\t$field = new XMLDBField('access');\n\t\t$field->setAttributes(XMLDB_TYPE_INTEGER, '11', XMLDB_UNSIGNED, null, null, null, null, '0', null);\n\n\t\t/// Launch rename field\n\t\t$result = $result && rename_field($table, $field, 'access_num');\n\t}\n\n\t/// Rename field\n\tif ($result && $oldversion < 2009042400) {\n\n\t\t$table = new XMLDBTable('studynotes_markers');\n\t\t$field = new XMLDBField('user');\n\t\t$field->setAttributes(XMLDB_TYPE_INTEGER, '11', XMLDB_UNSIGNED, null, null, null, null, '0', null);\n\n\t\t/// Launch rename field\n\t\t$result = $result && rename_field($table, $field, 'user_id');\n\t}\n\n\t/// Rename field\n\tif ($result && $oldversion < 2009042400) {\n\n\t\t$table = new XMLDBTable('studynotes_markers');\n\t\t$field = new XMLDBField('range');\n\t\t$field->setAttributes(XMLDB_TYPE_TEXT, 'small', null, null, null, null, null, null, null);\n\t\tif($CFG->dbfamily==\"mysql\"||$CFG->dbfamily==\"mysqli\") {\n\t\t\tif(field_exists($table, $field)) {\n\t\t\t\t$query=\"ALTER TABLE {$CFG->prefix}studynotes_markers CHANGE `range` range_store TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL\";\n\t\t\t\t$db->Execute($query);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t/// Launch rename field\n\t\t\t$result = $result && rename_field($table, $field, 'range_store');\n\t\t}\n\t}\n\n\t/// Rename field\n\tif ($result && $oldversion < 2009042400) {\n\n\t\t$table = new XMLDBTable('studynotes_memberships');\n\t\t$field = new XMLDBField('user');\n\t\t$field->setAttributes(XMLDB_TYPE_INTEGER, '11', XMLDB_UNSIGNED, null, null, null, null, '0', null);\n\n\t\t/// Launch rename field\n\t\t$result = $result && rename_field($table, $field, 'user_id');\n\t}\n\n\t/// Rename field\n\tif ($result && $oldversion < 2009042400) {\n\n\t\t$table = new XMLDBTable('studynotes_memberships');\n\t\t$field = new XMLDBField('group');\n\t\t$field->setAttributes(XMLDB_TYPE_INTEGER, '11', XMLDB_UNSIGNED, null, null, null, null, '0', null);\n\t\tif($CFG->dbfamily==\"mysql\"||$CFG->dbfamily==\"mysqli\") {\n\t\t\tif(field_exists($table, $field)) {\n\t\t\t\t$query=\"ALTER TABLE {$CFG->prefix}studynotes_memberships CHANGE `group` group_id BIGINT( 11 ) UNSIGNED NOT NULL\";\n\t\t\t\t$db->Execute($query);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t/// Launch rename field\n\t\t\t$result = $result && rename_field($table, $field, 'group_id');\n\t\t}\n\t}\n\n\t/// Rename field\n\tif ($result && $oldversion < 2009042400) {\n\n\t\t$table = new XMLDBTable('studynotes_memberships');\n\t\t$field = new XMLDBField('level');\n\t\t$field->setAttributes(XMLDB_TYPE_INTEGER, '11', XMLDB_UNSIGNED, null, null, null, null, '0', null);\n\n\t\t/// Launch rename field\n\t\t$result = $result && rename_field($table, $field, 'level_num');\n\t}\n\n\t/// Rename field\n\tif ($result && $oldversion < 2009042400) {\n\n\t\t$table = new XMLDBTable('studynotes_rights');\n\t\t$field = new XMLDBField('group');\n\t\t$field->setAttributes(XMLDB_TYPE_INTEGER, '11', XMLDB_UNSIGNED, null, null, null, null, '0', null);\n\t\tif($CFG->dbfamily==\"mysql\"||$CFG->dbfamily==\"mysqli\") {\n\t\t\tif(field_exists($table, $field)) {\n\t\t\t\t$query=\"ALTER TABLE {$CFG->prefix}studynotes_rights CHANGE `group` group_id BIGINT( 11 ) UNSIGNED NOT NULL\";\n\t\t\t\t$db->Execute($query);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t/// Launch rename field\n\t\t\t$result = $result && rename_field($table, $field, 'group_id');\n\t\t}\n\t}\n\n\t/// Rename field\n\tif ($result && $oldversion < 2009042400) {\n\n\t\t$table = new XMLDBTable('studynotes_topics');\n\t\t$field = new XMLDBField('user');\n\t\t$field->setAttributes(XMLDB_TYPE_INTEGER, '11', XMLDB_UNSIGNED, null, null, null, null, '0', null);\n\n\t\t/// Launch rename field\n\t\t$result = $result && rename_field($table, $field, 'user_id');\n\t}\n\n\t// Rename tables longer than 24 chars\n\tif ($result && $oldversion < 2009043001) {\n\n\t\t/// Define table studynotes_feed_msg_stat to be renamed\n\t\t$table = new XMLDBTable('studynotes_feed_messages_status');\n\n\t\t/// Launch rename table for studynotes_feed_msg_stat\n\t\t$result = $result && rename_table($table, 'studynotes_feed_msg_stat');\n\t}\n\n\t// Rename tables longer than 24 chars\n\tif ($result && $oldversion < 2009043001) {\n\n\t\t/// Define table studynotes_feed_subscrib to be renamed\n\t\t$table = new XMLDBTable('studynotes_feed_subscriptions');\n\n\t\t/// Launch rename table for studynotes_feed_subscrib\n\t\t$result = $result && rename_table($table, 'studynotes_feed_subscrib');\n\t}\n\n\t// Rename tables longer than 24 chars\n\tif ($result && $oldversion < 2009043001) {\n\n\t\t/// Define table studynotes_rel_questions to be renamed\n\t\t$table = new XMLDBTable('studynotes_relation_questions');\n\n\t\t/// Launch rename table for studynotes_rel_questions\n\t\t$result = $result && rename_table($table, 'studynotes_rel_questions');\n\t}\n\n\t// Rename tables longer than 24 chars\n\tif ($result && $oldversion < 2009043001) {\n\n\t\t/// Define table studynotes_rel_questions to be renamed\n\t\t$table = new XMLDBTable('studynotes_relation_translations');\n\n\t\t/// Launch rename table for studynotes_rel_questions\n\t\t$result = $result && rename_table($table, 'studynotes_rel_translations');\n\t}\n\n\tif ($result && $oldversion < 2009050301) {\n\n\t\t$fields = array(\n\t\tarray('studynotes_cards','created'),\n\t\tarray('studynotes_cards','modified'),\n\t\tarray('studynotes_cards','locked_time'),\n\t\tarray('studynotes_feed_messages','created'),\n\t\tarray('studynotes_feed_messages','modified'),\n\t\tarray('studynotes_feed_msg_stat','created'),\n\t\tarray('studynotes_feed_msg_stat','modified'),\n\t\tarray('studynotes_feeds','created'),\n\t\tarray('studynotes_feeds','modified'),\n\t\tarray('studynotes_groups','created'),\n\t\tarray('studynotes_groups','modified'),\n\t\tarray('studynotes_markers','created'),\n\t\tarray('studynotes_markers','modified'),\n\t\tarray('studynotes_memberships','created'),\n\t\tarray('studynotes_memberships','modified'),\n\t\tarray('studynotes_relations','created'),\n\t\tarray('studynotes_relations','modified'),\n\t\tarray('studynotes_relation_answers','created'),\n\t\tarray('studynotes_relation_answers','modified'),\n\t\tarray('studynotes_relation_links','created'),\n\t\tarray('studynotes_relation_links','modified'),\n\t\tarray('studynotes_rel_questions','created'),\n\t\tarray('studynotes_rel_questions','modified'),\n\t\tarray('studynotes_topics','created'),\n\t\tarray('studynotes_topics','modified'),\n\t\tarray('studynotes_uploads','created'),\n\t\tarray('studynotes_uploads','modified'),\n\t\tarray('studynotes_users','created'),\n\t\tarray('studynotes_users','last_login')\n\t\t);\n\n\t\tforeach($fields as $info) {\n\t\t\t$table = new XMLDBTable($info[0]);\n\t\t\t$tmpField = new XMLDBField($info[1].\"_cpy\");\n\t\t\t$tmpField->setAttributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', $info[1]);\n\t\t\t\t\n\t\t\t//add new integer field\n\t\t\t$result = $result && add_field($table, $tmpField);\n\t\t\t\t\n\t\t\t//get value\n\t\t\tif($records = get_records($info[0], '', '', '', 'id,'.$info[1])) {\n\n\t\t\t\t//convert value\n\t\t\t\tforeach($records as $record) {\n\t\t\t\t\t$record->{$info[1].\"_cpy\"} = strtotime($record->{$info[1]});\n\t\t\t\t\tunset($record->{$info[1]});\n\t\t\t\t\tprint_r($record);\n\t\t\t\t\t$result = $result && update_record($info[0],$record);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n\t\t\t//drop old field\n\t\t\t$field = new XMLDBField($info[1]);\n\t\t\t$result = $result && drop_field($table, $field);\n\n\t\t\t//rename copy\n\t\t\t$tmpField->setAttributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', null);\n\t\t\t$result = $result && change_field_default($table, $tmpField);\n\t\t\t$result = $result && rename_field($table, $tmpField, $info[1]);\n\t\t}\n\t}\n\n\tif ($result && $oldversion < 2009050301) {\n\n\t\t/// Define table studynotes_rel_translations to be dropped\n\t\t$table = new XMLDBTable('studynotes_rel_translations');\n\n\t\t/// Launch drop table for studynotes_rel_translations\n\t\t$result = $result && drop_table($table);\n\t}\n\n\tif ($result && $oldversion < 2009070300) {\n\n\t\t/// Define index link (not unique) to be dropped form studynotes_relation_links\n\t\t$table = new XMLDBTable('studynotes_relation_links');\n\t\t$index = new XMLDBIndex('link');\n\t\t$index->setAttributes(XMLDB_INDEX_NOTUNIQUE, array('link'));\n\n\t\t/// Launch drop index link\n\t\t$result = $result && drop_index($table, $index);\n\t}\n\t\n\tif ($result && $oldversion < 2009070300) {\n\n\t\t/// Changing type of field link on table studynotes_relation_links to text\n\t\t$table = new XMLDBTable('studynotes_relation_links');\n\t\t$field = new XMLDBField('link');\n\t\t$field->setAttributes(XMLDB_TYPE_TEXT, 'medium', null, XMLDB_NOTNULL, null, null, null, null, 'id');\n\n\t\t/// Launch change of type for field link\n\t\t$result = $result && change_field_type($table, $field);\n\t}\n\tif ($result && $oldversion < 2009070300) {\n\n\t\t/// Changing type of field answer on table studynotes_relation_answers to text\n\t\t$table = new XMLDBTable('studynotes_relation_answers');\n\t\t$field = new XMLDBField('answer');\n\t\t$field->setAttributes(XMLDB_TYPE_TEXT, 'medium', null, null, null, null, null, null, 'id');\n\n\t\t/// Launch change of type for field answer\n\t\t$result = $result && change_field_type($table, $field);\n\t}\n\tif ($result && $oldversion < 2009070300) {\n\n\t\t/// Changing type of field question on table studynotes_rel_questions to text\n\t\t$table = new XMLDBTable('studynotes_rel_questions');\n\t\t$field = new XMLDBField('question');\n\t\t$field->setAttributes(XMLDB_TYPE_TEXT, 'medium', null, XMLDB_NOTNULL, null, null, null, null, 'id');\n\n\t\t/// Launch change of type for field question\n\t\t$result = $result && change_field_type($table, $field);\n\t}\n\n\treturn $result;\n}", "public function up()\n {\n $oldStores = $this->getOldStores(); // update to newest data_version\n $newStores = $this->getNewStores(); // run all upgrade files\n if (!count($oldStores) && !count($newStores)) {\n return;\n }\n\n foreach ($this->getDepends() as $moduleCode) {\n if (0 !== strpos($moduleCode, 'TM_')) {\n continue;\n }\n $this->_getModuleObject($moduleCode)->up();\n }\n $saved = false;\n\n // upgrade currently installed version to the latest data_version\n if (count($oldStores)) {\n foreach ($this->getUpgradesToRun() as $version) {\n // customer able to skip upgrading data of installed modules\n if (!$this->getSkipUpgrade()) {\n $this->getUpgradeObject($version)\n ->setStoreIds($oldStores)\n ->upgrade();\n }\n $this->setDataVersion($version)->save();\n $saved = true;\n }\n }\n\n // install module to the new stores\n if (count($newStores)) {\n foreach ($this->getUpgradesToRun(0) as $version) {\n $this->getUpgradeObject($version)\n ->setStoreIds($newStores)\n ->upgrade();\n $this->setDataVersion($version)->save();\n $saved = true;\n }\n }\n\n if (!$saved) {\n $this->save(); // identity key could be updated without running the upgrades\n }\n }", "function upgradeKernel(){\n\t\tif( is_file( INSTALL_PKG_PATH.'BitInstaller.php' ) && is_readable( INSTALL_PKG_PATH.'BitInstaller.php' ) ){\n\t\t\tdefine( 'AUTO_UPDATE_KERNEL', TRUE );\n\t\t\tinclude_once( INSTALL_PKG_PATH.'BitInstaller.php' );\n\t\t\tglobal $gBitInstaller;\n\t\t\t$gBitInstaller = new BitInstaller();\n\n\t\t\t$dir = KERNEL_PKG_PATH.'admin/upgrades/';\n\t\t\t$upDir = opendir( $dir );\n\t\t\twhile( FALSE !== ( $file = readdir( $upDir ))) {\n\t\t\t\tif( is_file( $dir.$file )) {\n\t\t\t\t\t$upVersion = str_replace( \".php\", \"\", $file );\n\t\t\t\t\t// we only want to load files of versions that are greater than is installed\n\t\t\t\t\t// special switch for pre 2.1.0 system\n\t\t\t\t\tif( $this->getConfig( 'package_kernel_version' ) ){\n\t\t\t\t\t\t$currVersion = $gBitInstaller->getVersion( 'kernel' );\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$currVersion = $this->getPackageConfigValue( 'kernel', 'version' ); \n\t\t\t\t\t}\n\t\t\t\t\tif( $gBitInstaller->validateVersion( $upVersion ) && version_compare( $currVersion, $upVersion, '<' )) {\n\t\t\t\t\t\tinclude_once( $dir.$file );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif( $errors = $gBitInstaller->upgradePackageVersions('kernel') ){\n\t\t\t\t// upgrade successful - continue\n\t\t\t\terror_log( 'Auto Kernel Upgrade: '.implode( $errors ) );\n\t\t\t}else{\n\t\t\t\t// yay!\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// if something went wrong fatal\n\t\t// fatal if installer is not available\n\t\t$_REQUEST['error'] = tra('The website is closed while critical updates are installed' );\n\t\tinclude( KERNEL_PKG_PATH . 'error_simple.php' );\n\t\texit;\n\t}", "function sitemgr_upgrade1_0_1_001()\n{\n\t$modules2nav_type = array('currentsection' => 1,'index' => 2,'index_block' => 3,'navigation' => 4,'sitetree' => 5,'toc' => 6,'toc_block' => 7);\n\n\t$db = clone($GLOBALS['egw_setup']->db);\n\t$db->set_app('sitemgr');\n\t$db2 = clone($db);\n\n\t// get the module_id of all navigation modules and remove the old modules\n\t$db->select('egw_sitemgr_modules','module_id,module_name',array('module_name' => array_keys($modules2nav_type)),__LINE__,__FILE__);\n\t$id2module = $old_modules = array();\n\twhile(($row = $db->row(true)))\n\t{\n\t\t$id2module[$row['module_id']] = $row['module_name'];\n\t\tif ($row['module_name'] != 'navigation')\n\t\t{\n\t\t\t$old_modules[] = $row['module_id'];\n\t\t}\n\t}\n\t$db->delete('egw_sitemgr_modules',array('module_id' => $old_modules),__LINE__,__FILE__);\n\n\t// check if navigation is already registered, if not register it\n\n\tif (!($navigation_id = array_search('navigation',$id2module)))\n\t{\n\t\tif (ereg('\\$this->description = lang\\(\\'([^'.\"\\n\".']*)\\'\\);',implode(\"\\n\",file(EGW_SERVER_ROOT.'/sitemgr/modules/class.module_navigation.inc.php')),$parts))\n\t\t{\n\t\t\t$description = str_replace(\"\\\\'\",\"'\",$parts[1]);\n\t\t}\n\t\t$db->insert('egw_sitemgr_modules',array(\n\t\t\t'module_name' => 'navigation',\n\t\t\t'module_description' => $description,\n\t\t),false,__LINE__,__FILE__);\n\t\t$navigation_id = $db->get_last_insert_id('egw_sitemgr_modules','module_id');\n\t}\n\t// add navigation to all contentareas, which allowed any for the old modules before and remove the old modules\n\t$db->select('egw_sitemgr_active_modules','DISTINCT cat_id,area',array('module_id' => $old_modules),__LINE__,__FILE__);\n\twhile (($row = $db->row(true)))\n\t{\n\t\t$row['module_id'] = $navigation_id;\n\t\t$db2->insert('egw_sitemgr_active_modules',array(),$row,__LINE__,__FILE__);\n\t}\n\t$db->delete('egw_sitemgr_active_modules',array('module_id' => $old_modules),__LINE__,__FILE__);\n\n\t// replace old modules in the blocks with the navigation module\n\t$db->select('egw_sitemgr_blocks','block_id,module_id',array('module_id' => array_keys($id2module)),__LINE__,__FILE__);\n\t$block_id2module_id = array();\n\twhile (($row = $db->row(true)))\n\t{\n\t\t$block_id2module_id[$row['block_id']] = $row['module_id'];\n\t}\n\t$db->select('egw_sitemgr_content','version_id,block_id,arguments',array('block_id' => array_keys($block_id2module_id)),__LINE__,__FILE__);\n\twhile (($row = $db->row(true)))\n\t{\n\t\t$arguments = unserialize($row['arguments']);\n\t\tif (!isset($arguments['nav_type']))\n\t\t{\n\t\t\t$version_id = $row['version_id'];\n\t\t\tunset($row['version_id']);\n\t\t\t$arguments['nav_type'] = $modules2nav_type[$id2module[$block_id2module_id[$row['block_id']]]];\n\t\t\t$row['arguments'] = serialize($arguments);\n\t\t\t$db2->update('egw_sitemgr_content',$row,array('version_id' => $version_id),__LINE__,__FILE__);\n\t\t}\n\t}\n\t$db->update('egw_sitemgr_blocks',array('module_id' => $navigation_id),array('module_id' => $old_modules),__LINE__,__FILE__);\n\n\t$GLOBALS['setup_info']['sitemgr']['currentver'] = '1.2';\n\treturn $GLOBALS['setup_info']['sitemgr']['currentver'];\n}", "function upgrade_460()\n {\n }", "function sitemgr_upgrade1_4_002()\n{\n\treturn $GLOBALS['setup_info']['sitemgr']['currentver'] = '1.5.001';\n}", "function plugin_upgrade_nexmenu() {\n global $_TABLES,$CONF_NEXMENU;\n\n include ('upgrade.inc'); // Include the upgrade functions\n\n $curversion = DB_getItem($_TABLES['plugins'],'pi_version',\"pi_name = 'nexmenu'\");\n\n switch ($curversion) {\n case '2.5':\n case '2.5.0':\n case '2.5.1':\n if (upgrade_252() == 0 ) {\n DB_query(\"UPDATE {$_TABLES['plugins']} SET `pi_version` = '2.5.2', `pi_gl_version` = '1.4.1' WHERE `pi_name` = 'nexmenu' LIMIT 1\");\n }\n break;\n default:\n if (upgrade_25() == 0 ) {\n DB_query(\"UPDATE {$_TABLES['plugins']} SET `pi_version` = '2.5', `pi_gl_version` = '1.4.1' WHERE `pi_name` = 'nexmenu' LIMIT 1\");\n }\n break;\n }\n\n /* Check if update completed and return a message number to be shown */\n if (DB_getItem($_TABLES['plugins'],'pi_version',\"pi_name = 'nexmenu'\") == $CONF_NEXMENU['version']) {\n return 11;\n } else {\n return 12;\n }\n}", "public function updateInternals(): int\n {\n $this->logManager->logMessage(lang('Revision.updateInternals'));\n\n try {\n return $this->upgrader->upgrade($this->config->rootPath);\n } catch (RevisionException $e) {\n $this->logManager->logMessage($e->getMessage(), 'error');\n\n return EXIT_ERROR;\n }\n }", "function upgrade_440()\n {\n }", "public function upgrade() {\n if (file_exists($this->fullpath)) {\n // Save the new file and report it\n return $this->handleSave();\n }\n\n return false;\n }", "public function upgrade($version)\n {\n if (version_compare($version, '1.1.0', '<')) {\n $updator = new Updator110($this->handler);\n $result = $updator->upgrade($version);\n if (false === $result) {\n return $result;\n }\n }\n if (version_compare($version, '1.2.2', '<')) {\n $updator = new Updator122($this->handler);\n $result = $updator->upgrade($version);\n if (false === $result) {\n return $result;\n }\n }\n if (version_compare($version, '1.3.0', '<')) {\n $updator = new Updator130($this->handler);\n $result = $updator->upgrade($version);\n if (false === $result) {\n return $result;\n }\n }\n if (version_compare($version, '1.3.1', '<')) {\n $updator = new Updator131($this->handler);\n $result = $updator->upgrade($version);\n if (false === $result) {\n return $result;\n }\n }\n \n if (version_compare($version, '1.3.2', '<')) {\n $updator = new Updator132($this->handler);\n $result = $updator->upgrade($version);\n if (false === $result) {\n return $result;\n }\n }\n $result = $this->from133($version);\n\n return $result;\n }", "function categories_upgrade($oldversion)\n{\n // Get database information\n $dbconn = xarDBGetConn();\n $xartable = xarDBGetTables();\n\n // Upgrade dependent on old version number\n switch($oldversion) {\n case '1.0':\n // Code to upgrade from version 1.0 goes here\n // fall through to the next upgrade\n\n case '2.0':\n // Code to upgrade from version 2.0 goes here\n\n // TODO: remove this for release\n $query = \"ALTER TABLE $xartable[categories]\n ADD COLUMN xar_image varchar(255) NOT NULL\";\n $result= $dbconn->Execute($query);\n if (!$result) return;\n // fall through to the next upgrade\n\n case '2.1':\n // Code to upgrade from version 2.1 goes here\n\n // TODO: remove this for release\n\n // when a new module item is being specified\n if (!xarModRegisterHook('item', 'new', 'GUI',\n 'categories', 'admin', 'newhook')) {\n return false;\n }\n // when a module item is created (uses 'cids')\n if (!xarModRegisterHook('item', 'create', 'API',\n 'categories', 'admin', 'createhook')) {\n return false;\n }\n // when a module item is being modified (uses 'cids')\n if (!xarModRegisterHook('item', 'modify', 'GUI',\n 'categories', 'admin', 'modifyhook')) {\n return false;\n }\n // when a module item is updated (uses 'cids')\n if (!xarModRegisterHook('item', 'update', 'API',\n 'categories', 'admin', 'updatehook')) {\n return false;\n }\n // when a module item is deleted\n if (!xarModRegisterHook('item', 'delete', 'API',\n 'categories', 'admin', 'deletehook')) {\n return false;\n }\n // when a module configuration is being modified (uses 'cids')\n if (!xarModRegisterHook('module', 'modifyconfig', 'GUI',\n 'categories', 'admin', 'modifyconfighook')) {\n return false;\n }\n // when a module configuration is updated (uses 'cids')\n if (!xarModRegisterHook('module', 'updateconfig', 'API',\n 'categories', 'admin', 'updateconfighook')) {\n return false;\n }\n // when a whole module is removed, e.g. via the modules admin screen\n // (set object ID to the module name !)\n if (!xarModRegisterHook('module', 'remove', 'API',\n 'categories', 'admin', 'removehook')) {\n return false;\n }\n // fall through to the next upgrade\n\n case '2.2':\n // Code to upgrade from version 2.2 goes here\n\n if (xarModIsAvailable('articles')) {\n // load API for table definition etc.\n if (!xarModAPILoad('articles','user')) return;\n }\n\n $linkagetable = $xartable['categories_linkage'];\n\n xarDBLoadTableMaintenanceAPI();\n\n // add the xar_itemtype column\n $query = xarDBAlterTable($linkagetable,\n array('command' => 'add',\n 'field' => 'xar_itemtype',\n 'type' => 'integer',\n 'null' => false,\n 'default' => '0'));\n $result = $dbconn->Execute($query);\n if (!$result) return;\n\n // make sure all current records have an itemtype 0 (just in case)\n $query = \"UPDATE $linkagetable SET xar_itemtype = 0\";\n $result= $dbconn->Execute($query);\n if (!$result) return;\n\n // update the itemtype field for all articles\n if (xarModIsAvailable('articles')) {\n $modid = xarModGetIDFromName('articles');\n $articlestable = $xartable['articles'];\n\n $query = \"SELECT xar_aid, xar_pubtypeid FROM $articlestable\";\n $result= $dbconn->Execute($query);\n if (!$result) return;\n\n while (!$result->EOF) {\n list($aid,$ptid) = $result->fields;\n $update = \"UPDATE $linkagetable SET xar_itemtype = $ptid WHERE xar_iid = $aid AND xar_modid = $modid\";\n $test = $dbconn->Execute($update);\n if (!$test) return;\n\n $result->MoveNext();\n }\n $result->Close();\n }\n\n// TODO: any other modules where we need to insert the right itemtype here ?\n\n // add an index for the xar_itemtype column\n $index = array('name' => 'i_' . xarDBGetSiteTablePrefix() . '_cat_linkage_4',\n 'fields' => array('xar_itemtype'),\n 'unique' => FALSE);\n $query = xarDBCreateIndex($linkagetable,$index);\n $result= $dbconn->Execute($query);\n if (!$result) return;\n\n // fall through to the next upgrade\n\n case '2.3':\n case '2.3.0':\n // remove old instance definitions for 'Category'\n $instancetable = $xartable['security_instances'];\n $query = \"DELETE FROM $instancetable\n WHERE xar_module='categories' AND xar_component='Category'\";\n $result= $dbconn->Execute($query);\n if (!$result) return;\n\n $categorytable =$xartable['categories'];\n // use external privilege wizard for 'Category' instance\n $instances = array(\n array('header' => 'external', // this keyword indicates an external \"wizard\"\n 'query' => xarModURL('categories', 'admin', 'privileges'),\n 'limit' => 0\n )\n );\n // TODO: get this parent/child stuff to work someday, or implement some other way ?\n //xarDefineInstance('categories', 'Category', $instances);\n xarDefineInstance('categories', 'Category', $instances,1,$categorytable,'xar_cid',\n 'xar_parent','Instances of the categories module, including multilevel nesting');\n\n // fall through to the next upgrade\n\n case '2.3.1':\n xarTplRegisterTag('categories', 'categories-filter',\n array(),\n 'categories_userapi_filtertag');\n\n // fall through to the next upgrade\n\n case '2.3.2':\n xarTplRegisterTag('categories', 'categories-catinfo', array(),\n 'categories_userapi_getcatinfotag');\n // fall through to the next upgrade\n case '2.3.3':\n\n xarRemoveInstances('categories','Block');\n\n case '2.3.4':\n xarModSetVar('categories', 'inputsize', 5);\n case '2.3.5'://\n\n case '2.4.0':\n // Indicate to the core privilege there is some xarprivilege.php to extend\n xarModSetVar('categories', 'extended_privileges', 1);\n\n // Todo: add the minimum core version requirement dependancy. Or should the privilege acts the same than before for full compability?\n\n //Load Table Maintainance API\n xarDBLoadTableMaintenanceAPI();\n\n // Get database information\n $dbconn = xarDBGetConn();\n $xartable = xarDBGetTables();\n\n $fields = array(\n 'xar_pid'=>array('type'=>'integer','null'=>FALSE,'default'=>'0'),\n 'xar_name'=>array('type'=>'varchar','size'=>254,'null'=>FALSE,'default'=>'0'),\n 'xar_cid'=>array('type'=>'integer','null'=>FALSE,'default'=>'0'),\n 'xar_forced_deny'=>array('type'=>'integer','size'=>'tiny','null'=>FALSE,'default'=>'0'),\n 'xar_forced_allow'=>array('type'=>'integer','size'=>'tiny','null'=>FALSE,'default'=>'0'),\n 'xar_forbid_receive'=>array('type'=>'integer','size'=>'tiny','null'=>FALSE,'default'=>'0'),\n 'xar_multi_level'=>array('type'=>'integer','size'=>'tiny','null'=>FALSE,'default'=>'0'),\n 'xar_to_children'=>array('type'=>'integer','size'=>'tiny','null'=>FALSE,'default'=>'0'),\n 'xar_to_parents'=>array('type'=>'integer','size'=>'tiny','null'=>FALSE,'default'=>'0'),\n 'xar_to_siblings'=>array('type'=>'integer','size'=>'tiny','null'=>FALSE,'default'=>'0'),\n 'xar_not_itself'=>array('type'=>'integer','size'=>'tiny','null'=>FALSE,'default'=>'0'),\n 'xar_override_others'=>array('type'=>'integer','size'=>'tiny','null'=>FALSE,'default'=>'0'),\n 'xar_inheritance_depth'=>array('type'=>'integer','size'=>'tiny','null'=>FALSE,'default'=>'0'),\n 'xar_deactivated'=>array('type'=>'integer','size'=>'tiny','null'=>FALSE,'default'=>'0'),\n 'xar_comment'=>array('type'=>'varchar','size'=>254,'null'=>FALSE,'default'=>'')\n );\n\n // Create the Table - the function will return the SQL is successful or\n // raise an exception if it fails, in this case $query is empty\n $query = xarDBCreateTable($xartable['categories_ext_privileges'],$fields);\n if (empty($query)) return; // throw back\n\n // Pass the Table Create DDL to adodb to create the table and send exception if unsuccessful\n $result= $dbconn->Execute($query);\n if (!$result) return;\n\n $index = array(\n 'name' => 'i_' . xarDBGetSiteTablePrefix() . '_categories_priv_pid',\n 'fields' => array('xar_pid'),\n 'unique' => false\n );\n $query = xarDBCreateIndex($xartable['categories_ext_privileges'],$index);\n $result= $dbconn->Execute($query);\n if (!$result) return;\n\n $index = array(\n 'name' => 'i_' . xarDBGetSiteTablePrefix() . '_categories_priv_cid',\n 'fields' => array('xar_cid'),\n 'unique' => false\n );\n $query = xarDBCreateIndex($xartable['categories_ext_privileges'],$index);\n $result= $dbconn->Execute($query);\n if (!$result) return;\n\n $index = array(\n 'name' => 'i_' . xarDBGetSiteTablePrefix() . '__categories_priv_cid_pid',\n 'fields' => array('xar_pid','xar_cid'),\n 'unique' => true\n );\n $query = xarDBCreateIndex($xartable['categories_ext_privileges'],$index);\n $result= $dbconn->Execute($query);\n if (!$result) return;\n\n case '2.4.1':\n // One or all-or nothing category access\n // http://xarigami.com/contrails/display/xcat/554\n xarModSetVar('categories', 'securitytestall', true);\n // Set to true to keep the former testall behavior.\n\n case '2.4.2':\n //upgrade for core 1.4.0 compatibility\n //add modvar to turn on/off dragdrop\n xarModSetVar('categories','allowdragdrop',false);\n\n case '2.4.3':\n\n case '2.5.0':\n case '2.5.1':\n case '2.5.2':\n case '2.5.3':\n xarModSetVar('categories', 'singleinput', false);\n case '2.5.5': //upgrade to reflect javascript update of treeTable. admin-veiwcats-render template also updated.\n default:\n break;\n }\n\n // Upgrade successful\n return true;\n}", "function xmldb_cognitivefactory_upgrade($oldversion = 0) {\n/// older versions to match current functionality \n\n global $CFG;\n\n $result = true;\n\n // Moodle 2.0 line\n \n return true;\n}", "private function upgrade_site() {\n // Get WPP version\n $wpp_ver = get_option( 'wpp_ver' );\n\n if ( !$wpp_ver ) {\n add_option( 'wpp_ver', $this->version );\n } elseif ( version_compare( $wpp_ver, $this->version, '<' ) ) {\n $this->upgrade();\n }\n }", "function upgrade_430()\n {\n }", "protected function whenNewVersionWasRequested()\n {\n }", "public function upgrade()\n\t{\n\t\tif (parent::upgrade()) {\n\t\t\t// Rebuild the categories table\n\t\t\t$table = JTable::getInstance('Category', 'JTable', array('dbo' => $this->_db));\n\n\t\t\tif (!$table->rebuild()) {\n\t\t\t\techo JError::raiseError(500, $table->getError());\n\t\t\t}\n\t\t}\n\t}", "function resource_upgrade($oldversion) {\n// This function does anything necessary to upgrade\n// older versions to match current functionality\n \n global $CFG ;\n\n if ($oldversion < 2004013101) {\n modify_database(\"\", \"INSERT INTO prefix_log_display VALUES ('resource', 'update', 'resource', 'name');\");\n modify_database(\"\", \"INSERT INTO prefix_log_display VALUES ('resource', 'add', 'resource', 'name');\");\n }\n\n if ($oldversion < 2004071000) {\n table_column(\"resource\", \"\", \"popup\", \"text\", \"\", \"\", \"\", \"\", \"alltext\");\n if ($resources = get_records_select(\"resource\", \"type='3' OR type='5'\", \"\", \"id, alltext\")) {\n foreach ($resources as $resource) {\n $resource->popup = addslashes($resource->alltext);\n $resource->alltext = \"\";\n if (!update_record(\"resource\", $resource)) {\n notify(\"Error updating popup field for resource id = $resource->id\");\n } \n }\n }\n require_once(\"$CFG->dirroot/course/lib.php\");\n rebuild_course_cache();\n }\n \n if ($oldversion < 2004071300) {\n table_column(\"resource\", \"\", \"options\", \"varchar\", \"255\", \"\", \"\", \"\", \"popup\");\n }\n\n if ($oldversion < 2004071303) {\n table_column(\"resource\", \"type\", \"type\", \"varchar\", \"30\", \"\", \"\", \"\", \"\");\n\n modify_database(\"\", \"UPDATE prefix_resource SET type='reference' WHERE type='1';\");\n modify_database(\"\", \"UPDATE prefix_resource SET type='file', options='frame' WHERE type='2';\");\n modify_database(\"\", \"UPDATE prefix_resource SET type='file' WHERE type='3';\");\n modify_database(\"\", \"UPDATE prefix_resource SET type='text', options='0' WHERE type='4';\");\n modify_database(\"\", \"UPDATE prefix_resource SET type='file' WHERE type='5';\");\n modify_database(\"\", \"UPDATE prefix_resource SET type='html' WHERE type='6';\");\n modify_database(\"\", \"UPDATE prefix_resource SET type='file' WHERE type='7';\");\n modify_database(\"\", \"UPDATE prefix_resource SET type='text', options='3' WHERE type='8';\");\n modify_database(\"\", \"UPDATE prefix_resource SET type='directory' WHERE type='9';\");\n }\n\n if ($oldversion < 2004080801) {\n modify_database(\"\", \"UPDATE prefix_resource SET alltext=reference,type='html' WHERE type='reference';\");\n rebuild_course_cache();\n }\n\n if ($oldversion < 2004111200) {//drop first to avoid conflicts when upgrading\n execute_sql(\"DROP INDEX {$CFG->prefix}resource_course_idx;\",false);\n\n modify_database('','CREATE INDEX prefix_resource_course_idx ON prefix_resource (course);');\n }\n \n if ($oldversion < 2005041100) { // replace wiki-like with markdown\n include_once( \"$CFG->dirroot/lib/wiki_to_markdown.php\" );\n $wtm = new WikiToMarkdown();\n $wtm->update( 'resource','alltext','options' );\n }\n\n return true;\n}", "function extendedforum_upgrade($oldversion) {\n// This function does anything necessary to upgrade\n// older versions to match current functionality\n\n global $CFG;\n\n if ($oldversion < 2003042402) {\n execute_sql(\"INSERT INTO {$CFG->prefix}log_display (module, action, mtable, field) VALUES ('extendedforum', 'move discussion', 'extendedforum_discussions', 'name')\");\n }\n\n if ($oldversion < 2003082500) {\n table_column(\"extendedforum\", \"\", \"assesstimestart\", \"integer\", \"10\", \"unsigned\", \"0\", \"\", \"assessed\");\n table_column(\"extendedforum\", \"\", \"assesstimefinish\", \"integer\", \"10\", \"unsigned\", \"0\", \"\", \"assesstimestart\");\n }\n\n if ($oldversion < 2003082502) {\n execute_sql(\"UPDATE {$CFG->prefix}extendedforum SET scale = (- scale)\");\n }\n\n if ($oldversion < 2003100600) {\n table_column(\"extendedforum\", \"\", \"maxbytes\", \"integer\", \"10\", \"unsigned\", \"0\", \"\", \"scale\");\n }\n\n if ($oldversion < 2004010100) {\n table_column(\"extendedforum\", \"\", \"assesspublic\", \"integer\", \"4\", \"unsigned\", \"0\", \"\", \"assessed\");\n }\n\n if ($oldversion < 2004011404) {\n table_column(\"extendedforum_discussions\", \"\", \"userid\", \"integer\", \"10\", \"unsigned\", \"0\", \"\", \"firstpost\");\n\n if ($discussions = get_records_sql(\"SELECT d.id, p.userid\n FROM {$CFG->prefix}extendedforum_discussions as d, \n {$CFG->prefix}extendedforum_posts as p\n WHERE d.firstpost = p.id\")) {\n foreach ($discussions as $discussion) {\n update_record(\"extendedforum_discussions\", $discussion);\n }\n }\n }\n if ($oldversion < 2004012200) {\n table_column(\"extendedforum_discussions\", \"\", \"groupid\", \"integer\", \"10\", \"unsigned\", \"0\", \"\", \"userid\");\n }\n\n if ($oldversion < 2004020600) {\n table_column(\"extendedforum_discussions\", \"\", \"usermodified\", \"integer\", \"10\", \"unsigned\", \"0\", \"\", \"timemodified\");\n }\n\n if ($oldversion < 2004050300) {\n table_column(\"extendedforum\",\"\",\"rsstype\",\"integer\",\"2\", \"unsigned\", \"0\", \"\", \"forcesubscribe\");\n table_column(\"extendedforum\",\"\",\"rssarticles\",\"integer\",\"2\", \"unsigned\", \"0\", \"\", \"rsstype\");\n set_config(\"extendedforum_enablerssfeeds\",0);\n }\n\n if ($oldversion < 2004060100) {\n modify_database('', \"CREATE TABLE prefix_extendedforum_queue (\n id SERIAL PRIMARY KEY,\n userid integer default 0 NOT NULL,\n discussionid integer default 0 NOT NULL,\n postid integer default 0 NOT NULL\n );\");\n }\n\n if ($oldversion < 2004070700) { // This may be redoing it from STABLE but that's OK\n table_column(\"extendedforum_discussions\", \"groupid\", \"groupid\", \"integer\", \"10\", \"\", \"0\", \"\");\n }\n\n\n if ($oldversion < 2004111700) {\n execute_sql(\" DROP INDEX {$CFG->prefix}extendedforum_posts_parent_idx;\",false);\n execute_sql(\" DROP INDEX {$CFG->prefix}extendedforum_posts_discussion_idx;\",false);\n execute_sql(\" DROP INDEX {$CFG->prefix}extendedforum_posts_userid_idx;\",false);\n execute_sql(\" DROP INDEX {$CFG->prefix}extendedforum_discussions_extendedforum_idx;\",false);\n execute_sql(\" DROP INDEX {$CFG->prefix}extendedforum_discussions_userid_idx;\",false);\n\n execute_sql(\" CREATE INDEX {$CFG->prefix}extendedforum_posts_parent_idx ON {$CFG->prefix}extendedforum_posts (parent) \");\n execute_sql(\" CREATE INDEX {$CFG->prefix}extendedforum_posts_discussion_idx ON {$CFG->prefix}extendedforum_posts (discussion) \");\n execute_sql(\" CREATE INDEX {$CFG->prefix}extendedforum_posts_userid_idx ON {$CFG->prefix}extendedforum_posts (userid) \");\n execute_sql(\" CREATE INDEX {$CFG->prefix}extendedforum_discussions_extendedforum_idx ON {$CFG->prefix}extendedforum_discussions (extendedforum) \");\n execute_sql(\" CREATE INDEX {$CFG->prefix}extendedforum_discussions_userid_idx ON {$CFG->prefix}extendedforum_discussions (userid) \");\n }\n\n if ($oldversion < 2004111200) {\n execute_sql(\"DROP INDEX {$CFG->prefix}extendedforum_course_idx;\",false);\n execute_sql(\"DROP INDEX {$CFG->prefix}extendedforum_queue_userid_idx;\",false);\n execute_sql(\"DROP INDEX {$CFG->prefix}extendedforum_queue_discussion_idx;\",false); \n execute_sql(\"DROP INDEX {$CFG->prefix}extendedforum_queue_postid_idx;\",false); \n execute_sql(\"DROP INDEX {$CFG->prefix}extendedforum_ratings_userid_idx;\",false); \n execute_sql(\"DROP INDEX {$CFG->prefix}extendedforum_ratings_post_idx;\",false);\n execute_sql(\"DROP INDEX {$CFG->prefix}extendedforum_subscriptions_userid_idx;\",false);\n execute_sql(\"DROP INDEX {$CFG->prefix}extendedforum_subscriptions_extendedforum_idx;\",false);\n\n modify_database('','CREATE INDEX prefix_extendedforum_course_idx ON prefix_extendedforum (course);');\n modify_database('','CREATE INDEX prefix_extendedforum_queue_userid_idx ON prefix_extendedforum_queue (userid);');\n modify_database('','CREATE INDEX prefix_extendedforum_queue_discussion_idx ON prefix_extendedforum_queue (discussionid);');\n modify_database('','CREATE INDEX prefix_extendedforum_queue_postid_idx ON prefix_extendedforum_queue (postid);');\n modify_database('','CREATE INDEX prefix_extendedforum_ratings_userid_idx ON prefix_extendedforum_ratings (userid);');\n modify_database('','CREATE INDEX prefix_extendedforum_ratings_post_idx ON prefix_extendedforum_ratings (post);');\n modify_database('','CREATE INDEX prefix_extendedforum_subscriptions_userid_idx ON prefix_extendedforum_subscriptions (userid);');\n modify_database('','CREATE INDEX prefix_extendedforum_subscriptions_extendedforum_idx ON prefix_extendedforum_subscriptions (extendedforum);');\n }\n\n if ($oldversion < 2005011500) {\n modify_database('','CREATE TABLE prefix_extendedforum_read (\n id SERIAL PRIMARY KEY,\n userid integer default 0 NOT NULL,\n extendedforumid integer default 0 NOT NULL,\n discussionid integer default 0 NOT NULL,\n postid integer default 0 NOT NULL,\n firstread integer default 0 NOT NULL,\n lastread integer default 0 NOT NULL\n );');\n\n modify_database('','CREATE INDEX prefix_extendedforum_user_extendedforum_idx ON prefix_extendedforum_read (userid, extendedforumid);');\n modify_database('','CREATE INDEX prefix_extendedforum_user_discussion_idx ON prefix_extendedforum_read (userid, discussionid);');\n modify_database('','CREATE INDEX prefix_extendedforum_user_post_idx ON prefix_extendedforum_read (userid, postid);');\n\n set_config('upgrade', 'extendedforumread'); // The upgrade of this table will be done later by admin/upgradeextendedforumread.php\n }\n\n if ($oldversion < 2005032900) {\n modify_database('','CREATE INDEX prefix_extendedforum_posts_created_idx ON prefix_extendedforum_posts (created);');\n modify_database('','CREATE INDEX prefix_extendedforum_posts_mailed_idx ON prefix_extendedforum_posts (mailed);');\n }\n\n if ($oldversion < 2005041100) { // replace wiki-like with markdown\n include_once( \"$CFG->dirroot/lib/wiki_to_markdown.php\" );\n $wtm = new WikiToMarkdown();\n $sql = \"select course from {$CFG->prefix}extendedforum_discussions, {$CFG->prefix}extendedforum_posts \";\n $sql .= \"where {$CFG->prefix}extendedforum_posts.discussion = {$CFG->prefix}extendedforum_discussions.id \";\n $sql .= \"and {$CFG->prefix}extendedforum_posts.id = \";\n $wtm->update( 'extendedforum_posts','message','format',$sql );\n }\n\n if ($oldversion < 2005042300) { // Add tracking prefs table\n modify_database('','CREATE TABLE prefix_extendedforum_track_prefs (\n id SERIAL PRIMARY KEY, \n userid integer default 0 NOT NULL,\n extendedforumid integer default 0 NOT NULL\n );');\n }\n\n if ($oldversion < 2005042600) {\n table_column('extendedforum','','trackingtype','integer','2', 'unsigned', '1', '', 'forcesubscribe');\n modify_database('','CREATE INDEX prefix_extendedforum_track_user_extendedforum_idx ON prefix_extendedforum_track_prefs (userid, extendedforumid);');\n }\n\n if ($oldversion < 2005042601) { // Mass cleanup of bad postgres upgrade scripts\n modify_database('','ALTER TABLE prefix_extendedforum ALTER trackingtype SET NOT NULL');\n }\n\n if ($oldversion < 2005111100) {\n table_column('extendedforum_discussions','','timestart','integer');\n table_column('extendedforum_discussions','','timeend','integer');\n }\n\n if ($oldversion < 2006011600) {\n notify('extendedforum_type does not exists, you can ignore and this will properly removed');\n execute_sql(\"ALTER TABLE {$CFG->prefix}extendedforum DROP CONSTRAINT {$CFG->prefix}extendedforum_type\");\n execute_sql(\"ALTER TABLE {$CFG->prefix}extendedforum ADD CONSTRAINT {$CFG->prefix}extendedforum_type CHECK (type IN ('single','news','general','social','eachuser','teacher','qanda')) \");\n }\n\n if ($oldversion < 2006011601) {\n table_column('extendedforum','','warnafter');\n table_column('extendedforum','','blockafter');\n table_column('extendedforum','','blockperiod');\n }\n\n if ($oldversion < 2006011700) {\n table_column('extendedforum_posts','','mailnow','integer');\n }\n\n if ($oldversion < 2006011701) {\n execute_sql(\"ALTER TABLE {$CFG->prefix}extendedforum DROP CONSTRAINT {$CFG->prefix}extendedforum_type_check\");\n }\n\n if ($oldversion < 2006011702) {\n execute_sql(\"INSERT INTO {$CFG->prefix}log_display (module, action, mtable, field) VALUES ('extendedforum', 'user report', 'user', 'firstname||\\' \\'||lastname')\");\n }\n\n if ($oldversion < 2006081800) {\n // Upgrades for new roles and capabilities support.\n require_once($CFG->dirroot.'/mod/extendedforum/lib.php');\n\n $extendedforummod = get_record('modules', 'name', 'extendedforum');\n\n if ($extendedforums = get_records('extendedforum')) {\n\n if (!$teacherroles = get_roles_with_capability('moodle/legacy:teacher', CAP_ALLOW)) {\n notify('Default teacher role was not found. Roles and permissions '.\n 'for all your extendedforums will have to be manually set after '.\n 'this upgrade.');\n }\n if (!$studentroles = get_roles_with_capability('moodle/legacy:student', CAP_ALLOW)) {\n notify('Default student role was not found. Roles and permissions '.\n 'for all your extendedforums will have to be manually set after '.\n 'this upgrade.');\n }\n if (!$guestroles = get_roles_with_capability('moodle/legacy:guest', CAP_ALLOW)) {\n notify('Default guest role was not found. Roles and permissions '.\n 'for teacher extendedforums will have to be manually set after '.\n 'this upgrade.');\n }\n foreach ($extendedforums as $extendedforum) {\n if (!extendedforum_convert_to_roles($extendedforum, $extendedforummod->id, $teacherroles,\n $studentroles, $guestroles)) {\n notify('Forum with id '.$extendedforum->id.' was not upgraded');\n }\n }\n // We need to rebuild all the course caches to refresh the state of\n // the extendedforum modules.\n rebuild_course_cache();\n \n } // End if.\n \n // Drop column extendedforum.open.\n modify_database('', 'ALTER TABLE prefix_extendedforum DROP COLUMN open;');\n\n // Drop column extendedforum.assesspublic.\n modify_database('', 'ALTER TABLE prefix_extendedforum DROP COLUMN assesspublic;');\n }\n \n if ($oldversion < 2006082700) {\n $sql = \"UPDATE {$CFG->prefix}extendedforum_posts SET message = REPLACE(message, '\".TRUSTTEXT.\"', '');\";\n $likecond = sql_ilike().\" '%\".TRUSTTEXT.\"%'\";\n while (true) {\n if (!count_records_select('extendedforum_posts', \"message $likecond\")) {\n break;\n }\n execute_sql($sql);\n }\n }\n\n ////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.\n\n return true;\n\n}", "function rss_client_upgrade($oldversion) {\n/// This function does anything necessary to upgrade \n/// older versions to match current functionality \n\n global $CFG;\n\n if ($oldversion < 2003111500) {\n # Do something ...\n }\n\n if ($oldversion < 2004112001) {\n // title and description should be TEXT as we don't have control over their length.\n table_column('block_rss_client','title','title','text',10,'unsigned','');\n table_column('block_rss_client','description','description','text',10,'unsigned','');\n }\n\n return true;\n}", "function phpgwapi_upgrade0_9_13_015()\n\t{\n\t\tif(phpversion() >= '4.0.5' && @$GLOBALS['phpgw_setup']->db->Type == 'mysql')\n\t\t{\n\t\t\t$_ver_str = @mysql_get_server_info();\n\t\t\t$_ver_arr = explode(\".\",$_ver_str);\n\t\t\t$_ver = $_ver_arr[1];\n\t\t\tif((int)$_ver < 23)\n\t\t\t{\n\t\t\t\t$GLOBALS['setup_info']['phpgwapi']['currentver'] = '0.9.13.016';\n\t\t\t\treturn $GLOBALS['setup_info']['phpgwapi']['currentver'];\n\t\t\t}\n\t\t}\n\n\t\t$GLOBALS['phpgw_setup']->oProc->AlterColumn(\n\t\t\t'lang',\n\t\t\t'message_id',\n\t\t\tarray(\n\t\t\t\t'type' => 'varchar',\n\t\t\t\t'precision' => 255,\n\t\t\t\t'nullable' => false,\n\t\t\t\t'default' => ''\n\t\t\t)\n\t\t);\n\n\t\t$GLOBALS['setup_info']['phpgwapi']['currentver'] = '0.9.13.016';\n\t\treturn $GLOBALS['setup_info']['phpgwapi']['currentver'];\n\t}", "public function upgrade($oldversion)\n {\n if (version_compare($oldversion, '3.1', '<')) {\n // Inform user about error, and how he can upgrade to $modversion\n $upgradeToVersion = $this->bundle->getMetaData()->getVersion();\n\n $this->addFlash('error', $this->__f('Notice: This version does not support upgrades from versions of Dizkus less than 3.1. Please upgrade to 3.1 before upgrading again to version %s.', $upgradeToVersion));\n\n return false;\n }\n switch ($oldversion) {\n case '3.1':\n case '3.1.0':\n case '3.2.0':\n if (!$this->upgrade_settings()) {\n return false;\n }\n\n $connection = $this->entityManager->getConnection();\n $dbName = $this->container->getParameter('database_name');\n $connection->executeQuery(\"DELETE FROM ${dbName}.`hook_area` WHERE `owner` = 'Dizkus'\");\n $connection->executeQuery(\"DELETE FROM ${dbName}.`hook_binding` WHERE `sowner` = 'Dizkus'\");\n $connection->executeQuery(\"DELETE FROM ${dbName}.`hook_runtime` WHERE `sowner` = 'Dizkus'\");\n $connection->executeQuery(\"DELETE FROM ${dbName}.`hook_subscriber` WHERE `owner` = 'Dizkus'\");\n\n $prefix = $this->container->hasParameter('prefix') ? $this->container->getParameter('prefix') : '';\n $schemaManager = $connection->getSchemaManager();\n $schema = $schemaManager->createSchema();\n if (!$schema->hasTable($prefix . 'dizkus_categories')) {\n $this->addFlash('error', $this->__f('There was a problem recognizing the existing Dizkus tables. Please confirm that your settings for prefix in $ZConfig[\\'System\\'][\\'prefix\\'] match the actual Dizkus tables in the database. (Current prefix loaded as `%s`)', ['%s' => $prefix]));\n\n return false;\n }\n\n $name = $prefix . 'dizkus_users';\n if (!$schema->hasTable($name)) {\n // 3.2.0 users dummy table\n $table = $schema->createTable($name);\n $table->addColumn('user_id', 'integer');\n $table->addColumn('user_posts', 'integer');\n $table->addColumn('user_rank', 'integer');\n $table->addColumn('user_level', 'integer');\n $table->addColumn('user_lastvisit', 'datetime');\n $table->addColumn('user_favorites', 'integer');\n $table->addColumn('user_post_order', 'integer');\n $sql = $schemaManager->getDatabasePlatform()->getCreateTableSQL($table);\n $statement = $connection->prepare($sql[0]);\n $statement->execute();\n }\n\n if ('' !== $prefix) {\n $this->removeTablePrefixes($prefix);\n }\n // mark tables for import\n $upgrade_mark = str_replace('.', '_', $oldversion) . '_';\n $this->markTablesForImport($upgrade_mark);\n // add upgrading info for later\n $this->setVar('upgrading', str_replace('.', '_', $oldversion));\n //install module now\n try {\n $this->schemaTool->create($this->entities);\n } catch (\\Exception $e) {\n $this->addFlash('error', $e->getMessage());\n\n return false;\n }\n\n // set up forum root (required)\n $forumRoot = new ForumEntity();\n $forumRoot->setName(ForumEntity::ROOTNAME);\n $forumRoot->lock();\n $this->entityManager->persist($forumRoot);\n $this->entityManager->flush();\n\n $this->addFlash('status', $this->__('Please go to Dizkus admin import to perform full data import.'));\n\n break;\n case '4.0.0':\n if (!$this->upgrade_settings()) {\n return false;\n }\n // reinstall hooks\n $connection = $this->entityManager->getConnection();\n $dbName = $this->container->getParameter('database_name');\n $connection->executeQuery(\"DELETE FROM ${dbName}.`hook_area` WHERE `owner` = 'ZikulaDizkusModule'\");\n $connection->executeQuery(\"DELETE FROM ${dbName}.`hook_binding` WHERE `sowner` = 'ZikulaDizkusModule'\");\n $connection->executeQuery(\"DELETE FROM ${dbName}.`hook_runtime` WHERE `sowner` = 'ZikulaDizkusModule'\");\n $connection->executeQuery(\"DELETE FROM ${dbName}.`hook_subscriber` WHERE `owner` = 'ZikulaDizkusModule'\");\n\n break;\n case '4.1.0':\n // nothing to do now\n break;\n }\n\n return true;\n }", "public function update($initialVersion) {\n\n $this->skip('0.0.0', '1.0.0');\n\n //Updater files are deprecated. Please use migrations.\n //See: https://github.com/oat-sa/generis/wiki/Tao-Update-Process\n $this->setVersion($this->getExtension()->getManifest()->getVersion());\n }", "public function update($moduleId)\n {\n // Hack: for some broken modules using wall aliases\n Yii::setPathOfAlias('wall', Yii::app()->getModulePath());\n\n // Remove old module files\n Yii::app()->moduleManager->removeModuleFolder($moduleId);\n $this->install($moduleId);\n\n $module = Yii::app()->moduleManager->getModule($moduleId);\n $module->update();\n }", "function nanogong_upgrade($oldversion) {\r\n/// This function does anything necessary to upgrade \r\n/// older versions to match current functionality \r\n\r\n global $CFG;\r\n\r\n if ($oldversion < 2008081100) {\r\n execute_sql(\" ALTER TABLE `{$CFG->prefix}nanogong` ADD `maxmessages` int(4) NOT NULL default '0' AFTER `message` \");\r\n execute_sql(\" ALTER TABLE `{$CFG->prefix}nanogong` ADD `color` varchar(7) AFTER `message` \");\r\n execute_sql(\" ALTER TABLE `{$CFG->prefix}nanogong_message` ADD `title` varchar(255) NOT NULL default '' AFTER `groupid` \");\r\n execute_sql(\" ALTER TABLE `{$CFG->prefix}nanogong_message` ADD `commentedby` int(10) unsigned AFTER `comments` \");\r\n execute_sql(\" ALTER TABLE `{$CFG->prefix}nanogong_message` ADD `timeedited` int(10) unsigned AFTER `timestamp` \");\r\n }\r\n\r\n return true;\r\n}", "public function upgrade( $previous_version ) {\n\n\t\t// Was previous Add-On version before 1.0.6?\n\t\t$previous_is_pre_custom_app_only = ! empty( $previous_version ) && version_compare( $previous_version, '1.0.6', '<' );\n\n\t\t// Run 1.0.6 upgrade routine.\n\t\tif ( $previous_is_pre_custom_app_only ) {\n\n\t\t\t// Get plugin settings.\n\t\t\t$settings = $this->get_plugin_settings();\n\n\t\t\t// Set default app flag.\n\t\t\tif ( ! rgar( $settings, 'customAppEnable' ) && $this->initialize_api() ) {\n\t\t\t\t$settings['defaultAppEnabled'] = '1';\n\t\t\t}\n\n\t\t\t// Remove custom app flag.\n\t\t\tunset( $settings['customAppEnable'] );\n\n\t\t\t// Save plugin settings.\n\t\t\t$this->update_plugin_settings( $settings );\n\n\t\t}\n\n\t\t// Was previous Add-On version before 2.0?\n\t\t$previous_is_pre_20 = ! empty( $previous_version ) && version_compare( $previous_version, '2.0dev2', '<' );\n\n\t\t// Run 2.0 upgrade routine.\n\t\tif ( $previous_is_pre_20 ) {\n\n\t\t\t// Get plugin settings.\n\t\t\t$settings = $this->get_plugin_settings();\n\n\t\t\t// Set custom app state.\n\t\t\tif ( rgar( $settings, 'defaultAppEnabled' ) ) {\n\t\t\t\tunset( $settings['defaultAppEnabled'], $settings['customAppEnable'] );\n\t\t\t} else {\n\t\t\t\t$settings['customAppEnable'] = '1';\n\t\t\t}\n\n\t\t\t// Save plugin settings.\n\t\t\t$this->update_plugin_settings( $settings );\n\n\t\t}\n\n\t}", "function upgrade_module_3_1_1()\n{\n $query = new \\DbQuery();\n $query->select('id, data')\n ->from(bqSQL('packlink_entity'))\n ->where('index_1=\"defaultParcel\"');\n\n $records = \\Db::getInstance()->executeS($query);\n foreach ($records as $record) {\n if (empty($record)) {\n continue;\n }\n\n $data = json_decode($record['data'], true);\n if (!empty($data['value']['weight'])) {\n $weight = (float)$data['value']['weight'];\n $data['value']['weight'] = !empty($weight) ? $weight : 1;\n }\n\n foreach (array('length', 'height', 'width') as $field) {\n if (!empty($data['value'][$field])) {\n $fieldValue = (int)$data['value'][$field];\n $data['value'][$field] = !empty($fieldValue) ? $fieldValue : 10;\n }\n }\n\n if (!empty($record['id'])) {\n \\Db::getInstance()->update(\n 'packlink_entity',\n array(\n 'data' => pSQL(json_encode($data), true)\n ),\n '`id` = ' . $record['id']\n );\n }\n }\n\n return true;\n}", "public function setNewVersion()\n {\n $difference = '9223372036854775806';\n $rand_percent = bcdiv(mt_rand(), mt_getrandmax(), 12);\n $version = bcmul($difference, $rand_percent, 0);\n $this->owner->setAttribute($this->versionField, $version);\n }", "public function upgrade_check(){\n $this->upgrade_site();\n }" ]
[ "0.75118977", "0.7058338", "0.70177084", "0.70156676", "0.67537296", "0.67451", "0.66763896", "0.66381776", "0.662459", "0.66178066", "0.6570241", "0.65227187", "0.6462585", "0.641134", "0.6393309", "0.6375556", "0.6357206", "0.6351729", "0.63500214", "0.63454276", "0.63423723", "0.63145757", "0.63066196", "0.6304757", "0.6299628", "0.6285107", "0.6265469", "0.6255786", "0.6252259", "0.62453043", "0.62259775", "0.6222256", "0.620109", "0.61967415", "0.61793286", "0.61722195", "0.61685175", "0.6162353", "0.61616164", "0.6136627", "0.6127668", "0.6116804", "0.6103845", "0.61029106", "0.60875505", "0.60768604", "0.6076818", "0.60533565", "0.6051852", "0.6002317", "0.59869605", "0.5970938", "0.5967952", "0.593433", "0.5918585", "0.5916799", "0.590653", "0.58923525", "0.58884656", "0.58701926", "0.586238", "0.5840681", "0.58076197", "0.5807124", "0.58063877", "0.58005834", "0.5794031", "0.5791324", "0.57895285", "0.5787035", "0.5785203", "0.5759529", "0.57594556", "0.57549363", "0.57349443", "0.57211787", "0.5712824", "0.5700875", "0.56606424", "0.56551296", "0.5650154", "0.56433785", "0.5642737", "0.56161284", "0.5615492", "0.5604425", "0.5602165", "0.5599138", "0.55957776", "0.55949044", "0.5594195", "0.55884296", "0.5584922", "0.5560446", "0.5559686", "0.5555407", "0.55489594", "0.55468833", "0.5533579", "0.55311996" ]
0.5972132
51
Delete the module This function is only ever called once during the lifetime of a particular module instance.
function files_delete() { // remove module vars and masks xarModDelAllVars('files'); xarRemoveMasks('files'); // Deletion successful return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete(Module $module);", "public function destroy(Module $module)\n {\n return $this->module_service->delete($module);\n }", "public function destroy(Module $module)\n {\n $module->delete();\n\n $auth = Auth::user();\n $remember = new Remember;\n $remember->model = 'Module';\n $remember->action = 'delete';\n $remember->user_id = $auth->id;\n $remember->model_id = $module->id;\n $remember->save();\n\n return redirect('/modules');\n }", "public function deleted(Module $module)\n {\n if ($module->images) {\n $this->deleteFiles($module);\n }\n }", "public function destroy(module $module)\n {\n //\n $module->delete();\n return redirect()->route('config.liste');\n }", "public function destroy(Module $module)\n {\n // file path\n $oldFile = \"uploads/$module->module_file\";\n\n $module->delete();\n\n // delete file from public\n if (File::exists(public_path($oldFile))) {\n File::delete(public_path($oldFile));\n }\n\n // message\n if (auth()->user()->role === 'admin') {\n if ($module) {\n return redirect(route(\"admin.module.index\"))->with('success', 'Module berhasil delete');\n } else {\n return redirect(route(\"admin.module.index\"))->with('danger', 'Module gagal delete!');\n }\n } elseif (auth()->user()->role === 'teacher') {\n if ($module) {\n return redirect(route(\"teacher.lesson.show\", $module->lesson))->with('success', 'Module berhasil delete');\n } else {\n return redirect(route(\"teacher.lesson.show\", $module->lesson))->with('danger', 'Module gagal delete!');\n }\n }\n }", "function Delete($customWriteModuleId = null)\n\t{\n\t\tinclude_once ('RCCWP_CustomGroup.php');\n\t\tif (isset($customWriteModuleId))\n\t\t{\n\t\t\tglobal $wpdb;\n\t\t\t\n\t\t\t$customWriteModule = RCCWP_CustomWriteModule::Get($customWriteModuleId);\n\t\t\t$customWriteModuleName = $customWriteModule->name;\n\t\t \t\n \t\t\t$sql = sprintf(\n\t\t\t\t\"DELETE FROM \" . RC_CWP_TABLE_MODULES .\n\t\t\t\t\" WHERE id = %d\",\n\t\t\t\t$customWriteModuleId\n\t\t\t\t);\n\t\t\t$wpdb->query($sql);\n\n\t\t\t// Remove template folder\n\t\t\tif (!empty($customWriteModuleName)){\n\t\t\t\t$moduleTemplateFolder = dirname(__FILE__).\"/modules/\".$customWriteModuleName;\n\t\t\t\tRCCWP_CustomWriteModule::remove_dir($moduleTemplateFolder);\n\t\t\t}\n \n\t\t\t// Remove Layout data\n\t\t\tFlutterLayoutBlock::DeleteModule($customWriteModuleId);\n\t\t}\n\t\t\n\t}", "public function destroy(Module $module)\n {\n $module->delete();\n return redirect()->route('modules.index');\n }", "public function deleteModule($Module){\n\n\n\t\t$SQL = \"DELETE from cbms_club_module where ModuleID ='\".$Module->getModuleID().\"'\";\n\t\n\t\t$SQL = $this->_DB->doQuery($SQL);\n\n\t \t$Result = new Result();\n\t\t$Result->setIsSuccess(1);\n\t\t$Result->setResultObject($SQL);\n\n\t\treturn $Result;\n\n\t}", "public function destroy($id)\n {\n $module = Module::find($id);\n\n // $categories = Category::where('module_id', '=', $id);\n // dd($categories);\n\n\n $module->delete();\n\n // Save entry to log file using built-in Monolog\n Log::info(Auth::user()->username . \" (\" . Auth::user()->id . \") DELETED module (\" . $module->id . \")\\r\\n\", \n [json_decode($module, true)]\n );\n\n Session::flash('success', 'The module was successfully deleted!');\n return redirect()->route('modules.index');\n }", "public static function delete() {\n\n\n\t\t}", "public function cleanModuleList()\n {\n /**\n * @var \\Magento\\TestFramework\\ObjectManager $objectManager\n */\n $objectManager = \\Magento\\TestFramework\\Helper\\Bootstrap::getObjectManager();\n $objectManager->removeSharedInstance(ModuleList::class);\n $objectManager->removeSharedInstance(ModuleListInterface::class);\n }", "public function removeAction()\n {\n $modules = $this->module->fetchAll(\" groupmodule_id = \".$this->_getParam('id'));\n foreach($modules as $key=>$row)\n { \n $this->module->removemodule(APPLICATION_PATH.\"/modules/\".$row->module_name);\n }\n \n $current = $this->gmodule->find($this->_getParam('id'))->current();\n $current->delete(); \n \n $message = \"Data Deleted Successfully\";\n \n $this->_helper->flashMessenger->addMessage($message);\n die;\n }", "public function destroy(Module $module)\n {\n $module = Module::find($module->id);\n $module -> delete();\n\n return redirect() -> route('modules.index');\n }", "public final function delete() {\n }", "public static function delete($module, $id) {\n return self::deleteDb($module, $id) ;\n }", "public function deleteModuleRow($module_row)\n {\n //\n }", "public function removeModule($name);", "public function uninstall(Module $module);", "public function delete()\n {\n global $_PM_;\n $api = 'handler_'.$this->handler.'_api';\n $this->api = new $api($_PM_, PHM_API_UID, $this->principalId);\n $this->api->remove_item($this->item['id']);\n }", "public function 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 delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete(): void\n {\n $this->instances->demo()->runHook($this->root(), 'delete:before', $this);\n\n Dir::remove($this->root());\n $this->instances->delete($this->id);\n\n $this->instances->demo()->runHook($this->root(), 'delete:after', $this);\n }", "public function destroy($id)\n {\n return ModuleService::delete($id);\n }", "public static function delete(){\r\n }", "public function destroy($id)\n {\n $module = App\\Module::find($id);\n $module->delete();\n\n return response([\n \"message\" => \"sucessfullly deleted module $module->name\" \n ]);\n }", "public function destroy() {}", "public function destroy() {}", "public function destroy() {}", "public function destroy() {}", "public function destroy() {}", "public function destroy() {}", "public function destroy()\n {\n $this->registry = array();\n\n $this->adaptor->deleteIndex($this->section);\n }", "public function instance_deleted() {\n $this->purge_all_definitions();\n @rmdir($this->filestorepath);\n }", "public function delete(): void;", "public static function delete() {\r\n\t\t\r\n\t}", "protected function __del__() { }", "protected function unsetModuleNameFromMongez()\n {\n Mongez::remove('modules', strtolower($this->moduleName));\n }", "function spyropress_builder_unregister_module( $module ) {\n global $spyropress_builder;\n\n $spyropress_builder->modules->unregister( $module );\n}", "public function destroy(ProfModule $profModule)\n {\n //\n }", "public function delete() {\n $this->logger->debug(\"Deleting session\");\n $this->repository->removeByKey($this->getKeys());\n self::$instance = null;\n }", "public function destroy(Python $python)\n {\n //\n }", "public function downModule()\n {\n /** @var App $app_record */\n $app_record = App::findOne(['name' => $this->module->id, 'className' => $this->module->getModuleClassName()]);\n if (!is_null($app_record))\n {\n if ($app_record->core_module == 1)\n {\n throw new yii\\base\\Exception('Module ' . $this->module->id . ' is core, so it can\\'t be uninstalled.');\n }\n\n $app_record->delete();\n $app_record = NULL;\n } else\n {\n throw new yii\\base\\Exception('No installed APP named ' . $this->module->id . ' found.');\n }\n }", "public static function destroy() {}", "public function deleteModule($moduleComponentId) {\n\t\t$pageId=getPageIdFromModuleComponentId(\"article\",$moduleComponentId);\n\t\t$path=getPagePath($pageId);\n\t\tglobal $urlRequestRoot;\n\t\t$delurl = \"http://\".$_SERVER['HTTP_HOST'].$urlRequestRoot.\"/home\".$path;\n\t\t$query=\"SELECT link_id FROM `links` WHERE url='$delurl'\";\n\t\t\n\t\t$result=mysql_query($query);\n\t\tif(mysql_num_rows($result)==0) return true; //Nothing to delete \n\t\t$delids=\"\";\n\t\twhile($row=mysql_fetch_row($result))\n\t\t\t$delids.=$row[0].\",\";\n\t\t\n\t\t$delids=rtrim($delids,\",\");\n\t\t\n\t\t$query=\"DELETE FROM `links` WHERE url='$delurl'\";\n\t\t\n\t\tmysql_query($query);\n\t\tfor ($i=0;$i<=15; $i++) \n\t\t{\n\t\t\t$char = dechex($i);\n\t\t\t$query=\"DELETE FROM `link_keyword$char` WHERE link_id IN ($delids)\";\n\t\t\t\n\t\t\tmysql_query($query) or die(mysql_error().\" article.lib.php L:441\");\n\t\t\t\n\t\t}\n\t\treturn true;\n\t\t\n\n\t}", "public function destroy() {\n }", "public function destroy($id)\n {\n $module = Module::where('id', $id);\n $module -> increment('deleted');\n\n return redirect('modules');\n }", "public function destroy()\n {\n //\n }", "public function destroy()\n {\n //\n }", "public function destroy()\n {\n //\n }", "public function destroy()\n {\n //\n }", "public function destroy()\n {\n //\n }", "public function destroy()\n {\n //\n }", "public function destroy()\n {\n //\n }", "public function destroy()\n {\n //\n }", "public function destroy()\n {\n }", "function lightboxgallery_delete_instance($id) {\n global $DB;\n\n if (!$gallery = $DB->get_record('lightboxgallery', array('id' => $id))) {\n return false;\n }\n\n $cm = get_coursemodule_from_instance('lightboxgallery', $gallery->id);\n $context = get_context_instance(CONTEXT_MODULE, $cm->id);\n // Files.\n $fs = get_file_storage();\n $fs->delete_area_files($context->id, 'mod_lightboxgallery');\n\n // Delete all the records and fields.\n $DB->delete_records('lightboxgallery_comments', array('gallery' => $gallery->id) );\n $DB->delete_records('lightboxgallery_image_meta', array('gallery' => $gallery->id));\n\n // Delete the instance itself.\n $DB->delete_records('lightboxgallery', array('id' => $id));\n\n return true;\n}", "public function destroy();", "public function destroy();", "public function destroy();", "public function destroy();", "public function destroy();", "public function destroy();", "public function destroy();", "public function clearModules();", "public function del()\n {\n }", "static function delete($id) {\n $extension = new self($id);\n\n foreach ($extension->versions as $version)\n Version::delete($version->id);\n\n parent::destroy(get_class(), $id);\n\n\t\t\tif (module_enabled(\"cacher\"))\n\t\t\t Modules::$instances[\"cacher\"]->regenerate();\n }", "function actiondeleteApiModule($id) {\n $this->isLogin();\n $Api_moduleObj = new ApiModule();\n $Api_moduleObj->deleteModule($id);\n\t\tYii::app()->user->setFlash('success', \"Module deleted successfully.\");\n header('location:' . Yii::app()->params->base_path . 'admin/apiModules');\n\t\texit;\n }", "public function destroy()\r\n {\r\n //\r\n }", "public function test_delete() {\n global $DB;\n\n $startcount = $DB->count_records('course_modules');\n\n // Delete the course module.\n course_delete_module($this->quiz->cmid);\n\n // Now, run the course module deletion adhoc task.\n phpunit_util::run_all_adhoc_tasks();\n\n // Try purging.\n $recyclebin = new \\tool_recyclebin\\course_bin($this->course->id);\n foreach ($recyclebin->get_items() as $item) {\n $recyclebin->delete_item($item);\n }\n\n // Item was deleted, so no course module was restored.\n $this->assertEquals($startcount - 1, $DB->count_records('course_modules'));\n $this->assertEquals(0, count($recyclebin->get_items()));\n }", "public static function delete_module_instance_data($cm) {\n global $DB;\n $where = 'courseid=? AND coursemoduleid=?';\n $wherearray = array($cm->course, $cm->id);\n\n $course = get_course($cm->course);\n $year = year_tables::get_year_for_tables($course);\n $occurstable = year_tables::get_occurs_table($year);\n $docstable = year_tables::get_docs_table($year);\n\n $DB->delete_records_select($occurstable,\n 'documentid IN (SELECT id FROM {' . $docstable . '} WHERE ' .\n $where . ')', $wherearray);\n $DB->delete_records_select($docstable, $where, $wherearray);\n\n // If this course is currently being transferred to the year-table\n // system, delete in both places in case this data was already\n // transferred.\n if (!$year && year_tables::currently_transferring_course($cm->course)) {\n $newyear = year_tables::get_year_for_course($course);\n $occurstable = year_tables::get_occurs_table($newyear);\n $docstable = year_tables::get_docs_table($newyear);\n $DB->delete_records_select($occurstable,\n 'documentid IN (SELECT id FROM {' . $docstable . '} WHERE ' .\n $where . ')', $wherearray);\n $DB->delete_records_select($docstable,\n $where, $wherearray);\n }\n }", "public function destroy()\n {\n }", "public function destroy()\n {\n }", "public function destroy()\n {\n }", "public function destroy()\n {\n }", "public function destroy()\n {\n }", "public function destroy()\n {\n }", "public function destroy()\n {\n }", "public function destroy()\n {\n }", "public function destroy()\n {\n }", "public function destroy()\n {\n }", "public function destroy()\n {\n }", "public function destroy()\n {\n }", "public function destroy()\n {\n }" ]
[ "0.7814754", "0.6837193", "0.67195964", "0.67052346", "0.6534743", "0.64828265", "0.6474073", "0.6434482", "0.6384914", "0.63619775", "0.62160087", "0.62013626", "0.61906046", "0.6177961", "0.61707413", "0.6148435", "0.6123266", "0.6102615", "0.6097067", "0.60796523", "0.6064667", "0.6064667", "0.60640246", "0.60615844", "0.60498774", "0.60498774", "0.60498774", "0.60498774", "0.60498774", "0.60498774", "0.60498774", "0.60498774", "0.60498774", "0.60498774", "0.60498774", "0.60498774", "0.60498774", "0.60498774", "0.60498774", "0.6019079", "0.60088944", "0.5979921", "0.59734917", "0.59729147", "0.59729147", "0.59729147", "0.59729147", "0.59729147", "0.59713775", "0.5970882", "0.5954036", "0.59506226", "0.594413", "0.59420604", "0.5940926", "0.5925213", "0.59070474", "0.58981276", "0.58959544", "0.58704627", "0.5868437", "0.58671546", "0.58667797", "0.58582926", "0.58553284", "0.58553284", "0.58553284", "0.58553284", "0.58553284", "0.58553284", "0.58553284", "0.58553284", "0.5847066", "0.58442765", "0.58442754", "0.58442754", "0.58442754", "0.58442754", "0.58442754", "0.58442754", "0.58442754", "0.58433574", "0.58396745", "0.5839248", "0.58375204", "0.58331805", "0.58155084", "0.581078", "0.57993186", "0.57993186", "0.57993186", "0.57993186", "0.57993186", "0.57993186", "0.57993186", "0.57993186", "0.57993186", "0.57993186", "0.57993186", "0.57993186", "0.57993186" ]
0.0
-1
setting exists, dont change value
public function setupSetting($code, $value, $extra = null) { if (Setting::isCodeExists($code)) { return true; } else { // setting not exists, create one $setting = new Setting; $setting->code = $code; $setting->value = $value; $setting->datatype = (!empty($extra) && !empty($extra['datatype'])) ? $extra['datatype'] : 'string'; $setting->datatype_value = (!empty($extra) && !empty($extra['datatype_value'])) ? $extra['datatype_value'] : ''; $setting->note = (!empty($extra) && !empty($extra['note'])) ? $extra['note'] : ''; return $setting->save(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setIfNot($name, $value) {\n\t\tif ($this->_settings->exists($name)) {\n\t\t\treturn ;\n\t\t} # if\n\t\t\n\t\t$this->_settings->set($name,$value);\n\t}", "public function setExists($value);", "public function hasSetting( $name );", "public function isSetValueActive() {}", "function is_set($item,$alter=false){\n\treturn isset($item)?$item:$alter;\n}", "function is_set($item,$alter=false){\n\treturn isset($item)?$item:$alter;\n}", "function can_be_manually_set() {\n return true;\n }", "protected function backupExistsProperty()\n {\n $this->backup_exists = $this->exists;\n }", "function __set($name , $value )\r\n {\r\n \tif (key_exists($name, $this->definicionCampos))\r\n \t{\r\n \t $this->campos[$name] = $value;\r\n \t return true;\r\n \t}\r\n \treturn false;\r\n \t\r\n }", "static function set($key, $value){\n \n if (!array_key_exists($key, self::$dades)) //array_key_exists comprueba si existe\n { \n self::$dades[$key] = $value; \n return true; //si existe le pasamos true\n \n }else\n { \n return false; //si existe le pasamos false \n } \n \n }", "function has_setting($name)\n {\n }", "private function set_to_be_updated()\n {\n if ( !$this->presence_in_db ){\n $this->to_be_updated = true;\n return;\n }\n $orig_db_check = ($this->value === $this->new_value) ? false : true;\n\n $wle_definition = $this->get_wpconfig_by_name();\n $pattern = $this->build_wle_pattern_by_name();\n\n preg_match($pattern, $wle_definition, $matches);\n\n if ( !$orig_db_check && !empty($matches[1]) ) {\n $this->to_be_updated = ($this->value === $matches[1]) ? false : true;\n }\n else {\n $this->to_be_updated = $orig_db_check;\n }\n }", "public function setUnique($val){ $this->field_map['is_unique'] = (bool)$val; }", "public function isSetValue()\n {\n return !is_null($this->_fields['Value']['FieldValue']);\n }", "function cspm_setting_exists($key, $array, $default = ''){\r\n\t\t\t\r\n\t\t\t$array_value = isset($array[$key]) ? $array[$key] : $default;\r\n\t\t\t\r\n\t\t\t$setting_value = empty($array_value) ? $default : $array_value;\r\n\t\t\t\r\n\t\t\treturn $setting_value;\r\n\t\t\t\r\n\t\t}", "public function __set($name, $value)\n {\n return false;\n }", "function _set($key,$value){\n switch($key){\n case 'value': case 'val': $this->set($value); return TRUE;\n case 'settings': $this->set_settings($value); return TRUE;\n case 'key': $this->set_key($value); return TRUE;\n }\n return FALSE;\n }", "public function hasValue(){\n return $this->_has(2);\n }", "public function hasValue(){\n return $this->_has(2);\n }", "public function hasValue(){\n return $this->_has(2);\n }", "public function hasValue(){\n return $this->_has(2);\n }", "public function hasValue(){\n return $this->_has(2);\n }", "public function hasValue(){\n return $this->_has(2);\n }", "public function hasValue(){\n return $this->_has(2);\n }", "public function hasValue(){\n return $this->_has(2);\n }", "public function hasValue(){\n return $this->_has(2);\n }", "public function hasValue(){\n return $this->_has(2);\n }", "static function is_set($src, $key){\n\t\tif(isset($src[$key]) || array_key_exists($key, $src)){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function is_set($key){\n\t\treturn isset($this->data[$key]);\n\t}", "function __get($value) {\n return false;\n }", "function acf_has_setting($name = '')\n{\n}", "function is_set($variabel_cek) {\n\t if(isset($_SESSION[$variabel_cek]) && !empty($_SESSION[$variabel_cek])){return $_SESSION[$variabel_cek];}\n\t\telse {return false;}\n\t}", "protected function setErrorsExist() {}", "function __set($var, $val){\n\t\tif($var == 'primary_key'){\n\t\t\t$this->primary_key = $val;\n\t\t}\n\n\t\tif($this->check_fields){\n\t\t\tif(in_array($var, $this->fields)){\n\t\t\t\t$this->data[$var] = $val;\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\t$this->data[$var] = $val;\n\t\t\treturn true;\n\t\t}\n\t}", "public function onBeforeSave()\n\t{\n\t\tif ($this->id == NULL && ee('Model')->get('hop_new_relic:Hnp_settings')->filter('name', $this->name)->count() != 0)\n\t\t{\n\t\t\tthrow new \\Exception('Hnp_settings cannot be saved, a setting with that name already exists.');\n\t\t}\n\t}", "public function testGetAndSetSetting()\n {\n $this->assertEquals(0, $this->fixture->getSetting('foo'));\n\n $this->fixture->setSetting('foo', 'bar');\n\n $this->assertEquals('bar', $this->fixture->getSetting('foo'));\n }", "public function set_site_setting($setting, $value, $use_long = false, $pushToDb = true)\n {\n if (isset($this->configuration_data[$setting]) && $this->configuration_data[$setting] === $value) {\n //it's already set to the exact same thing, no need to re-set it.\n return true;\n }\n if ($value === false || $value === null) {\n //null not allowed, so if null, assume false is meant.\n if ($pushToDb) {\n $sql = 'DELETE FROM ' . geoTables::site_settings_table . ' WHERE `setting` = ? LIMIT 1';\n $result = $this->Execute($sql, array($setting));\n if (!$result) {\n //don't need to show error message, the wrapper does that for us.\n //trigger_error('ERROR SQL: Query: '.$sql_query.' ERROR: '.$this->db->ErrorMsg());\n return false;\n }\n if ($use_long) {\n //also delete from the long table\n $sql = 'DELETE FROM ' . geoTables::site_settings_long_table . ' WHERE `setting` = ? LIMIT 1';\n $result = $this->Execute($sql, array($setting));\n if (!$result) {\n trigger_error('ERROR SQL: Error deleting long setting ' . $setting . ' - Query: ' . $sql\n . ' ERROR: ' . $this->db->ErrorMsg());\n return false;\n }\n }\n }\n $this->configuration_data[$setting] = false;\n //if the setting exists in the old table, set it to 0 in that old table as well, just to be safe.\n if ($pushToDb) {\n $this->init_old_config_columns();\n if (in_array($setting, $this->old_config_columns)) {\n $sql = 'UPDATE ' . geoTables::site_configuration_table . ' SET `' . $setting . '` = 0 LIMIT 1';\n $result = $this->Execute($sql);\n if (!$result) {\n return false;\n }\n geoCacheSetting::expire('configuration_data');\n }\n //clear normal cache, whether it's long or not, since long could be in\n //normal cache\n geoCacheSetting::expire('site_settings');\n if ($use_long) {\n //clear cache specific to long setting\n geoCacheSetting::expire('site_settings_long_' . $setting);\n }\n }\n return true;\n }\n if (strlen($value) < 255 || !$use_long) {\n $table_to_use = geoTables::site_settings_table;\n //where to delete setting from.\n $table_to_delete_from = geoTables::site_settings_long_table;\n } else {\n $table_to_use = geoTables::site_settings_long_table;\n //where to delete setting from.\n $table_to_delete_from = geoTables::site_settings_table;\n }\n if ($pushToDb) {\n trigger_error('DEBUG STATS_EXTRA: DataAccess::set_site_setting() - Setting ' . $setting . ' to ' . $value\n . ' in table ' . $table_to_use);\n $sql = 'REPLACE INTO ' . $table_to_use . ' SET `setting` = ?, `value` = ?';\n $result = $this->Execute($sql, array($setting, $value));\n if (!$result) {\n trigger_error('ERROR STATS_EXTRA SQL: DataAccess::set_site_setting() - Setting ' . $setting\n . ' query failed! Setting not set!');\n return false;\n }\n if ($use_long) {\n //delete the other setting just in case it was set already.\n trigger_error('DEBUG STATS_EXTRA: DataAccess::set_site_setting() - use_long so deleting ' . $setting\n . ' from other table ' . $table_to_delete_from);\n $sql = 'DELETE FROM ' . $table_to_delete_from . ' WHERE `setting` = ? LIMIT 1';\n $result = $this->Execute($sql, array($setting));\n if (!$result) {\n return false;\n }\n }\n }\n\n $this->configuration_data[$setting] = $value;\n if ($pushToDb) {\n //clear normal cache, whether it's long or not, since long could be in\n //normal cache\n geoCacheSetting::expire('site_settings');\n if ($use_long) {\n //clear cache specific to long setting\n geoCacheSetting::expire('site_settings_long_' . $setting);\n }\n }\n return true;\n }", "public function setUnique($value = TRUE);", "public function setSettingIfNot(&$pref, $name, $value)\n {\n if (isset($pref[$name])) {\n return;\n } // if\n\n $pref[$name] = $value;\n }", "protected function setNoticesExist() {}", "function wp_is_ini_value_changeable($setting)\n {\n }", "abstract protected function handle_set($name,$value);", "function set($name, $value) {\r\n\t\tif ($this->_send(array('cmd'=>'set', 'name'=>$name, 'value'=>$value)) == 'ok') {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public function has($key){\n return (array_key_exists($key,$this->settings));\n }", "public function __isset($key) {\n return isset(self::$settings[$key]);\n }", "public function __isset(string $name) : bool\n {\n return array_key_exists($name, $this->settings) || in_array($name, $this->current);\n }", "public function set($name, $value) {\n\t\tif (array_key_exists($name, $this->attributes)) {\n\t\t\t// Check that we're not trying to change the guid!\n\t\t\tif ((array_key_exists('guid', $this->attributes)) && ($name == 'guid')) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$this->attributes[$name] = $value;\n\t\t} else {\n\t\t\treturn $this->setPrivateSetting($name, $value);\n\t\t}\n\n\t\treturn true;\n\t}", "private function settings_option($option){\n $models = new Models('settings');\n $where = array(\n 'type' => strval($option['type']),\n 'meta_key' => strval($option['meta_key'])\n );\n $exists = $models->check_row_exists($where);\n if($exists){\n $this->update_settings($models, $option);\n }else{\n $this->insert_settings($models, $option);\n }\n }", "abstract protected function alter_set($name,$value);", "function is_Set($key)\n {\n return isset($this->keyvalList[$key]);\n }", "function is_set($field) {\n\t\treturn isset($this->data[$field]) || isset($this->associations[$field]);\n\n\t}", "public function testSetValue()\n {\n $this->todo('stub');\n }", "function set($key,$val) {\n\t\tif ($this->{$key} !== $val) {\n\t\t\t$this->_modified = true;\n\t\t\t$this->{$key} = $val;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function set($key,$val) {\n\t\tif ($this->{$key} !== $val) {\n\t\t\t$this->_modified = true;\n\t\t\t$this->{$key} = $val;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function write_setting($data) {\n if (in_array('$@ALL@$', $data)) {\n $data = array('$@ALL@$');\n }\n // None never needs to be writted to the DB.\n if (in_array('$@NONE@$', $data)) {\n unset($data[array_search('$@NONE@$', $data)]);\n }\n return parent::write_setting($data);\n }", "abstract protected function handle_isset($name);", "public function setNotPublic($list_id, $value = TRUE) {\n DB::q('\nINSERT INTO !table\n(list_id, not_public)\nVALUES (%list_id, %not_public)\nON DUPLICATE KEY UPDATE\nnot_public = %not_public\n ', array(\n '!table' => $this->table,\n '%not_public' => $value,\n '%list_id' => $list_id,\n ));\n\n return TRUE;\n }", "function update_setting($name, $value)\n {\n }", "public function has($name) {\n\n if(isset($this->settings[$name])) {\n return true;\n }\n\n /** @var Setting $setting */\n if($setting=$this->em->getRepository('CreavoOptionBundle:Setting')->findByName($name)) {\n $this->addToCache($setting);\n return true;\n }\n\n return false;\n }", "public function testSet()\n {\n $object = new \\Webaholicson\\Minimvc\\Core\\Object(['test' => true]);\n $this->assertTrue($object->get('test'));\n $this->assertSame($object, $object->set('test', false));\n $this->assertFalse($object->get('test'));\n $object->set(['node' => ['test' => false]]);\n $this->assertContains(false , $object->get('node'));\n }", "protected final function set($name, $value){\n\t\t\n\t\t//check that vars has been set\n\t\tif(count($this->vars > 0)){\n\t\t\t\n\t\t\t//check if value can be changes\n\t\t\tif((!$this->check_lock($name)) && (!$this->check_hide($name))){\n\t\t\t\t//check the name and value\n\t\t\t\tif($this->chkvals($name,$value)){\n\t\t\t\t\tif(!is_null($this->set_hook)){\n\t\t\t\t\t\t$this->do_callbacks($this->set_hook,$name,$value);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$this->values[$name] = $value;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$this->values[$name] = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse{\n\t\t\t$this->values[$name] = null;\n\t\t}\n\t\t\n\t\t\n\t}", "public function existSetting(string $name): bool\n {\n return Setting::find()->where(['name' => $name])->exists();\n }", "public function set($setting, $value, $fallback = false): int|false {\n if (isset($this->data[$setting]) and $fallback)\n return true;\n\n $this->data[$setting] = $value;\n\n if (class_exists(\"Trigger\"))\n Trigger::current()->call(\"change_setting\", $setting, $value);\n\n return $this->write();\n }", "function __set($name,$value){\r\n try{\r\n return parent::__set($name,$value);\r\n }catch(exception $e){\r\n return $this->_options[$name]=$value;\r\n }\r\n }", "function setProperty($key ='', $value ='') {\r\r\n \r\r\n return ( array_key_exists($key, $this->_timezone) ? ($this->_timezone[$key] = $value) : false );\r\r\n }", "function datalist_set($name, $value) {\n\n\tglobal $CONFIG, $DATALIST_CACHE;\n\n\t$name = trim($name);\n\n\t// cannot store anything longer than 32 characters in db, so catch before we set\n\tif (elgg_strlen($name) > 32) {\n\t\telgg_log(\"The name length for configuration variables cannot be greater than 32\", \"ERROR\");\n\t\treturn false;\n\t}\n\n\t$name = sanitise_string($name);\n\t$value = sanitise_string($value);\n\n\t// If memcache is available then invalidate the cached copy\n\tstatic $datalist_memcache;\n\tif ((!$datalist_memcache) && (is_memcache_available())) {\n\t\t$datalist_memcache = new ElggMemcache('datalist_memcache');\n\t}\n\n\tif ($datalist_memcache) {\n\t\t$datalist_memcache->delete($name);\n\t}\n\n\tinsert_data(\"INSERT into {$CONFIG->dbprefix}datalists set name = '{$name}', value = '{$value}' ON DUPLICATE KEY UPDATE value='{$value}'\");\n\n\t$DATALIST_CACHE[$name] = $value;\n\n\treturn true;\n}", "public function __isset($name)\r\n {\r\n return isset($this->_values[$name]);\r\n }", "public function __set( $name, $value )\n\t{\n\t\tif( property_exists( $this, $name ) ) :\n\t\t\t$this -> $name = $value;\n\t\telse :\n\t\t\treturn false;\n\t\tendif;\n\t}", "public function onSave()\n\t{\n\t\t$value = $this->getValue();\n\t\tif(!empty( $value ))\n\t\t{\n\t\t\treturn $this->getLookupTable()->set(\n\t\t\t\t $this->getValue(),\n\t\t\t\t $this->getValueObject()->getKey()\n\t\t\t ) > 0;\n\t\t}\n\t\treturn false;\n\t}", "abstract protected function getSetting() ;", "function OPTIONAL_SETTING($name, $value) {\r\n define($name, $value, true);\r\n}", "function is_set($variable, $value = '') {\n return isset($variable)?$variable:$value;\n}", "public function __set($var,$val){\n\t\tif(!isset($this->$var))\n\t\t\treturn false;\n\t\t$this->$var=$val;\n\t\treturn true;\n\t}", "public function set_stupidly_fast($set = \\false)\n {\n }", "function system_flag_set ($flag_name, $flag_value)\n\t{\n\t\t$flag_exists = mysqli_isrow ($GLOBALS[\"tables\"][\"flag\"], \"`name` = '\".$flag_name.\"'\");\n\n\t\tif ($flag_exists[\"data\"])\n\t\t{\n\t\t\t$inserted = mysqli_setfield ($GLOBALS[\"tables\"][\"flag\"], \"value\", $flag_value, \"`name` = '\".$flag_name.\"'\");\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$flag[\"name\"] = $flag_name;\n\t\t\t$flag[\"value\"] = $flag_value;\n\t\t\t\n\t\t\t$inserted = mysqli_setrow ($GLOBALS[\"tables\"][\"flag\"], $flag);\n\t\t}\n\t\t\n\t\treturn $inserted[\"success\"];\n\t}", "public function set($propiedad,$valor)\n\t{\t\n\t\tif(in_array($propiedad,$this->noPermitirSetVar))\n\t\t{\treturn \tfalse;\t}\n\t\tif(property_exists(__CLASS__,$propiedad))\n\t\t{\t$this->$propiedad\t= $valor;\n\t\t\treturn true;\n\t\t}\n\t\telse \n\t\t{\t//echo \"El Atributo \".$propiedad.\" no existe.\";\n\t\t\treturn false;\n\t\t}\n\t}", "public function hasValue() {\n return $this->_has(2);\n }", "public function hasValue() {\n return $this->_has(2);\n }", "public function hasValue() {\n return $this->_has(2);\n }", "public function testSetNotExistent()\n {\n $this->container->set('notExistent', 'created');\n $this->assertEquals('created', $this->container->get('notExistent'));\n }", "public function check_setting()\n\t{\n\t\tif ($this->db->count_all('setting') == 0) {\n\t\t\t$this->db->insert('setting',[\n\t\t\t\t'title' => 'bdtask Treading System',\n\t\t\t\t'description' => '123/A, Street, State-12345, Demo',\n\t\t\t\t'time_zone' => 'Asia/Dhaka',\n\t\t\t\t'footer_text' => '2018&copy;Copyright',\n\t\t\t]);\n\n\t\t}\n\n\t}", "function __set($key,$val){\n if($this->_set($key,$val)==TRUE) return $this->_ok();\n return $this->_err(array(2,$key));\n }", "public function set($key, $value = null): bool;", "function __set($name,$value){\n try{\n return parent::__set($name,$value);\n }catch(exception $e){\n return $this->_options[$name]=$value;\n }\n }", "function has_value($value){\r\n\t\treturn isset($value) && $value !==\"\";\r\n\t}", "protected function setWarningsExist() {}", "public function check() {\n\t\t$values = array($this->value);\n\t\tif ($this->value == 'On') {\n\t\t\t$values[] = '1';\n\t\t}\n\t\telseif ($this->value == 'Off') {\n\t\t\t// TODO check it, empty is default value\n\t\t\t$values[] = '';\n\t\t\t$values[] = '0';\n\t\t}\n\t\tif (!in_array(ini_get($this->name), $values)) {\n\t\t\t$this->log('Setting '.$this->name.'='.ini_get($this->name).'. \"'.$this->value.'\" is required', Project::MSG_ERR);\n\t\t\treturn 1;\n\t\t}\n\t\t\n\t\t$this->log('Setting '.$this->name.' is passed', Project::MSG_VERBOSE);\n\t\treturn 0;\n\t}", "static private function __isset($name) {}", "public function set(string $key, $value) : bool;", "public function settingExists($key) {\n return isset($this->options[$key]);\n }", "function set($name, $value, $site_guid = 0) {\n\n\n\t\t$name = trim($name);\n\n\t\t// cannot store anything longer than 255 characters in db, so catch before we set\n\t\tif (elgg_strlen($name) > 255) {\n\t\t\t_elgg_services()->logger->error(\"The name length for configuration variables cannot be greater than 255\");\n\t\t\treturn false;\n\t\t}\n\n\t\t$site_guid = (int) $site_guid;\n\t\tif ($site_guid == 0) {\n\t\t\t$site_guid = (int) $this->CONFIG->site_guid;\n\t\t}\n\n\t\tif ($site_guid == $this->CONFIG->site_guid) {\n\t\t\t$this->CONFIG->$name = $value;\n\t\t}\n\n\t\t$escaped_name = sanitize_string($name);\n\t\t$escaped_value = sanitize_string(serialize($value));\n\t\t$result = _elgg_services()->db->insertData(\"INSERT INTO {$this->CONFIG->dbprefix}config\n\t\t\tSET name = '$escaped_name', value = '$escaped_value', site_guid = $site_guid\n\t\t\tON DUPLICATE KEY UPDATE value = '$escaped_value'\");\n\n\t\treturn $result !== false;\n\t}", "function set_or_empty($a)\n{\n\tif (isset($a)) {\n\t\techo \"Variable is set\" . PHP_EOL;\n\t} else {\n\t\techo \"Variable is empty\" . PHP_EOL;\n\t}\n\treturn;\n}", "protected function _setting_handle() {}", "private function evalexists($value, $data){\n\n\t\t\treturn (bool) $passed = (array_key_exists($value, $data)) ? true : false;\n\t\t}", "protected function doSet($value)\n {\n }", "abstract protected function tryWriteOption($name, $value);", "public function useSetting()\n\t{\n\t\treturn count($this->settingConfig()) ? true : false;\n\t}", "public function canSetProperty($key) {\r\n if(parent::canSetProperty($key)) return true;\r\n $owner=$this->getOwner();\r\n if($owner->getScenario()==='search') {\r\n return($owner->isAttributeSafe($key));\r\n }\r\n return false;\r\n }", "function __isset($name) {\n\t\treturn array_key_exists($name,$this->object);\n\t}", "function Set($var='', $val='') {\n\t\tif ($var == '') return false;\n\t\t$this->_ExternalVars[$var] = $val;\n\t\treturn true;\n\t}", "function ini_safe_set($key, $value) {\n\t// some hosts disable ini_set for security \n\t// lets check so see if its disabled\n\tif(($disable_functions = ini_get('disable_functions')) !== false) {\n\t\t// if it is disabled then return as there is nothing we can do\n\t\tif(strpos($disable_functions, 'ini_set') !== false) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// lets set it because we can!\n\treturn ini_set($key, $value);\n}" ]
[ "0.72373164", "0.70985776", "0.660392", "0.64099544", "0.61747205", "0.61747205", "0.6156768", "0.61430186", "0.60997677", "0.6073855", "0.6027854", "0.5948574", "0.59286803", "0.58531713", "0.57995754", "0.5785957", "0.5756537", "0.573742", "0.573742", "0.573742", "0.573742", "0.573742", "0.573742", "0.573742", "0.573742", "0.573742", "0.573742", "0.5719889", "0.570772", "0.5693566", "0.56932914", "0.5689935", "0.5688732", "0.56805843", "0.56759834", "0.56750315", "0.5674488", "0.5672405", "0.566346", "0.56594205", "0.5650049", "0.5640635", "0.56381756", "0.56249297", "0.5600836", "0.55968004", "0.55777127", "0.5574682", "0.5565542", "0.55620855", "0.5542803", "0.5537593", "0.55336165", "0.55336165", "0.55316275", "0.5521875", "0.5513489", "0.5508603", "0.5489381", "0.5483754", "0.54833263", "0.5482592", "0.5480712", "0.5477665", "0.54670835", "0.5455071", "0.5453948", "0.5453051", "0.54521024", "0.54516065", "0.5450697", "0.5448428", "0.5446754", "0.54416615", "0.54349005", "0.5421189", "0.54193395", "0.54193395", "0.54193395", "0.5414371", "0.54129475", "0.5411607", "0.5409863", "0.53905183", "0.5389661", "0.538737", "0.5386678", "0.53862727", "0.53826267", "0.5379253", "0.53774834", "0.5375145", "0.53720486", "0.53711677", "0.5366849", "0.53613675", "0.5361253", "0.53590673", "0.5356393", "0.5337193", "0.5333461" ]
0.0
-1
Execute batch process finished.
public static function finishedImport($success, array $results, array $operations) { drupal_set_message(t('Import completed!')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function batchExecute() {\n\n }", "public function afterBatch();", "protected function complete() {\n\t\t\tparent::complete();\n\n\t\t\tastra_sites_error_log( esc_html__( 'All processes are complete', 'astra-sites' ) );\n\t\t\tupdate_site_option( 'astra-sites-batch-status-string', 'All processes are complete', 'no' );\n\t\t\tdelete_site_option( 'astra-sites-batch-status' );\n\t\t\tupdate_site_option( 'astra-sites-batch-is-complete', 'yes', 'no' );\n\n\t\t\tdo_action( 'astra_sites_site_import_batch_complete' );\n\t\t}", "function executionDone() {\n\tif($err = @error_get_last()) {\n\t\tswitch($err['type']) {\n\t\t\tdefault:\n\t\t\t\tstopForError($err['message'], $err['type'], $err['file'], $err['line']);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\tif(class_exists('Locker')) {\n\t\tLocker::releaseAll();\n\t}\n}", "function completeBatchProcessing($success, $results, $operations) {\n\n if ($results['ocrError'] == 1) {\n /*\n * Remove the temporary directory here\n * as it will not now be done in the\n * attachOcrDatastream function.\n */\n $execCommand = 'rm -rf ' . $results['tmpDirPath'];\n passthru($execCommand, $returnValue);\n drupal_set_message($results['ocrMsg']);\n } else {\n attachOcrDatastream($results['pid'],$results['tmpDirPath'], $results['concatOutputFilePath'], $results['ocrMsg']);\n }\n $context['finished'] = 1;\n }", "public function finishJob()\r\n {\r\n $this->done = true;\r\n }", "public function execute()\n {\n foreach ($this->queue->pull(1000) as $message) {\n $this->process($message)->delete();\n }\n }", "protected function finish() {}", "protected abstract function executeProcess();", "public function flushBatch()\n\t{\n\t\tif ($this->batching)\n\t\t{\n\t\t\t$this->batching = FALSE;\n\t\t\t\n\t\t\t$this->statpro->endBatch();\n\t\t}\n\t}", "public function endProcess() {\n if ($this->previousErrorHandler) {\n set_error_handler($this->previousErrorHandler);\n $this->previousErrorHandler = NULL;\n }\n if ($this->processing) {\n $this->status = MigrationBase::STATUS_IDLE;\n $fields = array('class_name' => get_class($this), 'status' => MigrationBase::STATUS_IDLE);\n db_merge('migrate_status')\n ->key(array('machine_name' => $this->machineName))\n ->fields($fields)\n ->execute();\n\n // Complete the log record\n if ($this->logHistory) {\n db_merge('migrate_log')\n ->key(array('mlid' => $this->logID))\n ->fields(array(\n 'endtime' => microtime(TRUE) * 1000,\n 'finalhighwater' => $this->getHighwater(),\n 'numprocessed' => $this->total_processed,\n ))\n ->execute();\n }\n\n $this->processing = FALSE;\n }\n self::$currentMigration = NULL;\n }", "function allChildProcessComplete(){\n print \"All child processing completed \\n\";\n}", "public function onFinish() {\n\t\t$this->onResponse->executeAll(false);\n\t\tparent::onFinish();\n\t}", "public function extProc_finish() {}", "public function extProc_finish() {}", "public function execute()\n\t{\n\t\t$id = 0;\n\n\t\tif((int)$this->sleep_milliseconds < 100)\n\t\t{\n\t\t\t$this->sleep_milliseconds = 100; // must be > 100\n\t\t}\n\n\t\tif(!empty($this->error_log_path)) // init error log file\n\t\t{\n\t\t\t@file_put_contents($this->error_log_path, null); // truncate\n\t\t}\n\n\t\twhile(true)\n\t\t{\n\t\t\twhile($id < count($this->__commands) && $this->__proc_running < $this->max_processes)\n\t\t\t{\n\t\t\t\tif($this->debug_mode)\n\t\t\t\t{\n\t\t\t\t\t$this->out('Executing command: ' . $this->__commands[$id]);\n\t\t\t\t}\n\n\t\t\t\t// enqueue process\n\t\t\t\t$this->__processes[] = new Process($this->__commands[$id],\n\t\t\t\t\t( isset($this->__commands_max_time[$id]) ? $this->__commands_max_time[$id] : 0 ),\n\t\t\t\t\t$this->error_log_path);\n\n\t\t\t\t$this->__proc_running++;\n\n\t\t\t\t$id++; // next command\n\t\t\t}\n\n\t\t\tif($id >= count($this->__commands) && $this->__proc_running === 0) // finished running\n\t\t\t{\n\t\t\t\tbreak; // stop\n\t\t\t}\n\n\t\t\tusleep($this->sleep_milliseconds * 1000);\n\n\t\t\tforeach($this->__processes as $pid => $proc) // cleanup completed processes\n\t\t\t{\n\t\t\t\t$is_dequeue = false;\n\n\t\t\t\tif($proc->isExpired()) // kill\n\t\t\t\t{\n\t\t\t\t\t$proc->close();\n\t\t\t\t\t$is_dequeue = true;\n\n\t\t\t\t\tif($this->debug_mode)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->out('Killed: ' . $proc->command);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(!$proc->isRunning()) // finished\n\t\t\t\t{\n\t\t\t\t\tif($this->verbose)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->out(stream_get_contents($proc->pipes[1])); // proc output\n\n\t\t\t\t\t\tif(!empty($proc->pipes[2])) // error check (pipe, not file)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$err = stream_get_contents($proc->pipes[2]);\n\n\t\t\t\t\t\t\tif(strlen($err) > 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$this->out($err);\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$proc->close();\n\t\t\t\t\t$is_dequeue = true;\n\n\t\t\t\t\tif($this->debug_mode)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->out('Done: ' . $proc->command);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif($is_dequeue)\n\t\t\t\t{\n\t\t\t\t\tunset($this->__processes[$pid]); // dequeue\n\t\t\t\t\t$this->__proc_running--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected function end_bulk_operation(){\n\t\twpcom_vip_end_bulk_operation();\n\t}", "public function finish() {}", "public function finish() {}", "public function finish() {}", "public function finish() {}", "public function finish() {}", "public function finish() {}", "public function finish() {}", "public function finish() {}", "public function finished()\n {\n }", "public function completed() {\n\t}", "function batch_callback_process_finished($success, $results, $operations) {\n if ($success) {\n // Here we could do something meaningful with the results.\n // We just display the number of nodes we processed...\n drupal_set_message(t('@count results', array('@count' => count($results))));\n // drupal_set_message(t('The final result was \"%final\"', array('%final' => end($results))));\n }\n else {\n // An error occurred.\n // $operations contains the operations that remained unprocessed.\n $error_operation = reset($operations);\n drupal_set_message(t('An error occurred while processing @operation with arguments : @args', array('@operation' => $error_operation[0], '@args' => print_r($error_operation[0], TRUE))));\n }\n\n}", "public function chunkCompleted()\n {\n $import = mw('Microweber\\Utils\\Import')->batch_save($this->content_items);\n $this->content_items = array();\n\n return true;\n }", "public function execute()\n {\n $this->_productOfferExportQueueHandler->execute();\n }", "protected function end_bulk_operation() {\n\t\t\n\t\t// This will also trigger a term count.\n\t\twp_defer_term_counting( false );\n\t}", "protected function iterationComplete() { if(!$this->resultFreed) {\n try {\n $this->db->free_result($this->result);\n $this->resultFreed = true;\n } catch(Exception $ex) {}\n }\n }", "public function execute() {\n GatewayFactory::getInstance()->startTransaction(true);\n $itemsGtw = GatewayFactory::getInstance()->getItemsGateway();\n $item = $itemsGtw->findItem($this->itemId);\n $item->removeItem();\n GatewayFactory::getInstance()->commit();\n $this->result = null;\n $this->status = IApiOutputter::HTTP_OK;\n }", "private function execute () {\n if($this->_query->execute()) {\n\n // It has been succesful so add the output to $this->results and set it as an object\n $this->_results = $this->_query->fetchAll(PDO::FETCH_OBJ);\n\n // Set the affected row count to $this->_count\n $this->_count = $this->_query->rowCount();\n\n } else {\n\n // The query failed so set $this->_error to true. MORE WORK NEEDED HERE\n $this->_error = true;\n\n }\n }", "protected function afterProcess() {\n }", "public abstract function afterExec();", "protected function end_bulk_operation() {\n\t\t// This will also trigger a term count.\n\t\twp_defer_term_counting( false );\n\t}", "public function ExecuteStep()\n {\n if ($this->ProcessStep()) {\n $this->ProcessStepSuccessHook();\n $oBasket = TShopBasket::GetInstance();\n $oBasket->aCompletedOrderStepList[$this->fieldSystemname] = true;\n $oNextStep = $this->GetNextStep();\n $this->JumpToStep($oNextStep);\n }\n }", "public function end()\n\t{\n\t\t$this->set_process_state(false);\n\t}", "public function finish()\n\t{\n\t\t\n\t}", "public function progressFinish() {}", "public function execute()\n\t{\n\t\t$this->run();\n\t}", "public function execute()\n {\n foreach ($this->commands as $command) {\n $command->execute();\n }\n }", "public function execute() {\n\t\t\t$connection = \\Leap\\Core\\DB\\Connection\\Pool::instance()->get_connection($this->data_source);\n\t\t\tif ($this->before !== NULL) {\n\t\t\t\tcall_user_func_array($this->before, array($connection));\n\t\t\t}\n\t\t\t$connection->execute($this->command());\n\t\t\tif ($this->after !== NULL) {\n\t\t\t\tcall_user_func_array($this->after, array($connection));\n\t\t\t}\n\t\t}", "public function finish() {\r\n\t}", "public function processFinished($process, $outputs = array())\n {\n $this->decision = $outputs['publish'];\n }", "public function process()\n {\n $this->send_status();\n $this->send_headers();\n $this->send_content();\n exit(0);\n }", "public function execute()\n {\n $this->run();\n }", "protected function execute()\n {\n // Clean the utilistion index.\n DUtilisationRecord::cleanDatabase();\n // Determine objects that are searchable.\n $models = DModel::search()\n ->removeDefaultFilters();\n // Track progress of task execution.\n $totalObjects = $models->getCount();\n $currentObject = 0;\n foreach ($models as $model) {\n /* @var $model DModel */\n try {\n $event = new DOnSave();\n $event->setFieldValue('dispatcher', $model);\n DUtilisationRecord::index($event);\n $model->free();\n // Catch and report any exception to allow processing to continue.\n } catch (Exception $exception) {\n DErrorHandler::logException($exception);\n }\n // Update progress of task execution.\n ++$currentObject;\n $this->updateProgress($currentObject, $totalObjects);\n }\n }", "public function execute()\n\t{\n\t\t$this->executeCall();\n\t\t$this->executeReminder();\n\t}", "public function execute()\n {\n try {\n $currentStore = $this->storeManager->getStore()->getId();\n $currentPage = 1;\n do {\n $vippsQuoteCollection = $this->createCollection($currentPage);\n $this->logger->debug('Fetched payment details');\n /** @var VippsQuote $vippsQuote */\n foreach ($vippsQuoteCollection as $vippsQuote) {\n $this->processQuote($vippsQuote);\n usleep(1000000); //delay for 1 second\n }\n $currentPage++;\n } while ($currentPage <= $vippsQuoteCollection->getLastPageNumber());\n } finally {\n $this->storeManager->setCurrentStore($currentStore);\n }\n }", "public function executeMigrationFinished($success, array $results) {\n if ($success) {\n $message = $this->formatPlural(\n count($results),\n 'One import step processed.',\n '@count import steps processed.'\n );\n $this->messenger->addStatus($message);\n }\n else {\n $message = $this->t('Finished with an error.');\n $this->messenger->addWarning($message);\n }\n\n // Providing data for the redirected page is done through $_SESSION.\n foreach ($results as $result) {\n $message = $this->t('Processed @title.', ['@title' => $result]);\n $this->messenger->addStatus($message);\n }\n }", "public function complete();", "public function complete();", "public function onAllActionsDone(array $results): ExecutionResult;", "public function finish()\n {\n $this->status = 'finished';\n return $this->save();\n }", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function iWaitForTheBatchJobToFinish() {\n $this->getSession()->wait(180000, 'jQuery(\"#updateprogress\").length === 0');\n }", "public function execute()\n\t{\n\n\t\tLog::info('=====================================');\n\t\tLog::info(' Start Daily task Process .');\n\t\tLog::info('-------------------------------------');\n\t\t\n\t\t$this->messages = array();\n\t\t$this->notrainers = array();\n\t\t$this->repeats = array();\n\t\t\n\t\t\n\t\t$this->notrainers = $this->getClassesWithoutTrainer();\n\t\t\n\t\t$this->repeats = $this->runCourseRepeats();\n\t\t\n\t\t$this->balance = $this->getSmsBalance();\n\t\t\n\t\t$this->cleaning = $this->clearLogFiles();\n\n\t\t$this->messages = $this->sendSmsMessages();\n\n\t\t$this->sendAdminEmail();\n\t\t\n\t\tLog::info('-------------------------------------');\n\t\tLog::info(' End Daily Task Process.');\n\t\tLog::info('=====================================');\n\t\t\n\t\t\n\t}", "public function done()\r\n {\r\n return $this->processor->done($this);\r\n }", "public function finish() {\n\t\tif ($this->isFinished())\n\t\t\treturn;\n\n\t\t$this->workflowActivitySpecification->setState(WorkflowActivityStateEnum::FINISHED);\n\n\t\tif ($this->runtimeContext)\n\t\t\t$this->workflowActivity->onFinish($this->runtimeContext);\n\n\t\tif ($this->onFinish) {\n\t\t\tforeach($this->onFinish as $callback) {\n\t\t\t\t$callback($this);\n\t\t\t}\n\t\t}\n\t}", "public function end() {}", "public function end() {}", "public function end() {}", "public function finishAction()\n\t{\n\t\tif ($this->isExportCompleted && !$this->isCloudAvailable)\n\t\t{\n\t\t\t// adjust completed local file size\n\t\t\t$this->fileSize = $this->getSizeTempFile();\n\t\t}\n\n\t\t$result = $this->preformAnswer(self::ACTION_FINISH);\n\n\t\t$result['STATUS'] = self::STATUS_COMPLETED;\n\n\t\treturn $result;\n\t}", "public function executeBatch() {\n if (!$this->isBatch) {\n throw new JsonRpcException('Client is not in batch mode, start a batch operation by calling startBatch() first');\n }\n\n if (empty($this->batchRequests)) {\n throw new JsonRpcException('No batch requests are attached. Use call() first');\n }\n\n $batchRequests = $this->batchRequests;\n $this->discardBatch();\n\n return $this->parseBatchResponse($this->performRequest($batchRequests));\n }", "protected function execute() \n {\n /** @var float */\n static $lastCleanUpTime = -999999999;\n\n $incCount = $this->_redis->getIncomingSize();\n if ($incCount > 0) {\n $this->log(\"$incCount elements in queue.\");\n $this->_redis->processMultiple($this->_redis->getIncoming(2000));\n }\n\n if ($this->_upTime() - $lastCleanUpTime > $this->ini['ttl']) {\n $this->_redis->cleanIndexes();\n $lastCleanUpTime = $this->_upTime();\n }\n }", "public function done(){\n\t\t$this->done=true;\n\t}", "public function processAll();", "public function run(){\n $explorers = $this->job_service->getUnfinishedJobs();\n\n // Recorro todos los trabajadores\n foreach ($explorers as $explorer){\n // Compruebo el trabajo pendiente del explorador\n $job = $this->job_service->checkJob($explorer->get('id_job'));\n\n // Si el trabajo ya ha terminado\n if ($job->getStatus()==jobService::STATUS_FINISHED){\n // Le quito el trabajo pendiente al explorador\n $explorer->set('id_job',null);\n $explorer->save();\n\n $job->jobDone();\n }\n }\n }", "public function done()\n {\n $this->setStatus(self::STATUS_DONE);\n }", "public function finish()\n\t{\n\t\t/* @todo this needs to be a queue task */\n\t\tforeach( new \\IPS\\Patterns\\ActiveRecordIterator( \\IPS\\Db::i()->select( '*', 'forums_forums' ), 'IPS\\forums\\Forum' ) AS $forum )\n\t\t{\n\t\t\t$forum->setLastComment();\n\n\t\t\t$forum->queued_topics = \\IPS\\Db::i()->select( 'COUNT(*)', 'forums_topics', array( 'forum_id=? AND approved=0', $forum->id ) )->first();\n\t\t\t$forum->queued_posts = \\IPS\\Db::i()->select( 'COUNT(*)', 'forums_posts', array( 'forums_topics.forum_id=? AND forums_posts.queued=1', $forum->id ) )->join( 'forums_topics', 'forums_topics.tid=forums_posts.topic_id' )->first();\n\t\t\t$forum->save();\n\t\t}\n\t\t\n\t\t/* Content Rebuilds */\n\t\t\\IPS\\Task::queue( 'convert', 'RebuildContent', array( 'app' => $this->app->app_id, 'link' => 'forums_posts', 'class' => 'IPS\\forums\\Topic\\Post' ), 2, array( 'app', 'link', 'class' ) );\n\t\t\\IPS\\Task::queue( 'convert', 'RebuildFirstPostIds', array( 'app' => $this->app->app_id ), 2, array( 'app' ) );\n\t\t\\IPS\\Task::queue( 'convert', 'DeleteEmptyTopics', array( 'app' => $this->app->app_id ), 4, array( 'app' ) );\n\t\t\n\t\treturn \"Search Index Rebuild, Content Rebuild, Content Recount, Member Recount, and Private Message Rebuild tasks started.\";\n\t}", "protected function _completeFlush() {\r\n\r\n }", "public function finish(): int;", "public static function MarkOrderProcessAsCompleted()\n {\n $_SESSION[self::SESSION_KEY_NAME_ORDER_SUCCESS] = true;\n }", "function execute() {\n foreach($this -> queue as $queue) {\n for($written = 0; $written < strlen($queue); $written += $fwrite) {\n $fwrite = fwrite($this -> __sock, substr($queue, $written));\n if($fwrite === false or $fwrite <= 0)\n trigger_error('WRITE ERROR', E_USER_ERROR);\n }\n }\n // Read in the results from the pipelined commands\n $responses = array();\n for($i = 0; $i < count($this -> queue); $i++) {\n $responses[] = $this -> response();\n }\n // Clear the queue and return the response\n $this -> queue = array();\n if($this -> pipelined) {\n $this -> pipelined = false;\n return $responses;\n }\n return $responses[0];\n }", "final public function perform()\n {\n $this->execute($this->args, $this->app);\n }", "protected function doExecute()\n\t{\n\t\t// Your application routines go here.\n\t}", "public function postProcess($results);", "public function process()\n {\n $allChunkFiles = glob($this->directoryPath);\n $now = now()->toDateTimeString();\n\n foreach ($allChunkFiles as $key => $chunkPart) {\n $this->batch->add(new ProcessCsvZones($chunkPart, $now));\n }\n }", "private function executeAfterSave()\n {\n Logger::getInstance()->po_log(\"Excecute after save \". get_class($this));\n\n foreach ( $this->afterSave as $cb ) $cb->execute();\n\n // Una vez que termino de ejecutar, reseteo los cb's registrados.\n $this->afterSave = array();\n }" ]
[ "0.7098277", "0.6487714", "0.647377", "0.6473249", "0.63843215", "0.63262063", "0.63032854", "0.63006854", "0.6289704", "0.6276052", "0.62459606", "0.62407434", "0.6211639", "0.62049615", "0.62048256", "0.6195385", "0.60550874", "0.6043025", "0.60413337", "0.60413337", "0.60413337", "0.60413337", "0.60413337", "0.60412604", "0.60407513", "0.6023221", "0.60207295", "0.6015264", "0.597145", "0.5963786", "0.5915103", "0.59145266", "0.5863605", "0.5854955", "0.58384895", "0.5830899", "0.58265984", "0.5817605", "0.581735", "0.5806289", "0.5801242", "0.5799237", "0.5779664", "0.5744376", "0.573599", "0.5697333", "0.56955975", "0.5691996", "0.56799644", "0.5675057", "0.564627", "0.56363416", "0.559467", "0.559467", "0.5592681", "0.5589892", "0.5571931", "0.5571931", "0.5571931", "0.5571931", "0.5571931", "0.5571931", "0.55718637", "0.55718637", "0.55718637", "0.55718637", "0.55718637", "0.55718637", "0.55718637", "0.55718637", "0.55718637", "0.55718637", "0.55718637", "0.55718637", "0.55718637", "0.5571587", "0.5571587", "0.5555393", "0.5541774", "0.55413675", "0.5527832", "0.5519649", "0.5519649", "0.5519649", "0.55169976", "0.5516881", "0.55162597", "0.55122787", "0.55087274", "0.55050105", "0.55043006", "0.5498813", "0.5498021", "0.54898024", "0.54865366", "0.54853874", "0.547955", "0.5476758", "0.54722834", "0.54702705", "0.5459535" ]
0.0
-1
Checks access for a specific request.
public function access(AccountInterface $account) { return AccessResult::allowed(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function check(Request $request)\n {\n // do we need to check the ip?\n if (false === array_search('ip', $this->app['config']['access'])) {\n // we don't\n } else {\n // we do\n return $this->ipService->checkIpList($this->app['config']['ip_list']);\n }\n\n // do we need to check the token?\n if (false === array_search('token', $this->app['config']['access'])) {\n // we don't\n } else {\n // we do\n return $this->tokenService->checkToken(\n $request->get('token'),\n $request->get('time')\n );\n }\n\n # no access granted\n return false;\n }", "public function checkPermission(App\\Request $request)\n\t{\n\t\t$userPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();\n\t\tif (!$userPrivilegesModel->hasModulePermission($request->getModule())) {\n\t\t\tthrow new \\App\\Exceptions\\NoPermitted('LBL_PERMISSION_DENIED', 406);\n\t\t}\n\t\tif ('updateEvent' === $request->getMode() && ($request->isEmpty('id', true) || !\\App\\Privilege::isPermitted($request->getModule(), 'EditView', $request->getInteger('id')))) {\n\t\t\tthrow new \\App\\Exceptions\\NoPermittedToRecord('ERR_NO_PERMISSIONS_FOR_THE_RECORD', 406);\n\t\t}\n\t}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkPermission(\\App\\Request $request)\n\t{\n\t\t$recordId = $request->getInteger('record');\n\t\tif (!$recordId) {\n\t\t\tthrow new \\App\\Exceptions\\NoPermittedToRecord('ERR_NO_PERMISSIONS_FOR_THE_RECORD', 406);\n\t\t}\n\t\tif (!\\App\\Privilege::isPermitted($request->getModule(), 'DetailView', $recordId)) {\n\t\t\tthrow new \\App\\Exceptions\\NoPermittedToRecord('ERR_NO_PERMISSIONS_FOR_THE_RECORD', 406);\n\t\t}\n\t}", "public function checkAccess()\n {\n // need to be modified for security\n }", "protected function checkAccess(Request $request): bool\n {\n $user = $request->user();\n\n if ($user === null) {\n return true;\n }\n\n return $user->hasAnyAccess($this->permission());\n }", "public function checkPermission(\\App\\Request $request)\n\t{\n\t\t$currentUserPriviligesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();\n\t\tif (!$currentUserPriviligesModel->hasModulePermission($request->getModule())) {\n\t\t\tthrow new \\App\\Exceptions\\NoPermitted('ERR_NOT_ACCESSIBLE', 406);\n\t\t}\n\t}", "public function checkPermission(App\\Request $request)\n\t{\n\t\t$currentUserPriviligesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();\n\t\tif (!$currentUserPriviligesModel->hasModulePermission($request->getModule())) {\n\t\t\tthrow new \\App\\Exceptions\\NoPermitted('LBL_PERMISSION_DENIED', 406);\n\t\t}\n\t}", "public function checkPermission(App\\Request $request)\n\t{\n\t\t$moduleName = $request->getModule();\n\t\t$userPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();\n\t\tif (!$userPrivilegesModel->hasModulePermission($moduleName) || !\\method_exists(Vtiger_Module_Model::getInstance($moduleName), 'getCalendarViewUrl')) {\n\t\t\tthrow new \\App\\Exceptions\\NoPermitted('LBL_PERMISSION_DENIED', 406);\n\t\t}\n\t\tif ('updateEvent' === $request->getMode() && ($request->isEmpty('id', true) || !\\App\\Privilege::isPermitted($moduleName, 'EditView', $request->getInteger('id')))) {\n\t\t\tthrow new \\App\\Exceptions\\NoPermittedToRecord('ERR_NO_PERMISSIONS_FOR_THE_RECORD', 406);\n\t\t}\n\t}", "public function get_item_permissions_check($request)\n {\n }", "public function isRequestAllowed(Request $request);", "public function checkPermission(\\App\\Request $request)\n\t{\n\t\tif (!\\App\\User::getCurrentUserModel()->isAdmin() || !$request->has('record')) {\n\t\t\tthrow new \\App\\Exceptions\\NoPermittedForAdmin('LBL_PERMISSION_DENIED');\n\t\t}\n\t}", "function checkAccess() ;", "public function canAccess($request) {\n if($this->access_level === self::ROOT_LEVEL) {\n return true;\n }\n if(!empty($this->permissions)) {\n if(in_array($request, $this->permissions[$this->access_level], true)) {\n return true;\n }\n }\n return false;\n }", "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 }", "public function checkPermission(App\\Request $request)\n\t{\n\t\tif (!$request->isEmpty('sourceRecord') && !\\App\\Privilege::isPermitted($request->getByType('sourceModule', 2), 'DetailView', $request->getInteger('sourceRecord'))) {\n\t\t\tthrow new \\App\\Exceptions\\NoPermittedToRecord('ERR_NO_PERMISSIONS_FOR_THE_RECORD', 406);\n\t\t}\n\t}", "public function checkAccess()\n {\n // Check token in headers\n if (isset($_SERVER['HTTP_TOKEN'])) {\n return $_SERVER['HTTP_TOKEN'] === Configuration::get('MARMIADS_TOKEN');\n }\n\n // Check token in GET or POST\n return Tools::getValue('token') === Configuration::get('MARMIADS_TOKEN');\n }", "private static function canAccess($request, $address){\n $currentUser_Account = $request->user;\n $user = $address->get_user();\n return ($user != null && $currentUser_Account->getId() === $user->getId()) || User_Precondition::ownerRequired($request);\n }", "protected function validate_request_permission($check)\n {\n }", "public function isAccess();", "public function verifyRequest(Request $request)\n {\n if($request->method() == 'GET') {\n return $this->currentUserCan('fcrm_manage_settings') || $this->currentUserCan('fcrm_manage_contacts');\n }\n\n return $this->currentUserCan('fcrm_manage_settings');\n }", "function isAuthorized($request) {\n return true;\n }", "private function checkAccess(): bool\n {\n echo \"Proxy: Checking access prior to firing a real request.\\n\";\n\n return true;\n }", "protected static function checkAccess(Request $request, $exp_id)\n {\n $access_token = $request->getHeader('HTTP_AUTHORIZATION');\n if (empty($access_token)) {\n throw new AccessForbiddenException(\"Guest can't import.\");\n }\n\n $access = DataApi::get('experiments/'.$exp_id, $access_token[0]);\n if(!$access){\n throw new OperationFailedException(\"Authorization.\");\n }\n if ($access['status'] !== 'ok') {\n throw new AccessForbiddenException('Not authorized.');\n }\n\n return $access_token[0];\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}", "public function checkAccess()\n {\n if (!$this->isAuthenticated()) {\n header('HTTP/1.1 401 Unauthorized');\n exit();\n }\n }", "function check_access() {\n if (!get_site()) {\n return true; // no access check before site is fully set up\n }\n $context = empty($this->context) ? get_context_instance(CONTEXT_SYSTEM) : $this->context;\n foreach($this->req_capability as $cap) {\n if (is_valid_capability($cap) and has_capability($cap, $context)) {\n return true;\n }\n }\n return false;\n }", "public function verifyRequest(Request $request)\n {\n $permission = apply_filters('fluentcrm_permission', 'manage_options', 'lists', 'all');\n\n if (!$permission) {\n return false;\n }\n\n return current_user_can($permission);\n }", "protected function check_4_access(Request $request, Response $response, array &$args)\n {\n return true;\n }", "protected function hasPermission($request) {\n $required = $this->requiredPermission();\n return !$this->forbiddenRoute($request) && $request->user()->can($required);\n }", "public static function Check(Request $request)\n {\n //request must have authorization header with token inside\n\n if(!($request->header('Authorization') == null))\n {\n\n //parse token\n\n $token = (new Parser())->parse((string) $request->header('Authorization')); // Parses from a string\n\n //verify if token is ok and take user_id from token\n\n //Algorithm, secret key\n\n if($token->verify(new Sha256(),\"SDASDA43fSDAgdsaDSA\"))\n {\n //return user id of authenticated user\n return $token->getClaim('uid');\n }\n\n throw new AccessDeniedHttpException;\n }\n throw new AccessDeniedHttpException;\n\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 checkAccess() {\n // if the user is not allowed access to the ACL, then redirect him\n if (!$this->user->isAllowed(ACL_RESOURCE, ACL_PRIVILEGE)) {\n // @todo change redirect to login page\n $this->redirect('Denied:');\n }\n }", "protected function _handleAccess (Zend_Controller_Request_Abstract $request)\n\t{\n\t\t$module = $request->getModuleName();\n\t\tif($module == null) $module = Zend_Controller_Front::getInstance()->getDispatcher()->getDefaultModule();\n\t\t\n\t\t$controller = $request->getControllerName();\n\t\t$action = $request->getActionName();\n\t\t$acl = Zend_Registry::get('Zend_Acl');\n\t\t\n\t\t//Récupération de l'authentification de l'utilisateur\n\t\t$auth = Zend_Auth::getInstance();\n\n\t\tif ($auth->hasIdentity()) {\n\t\t\t$userAuth = $auth->getIdentity();\n\t\t} else {\n\t\t\t//Initialisation avec un Role User correspondant à GUEST (Non connecté)\n\t\t\t$userAuth = new Core_Model_User();\n\t\t\t$userAuth->setUserRole(Core_Model_User::GUEST);\n\t\t}\n\t\t\t\n // action/resource does not exist in ACL -> 404\n if (! $acl->has($module . '::' . $controller . '::' . $action)) {\n\t\t\tthrow new Zend_Controller_Dispatcher_Exception('Erreur page 404');\n\t\t} else if (! $acl->isAllowed($userAuth, $module . '::' . $controller . '::' . $action)) { // resource does exist, check ACL\n\t\t\tthrow new Zend_Acl_Exception('Vous n\\'êtes pas autorisez à cette section !!! ' . $module . '::' . $controller . '::' . $action);\n\t\t}\n\t}", "public function checkPermission(App\\Request $request)\n\t{\n\t\t$recordId = $request->getInteger('record');\n\t\t$moduleName = $request->getModule();\n\t\tif (!$recordId) {\n\t\t\tthrow new \\App\\Exceptions\\NoPermittedToRecord('ERR_NO_PERMISSIONS_FOR_THE_RECORD', 406);\n\t\t}\n\t\t$this->record = Vtiger_Record_Model::getInstanceById($recordId, $moduleName);\n\t\tif (!$this->record->isEditable()) {\n\t\t\tthrow new \\App\\Exceptions\\NoPermittedToRecord('ERR_NO_PERMISSIONS_FOR_THE_RECORD', 406);\n\t\t}\n\t\tif (!\\App\\Privilege::isPermitted($moduleName, 'ConvertLead')) {\n\t\t\tthrow new \\App\\Exceptions\\NoPermitted('LBL_PERMISSION_DENIED', 406);\n\t\t}\n\t\tif (!Leads_Module_Model::checkIfAllowedToConvert($this->record->get('leadstatus'))) {\n\t\t\tthrow new \\App\\Exceptions\\NoPermitted('LBL_PERMISSION_DENIED', 406);\n\t\t}\n\t}", "public function hasAccess() : bool\n\t{\n\t\t$ip = Server::getIP();\n\t\t$access = false;\n\n\t\t// Allow local access\n\t\tif ( Stringify::contains(['127.0.0.1','::1'], $ip) ) {\n\t\t\t$access = true;\n\n\t\t} else {\n\n\t\t\t// Check allowed IPs\n\t\t\t$allowed = $this->applyFilter('access-allowed-ip', $this->getAllowedAccess());\n\t\t\tif ( !empty($allowed) ) {\n\t\t\t\tif ( Stringify::contains($allowed, $ip) ) {\n\t\t\t\t\t$access = true;\n\n\t\t\t\t} else {\n\t\t\t\t\t$access = false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t// Deny access\n\t\t\t\t$denied = $this->applyFilter('access-denied-ip', $this->getDeniedAccess());\n\t\t\t\tif ( Stringify::contains($denied, $ip) ) {\n\t\t\t\t\t$access = false;\n\n\t\t\t\t} else {\n\t\t\t\t\t$access = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$data = ['ip' => $ip, 'access' => $access];\n\t\t$this->doAction('ip-access', $data);\n\t\treturn $access;\n\t}", "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 }", "function canHandleRequest() ;", "public function hasAccess(): bool;", "private function checkOrigin(Request $request)\n {\n if (!$request->headers->get('X-Appengine-Taskname')) {\n throw $this->createAccessDeniedException();\n }\n }", "public function testMeetupAccessWillCheckPermission()\n {\n list($responseCodeForUser1, $responseBody) = sendGetRequest($this->endpoint .'/5003e8bc757df2020d0f0033', array(), $this->user1Headers);\n list($responseCodeForUser2, $responseBody) = sendGetRequest($this->endpoint .'/5003e8bc757df2020d0f0033', array(), $this->user3Headers);\n\n $this->assertEquals(200, $responseCodeForUser1);\n $this->assertEquals(403, $responseCodeForUser2);\n }", "public function get_item_permissions_check( $request ) {\n\t\treturn current_user_can( 'manage_options' );\n\t}", "abstract public function require_access();", "public function isRequestAllowed(Request $request)\n {\n $ip = $request->getClientIp();\n return $this->isIpAllowed($ip);\n }", "private static function checkRequest(): void\n {\n if (isset($_REQUEST['GLOBALS']) || isset($_FILES['GLOBALS'])) {\n Core::fatalError(__('GLOBALS overwrite attempt'));\n }\n\n /**\n * protect against possible exploits - there is no need to have so much variables\n */\n if (count($_REQUEST) <= 1000) {\n return;\n }\n\n Core::fatalError(__('possible exploit'));\n }", "public function authorizedToView(Request $request)\n {\n return parent::authorizedToView($request) || $this->inContract($request);\n }", "public function checkAuthorizeRequest(sfWebRequest $request)\n\t{\n\t\t$sfToken = Doctrine::getTable('sfOauthServerRequestToken')->findOneByToken($request->getParameter('oauth_token'));\n\t\tif (!$sfToken)\n\t\t\t\treturn false;\t\n\t\treturn true;\n\t}", "public static function check($request)\n {\n return (static::$auth ?? function (): bool {\n return true;\n })($request);\n }", "private function checkrequest()\n {\n // This method checks if there is user input, and returns the request_method if evaluated to be true\n if ($_SERVER['REQUEST_METHOD'] == \"POST\") {\n $this->request = \"post\";\n return true;\n } elseif ($_SERVER['REQUEST_METHOD'] == \"GET\") {\n $this->request = \"get\";\n return true;\n } else {\n $this->request = false;\n }\n }", "public function checkPermissions() {\n if ($this->checkIp()) {\n \\BDSCore\\Errors\\Errors::returnError(403);\n }\n }", "public function authorize()\n\t{\n\t\t// Compile the rules\n\t\t$this->compile();\n\t\t\t\n\t\t// Check if this user has access to this request\n\t\tif ($this->user_authorized())\n\t\t\treturn TRUE;\n\n\t\t// Set the HTTP status to 403 - Access Denied\n\t\t$this->request->status = 403;\n\n\t\t// Execute the callback (if any) from the compiled rule\n\t\t$this->perform_callback();\n\n\t\t// Throw a 403 Exception if no callback has altered program flow\n\t\tthrow new Kohana_Request_Exception('You are not authorized to access this resource.', NULL, 403);\n\t}", "function check_permission()\r\n {\r\n // Ensure the user logs in\r\n require_login($this->course->id);\r\n if (isguestuser()) error(get_string('noguestaccess', 'sloodle'));\r\n add_to_log($this->course->id, 'course', 'view sloodle data', '', \"{$this->course->id}\");\r\n\r\n // Ensure the user is allowed to update information on this course\r\n $this->course_context = get_context_instance(CONTEXT_COURSE, $this->course->id);\r\n require_capability('moodle/course:update', $this->course_context);\r\n }", "public function access(Request $request) {\n if (empty($this->before)) {\n return true;\n }\n \n foreach ($this->before as $before) {\n if (is_callable($before)) {\n if(!call_user_func($before, $request)) {\n return false;\n }\n continue;\n }\n \n if(!Routes::before($before, $request)) {\n return false;\n }\n }\n \n return true;\n }", "function check_user_permissions($request, $actionName = NULL, $id = NULL)\n{\n /* Get currently logged in user */\n $currentUser = $request->user();\n\n /* Current Action Name */\n if ($actionName) {\n $currentActionName = $actionName;\n }\n\n /* Get current controller and method name */\n $currentActionName = $request->route()->getActionName();\n\n /* Get controller and action name from the action name */\n list($controller, $method) = explode('@', $currentActionName);\n $controller = str_replace([\"App\\\\Http\\\\Controllers\\Api\\\\\", \"Controller\"], \"\", $controller);\n\n /* Create, Read, Update, Delete mapping to controller actions */\n $crudPermissionMap = [\n 'create' => ['create', 'store'],\n 'update' => ['edit', 'update'],\n 'delete' => ['destroy', 'restore', 'forceDestroy'],\n 'read' => ['index', 'view'],\n 'cancel' => ['cancelRequest'],\n 'acceptance' => ['acceptDeliveryOffer'],\n ];\n\n foreach ($crudPermissionMap as $permission => $methods) {\n if (in_array($method, $methods)) {\n\n /**\n * If you have a specific restriction you want to make on a user not accessing\n * Another persons resource replicate this code below\n * Retrieve the route parameter check whether the current user id and\n * the foreign id of the user in the resource match, they donot match return a\n * 403 abort error message\n * Turn the down if into an if else\n */\n /*if (from_camel_case($controller) == 'service_request' && in_array($method, ['edit', 'update', 'destroy', 'restore', 'forceDestroy', 'view', 'index'])) {\n\n $id = !is_null($id) ? $id : $request->route('');\n\n // If the current user has no permission to access other people's service requests permission\n // Make sure he/she only modifies his/her service requests\n if (($id) && (!$currentUser->can(\"\") || !$currentUser->can(\"\"))) {\n $serviceRequest = ServiceRequest::find($id);\n if($serviceRequest->customer_id !== $currentUser->id) {\n return false;\n }\n }\n\n }*/\n // If user has no permission donot allow next request\n /*else if (! $currentUser->can(from_camel_case($controller).\".{$permission}\")) {\n return false;\n }*/\n\n if (from_camel_case($controller) == 'service_request' && in_array(\n $method,\n ['edit', 'update', 'destroy', 'restore', 'forceDestroy', 'view', 'index', 'acceptRequest', 'cancelRequest']\n )) {\n if ($request->is('api/services/requests/cancelled')) {\n $id = !is_null($id) ? $id : $request->id;\n\n // If the current user has no permission to access other people's service requests permission\n // Make sure he/she only modifies his/her service requests\n if (($id)) {\n $serviceRequest = ServiceRequest::find($id);\n if ($serviceRequest->customer_id !== $currentUser->id) {\n return false;\n }\n }\n }\n\n\n }\n\n if (from_camel_case($controller) == 'service_delivery_offer' && in_array(\n $method,\n ['edit', 'update', 'destroy', 'restore', 'forceDestroy', 'view', 'index', 'acceptDeliveryOffer']\n )) {\n if ($request->is('api/delivery/offers/acceptance')) {\n $id = !is_null($id) ? $id : $request->id;\n\n // If the current user has no permission to access other people's service requests permission\n // Make sure he/she only modifies his/her service requests\n if (($id)) {\n $serviceDeliveryOffer = ServiceDeliveryOffer::find($id);\n if ($serviceDeliveryOffer->provider_id !== $currentUser->id) {\n return false;\n }\n }\n }\n\n\n }\n\n\n\n break;\n\n }\n }\n\n return true;\n}", "public static function check_item_access($requested_id, $shared)\n {\n // Get all children folders\n $foldersIds = FileManagerFolder::with('folders:id,parent_id,unique_id,name')\n ->where('user_id', $shared->user_id)\n ->where('parent_id', $shared->item_id)\n ->get();\n\n // Get all authorized parent folders by shared folder as root of tree\n $accessible_folder_ids = Arr::flatten([filter_folders_ids($foldersIds), $shared->item_id]);\n\n // Check user access\n if ( is_array($requested_id) ) {\n foreach ($requested_id as $id) {\n if (!in_array($id, $accessible_folder_ids))\n abort(403);\n }\n }\n\n if (! is_array($requested_id)) {\n if (! in_array($requested_id, $accessible_folder_ids))\n abort(403);\n }\n }", "public function check(Request $request)\n {\n }", "public function checkAccess() {\n $this->maybeStartSession();\n\n //If user is not logged in, redirect to login page\n if(!isset($_SESSION['userID'])) {\n header('Location: login.php');\n die();\n }\n\n //if user doesn't exist in database, redirect to logout page to clear session\n $repo = $this->getRepository();\n if($repo && !$repo->getUser($_SESSION['userID'])) {\n header('Location: logout.php');\n die();\n }\n }", "public function authorizeToView(Request $request)\n {\n return $this->inContract($request) || parent::authorizeToView($request);\n }", "public function canHandleRequest() {}", "public function canHandleRequest() {}", "public function canHandleRequest() {}", "public function canHandleRequest() {}", "public function has_access() { \n\n\t\tif (!Access::check('interface','25')) { \n\t\t\treturn false; \n\t\t} \n\t\tif ($this->user == $GLOBALS['user']->id) { \n\t\t\treturn true; \n\t\t} \n\t\telse {\n\t\t\treturn Access::check('interface','100'); \n\t\t} \t\n\n\t\treturn false; \n\n\t}", "function checkRequest($req){\n\t//Variables that should be defined for checkRequest. Ideally this would be defined in a abstact/general form.\n\t$methods_supported = array(\"GET\", \"POST\", \"HEAD\", \"DELETE\", \"PUT\");\n\t$request_vars = array(\"start\", \"count\", );\n\n\tif (array_search($req->getMethod(), $methods_supported ) === FALSE){\n\t\tRestUtils::sendResponse(405, array('allow' => $methods_supported));\n\t}\n\tif($req->getMethod() == \"GET\") {\n\t\t//check the request variables that are not understood by this resource\n\t\t$dif = array_diff(array_keys($req->getRequestVars()), $request_vars);\n\t\t//If they are differences then we do not understand the request.\n\t\tif ( count($dif) != 0 ){\n\t\t\tRestUtils::sendResponse(400, array('unrecognized_req_vars' => $dif));\n\t\t\texit;\n\t\t}\n\t}\n\t//TODO - check that path parameters are correct through regulares expressions that validate input types and formats.\n\t//could respond BadRequest also.\n}", "public function sendAccess() {\n $request = \\Drupal::request();\n $acquia_key = Storage::getKey();\n if (!empty($acquia_key) && $request->get('key')) {\n $key = sha1(\\Drupal::service('private_key')->get());\n if ($key === $request->get('key')) {\n return AccessResultAllowed::allowed();\n }\n }\n return AccessResultForbidden::forbidden();\n }", "public function canViewRequest()\n {\n return $this->_authorization->isAllowed('RealtimeDespatch_OrderFlow::orderflow_requests_imports');\n }", "public function hasAccess($permission);", "public function canHandleRequest();", "public function canHandleRequest();", "public function checkAccess()\n {\n $orders = $this->getOrders();\n\n return parent::checkAccess()\n && $orders\n && $orders[0]\n && $orders[0]->getProfile();\n }", "public static function authorizedToViewAny(Request $request)\n {\n return $_SERVER['nova.authorize.forbidden-users'] ?? false;\n }", "abstract protected function canAccess();", "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 authorizeToViewAny(Request $request)\n {\n return $this->inContract($request) || parent::authorizedToView($request);\n }", "public function hasPerm($handler, $request_method);", "public static function check($request)\n {\n return (static::$authUsing ?: function () {\n return App::environment('local');\n })($request);\n }", "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 checkOnAccess() : bool\r\n {\r\n if (empty($this->gates)){\r\n return true;\r\n }\r\n\r\n foreach ($this->gates as $gate) {\r\n\r\n if(Gate::allows($gate)){\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }", "protected function check_assign_terms_permission($request)\n {\n }", "function _checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id = \"\")\n\t{\n\t\tglobal $ilUser, $ilAccess;\n\n\t\tif ($a_user_id == \"\")\n\t\t{\n\t\t\t$a_user_id = $ilUser->getId();\n\t\t}\n\n\t\t// add no access info item and return false if access is not granted\n\t\t// $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $a_text, $a_data = \"\");\n\t\t//\n\t\t// for all RBAC checks use checkAccessOfUser instead the normal checkAccess-method:\n\t\t// $ilAccess->checkAccessOfUser($a_user_id, $a_permission, $a_cmd, $a_ref_id)\n\n\t\treturn true;\n\t}", "public function check_request($mode = rcube_ui::INPUT_POST)\n {\n $token = rcube_ui::get_input_value('_token', $mode);\n $sess_id = $_COOKIE[ini_get('session.name')];\n return !empty($sess_id) && $token == $this->get_request_token();\n }", "public function authorizeRequest($request)\n\t{\n\t\t$headers = $request->headers->all();\n\t\t$authUser = $headers['php-auth-user'][0];\n\t\t$authPass = $headers['php-auth-pw'][0];\n\n\t\t$username = Crypto::decryptWithPassword($authUser, $_ENV['APP_SECRET']);\n\t\t$apiKey = $authPass;\n\t\t$userRepo = $this->getDoctrine()->getRepository(User::class);\n\t\t$user \t = $userRepo->findOneBy(['email' => $username, 'api_key' => $apiKey]);\n\n\t\tif ($user == null || !in_array('ROLE_ADMIN', $user->getRoles())) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public static function hasAccess($service, array $request = array(), &$error = null) {\n\t\t$params = compact('service','request');\n\t\t$params['error'] = &$error;\n\n\t\treturn static::_filter(__FUNCTION__, $params, function($self, $params) {\n\t\t\t$service = $params['service'];\n\t\t\t$request = $params['request'];\n\n\t\t\tif (!$cache = $self::_refresh($service, $params['error'], 300)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn $self::adapter($service)->hasAccess($cache['token'], $request, $params['error']);\n\t\t});\n\t}", "public function canHandleRequest(\\Eeno\\Http\\Request $request)\n {\n if( strcasecmp($request->method() , $this->method() ) == 0 &&\n strcasecmp($this->url() , $request->url() ) == 0)\n return true;\n return false; \n }", "private function checkIfGOCDBIsReadOnlyAndRequestisNotGET(){\n if ($this->requestMethod != 'GET' && $this->portalIsReadOnly()){\n $this->exceptionWithResponseCode(503,\"GOCDB is currently in read only mode\");\n }\n }", "protected function checkAccess($operation, $params = [])\n {\n if (is_array($operation)) {\n foreach ($operation as $item) {\n if ($this->hasAccess($item, $params)) {\n return true;\n }\n }\n }\n if ($this->hasAccess($operation, $params)) {\n return true;\n }\n\n throw new HttpException(403, 'Not allowed');\n }", "private function checkAccess() {\n $this->permission('Garden.Import'); // This permission doesn't exist, so only users with Admin == '1' will succeed.\n \\Vanilla\\FeatureFlagHelper::ensureFeature(\n 'Import',\n t('Imports are not enabled.', 'Imports are not enabled. Set the config Feature.Import.Enabled = true to enable imports.')\n );\n }", "function verify_access($user_access){\n\n switch($user_access){\n case \"ADMIN\":\n break;\n default:\n header('Location:index.php?error=0000000001');\n }\n}", "public static function check($request)\n {\n return (static::$authUsing ?: function () {\n return app()->environment('local') || app()->environment('testing');\n })($request);\n }", "protected function _is_valid_request($request) {\n if ( empty($request) ) {\n return true;\n }\n return Auth::is_token_valid($request, $this->classname());\n }", "private function validateRequest()\n {\n //verify there is a valid access token and it matches our config. Bail if not present\n $incoming_access_token = $this->request->token();\n if ($incoming_access_token !== $this->config->access_token && ! empty($this->config->access_token)) {\n $msg = 'Access denied due to invalid token.';\n syslog(LOG_DEBUG, $msg);\n header('HTTP/1.1 403 Access Denied.');\n exit();\n }\n\n //verify we have a valid request\n if (! $this->request->isValid()) {\n $msg = 'Invalid package received.';\n syslog(LOG_DEBUG, $msg);\n header('HTTP/1.1 400 Bad Request');\n exit($msg);\n }\n }", "static function access(){\n return onapp_has_permission(array('hypervisors', 'hypervisors.read'));\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 checkRequesterIP($action) {\n return isUserLoggedOn() || $this->getCountOfRequest($action,24) < $action;\n }" ]
[ "0.74067205", "0.73175895", "0.7259858", "0.7259858", "0.7259858", "0.7258603", "0.7258603", "0.72582316", "0.72582316", "0.72582316", "0.72184247", "0.71953326", "0.7180081", "0.7157474", "0.71453184", "0.710367", "0.7086209", "0.7059934", "0.70594263", "0.69839317", "0.69593537", "0.6807493", "0.6757556", "0.675695", "0.66334486", "0.6548668", "0.65211457", "0.65174663", "0.65098745", "0.64819676", "0.646532", "0.6459478", "0.6401834", "0.6393085", "0.63913876", "0.63686544", "0.63682365", "0.63511074", "0.63478655", "0.6336313", "0.6315404", "0.6303694", "0.6296592", "0.628446", "0.62838465", "0.62673473", "0.62664455", "0.6260791", "0.6260756", "0.62284994", "0.62183183", "0.62178046", "0.62111473", "0.6199158", "0.61947656", "0.61747193", "0.61547333", "0.6148177", "0.6147879", "0.6134087", "0.61260206", "0.61223257", "0.6108078", "0.61076796", "0.6107553", "0.6100559", "0.6100559", "0.6100559", "0.6100559", "0.60973126", "0.60904604", "0.6090233", "0.60881746", "0.6083127", "0.60816985", "0.60816985", "0.6077167", "0.60525024", "0.6051468", "0.60463846", "0.60227513", "0.6021802", "0.6021553", "0.6012831", "0.6010354", "0.6006298", "0.6002031", "0.5996488", "0.5984429", "0.5982628", "0.598202", "0.5980466", "0.59669197", "0.59665775", "0.5964217", "0.5963762", "0.5958758", "0.59506035", "0.5946935", "0.5946049", "0.5945194" ]
0.0
-1
Reader should thrown exception if configuration cannot be read.
public function testIfExceptionIsThrownWhenConfigurationCannotBeRead() { $reader = new Reader(new Configuration()); $reader->read('/does-not-exists-i-guess'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function readConfig() {\n if ( file_exists( $this->path . '/config/config.php' ) ) {\n require_once $this->path . '/config/config.php';\n }\n }", "public function testIfExceptionIsThrownWhenConfigurationIsNotValid()\n {\n $path = $this->getTestDataDir() . '/config.invalid.yml';\n\n $this->assertTrue(is_readable($path), 'Invalid configuration file is missing.');\n\n $reader = new Reader(new Configuration());\n $reader->read($path);\n }", "public function testReadWithNonExistentFile() {\n $reader = new ConfigReader($this->path);\n $reader->read('fake_values');\n }", "public function testReadConfigurationTrowsException()\n {\n\t $method = $this->setAccessibleMethod('readConfig');\n\n\t $method->invoke($this->dbConfiguration->newInstanceWithoutConstructor(), 11);\n\n }", "protected function initConfiguration()\n {\n if (!file_exists(self::$config_file)) {\n // get the configuration directly from CMS\n $this->getConfigurationFromCMS();\n }\n elseif ((false === (self::$config_array = json_decode(@file_get_contents(self::$config_file), true))) || !is_array(self::$config_array)) {\n throw new ConfigurationException(\"Can't read the Doctrine configuration file!\");\n }\n }", "private function load()\n {\n if (!file_exists($this->file)) {\n throw new Exception('config file not found');\n }\n // read contents of wordpress config\n // we can not require the configuration because it requires a shit load of other files\n $this->config = file_get_contents($this->file);\n }", "private function _readFile()\n {\n $content = file_get_contents($this->file);\n $this->config = json_decode(utf8_encode($content), true);\n\n if ($this->config == null && json_last_error() != JSON_ERROR_NONE)\n {\n throw new \\LogicException(sprintf(\"Failed to parse config file '%s'. Error: '%s'\", basename($this->file) , json_last_error_msg()));\n }\n }", "private static function loadConfigurationFile()\n {\n if(self::$ConfigurationData == null)\n {\n $file_contents = file_get_contents(CONFIGURATION_FILE);\n $json_data = json_decode($file_contents, true);\n\n if(empty($json_data))\n {\n throw new Exception(\"Invalid JSON data in the configuration file\");\n }\n\n self::$ConfigurationData = $json_data;\n }\n }", "protected function getConfig() {\n\t\t\t$handle = fopen($this->configFile, 'r');\n\t\t\t$contents = fread($handle, filesize($this->configFile));\n\t\t\tfclose($handle);\n\n\t\t\t$this->config = json_decode($contents);\n\n\t\t\tforeach ($this->configMap as $key => $value) {\n\t\t\t\tif ($handle && !array_key_exists($key, $this->config)) {\n\t\t\t\t\tthrow new Exception('Missing key: ' . $key);\n\t\t\t\t}\n\n\t\t\t\tif (empty($this->config->{$key})) {\n\t\t\t\t\t/*\n\t\t\t\t\t\tIf the config isn't found we'll check if an environment\n\t\t\t\t\t\tvariable exists, this is largely Heroku specific, and offers\n\t\t\t\t\t\tus a nice way to avoid deploying any config.\n\n\t\t\t\t\t\tIf time were no issue this handling would be more loosely\n\t\t\t\t\t\tcoupled to this class.\n\t\t\t\t\t*/\n\t\t\t\t\t$env_value = getenv($value['env']);\n\n\t\t\t\t\tif (empty($env_value)) {\n\t\t\t\t\t\tthrow new Exception('Missing value: ' . $key);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$this->{$value['prop']} = !empty($env_value) ? $env_value : $this->config->{$key};\n\t\t\t}\n\n\t\t\treturn $this;\n\t\t}", "public function readConfigurationValues();", "public function readConfig() {\n \t// Read the current configuration file\n \t$this->setConfig(parse_ini_file($this->getConfigFile(), true));\n \t// Return instance \n \treturn $this;\n }", "public function init(){\n\t\t$jsonParsed = json_decode($this->configFileRaw, true);\n\t\t\n\t\tif(empty($jsonParsed) || !is_array($jsonParsed)){\n\t\t\tthrow new \\Exception(\"config.json empty or corrupted\");\n\t\t}\n\t\t$this->config = $jsonParsed;\n\t}", "abstract protected function loadConfig();", "public function testReadEmptyFile() {\n $reader = new ConfigReader($this->path);\n $reader->read('empty');\n }", "public function read(){\n\t\n\t\tif (!$this->cfg_loaded){\n\t\t\t$this->load();\n\t\t}\n\t\t\n\t\tif ($this->cfg_loaded){\n\t\t\t\n\t\t\t$this->getLogger()->debug(\"Starting reading XML configuration\");\n\t\t\t$config = $this->cfg->getElementsByTagName(\"configuration\");\n\t\t\t\t\n\t\t\tif ($config->length == 1){\n\t\t\t\n\t\t\t\t// first read debug configuration\n\t\t\t\t$this->cfg_debug->read_debug($config->item(0)->getElementsByTagName(\"debug\")->item(0));\n\t\t\t\t\n\t\t\t\t// $this->read_sensors($config->item(0));\n\t\t\t\t$this->cfg_sensors->read_sensors($config->item(0));\n\t\t\t\t\n\t\t\t\t$this->cfg_actions->read_actions($config->item(0)->getElementsByTagName(\"actions\")->item(0));\n\t\t\t\t$this->cfg_gpio->read_gpios($config->item(0)->getElementsByTagName(\"gpios\")->item(0));\n\t\t\t\t$this->cfg_stats->read_stats($config->item(0)->getElementsByTagName(\"statistics\")->item(0));\n\t\t\t\t\n\t\t\t\t$this->cfg_modes->read_modes($config->item(0)->getElementsByTagName(\"modes\")->item(0));\n\t\t\t\t$this->cfg_progs->read_programs($config->item(0)->getElementsByTagName(\"programs\")->item(0));\n\t\t\t} else {\n\t\t\t\t$this->getLogger()->error(\"section <configuration> not found. Can't read configuration.\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public function getReader() {}", "public function getReader() {}", "public function getReader() {}", "public function getReader() {}", "public function getReader() {}", "public function getReader() {}", "public function getReader() {}", "function getConfiguration(): Configuration\n {\n $configFileContent = file_get_contents($this->configurationFilePath);\n try {\n $this->configuration = $this->serializer->deserialize($configFileContent, Configuration::class, $this->configurationFileFormat);\n } catch (\\RuntimeException|\\Exception $e) {\n throw new ConfigurationFileDeserializationException($this->configurationFileFormat . ' is unsupported', 0, $e);\n }\n return $this->configuration;\n }", "public function testReadConfigurationFileOrArray()\n {\n\t $method = $this->setAccessibleMethod('readConfig');\n\n\t $this->assertEquals([], $method->invoke($this->dbConfiguration->newInstanceWithoutConstructor(), __DIR__.'/dummy/configuration.php'));\n\n\t $this->assertEquals([], $method->invoke($this->dbConfiguration->newInstanceWithoutConstructor(), []));\n }", "public static function read()\n {\n return self::$config;\n }", "private function getRead()\n {\n if (!$this->read) {\n shuffle($this->readConfigs);\n foreach ($this->readConfigs as $config) {\n /** @var \\Redis $redis */\n $redis = $config['redis'];\n try {\n $redis->connect($config['host'], $config['port'], $config['timeout']);\n $redis->setOption(Redis::OPT_SERIALIZER, $this->getSerializerValue());\n $this->read = $redis;\n break;\n }\n catch (\\RedisException $ex) {\n if ($this->logger) {\n $this->logger->warning('Failed to connect to a Redis read replica.', [\n 'exception' => $ex,\n 'host' => $config['host'],\n 'port' => $config['port'],\n ]);\n }\n }\n }\n\n // If we failed to connect to any read replicas, give up, and send back the last exception (if any)\n if (!$this->read) {\n throw new \\RedisException('Failed to connect to any Redis read replicas.', 0, isset($ex) ? $ex : null);\n }\n }\n\n return $this->read;\n }", "function __construct() {\n if (!file_exists($this->configuration_file_path)) {\n \n die(\"FATAL: Missing \" . $this->configuration_file_path . `pwd` );\n \n }\n \n $raw_contents = file_get_contents($this->configuration_file_path);\n\n\n //parse json object\n try {\n\n $this->Config = json_decode( $raw_contents );\n\n } catch (Exception $e) {\n\n die(\"FATAL: Bad configuration file? \");\n\n }\n \n\n }", "protected function openJson()\n {\n if (!file_exists($this->configPath))\n {\n throw new exceptions\\FileException('The configuration file is corrupted or don\\'t exist' );\n }\n else\n {\n $json = file_get_contents($this->configPath);\n $this->config = json_decode($json, TRUE);\n if ($error = json_last_error_msg())\n {\n throw new exceptions\\JsonException (sprintf(\"Failed to parse json string '%s', error: '%s'\", $this->config, $error));\n }\n }\n }", "private function readConfig(){\n\n\t\t$this->_ini_array = parse_ini_file(CONFIG.'system.ini');\n\n\t\t$this->_host =\t$this->_ini_array['db_host'];\n\t\t$this->_username = $this->_ini_array['db_username'];\n\t\t$this->_password = $this->_ini_array['db_password'];\n\t\t$this->_database = $this->_ini_array['db_database'];\n\t\n\t\t$this->_log_enabled=$this->_ini_array['log_enabled'];\n\t\t$this->_log_level=$this->_ini_array['log_level'];\n\t\t$this->_log_file_path=$this->_ini_array['log_path'];\n\t\n\n\t\t$this->_lang_default=$this->_ini_array['lang_default'];\n\n\t}", "public function testReadWithExistentFileWithoutExtension() {\n $reader = new ConfigReader($this->path);\n $reader->read('no_php_extension');\n }", "function SM_loadConfigReader($rName, $user, $rFile='') {\n \n // globalize\n global $SM_siteManager;\n\n // rFile shouldn't be passed unless this is SMCONFIG calling us\n if ($rFile == '') {\n // find file\n $rFile = $SM_siteManager->findSMfile($rName.'_reader', 'configReaders', 'inc', true);\n }\n\n // include the file\n include_once($rFile);\n\n // found it, instantiate and return\n $className = 'SM_configReader_'.$rName;\n $reader = new $className();\n $reader->setUser($user);\n\n return $reader;\n}", "public function __construct($reader) {\n $this->cfgReader = $reader;\n }", "public function readConfigAction()\n {\n $this->getResponse()->setBody(self::getHelper()->readconfig());\n\n }", "protected function read() {\n\t\t$fileContent = trim(file_get_contents($this->filepath));\n\t\t$pattern = '/\\$([^=]+)=([^;]+);/';\n\t\t$matches = null;\n\t\t$matchesFound = preg_match_all($pattern, $fileContent, $matches);\n\t\t$configContents = array();\n\t\tif ($matchesFound) {\n\t\t\t$configContents = $matches[0];\n\t\t}\n\t\t$this->rows = array();\n\t\tforeach ($configContents as $configLine) {\n\t\t\t$this->rows[] = new ConfigFileRow($configLine, $this);\n\t\t}\n\t\t$this->rowIndex = -1;\n\t\tunset($fileContent);\n\t}", "public function read($filename)\n {\n if (!file_exists($filename)) {\n throw new Config_Lite_RuntimeException('file not found: ' . $filename);\n }\n $this->filename = $filename;\n $this->sections = parse_ini_file($filename, true);\n if (false === $this->sections) {\n throw new Config_Lite_RuntimeException(\n 'failure, can not parse the file: ' . $filename);\n }\n }", "public function load()\n\t{\n\t\tif (file_exists(self::$configPath))\n\t\t{\n\t\t\t$this->config = json_decode(file_get_contents(self::$configPath), true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->config = array();\n\t\t}\n\t}", "private static function init()\n {\n if (self::$config !== null) {\n return;\n }\n\n if (empty(self::$configPath)) {\n throw new Exception('Please set path to json config file in SystemConfig::$configPath');\n }\n\n self::$config = [];\n \n if (file_exists(self::$configPath)) {\n self::$config = @json_decode(file_get_contents(self::$configPath));\n }\n }", "public function getReader();", "public function getReader();", "private static function init()\n {\n $configFile = App::root(self::FILE);\n if (!file_exists($configFile)) {\n throw new Exception('Missing configuration file: ' . self::FILE);\n }\n\n $userConfig = require $configFile;\n\n return array_replace_recursive(self::$default, $userConfig);\n }", "function readConfigDB($dbHandle) {\n // virtual\n $this->debugLog(\"this configReader does not implement readConfigDB()\");\n }", "private static function loadAppConfig() {\n\t\t\t$appConfJson = file_get_contents(JIAOYU_PROJECT_HOME.\"/app/conf/config.json\");\n\t\t\ttry {\n\t\t\t\t$appConf = JsonUtils::decode($appConfJson);\n\t\t\t} catch (JsonException $e) {\n\t\t\t\tthrow new ConfigurationException(\"Error initializing app config: \".$e->getMessage());\n\t\t\t}\n\n\t\t\t// OK - now we can load up the config array from the file\n\t\t\tforeach ($appConf as $configKey => $configValue) {\n\t\t\t\tself::$config[$configKey] = $configValue;\n\t\t\t}\n\t\t}", "abstract protected function loadConfiguration($name);", "public function readConfigFile(): void\n {\n $configPath = __DIR__ . '/../../.config';\n if (!file_exists($configPath)) {\n echo \"Could not find .config\\n\";\n die;\n }\n $lines = preg_split('/[\\r\\n]+/', file_get_contents($configPath));\n foreach ($lines as $line) {\n if (empty($line)) {\n continue;\n }\n if (substr($line, 0, 1) == '#') {\n continue;\n }\n $kv = preg_split(\"/=/\", $line);\n $key = $kv[0];\n $value = $kv[1];\n $this->data[$key] = $value;\n }\n }", "function parseConfig() {\n\n\t\t// Make sure our config file exists\n\t\tif(!file_exists(CONFIGPATH . $this->_options['configFile'])) {\n\t\t\tdie('Unable to find <b>'. CONFIGPATH . $this->_options['configFile'] .'</b> file, please check your application configuration');\n\t\t}\n\n\t\t// Switch the file extension\n\t\tswitch(PPI_Helper::getFileExtension($this->_options['configFile'])) {\n\t\t\tcase 'ini':\n\t\t\t\treturn new PPI_Config_Ini(parse_ini_file(CONFIGPATH . $this->_options['configFile'], true, INI_SCANNER_RAW), $this->_options['configBlock']);\n\n\t\t\tcase 'xml':\n\t\t\t\tdie('Trying to load a xml config file but no parser yet created.');\n\t\t\t\tbreak;\n\n\t\t\tcase 'php':\n\t\t\t\tdie('Trying to load a php config file but no parser yet created.');\n\t\t\t\tbreak;\n\n\t\t}\n\t}", "protected function reader()\n {\n if ($this->_reader === null) {\n $this->_reader = Reader::createFromDefaults();\n }\n\n return $this->_reader;\n }", "public function testReadWithDots() {\n $reader = new ConfigReader($this->path);\n $reader->read('../empty');\n }", "static function loadConfig() {\n\t\t$config = self::file($_SERVER[\"DOCUMENT_ROOT\"] . \"/../config.json\");\n\t\tif (!is_null($config))\n\t\t\tself::$config = json_decode($config);\n\t}", "private function read_config() {\n\t\t$sections = parse_ini_file($this->config['conf'], true);\n\t\tforeach ($sections as $sectionk => $sectionv) {\n\t\t\tforeach ($sectionv as $key => $var)\n\t\t\t\t$this->config[$sectionk . '.' . $key] = $var;\n\t\t}\n\t}", "protected function getConfigFromFile()\n {\n if (isset($this->config)) {\n return $this->config;\n }\n\n $className = get_class($this);\n $configPath = realpath(dirname(File::fromClass($className)));\n\n if (File::exists($configFile = $configPath.'/extension.json')) {\n $config = json_decode(File::get($configFile), true) ?? [];\n }\n elseif (File::exists($configFile = $configPath.'/composer.json')) {\n $config = ComposerManager::instance()->getConfig($configPath);\n }\n else {\n throw new SystemException(\"The configuration file for extension <b>{$className}</b> does not exist. \".\n 'Create the file or override extensionMeta() method in the extension class.');\n }\n\n foreach (['code', 'name', 'description', 'author', 'icon'] as $item) {\n if (!array_key_exists($item, $config)) {\n throw new SystemException(sprintf(\n Lang::get('system::lang.missing.config_key'),\n $item, File::localToPublic($configFile)\n ));\n }\n }\n\n return $this->config = $config;\n }", "protected function _load_config()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n try {\n $config_file = new Configuration_File(self::FILE_CONFIG);\n $rawdata = $config_file->load();\n } catch (File_Not_Found_Exception $e) {\n // Not fatal, set defaults below\n } catch (Engine_Exception $e) {\n throw new Engine_Exception($e->get_message(), CLEAROS_WARNING);\n }\n\n if (isset($rawdata['allow_shell']) && preg_match(\"/(true|1)/i\", $rawdata['allow_shell']))\n $this->config['allow_shell'] = TRUE;\n else\n $this->config['allow_shell'] = FALSE;\n\n if (isset($rawdata['theme_mode']) && !empty($rawdata['theme_mode']))\n $this->config['theme_mode'] = $rawdata['theme_mode'];\n else\n $this->config['theme_mode'] = 'normal';\n\n if (isset($rawdata['theme']) && !empty($rawdata['theme']))\n $this->config['theme'] = $rawdata['theme'];\n else\n $this->config['theme'] = 'default';\n\n $this->is_loaded = TRUE;\n }", "function readResource() {\n\t\tif ( $this->_Resource ) {\n\t\t\tif ( stripos($this->_Resource, '<xml') !== false || stripos($this->_Resource, '<wurfl') !== false ) {\n\t\t\t\t$this->_Xml = @simplexml_load_string($this->_Resource);\n\t\t\t} elseif ( @file_exists($this->_Resource) && @is_readable($this->_Resource) ) {\n\t\t\t\t$this->_Xml = @simplexml_load_file($this->_Resource);\n\t\t\t} else {\n\t\t\t\tthrow new wurflException('Cannot read resource '.$this->_Resource.'. Resource must be either a valid file or an XML string');\n\t\t\t}\n\t\t}\n\t}", "public static function read( $key ) {\r\n\t\t\t// split keys\r\n\t\t\t$keys = self::explode( $key );\r\n\t\t\t// read value\r\n\t\t\t$data = self::$data;\r\n\r\n\t\t\tforeach ( $keys as $part ) {\r\n\t\t\t\tif ( isset( $data[ $part ] ) ) {\r\n\t\t\t\t\t$data = $data[ $part ];\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\tthrow new ConfigureException( $key );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn $data;\r\n\t\t}", "private function read(): array|false {\n $security = \"<?php header(\\\"Status: 403\\\"); exit(\\\"Access denied.\\\"); ?>\\n\";\n $contents = @file_get_contents(INCLUDES_DIR.DIR.\"config.json.php\");\n\n if ($contents === false)\n return false;\n\n $json = json_get(str_replace($security, \"\", $contents), true);\n\n if (!is_array($json))\n return false;\n\n return $this->data = $json;\n }", "public function test_load_returns_empty_array_if_conf_dir_dnx()\n {\n $config = new Bootphp_Config_File_Reader('gafloogle');\n\n $this->assertSame([], $config->load('values'));\n }", "public function read()\n {\n }", "function loadConfig(){\n $file = file_get_contents($this->config_dir, FILE_USE_INCLUDE_PATH);\n $urls = json_decode($file,TRUE);\n //not the best way but error handling\n if ($file == NULL || $urls == NUll ){\n print(\"Error reading the config file or it it is empty\");\n }\n else{\n $this->config_data = $urls;\n\n }\n }", "public function __construct()\n {\n // Check PHP version\n $this->_checkPHPVersion(5.3);\n\n $this->file = __DIR__.'/../datas/config.json';\n\n if (!file_exists($this->file))\n throw new \\Exception('Config file '.basename($this->file).' not found');\n\n $this->_readFile();\n }", "function Event_Config_Read()\n {\n if (empty($this->Event_Config))\n {\n $this->Event_Config=$this->ReadPHPArray($this->Event_Config_File());\n $groups=$this->Dir_Files($this->Event_Config_Path.\"/Config\",'\\.php$');\n $this->Event_Config_Group=$this->Event_Config[ \"Config_Group_Default\" ];\n \n }\n }", "function getConfigProperties() {\n\tglobal $ethereum_reader_Config;\n\t\n\tif (isset($ethereum_reader_Config))\n\t\treturn $ethereum_reader_Config;\n\t\n\t// initialization of array\n\t$ethereum_reader_Config = array();\n\t\n\t$jsonfile = dirname(__FILE__).'/../settings/config.json';\n\t\n\tif (!file_exists($jsonfile)) {\n\t\treturn $ethereum_reader_Config;\n\t\t\n\t}\n\t\t\t\n\t// read jsonfile\n\t$jsonstring = file_get_contents($jsonfile);\n\n\t$ethereum_reader_Config = json_decode($jsonstring, true);\n\n\treturn $ethereum_reader_Config ;\n}", "private function readLogConfig(){\n\n\t\t$_config = ConfigUtil::getInstance();\n\n\t\t$this->_log_enabled = $_config->isLogEnabled();\n\t\t$this->_log_level = $_config->getLogLevel();\n\t\t$this->_log_file_path = $_config->getLogFilePath();\n\t\n\t}", "public function __construct(){\n\t\t$this->_file = BP.'/settings.ini';\n\t\t$config_file = $this->_file;\n\t\tif(!file_exists($config_file)){\n\t\t\tthrow new \\Exception('The file '. basename($config_file) .' does not existed or cannot readable permission, please check in '. BP);\n\t\t}\n\t\t$setting_content = '';\n\t\t//read line\n\t\t$this->_handle = fopen($config_file, \"r+\");\n\t\tif ($this->_handle) {\n\t\t\twhile (($line = fgets($this->_handle)) !== false) {\n\t\t\t\t// process the line read.\n\t\t\t\tif(strpos(trim($line), '#') === 0){\n\t\t\t\t\tcontinue; //ignore comment line\n\t\t\t\t}\n\t\t\t\t//connect string content\n\t\t\t\tif($line != ''){\t\t\t\n\t\t\t\t\t$setting_content .= $line;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfclose($this->_handle); //destroy handle file opening\n\t\t\t\n\t\t\t$this->_settings = json_decode($setting_content, true); //converted into associative arrays\n\t\t\tif($setting_content != '' && $this->_settings == null && ($json_error = json_last_error()) != JSON_ERROR_NONE){\n\t\t\t\tswitch ($json_error) {\n\t\t\t\t\tcase JSON_ERROR_NONE:\n\t\t\t\t\t\t$json_error = ''; // JSON is valid // No error has occurred\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase JSON_ERROR_DEPTH:\n\t\t\t\t\t\t$json_error = 'The maximum stack depth has been exceeded.';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase JSON_ERROR_STATE_MISMATCH:\n\t\t\t\t\t\t$json_error = 'Invalid or malformed JSON.';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase JSON_ERROR_CTRL_CHAR:\n\t\t\t\t\t\t$json_error = 'Control character error, possibly incorrectly encoded.';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase JSON_ERROR_SYNTAX:\n\t\t\t\t\t\t$json_error = 'Syntax error, malformed JSON.';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t// PHP >= 5.3.3\n\t\t\t\t\tcase JSON_ERROR_UTF8:\n\t\t\t\t\t\t$json_error = 'Malformed UTF-8 characters, possibly incorrectly encoded.';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t// PHP >= 5.5.0\n\t\t\t\t\tcase JSON_ERROR_RECURSION:\n\t\t\t\t\t\t$json_error = 'One or more recursive references in the value to be encoded.';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t// PHP >= 5.5.0\n\t\t\t\t\tcase JSON_ERROR_INF_OR_NAN:\n\t\t\t\t\t\t$json_error = 'One or more NAN or INF values in the value to be encoded.';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase JSON_ERROR_UNSUPPORTED_TYPE:\n\t\t\t\t\t\t$json_error = 'A value of a type that cannot be encoded was given.';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$json_error = 'Unknown JSON error occured.';\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tthrow new \\Exception($json_error.PHP_EOL);\n\t\t\t}\n\t\t} else {\n\t\t\t// error opening the file.\n\t\t\tthrow new \\Exception('The file '. basename($config_file) .' opening error');\n\t\t}\n\t}", "public function load()\n {\n $ini = APP_DIR.'config/'.ENVIRONMENT.'.ini';\n\n if(!file_exists($ini))\n Clockwork::throwError('Could not load config ('.$ini.')');\n\n $this->data = parse_ini_file($ini, true);\n \n $this->setValues();\n }", "public function test_load_returns_empty_array_if_conf_dnx()\n {\n $config = new Bootphp_Config_File_Reader;\n\n $this->assertSame([], $config->load('gafloogle'));\n }", "public function load()\n {\n $parser = new ezcConfigurationIniParser( ezcConfigurationIniParser::PARSE, $this->path );\n $settings = array();\n $comments = array();\n\n foreach ( new NoRewindIterator( $parser ) as $element )\n {\n if ( $element instanceof ezcConfigurationIniItem )\n {\n switch ( $element->type )\n {\n case ezcConfigurationIniItem::GROUP_HEADER:\n $settings[$element->group] = array();\n if ( !is_null( $element->comments ) )\n {\n $comments[$element->group]['#'] = $element->comments;\n }\n break;\n\n case ezcConfigurationIniItem::SETTING:\n eval( '$settings[$element->group][$element->setting]'. $element->dimensions. ' = $element->value;' );\n if ( !is_null( $element->comments ) )\n {\n eval( '$comments[$element->group][$element->setting]'. $element->dimensions. ' = $element->comments;' );\n }\n break;\n }\n }\n if ( $element instanceof ezcConfigurationValidationItem )\n {\n throw new ezcConfigurationParseErrorException( $element->file, $element->line, $element->description );\n }\n }\n\n $this->config = new ezcConfiguration( $settings, $comments );\n return $this->config;\n }", "public function testIfItReadsLocalFile()\n {\n $path = $this->getConfigExampleFilePath();\n $reader = new Reader(new Configuration());\n $data = $reader->read($path);\n\n $this->assertInternalType('array', $data);\n }", "public function read() {\r\n }", "function get_config($filename)\n{\n\t$config = parse_ini_file($filename);\n\n\tif ($config === FALSE) {\n\t\tthrow new Exception(\"could not read configuration from '{$filename}'\");\n\t}\n\n\tif (!isset($config['url'])) {\n\t\tthrow new Exception(\"url not found in '{$filename}'\");\n\t}\n\tif (!isset($config['username'])) {\n\t\tthrow new Exception(\"username not found in '{$filename}'\");\n\t}\n\tif (!isset($config['password'])) {\n\t\tthrow new Exception(\"password not found in '{$filename}'\");\n\t}\n\tif (!isset($config['source'])) {\n\t\tthrow new Exception(\"source project not found in '{$filename}'\");\n\t}\n\tif (!isset($config['destination'])) {\n\t\tthrow new Exception(\"destination project not found in '{$filename}'\");\n\t}\n\n\treturn $config;\n}", "public static function get(string $key): mixed\n {\n if (!isset(static::$config[$key])) {\n throw new Exception(\n sprintf(\n 'Configuration with key %s not found!',\n $key\n )\n );\n }\n\n return static::$config[$key];\n }", "public function test_loads_config_from_files()\n {\n $config = new Bootphp_Config_File_Reader;\n\n $values = $config->load('inflector');\n\n // Due to the way the cascading filesystem works there could be\n // any number of modifications to the system config in the\n // actual output. Therefore to increase compatability we just\n // check that we've got an array and that it's not empty\n $this->assertNotSame([], $values);\n $this->assertInternalType('array', $values);\n }", "public function getConfig()\n { // Try the template specific path first\n $fname = APPLICATION_PATH.$this->_paths['pkg_template'].'/config.json';\n if( file_exists($fname) ) {\n return json_decode(file_get_contents($fname));\n }\n // Next try the domain common path\n $fname = APPLICATION_PATH.$this->_paths['pkg_common'].'/config.json';\n if( file_exists($fname) ) {\n return json_decode(file_get_contents($fname));\n }\n // Finally, try the app common path\n $fname = APPLICATION_PATH.$this->_paths['app_common'].'/config.json';\n if( file_exists($fname) ) {\n return json_decode(file_get_contents($fname));\n }\n // If none of these files were found, return false to indicate failure\n if( !$this->_config) throw new CException('Configuration not found');\n }", "protected function _load_config()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n try {\n $config_file = new Configuration_File(self::APP_CONFIG);\n $this->config = $config_file->load();\n } catch (File_Not_Found_Exception $e) {\n // Not fatal\n }\n\n $this->is_loaded = TRUE;\n }", "public function get(String $name=\"\"){\n\t\tif(isset($this->config[$name])){\n\t\t\treturn $this->config[$name];\n\t\t}\n\t\t\n\t\t// We need to split anyway if successful and sizeof is cheaper than a string search\n\t\t$split = explode(\"\\\\\",$name);\n\t\tif(sizeof($split) > 1){\n\t\t\tif(isset($this->config[$split[0]]) && isset($this->config[$split[0]][$split[1]])){\n\t\t\t\treturn $this->config[$split[0]][$split[1]];\n\t\t\t}\n\t\t}\n\t\t\n\t\tthrow new \\Exception($name.\" could not be found in config.json\");\n\t}", "public abstract function loadConfig($fileName);", "private function readXML() {\n $xmlFile = __DIR__ .\"\\configuracion.xml\";\n if (file_exists($xmlFile)) {\n $xml = simplexml_load_file($xmlFile);\n } else {\n exit('Fallo al abrier el archivo configuraciones.xml');\n }\n $this->host = $xml->mysql[0]->host;\n $this->database = $xml->mysql[0]->database;\n $this->user = $xml->mysql[0]->user;\n $this->password = $xml->mysql[0]->password;\n }", "protected function initConfig()\n {\n $this->di->setShared('config', function () {\n $path = BASE_DIR . 'app/config/';\n\n if (!is_readable($path . 'config.php')) {\n throw new RuntimeException(\n 'Unable to read config from ' . $path . 'config.php'\n );\n }\n\n $config = include $path . 'config.php';\n\n if (is_array($config)) {\n $config = new Config($config);\n }\n\n if (!$config instanceof Config) {\n $type = gettype($config);\n if ($type == 'boolean') {\n $type .= ($type ? ' (true)' : ' (false)');\n } elseif (is_object($type)) {\n $type = get_class($type);\n }\n\n throw new RuntimeException(\n sprintf(\n 'Unable to read config file. Config must be either an array or Phalcon\\Config instance. Got %s',\n $type\n )\n );\n }\n\n if (is_readable($path . APPLICATION_ENV . '.php')) {\n $override = include_once $path . APPLICATION_ENV . '.php';\n\n if (is_array($override)) {\n $override = new Config($override);\n }\n\n if ($override instanceof Config) {\n $config->merge($override);\n }\n }\n\n return $config;\n });\n }", "abstract protected function getConfig();", "public function getReader()\n\t{\n\t\treturn static::$reader;\n\t}", "private function loadConfiguration()\n {\n if (!Configuration::configurationIsLoaded()) {\n Configuration::loadConfiguration();\n }\n }", "public function __construct(array $config = array())\n\t{\n\t\tif ( is_null(static::$reader) )\n\t\t{\n\t\t\tif ( !file_exists($config['maxmind_db']) )\n\t\t\t{\n\t\t\t\tthrow new UnexpectedValueException(\"Could not find the MaxMind database file at the specified location! Check your paths and try again ({$config['maxmind_db']}).\");\n\t\t\t}\n\n\t\t\tstatic::$reader = new Reader($config['maxmind_db']);\n\t\t}\n\n\t\t$this->databaseType = static::$reader->metadata()->databaseType;\n\n\t\tif ( !in_array($this->databaseType, $this->databaseSupport) )\n\t\t{\n\t\t\tthrow new UnexpectedValueException(\"Unexpected database type '{$this->databaseType}'!\");\n\t\t}\n\t}", "public function loadConfig()\n {\n return parse_ini_file(\n DIR_ROOT . '/config.ini', False\n );\n }", "public function initializeObject()\n {\n if (!isset($this->options['csvFilePath']) || !is_string($this->options['csvFilePath'])) {\n throw new InvalidArgumentException('Missing or invalid \"csvFilePath\" in preset part settings', 1429027715);\n }\n\n $this->csvFilePath = $this->options['csvFilePath'];\n if (!is_file($this->csvFilePath)) {\n throw new \\Exception(sprintf('File \"%s\" not found', $this->csvFilePath), 1427882078);\n }\n\n if (isset($this->options['csvDelimiter'])) {\n $this->csvDelimiter = $this->options['csvDelimiter'];\n }\n\n if (isset($this->options['csvEnclosure'])) {\n $this->csvEnclosure = $this->options['csvEnclosure'];\n }\n\n $this->logger->debug(sprintf('%s will read from \"%s\", using %s as delimiter and %s as enclosure character.', get_class($this), $this->csvFilePath, $this->csvDelimiter, $this->csvEnclosure));\n }", "public function read()\n {\n }", "private function readConfigFile($path){\n return parse_ini_file($path);\n }", "protected function getConfiguration() {}", "public function read() \n {\n\n if ($this->is_csv) \n {\n return $this->read_csv();\n }\n else\n {\n return $this->read_lines();\n }\n \n }", "abstract protected function loadConfig(array $config);", "public static function wrongConfigigurationProvider() {}", "public function getConfig() {\n if ($this->config) {\n return $this->config;\n }\n \n $this->config = $this->parse($this->configFile);\n return $this->config;\n }", "protected function readConfigFile($filename, $environment)\r\n {\r\n $filename = realpath($filename);\r\n if (!file_exists($filename)) {\r\n ExceptionFactory::ResourceConfigException('Config file ' . $filename . ' not found');\r\n }\r\n $tmp = explode('.', $filename);\r\n $extension = array_pop($tmp);\r\n switch($extension) {\r\n case 'ini':\r\n return new IniFile($filename, $environment);\r\n \r\n case 'php':\r\n return new PhpFile($filename);\r\n \r\n default:\r\n ExceptionFactory::ResourceConfigException('Unsupported config file format'); \r\n }\r\n }", "protected function validateConfigFile(): void\n {\n switch ($this->filePath) {\n case !is_file($this->filePath):\n throw new DbConnectorException(\n 'Specified configuration file does not exist.',\n 1001\n );\n case !is_readable($this->filePath):\n throw new DbConnectorException(\n 'Config file is not readable by DbConnector.',\n 1002\n );\n }\n\n $jsonConfig = json_decode(file_get_contents($this->filePath) ?: '', false);\n $this->filePath = null;\n\n if (empty($jsonConfig->dbConnector) || !\\is_object($jsonConfig->dbConnector)) {\n throw new DbConnectorException(\n 'The config file is malformed. Please refer to documentation for schema information.',\n 1003\n );\n }\n\n $this->jsonObject = $jsonConfig->dbConnector;\n }", "public function loadConfig() {\n return (object)$this->config;\n }", "protected function getWorkingReader()\n {\n static $reader;\n\n // Reader aready created\n if ($reader)\n {\n return $reader;\n }\n\n // The path to the data source\n $file_path = realpath(__DIR__.'/logs/assettocorsa/offline_quick_race_session.json');\n\n // Get the data reader for the given data source\n $reader = Data_Reader::factory($file_path);\n\n // Return reader\n return $reader;\n }", "public static function get(string $config): mixed {\n if(!isset(self::$configurations[$config])) {\n throw new ConfigurationException('No configuration set for \"' . $config . '\"');\n }\n return self::$configurations[$config];\n }", "private function __construct() {\n if (!$this->read() and !INSTALLING)\n trigger_error(\n __(\"Could not read the configuration file.\"),\n E_USER_ERROR\n );\n\n fallback($this->data[\"sql\"], array());\n fallback($this->data[\"enabled_modules\"], array());\n fallback($this->data[\"enabled_feathers\"], array());\n fallback($this->data[\"routes\"], array());\n }", "private static function getConfig() {\n\n\t\t$pathRoot = $_SERVER['DOCUMENT_ROOT'].substr($_SERVER['PHP_SELF'],0, strpos($_SERVER['PHP_SELF'],\"/\",1)).\"/config/\";\n\n\t\t$jsonConfig = file_get_contents($pathRoot.'config.json');\n\t\tself::$arrayConfig = json_decode($jsonConfig);\n\t}", "private static function getConfig(){\n return parse_ini_file(__DIR__ . \"/../config/config.ini\");\n }", "private static function getConfig(){\n return parse_ini_file(__DIR__ . \"/../config/config.ini\");\n }", "function config() {\n\t\t$reader = new \\Zend\\Config\\Reader\\Ini();\n\t\t$ar = $reader->fromString($this->config);\n\t\t\n\t\treturn new \\Zend\\Config\\Config($ar, true);\n\t}", "abstract public function loadConfig(array $config);" ]
[ "0.69832903", "0.6949449", "0.6850389", "0.6694491", "0.66572267", "0.6607392", "0.6485937", "0.63353056", "0.6288577", "0.6278537", "0.6253924", "0.6216068", "0.61751735", "0.61400473", "0.6079878", "0.60755956", "0.60755956", "0.60755956", "0.60755956", "0.60755956", "0.60755956", "0.60755956", "0.6050351", "0.60356396", "0.6027113", "0.60022277", "0.5981313", "0.5869144", "0.5844564", "0.5837518", "0.58301777", "0.57891333", "0.5771833", "0.5760217", "0.574831", "0.5732983", "0.57137704", "0.5684081", "0.5684081", "0.5675616", "0.5671599", "0.5639833", "0.56187916", "0.5596224", "0.55958074", "0.5570802", "0.5564252", "0.5535458", "0.553431", "0.5518177", "0.5514678", "0.55087364", "0.55079645", "0.55020285", "0.5499718", "0.5496395", "0.54948056", "0.5478467", "0.5445966", "0.54436845", "0.5443558", "0.5442048", "0.54377353", "0.54316723", "0.5415995", "0.5397562", "0.53924567", "0.53915054", "0.53794825", "0.5372968", "0.53696233", "0.5364993", "0.5362823", "0.53573394", "0.5343818", "0.5321585", "0.53129584", "0.53025573", "0.53024673", "0.52856135", "0.52792525", "0.52760524", "0.52734643", "0.5273039", "0.52722657", "0.5262785", "0.5253215", "0.5249482", "0.52464586", "0.5242974", "0.52414834", "0.5239865", "0.52392066", "0.52366024", "0.52208537", "0.5219747", "0.52140725", "0.52140725", "0.52108675", "0.52084285" ]
0.7764855
0
Reader should thrown exception if configuration is not valid.
public function testIfExceptionIsThrownWhenConfigurationIsNotValid() { $path = $this->getTestDataDir() . '/config.invalid.yml'; $this->assertTrue(is_readable($path), 'Invalid configuration file is missing.'); $reader = new Reader(new Configuration()); $reader->read($path); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testIfExceptionIsThrownWhenConfigurationCannotBeRead()\n {\n $reader = new Reader(new Configuration());\n $reader->read('/does-not-exists-i-guess');\n }", "public function testReadWithNonExistentFile() {\n $reader = new ConfigReader($this->path);\n $reader->read('fake_values');\n }", "public function testReadConfigurationTrowsException()\n {\n\t $method = $this->setAccessibleMethod('readConfig');\n\n\t $method->invoke($this->dbConfiguration->newInstanceWithoutConstructor(), 11);\n\n }", "private function _readFile()\n {\n $content = file_get_contents($this->file);\n $this->config = json_decode(utf8_encode($content), true);\n\n if ($this->config == null && json_last_error() != JSON_ERROR_NONE)\n {\n throw new \\LogicException(sprintf(\"Failed to parse config file '%s'. Error: '%s'\", basename($this->file) , json_last_error_msg()));\n }\n }", "public function readConfig() {\n if ( file_exists( $this->path . '/config/config.php' ) ) {\n require_once $this->path . '/config/config.php';\n }\n }", "protected function initConfiguration()\n {\n if (!file_exists(self::$config_file)) {\n // get the configuration directly from CMS\n $this->getConfigurationFromCMS();\n }\n elseif ((false === (self::$config_array = json_decode(@file_get_contents(self::$config_file), true))) || !is_array(self::$config_array)) {\n throw new ConfigurationException(\"Can't read the Doctrine configuration file!\");\n }\n }", "public function init(){\n\t\t$jsonParsed = json_decode($this->configFileRaw, true);\n\t\t\n\t\tif(empty($jsonParsed) || !is_array($jsonParsed)){\n\t\t\tthrow new \\Exception(\"config.json empty or corrupted\");\n\t\t}\n\t\t$this->config = $jsonParsed;\n\t}", "private function load()\n {\n if (!file_exists($this->file)) {\n throw new Exception('config file not found');\n }\n // read contents of wordpress config\n // we can not require the configuration because it requires a shit load of other files\n $this->config = file_get_contents($this->file);\n }", "private static function loadConfigurationFile()\n {\n if(self::$ConfigurationData == null)\n {\n $file_contents = file_get_contents(CONFIGURATION_FILE);\n $json_data = json_decode($file_contents, true);\n\n if(empty($json_data))\n {\n throw new Exception(\"Invalid JSON data in the configuration file\");\n }\n\n self::$ConfigurationData = $json_data;\n }\n }", "abstract protected function loadConfig();", "function __construct() {\n if (!file_exists($this->configuration_file_path)) {\n \n die(\"FATAL: Missing \" . $this->configuration_file_path . `pwd` );\n \n }\n \n $raw_contents = file_get_contents($this->configuration_file_path);\n\n\n //parse json object\n try {\n\n $this->Config = json_decode( $raw_contents );\n\n } catch (Exception $e) {\n\n die(\"FATAL: Bad configuration file? \");\n\n }\n \n\n }", "public function readConfigurationValues();", "public function testReadEmptyFile() {\n $reader = new ConfigReader($this->path);\n $reader->read('empty');\n }", "public function testReadConfigurationFileOrArray()\n {\n\t $method = $this->setAccessibleMethod('readConfig');\n\n\t $this->assertEquals([], $method->invoke($this->dbConfiguration->newInstanceWithoutConstructor(), __DIR__.'/dummy/configuration.php'));\n\n\t $this->assertEquals([], $method->invoke($this->dbConfiguration->newInstanceWithoutConstructor(), []));\n }", "public function getReader() {}", "public function getReader() {}", "public function getReader() {}", "public function getReader() {}", "public function getReader() {}", "public function getReader() {}", "public function getReader() {}", "public function __construct($reader) {\n $this->cfgReader = $reader;\n }", "function SM_loadConfigReader($rName, $user, $rFile='') {\n \n // globalize\n global $SM_siteManager;\n\n // rFile shouldn't be passed unless this is SMCONFIG calling us\n if ($rFile == '') {\n // find file\n $rFile = $SM_siteManager->findSMfile($rName.'_reader', 'configReaders', 'inc', true);\n }\n\n // include the file\n include_once($rFile);\n\n // found it, instantiate and return\n $className = 'SM_configReader_'.$rName;\n $reader = new $className();\n $reader->setUser($user);\n\n return $reader;\n}", "protected function getConfig() {\n\t\t\t$handle = fopen($this->configFile, 'r');\n\t\t\t$contents = fread($handle, filesize($this->configFile));\n\t\t\tfclose($handle);\n\n\t\t\t$this->config = json_decode($contents);\n\n\t\t\tforeach ($this->configMap as $key => $value) {\n\t\t\t\tif ($handle && !array_key_exists($key, $this->config)) {\n\t\t\t\t\tthrow new Exception('Missing key: ' . $key);\n\t\t\t\t}\n\n\t\t\t\tif (empty($this->config->{$key})) {\n\t\t\t\t\t/*\n\t\t\t\t\t\tIf the config isn't found we'll check if an environment\n\t\t\t\t\t\tvariable exists, this is largely Heroku specific, and offers\n\t\t\t\t\t\tus a nice way to avoid deploying any config.\n\n\t\t\t\t\t\tIf time were no issue this handling would be more loosely\n\t\t\t\t\t\tcoupled to this class.\n\t\t\t\t\t*/\n\t\t\t\t\t$env_value = getenv($value['env']);\n\n\t\t\t\t\tif (empty($env_value)) {\n\t\t\t\t\t\tthrow new Exception('Missing value: ' . $key);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$this->{$value['prop']} = !empty($env_value) ? $env_value : $this->config->{$key};\n\t\t\t}\n\n\t\t\treturn $this;\n\t\t}", "function getConfiguration(): Configuration\n {\n $configFileContent = file_get_contents($this->configurationFilePath);\n try {\n $this->configuration = $this->serializer->deserialize($configFileContent, Configuration::class, $this->configurationFileFormat);\n } catch (\\RuntimeException|\\Exception $e) {\n throw new ConfigurationFileDeserializationException($this->configurationFileFormat . ' is unsupported', 0, $e);\n }\n return $this->configuration;\n }", "public function readConfig() {\n \t// Read the current configuration file\n \t$this->setConfig(parse_ini_file($this->getConfigFile(), true));\n \t// Return instance \n \treturn $this;\n }", "public function testReadWithExistentFileWithoutExtension() {\n $reader = new ConfigReader($this->path);\n $reader->read('no_php_extension');\n }", "public function read(){\n\t\n\t\tif (!$this->cfg_loaded){\n\t\t\t$this->load();\n\t\t}\n\t\t\n\t\tif ($this->cfg_loaded){\n\t\t\t\n\t\t\t$this->getLogger()->debug(\"Starting reading XML configuration\");\n\t\t\t$config = $this->cfg->getElementsByTagName(\"configuration\");\n\t\t\t\t\n\t\t\tif ($config->length == 1){\n\t\t\t\n\t\t\t\t// first read debug configuration\n\t\t\t\t$this->cfg_debug->read_debug($config->item(0)->getElementsByTagName(\"debug\")->item(0));\n\t\t\t\t\n\t\t\t\t// $this->read_sensors($config->item(0));\n\t\t\t\t$this->cfg_sensors->read_sensors($config->item(0));\n\t\t\t\t\n\t\t\t\t$this->cfg_actions->read_actions($config->item(0)->getElementsByTagName(\"actions\")->item(0));\n\t\t\t\t$this->cfg_gpio->read_gpios($config->item(0)->getElementsByTagName(\"gpios\")->item(0));\n\t\t\t\t$this->cfg_stats->read_stats($config->item(0)->getElementsByTagName(\"statistics\")->item(0));\n\t\t\t\t\n\t\t\t\t$this->cfg_modes->read_modes($config->item(0)->getElementsByTagName(\"modes\")->item(0));\n\t\t\t\t$this->cfg_progs->read_programs($config->item(0)->getElementsByTagName(\"programs\")->item(0));\n\t\t\t} else {\n\t\t\t\t$this->getLogger()->error(\"section <configuration> not found. Can't read configuration.\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "protected function validateConfigFile(): void\n {\n switch ($this->filePath) {\n case !is_file($this->filePath):\n throw new DbConnectorException(\n 'Specified configuration file does not exist.',\n 1001\n );\n case !is_readable($this->filePath):\n throw new DbConnectorException(\n 'Config file is not readable by DbConnector.',\n 1002\n );\n }\n\n $jsonConfig = json_decode(file_get_contents($this->filePath) ?: '', false);\n $this->filePath = null;\n\n if (empty($jsonConfig->dbConnector) || !\\is_object($jsonConfig->dbConnector)) {\n throw new DbConnectorException(\n 'The config file is malformed. Please refer to documentation for schema information.',\n 1003\n );\n }\n\n $this->jsonObject = $jsonConfig->dbConnector;\n }", "function parseConfig() {\n\n\t\t// Make sure our config file exists\n\t\tif(!file_exists(CONFIGPATH . $this->_options['configFile'])) {\n\t\t\tdie('Unable to find <b>'. CONFIGPATH . $this->_options['configFile'] .'</b> file, please check your application configuration');\n\t\t}\n\n\t\t// Switch the file extension\n\t\tswitch(PPI_Helper::getFileExtension($this->_options['configFile'])) {\n\t\t\tcase 'ini':\n\t\t\t\treturn new PPI_Config_Ini(parse_ini_file(CONFIGPATH . $this->_options['configFile'], true, INI_SCANNER_RAW), $this->_options['configBlock']);\n\n\t\t\tcase 'xml':\n\t\t\t\tdie('Trying to load a xml config file but no parser yet created.');\n\t\t\t\tbreak;\n\n\t\t\tcase 'php':\n\t\t\t\tdie('Trying to load a php config file but no parser yet created.');\n\t\t\t\tbreak;\n\n\t\t}\n\t}", "public function getReader();", "public function getReader();", "protected function openJson()\n {\n if (!file_exists($this->configPath))\n {\n throw new exceptions\\FileException('The configuration file is corrupted or don\\'t exist' );\n }\n else\n {\n $json = file_get_contents($this->configPath);\n $this->config = json_decode($json, TRUE);\n if ($error = json_last_error_msg())\n {\n throw new exceptions\\JsonException (sprintf(\"Failed to parse json string '%s', error: '%s'\", $this->config, $error));\n }\n }\n }", "public function __construct(array $config = array())\n\t{\n\t\tif ( is_null(static::$reader) )\n\t\t{\n\t\t\tif ( !file_exists($config['maxmind_db']) )\n\t\t\t{\n\t\t\t\tthrow new UnexpectedValueException(\"Could not find the MaxMind database file at the specified location! Check your paths and try again ({$config['maxmind_db']}).\");\n\t\t\t}\n\n\t\t\tstatic::$reader = new Reader($config['maxmind_db']);\n\t\t}\n\n\t\t$this->databaseType = static::$reader->metadata()->databaseType;\n\n\t\tif ( !in_array($this->databaseType, $this->databaseSupport) )\n\t\t{\n\t\t\tthrow new UnexpectedValueException(\"Unexpected database type '{$this->databaseType}'!\");\n\t\t}\n\t}", "public function testReadWithDots() {\n $reader = new ConfigReader($this->path);\n $reader->read('../empty');\n }", "public function test_load_returns_empty_array_if_conf_dnx()\n {\n $config = new Bootphp_Config_File_Reader;\n\n $this->assertSame([], $config->load('gafloogle'));\n }", "protected function read() {\n\t\t$fileContent = trim(file_get_contents($this->filepath));\n\t\t$pattern = '/\\$([^=]+)=([^;]+);/';\n\t\t$matches = null;\n\t\t$matchesFound = preg_match_all($pattern, $fileContent, $matches);\n\t\t$configContents = array();\n\t\tif ($matchesFound) {\n\t\t\t$configContents = $matches[0];\n\t\t}\n\t\t$this->rows = array();\n\t\tforeach ($configContents as $configLine) {\n\t\t\t$this->rows[] = new ConfigFileRow($configLine, $this);\n\t\t}\n\t\t$this->rowIndex = -1;\n\t\tunset($fileContent);\n\t}", "public function test_load_returns_empty_array_if_conf_dir_dnx()\n {\n $config = new Bootphp_Config_File_Reader('gafloogle');\n\n $this->assertSame([], $config->load('values'));\n }", "function readConfigDB($dbHandle) {\n // virtual\n $this->debugLog(\"this configReader does not implement readConfigDB()\");\n }", "public function test_loads_config_from_files()\n {\n $config = new Bootphp_Config_File_Reader;\n\n $values = $config->load('inflector');\n\n // Due to the way the cascading filesystem works there could be\n // any number of modifications to the system config in the\n // actual output. Therefore to increase compatability we just\n // check that we've got an array and that it's not empty\n $this->assertNotSame([], $values);\n $this->assertInternalType('array', $values);\n }", "private function readConfig(){\n\n\t\t$this->_ini_array = parse_ini_file(CONFIG.'system.ini');\n\n\t\t$this->_host =\t$this->_ini_array['db_host'];\n\t\t$this->_username = $this->_ini_array['db_username'];\n\t\t$this->_password = $this->_ini_array['db_password'];\n\t\t$this->_database = $this->_ini_array['db_database'];\n\t\n\t\t$this->_log_enabled=$this->_ini_array['log_enabled'];\n\t\t$this->_log_level=$this->_ini_array['log_level'];\n\t\t$this->_log_file_path=$this->_ini_array['log_path'];\n\t\n\n\t\t$this->_lang_default=$this->_ini_array['lang_default'];\n\n\t}", "private function getRead()\n {\n if (!$this->read) {\n shuffle($this->readConfigs);\n foreach ($this->readConfigs as $config) {\n /** @var \\Redis $redis */\n $redis = $config['redis'];\n try {\n $redis->connect($config['host'], $config['port'], $config['timeout']);\n $redis->setOption(Redis::OPT_SERIALIZER, $this->getSerializerValue());\n $this->read = $redis;\n break;\n }\n catch (\\RedisException $ex) {\n if ($this->logger) {\n $this->logger->warning('Failed to connect to a Redis read replica.', [\n 'exception' => $ex,\n 'host' => $config['host'],\n 'port' => $config['port'],\n ]);\n }\n }\n }\n\n // If we failed to connect to any read replicas, give up, and send back the last exception (if any)\n if (!$this->read) {\n throw new \\RedisException('Failed to connect to any Redis read replicas.', 0, isset($ex) ? $ex : null);\n }\n }\n\n return $this->read;\n }", "public function __construct(){\n\t\t$this->_file = BP.'/settings.ini';\n\t\t$config_file = $this->_file;\n\t\tif(!file_exists($config_file)){\n\t\t\tthrow new \\Exception('The file '. basename($config_file) .' does not existed or cannot readable permission, please check in '. BP);\n\t\t}\n\t\t$setting_content = '';\n\t\t//read line\n\t\t$this->_handle = fopen($config_file, \"r+\");\n\t\tif ($this->_handle) {\n\t\t\twhile (($line = fgets($this->_handle)) !== false) {\n\t\t\t\t// process the line read.\n\t\t\t\tif(strpos(trim($line), '#') === 0){\n\t\t\t\t\tcontinue; //ignore comment line\n\t\t\t\t}\n\t\t\t\t//connect string content\n\t\t\t\tif($line != ''){\t\t\t\n\t\t\t\t\t$setting_content .= $line;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfclose($this->_handle); //destroy handle file opening\n\t\t\t\n\t\t\t$this->_settings = json_decode($setting_content, true); //converted into associative arrays\n\t\t\tif($setting_content != '' && $this->_settings == null && ($json_error = json_last_error()) != JSON_ERROR_NONE){\n\t\t\t\tswitch ($json_error) {\n\t\t\t\t\tcase JSON_ERROR_NONE:\n\t\t\t\t\t\t$json_error = ''; // JSON is valid // No error has occurred\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase JSON_ERROR_DEPTH:\n\t\t\t\t\t\t$json_error = 'The maximum stack depth has been exceeded.';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase JSON_ERROR_STATE_MISMATCH:\n\t\t\t\t\t\t$json_error = 'Invalid or malformed JSON.';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase JSON_ERROR_CTRL_CHAR:\n\t\t\t\t\t\t$json_error = 'Control character error, possibly incorrectly encoded.';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase JSON_ERROR_SYNTAX:\n\t\t\t\t\t\t$json_error = 'Syntax error, malformed JSON.';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t// PHP >= 5.3.3\n\t\t\t\t\tcase JSON_ERROR_UTF8:\n\t\t\t\t\t\t$json_error = 'Malformed UTF-8 characters, possibly incorrectly encoded.';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t// PHP >= 5.5.0\n\t\t\t\t\tcase JSON_ERROR_RECURSION:\n\t\t\t\t\t\t$json_error = 'One or more recursive references in the value to be encoded.';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t// PHP >= 5.5.0\n\t\t\t\t\tcase JSON_ERROR_INF_OR_NAN:\n\t\t\t\t\t\t$json_error = 'One or more NAN or INF values in the value to be encoded.';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase JSON_ERROR_UNSUPPORTED_TYPE:\n\t\t\t\t\t\t$json_error = 'A value of a type that cannot be encoded was given.';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$json_error = 'Unknown JSON error occured.';\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tthrow new \\Exception($json_error.PHP_EOL);\n\t\t\t}\n\t\t} else {\n\t\t\t// error opening the file.\n\t\t\tthrow new \\Exception('The file '. basename($config_file) .' opening error');\n\t\t}\n\t}", "function readResource() {\n\t\tif ( $this->_Resource ) {\n\t\t\tif ( stripos($this->_Resource, '<xml') !== false || stripos($this->_Resource, '<wurfl') !== false ) {\n\t\t\t\t$this->_Xml = @simplexml_load_string($this->_Resource);\n\t\t\t} elseif ( @file_exists($this->_Resource) && @is_readable($this->_Resource) ) {\n\t\t\t\t$this->_Xml = @simplexml_load_file($this->_Resource);\n\t\t\t} else {\n\t\t\t\tthrow new wurflException('Cannot read resource '.$this->_Resource.'. Resource must be either a valid file or an XML string');\n\t\t\t}\n\t\t}\n\t}", "public function initializeObject()\n {\n if (!isset($this->options['csvFilePath']) || !is_string($this->options['csvFilePath'])) {\n throw new InvalidArgumentException('Missing or invalid \"csvFilePath\" in preset part settings', 1429027715);\n }\n\n $this->csvFilePath = $this->options['csvFilePath'];\n if (!is_file($this->csvFilePath)) {\n throw new \\Exception(sprintf('File \"%s\" not found', $this->csvFilePath), 1427882078);\n }\n\n if (isset($this->options['csvDelimiter'])) {\n $this->csvDelimiter = $this->options['csvDelimiter'];\n }\n\n if (isset($this->options['csvEnclosure'])) {\n $this->csvEnclosure = $this->options['csvEnclosure'];\n }\n\n $this->logger->debug(sprintf('%s will read from \"%s\", using %s as delimiter and %s as enclosure character.', get_class($this), $this->csvFilePath, $this->csvDelimiter, $this->csvEnclosure));\n }", "public function parseConfig()\n {\n $fileContents = file_get_contents($this->filename);\n if (!$fileContents) {\n $this->error = 'Failed to read file contents';\n\n return false;\n }\n\n $config = json_decode($fileContents, true);\n if (json_last_error()) {\n $this->error = json_last_error_msg();\n\n return false;\n }\n\n $this->config = new Data(array_replace_recursive($config, $this->overrides));\n\n return true;\n }", "abstract protected function loadConfiguration($name);", "private static function init()\n {\n if (self::$config !== null) {\n return;\n }\n\n if (empty(self::$configPath)) {\n throw new Exception('Please set path to json config file in SystemConfig::$configPath');\n }\n\n self::$config = [];\n \n if (file_exists(self::$configPath)) {\n self::$config = @json_decode(file_get_contents(self::$configPath));\n }\n }", "public function read($filename)\n {\n if (!file_exists($filename)) {\n throw new Config_Lite_RuntimeException('file not found: ' . $filename);\n }\n $this->filename = $filename;\n $this->sections = parse_ini_file($filename, true);\n if (false === $this->sections) {\n throw new Config_Lite_RuntimeException(\n 'failure, can not parse the file: ' . $filename);\n }\n }", "public function readConfigFile(): void\n {\n $configPath = __DIR__ . '/../../.config';\n if (!file_exists($configPath)) {\n echo \"Could not find .config\\n\";\n die;\n }\n $lines = preg_split('/[\\r\\n]+/', file_get_contents($configPath));\n foreach ($lines as $line) {\n if (empty($line)) {\n continue;\n }\n if (substr($line, 0, 1) == '#') {\n continue;\n }\n $kv = preg_split(\"/=/\", $line);\n $key = $kv[0];\n $value = $kv[1];\n $this->data[$key] = $value;\n }\n }", "public function testIfItReadsLocalFile()\n {\n $path = $this->getConfigExampleFilePath();\n $reader = new Reader(new Configuration());\n $data = $reader->read($path);\n\n $this->assertInternalType('array', $data);\n }", "public function testCsvReaderThrowsCannotDetermineDialectIfDataCorrupt() {\n \n //$this->expectException(new Csv_Exception_CannotDetermineDialect('File does not exist or is not readable: \"./data/nonexistant.csv\".'));\n $reader = new Csv_Reader('./data/corrupt.csv');\n \n }", "public function load()\n\t{\n\t\tif (file_exists(self::$configPath))\n\t\t{\n\t\t\t$this->config = json_decode(file_get_contents(self::$configPath), true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->config = array();\n\t\t}\n\t}", "public function __construct()\n {\n // Check PHP version\n $this->_checkPHPVersion(5.3);\n\n $this->file = __DIR__.'/../datas/config.json';\n\n if (!file_exists($this->file))\n throw new \\Exception('Config file '.basename($this->file).' not found');\n\n $this->_readFile();\n }", "public static function wrongConfigigurationProvider() {}", "public static function read()\n {\n return self::$config;\n }", "public function read()\n {\n }", "private static function init()\n {\n $configFile = App::root(self::FILE);\n if (!file_exists($configFile)) {\n throw new Exception('Missing configuration file: ' . self::FILE);\n }\n\n $userConfig = require $configFile;\n\n return array_replace_recursive(self::$default, $userConfig);\n }", "public function validate() {\n\n if (empty($this->config['default_pool_read'])) {\n throw new neoform\\config\\exception('\"default_pool_read\" must be set');\n }\n\n if (empty($this->config['default_pool_write'])) {\n throw new neoform\\config\\exception('\"default_pool_write\" must be set');\n }\n\n if (empty($this->config['pools']) || ! is_array($this->config['pools']) || ! $this->config['pools']) {\n throw new neoform\\config\\exception('\"pools\" must contain at least one server');\n }\n }", "private function validateConfig()\n {\n // Throw error when username is missing from the config files.\n if (! config('mailcamp.username')) {\n throw new MailcampException('Mailcamp API error: No username is specified for connecting with Mailcamp.');\n }\n\n // Throw error when token is missing from the config files.\n if (! config('mailcamp.token')) {\n throw new MailcampException('Mailcamp API error: No token is specified for connecting with Mailcamp.');\n }\n\n // Throw error when endpoint is missing from the config files.\n if (! config('mailcamp.endpoint')) {\n throw new MailcampException('Mailcamp API error: No endpoint is specified for connecting with Mailcamp.');\n }\n\n // Set connection details.\n $this->config = new \\stdClass();\n $this->config->username = config('mailcamp.username');\n $this->config->token = config('mailcamp.token');\n $this->config->endpoint = config('mailcamp.endpoint');\n }", "private function read(): array|false {\n $security = \"<?php header(\\\"Status: 403\\\"); exit(\\\"Access denied.\\\"); ?>\\n\";\n $contents = @file_get_contents(INCLUDES_DIR.DIR.\"config.json.php\");\n\n if ($contents === false)\n return false;\n\n $json = json_get(str_replace($security, \"\", $contents), true);\n\n if (!is_array($json))\n return false;\n\n return $this->data = $json;\n }", "protected function reader()\n {\n if ($this->_reader === null) {\n $this->_reader = Reader::createFromDefaults();\n }\n\n return $this->_reader;\n }", "function __construct()\n {\n $arguments = func_num_args();\n\n if ($arguments != 1) {\n throw new InvalidConfigurationException(\"Invalid arguments. Use config array\");\n } else {\n $this->config = func_get_arg(0);\n\n if(!is_array($this->config))\n throw new InvalidConfigurationException(\"Invalid arguments. Use config array\");\n\n if(!array_key_exists('login', $this->config))\n throw new InvalidConfigurationException(\"Invalid arguments. The config array is missing the 'login' key\");\n\n if(!array_key_exists('password', $this->config))\n throw new InvalidConfigurationException(\"Invalid arguments. The config array is missing the 'password' key\");\n }\n }", "public function validateConfig() {\n // Validate the site has default content configuration.\n if (empty($this->defaultContentConfig)) {\n throw new \\Exception(\"No default content configuration exists for current site.\");\n }\n\n // Validate the configuration specifies a valid path.\n if (isset($this->defaultContentConfig['path']) && !is_dir($this->defaultContentConfig['path'])) {\n throw new \\Exception(\"Configured default content path is not a valid directory. Check the site's configuration.\");\n }\n\n // Validate that default entities to export are given.\n if (empty($this->defaultContentConfig['default-entities']) || !is_array($this->defaultContentConfig['default-entities'])) {\n throw new \\Exception(\"Default entities are not properly configured. Ensure entity types are listed.\");\n }\n\n // Validate a proper default_author value is passed.\n if (isset($this->defaultContentConfig['default_author']) && $this->defaultContentConfig['default_author'] != self::DEFAULT_AUTHOR_PRESERVE) {\n if (!is_numeric($this->defaultContentConfig['default_author'])) {\n throw new \\Exception(\"Assigned default_author value is not an integer. Assign to a valid UID.\");\n }\n }\n }", "public abstract function loadConfig($fileName);", "public function load()\n {\n $parser = new ezcConfigurationIniParser( ezcConfigurationIniParser::PARSE, $this->path );\n $settings = array();\n $comments = array();\n\n foreach ( new NoRewindIterator( $parser ) as $element )\n {\n if ( $element instanceof ezcConfigurationIniItem )\n {\n switch ( $element->type )\n {\n case ezcConfigurationIniItem::GROUP_HEADER:\n $settings[$element->group] = array();\n if ( !is_null( $element->comments ) )\n {\n $comments[$element->group]['#'] = $element->comments;\n }\n break;\n\n case ezcConfigurationIniItem::SETTING:\n eval( '$settings[$element->group][$element->setting]'. $element->dimensions. ' = $element->value;' );\n if ( !is_null( $element->comments ) )\n {\n eval( '$comments[$element->group][$element->setting]'. $element->dimensions. ' = $element->comments;' );\n }\n break;\n }\n }\n if ( $element instanceof ezcConfigurationValidationItem )\n {\n throw new ezcConfigurationParseErrorException( $element->file, $element->line, $element->description );\n }\n }\n\n $this->config = new ezcConfiguration( $settings, $comments );\n return $this->config;\n }", "public function validateConfig()\n\t{\n\t\t$schemaContent = @file_get_contents(Config::$schemaFile);\n\t\tif($schemaContent === FALSE) {\n\t\t\t$this->errors['File not found'][] = [\n\t\t\t\t'property' => Config::$schemaFile,\n\t\t\t\t'message' => 'Schema file not found.'\n\t\t\t];\n\t\t\treturn;\n\t\t}\n\n\t\t$schema = Json::decode($schemaContent);\n\n\t\t$this->schemaValidator->check($this->config, $schema);\n\n\t\tif (!$this->schemaValidator->isValid()) {\n\t\t\t$this->errors['schema'] = $this->schemaValidator->getErrors();\n\t\t}\n\t}", "private function _checkConfig() {\n // Ftp configuration can be namespaced with the 'ftp' keyword\n if (isset($this->_config['ftp']))\n $this->_config = $this->_config['ftp'];\n\n // Check each configuration entry\n if (empty($this->_config) || !is_array($this->_config))\n throw new \\InvalidArgumentException(\"Configuration should be an array\");\n else if (empty($this->_config['host']))\n throw new \\InvalidArgumentException(\"Ftp server host not specified in configuration\");\n else if (empty($this->_config['port']))\n throw new \\InvalidArgumentException(\"Ftp server port not specified in configuration\");\n else if (empty($this->_config['user']))\n throw new \\InvalidArgumentException(\"Ftp user not specified in configuration\");\n else if (empty($this->_config['private_key']))\n throw new \\InvalidArgumentException(\"Ftp user ssh private key not specified in configuration\");\n else if (!is_readable($this->_baseDir.'/'.$this->_config['private_key']))\n throw new \\InvalidArgumentException(\"Ftp user ssh private key not found or not readable at: \".$this->_baseDir.'/'.$this->_config['private_key']);\n else if (empty($this->_config['public_key']))\n throw new \\InvalidArgumentException(\"Ftp user ssh public key not specified in configuration\");\n else if (!is_readable($this->_baseDir.'/'.$this->_config['public_key']))\n throw new \\InvalidArgumentException(\"Ftp user ssh public key not found or not readable at: \".$this->_baseDir.'/'.$this->_config['public_key']);\n }", "public function parseConfig()\n {\n parent::parseConfig();\n if(empty($this->config['parentClass'])) {\n throw new \\InvalidArgumentException(\"parentClass configuration option is required to use parent factory\");\n }\n $this->parentClass = $this->config['parentClass'] ?: null;\n $this->parentNamespace = $this->config['parentNamespace'] ?: $this->namespace;\n }", "public abstract function validateConfig($config);", "public function read() {\r\n }", "protected function _load_config()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n try {\n $config_file = new Configuration_File(self::FILE_CONFIG);\n $rawdata = $config_file->load();\n } catch (File_Not_Found_Exception $e) {\n // Not fatal, set defaults below\n } catch (Engine_Exception $e) {\n throw new Engine_Exception($e->get_message(), CLEAROS_WARNING);\n }\n\n if (isset($rawdata['allow_shell']) && preg_match(\"/(true|1)/i\", $rawdata['allow_shell']))\n $this->config['allow_shell'] = TRUE;\n else\n $this->config['allow_shell'] = FALSE;\n\n if (isset($rawdata['theme_mode']) && !empty($rawdata['theme_mode']))\n $this->config['theme_mode'] = $rawdata['theme_mode'];\n else\n $this->config['theme_mode'] = 'normal';\n\n if (isset($rawdata['theme']) && !empty($rawdata['theme']))\n $this->config['theme'] = $rawdata['theme'];\n else\n $this->config['theme'] = 'default';\n\n $this->is_loaded = TRUE;\n }", "private function readXML() {\n $xmlFile = __DIR__ .\"\\configuracion.xml\";\n if (file_exists($xmlFile)) {\n $xml = simplexml_load_file($xmlFile);\n } else {\n exit('Fallo al abrier el archivo configuraciones.xml');\n }\n $this->host = $xml->mysql[0]->host;\n $this->database = $xml->mysql[0]->database;\n $this->user = $xml->mysql[0]->user;\n $this->password = $xml->mysql[0]->password;\n }", "private static function loadAppConfig() {\n\t\t\t$appConfJson = file_get_contents(JIAOYU_PROJECT_HOME.\"/app/conf/config.json\");\n\t\t\ttry {\n\t\t\t\t$appConf = JsonUtils::decode($appConfJson);\n\t\t\t} catch (JsonException $e) {\n\t\t\t\tthrow new ConfigurationException(\"Error initializing app config: \".$e->getMessage());\n\t\t\t}\n\n\t\t\t// OK - now we can load up the config array from the file\n\t\t\tforeach ($appConf as $configKey => $configValue) {\n\t\t\t\tself::$config[$configKey] = $configValue;\n\t\t\t}\n\t\t}", "abstract protected function loadConfig(array $config);", "static function loadConfig() {\n\t\t$config = self::file($_SERVER[\"DOCUMENT_ROOT\"] . \"/../config.json\");\n\t\tif (!is_null($config))\n\t\t\tself::$config = json_decode($config);\n\t}", "public function processConfiguration() {}", "public function checkConfig();", "abstract public function loadConfig(array $config);", "function loadConfig(){\n $file = file_get_contents($this->config_dir, FILE_USE_INCLUDE_PATH);\n $urls = json_decode($file,TRUE);\n //not the best way but error handling\n if ($file == NULL || $urls == NUll ){\n print(\"Error reading the config file or it it is empty\");\n }\n else{\n $this->config_data = $urls;\n\n }\n }", "function get_config($filename)\n{\n\t$config = parse_ini_file($filename);\n\n\tif ($config === FALSE) {\n\t\tthrow new Exception(\"could not read configuration from '{$filename}'\");\n\t}\n\n\tif (!isset($config['url'])) {\n\t\tthrow new Exception(\"url not found in '{$filename}'\");\n\t}\n\tif (!isset($config['username'])) {\n\t\tthrow new Exception(\"username not found in '{$filename}'\");\n\t}\n\tif (!isset($config['password'])) {\n\t\tthrow new Exception(\"password not found in '{$filename}'\");\n\t}\n\tif (!isset($config['source'])) {\n\t\tthrow new Exception(\"source project not found in '{$filename}'\");\n\t}\n\tif (!isset($config['destination'])) {\n\t\tthrow new Exception(\"destination project not found in '{$filename}'\");\n\t}\n\n\treturn $config;\n}", "public function testCsvReaderThrowsCannotDetermineDialectIfDataTooSmall() {\n \n $this->expectException(new Csv_Exception_CannotDetermineDialect('You must provide at least ten lines in your sample data.'));\n $reader = new Csv_Reader('./data/too-short.csv');\n \n }", "function config_load() {\n\t\t$config_camera = '/^\\s*([^:]+)\\s*:\\s*([0-9a-f]{2})[:-]?([0-9a-f]{2})[:-]?([0-9a-f]{2})[:-]?([0-9a-f]{2})[:-]?([0-9a-f]{2})[:-]?([0-9a-f]{2})\\s+(\\d+)\\s*x\\s*(\\d+)\\s*$/iu';\n\t\t$config_gate = '/^\\s*(.+)\\s*\\((\\d+)\\s*,\\s*(\\d+)\\)\\s*\\((\\d+),(\\d+)\\)\\s*$/u';\n\n\t\t$data = file(CONFIG_PATH);\n\t\tif ($data === NULL) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$config = array();\n\n\t\t$status = 0;\n\t\tfor ($n=0; $n<sizeof($data); $n++) {\n\t\t\t$str = $data[$n];\n\t\t\n\t\t\tif (preg_match($config_camera, $str, $matches)) {\n\t\t\t\t$name = trim($matches[1]);\n\t\t\t\t$hw_id = $matches[2].$matches[3].$matches[4].$matches[5].$matches[6].$matches[7];\n\t\t\t\t$width = $matches[8];\n\t\t\t\t$height= $matches[9];\n\n\t\t\t\t$gates = array();\n\t\t\t\tarray_push($config, \n\t\t\t\t\t\t array(\"hw\" => $hw_id, \n\t\t\t\t\t\t \"name\" => $name, \n\t\t\t\t\t\t\t\t \"gates\" => &$gates,\n\t\t\t\t\t\t\t\t \"width\" => $width,\n\t\t\t\t\t\t\t\t \"height\"=> $height));\n\t\t\t\t$status = 1;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ($status == 1 && preg_match($config_gate, $str, $matches)) {\n\t\t\t\tarray_push($gates, array(\"name\"=>trim($matches[1]),\n\t\t\t\t\t\t\t\t\t\t \"x1\" =>$matches[2],\n\t\t\t\t\t\t\t\t\t\t \"y1\" =>$matches[3],\n\t\t\t\t\t\t\t\t\t\t \"x2\" =>$matches[4],\n\t\t\t\t\t\t\t\t\t\t \"y2\" =>$matches[5]));\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\treturn $config;\n\t}", "public static function read( $key ) {\r\n\t\t\t// split keys\r\n\t\t\t$keys = self::explode( $key );\r\n\t\t\t// read value\r\n\t\t\t$data = self::$data;\r\n\r\n\t\t\tforeach ( $keys as $part ) {\r\n\t\t\t\tif ( isset( $data[ $part ] ) ) {\r\n\t\t\t\t\t$data = $data[ $part ];\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\tthrow new ConfigureException( $key );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn $data;\r\n\t\t}", "public function readConfigAction()\n {\n $this->getResponse()->setBody(self::getHelper()->readconfig());\n\n }", "function Event_Config_Read()\n {\n if (empty($this->Event_Config))\n {\n $this->Event_Config=$this->ReadPHPArray($this->Event_Config_File());\n $groups=$this->Dir_Files($this->Event_Config_Path.\"/Config\",'\\.php$');\n $this->Event_Config_Group=$this->Event_Config[ \"Config_Group_Default\" ];\n \n }\n }", "public function testLoadWithInvalidConfiguration(string $expectedMessage, array $config): void\n {\n $this->expectException(InvalidConfigurationException::class);\n $this->expectExceptionMessage($expectedMessage);\n $this->load($config);\n }", "public function read()\n {\n }", "private function read_config() {\n\t\t$sections = parse_ini_file($this->config['conf'], true);\n\t\tforeach ($sections as $sectionk => $sectionv) {\n\t\t\tforeach ($sectionv as $key => $var)\n\t\t\t\t$this->config[$sectionk . '.' . $key] = $var;\n\t\t}\n\t}", "private static function throwMissingConfigException()\n {\n throw new ValidationException('-missing parameter: This method requires an Svea\\WebPay\\Config\\ConfigurationProvider object as parameter. Create a class that implements class Svea\\WebPay\\Config\\ConfigurationProvider. Set returnvalues to configuration values. Create an object from that class. Alternative use static function from class ConfigurationService e.g. ConfigurationService::getDefaultConfig(). You can replace the default config values into config files to return your own config values.');\n }", "abstract protected function getConfig();", "abstract public function read();", "private function __construct() {\n if (!$this->read() and !INSTALLING)\n trigger_error(\n __(\"Could not read the configuration file.\"),\n E_USER_ERROR\n );\n\n fallback($this->data[\"sql\"], array());\n fallback($this->data[\"enabled_modules\"], array());\n fallback($this->data[\"enabled_feathers\"], array());\n fallback($this->data[\"routes\"], array());\n }", "public function __construct()\n {\n if (is_file($config = root('config', 'config.php'))) {\n $this->item = (array) require($config);\n }\n if (is_file($config = _DIR_ . _DS_ . 'config.php')) {\n $this->set((array) require($config));\n }\n if(getenv('ENV')){\n if(is_file($config_env = root('config', getenv('ENV').'.php'))){\n $this->set((array) require($config_env));\n }\n }\n if (!$this->item) {\n throw new \\ErrorException('Unable load config');\n }\n }", "public function load()\n {\n $ini = APP_DIR.'config/'.ENVIRONMENT.'.ini';\n\n if(!file_exists($ini))\n Clockwork::throwError('Could not load config ('.$ini.')');\n\n $this->data = parse_ini_file($ini, true);\n \n $this->setValues();\n }", "protected function readConfigFile($filename, $environment)\r\n {\r\n $filename = realpath($filename);\r\n if (!file_exists($filename)) {\r\n ExceptionFactory::ResourceConfigException('Config file ' . $filename . ' not found');\r\n }\r\n $tmp = explode('.', $filename);\r\n $extension = array_pop($tmp);\r\n switch($extension) {\r\n case 'ini':\r\n return new IniFile($filename, $environment);\r\n \r\n case 'php':\r\n return new PhpFile($filename);\r\n \r\n default:\r\n ExceptionFactory::ResourceConfigException('Unsupported config file format'); \r\n }\r\n }", "private static function check_config ()\n\t{\n\t\t// load config file here\n\t\tif (count(self::$_config) == 0)\n\t\t{\n\t\t\tself::LoadConfigFile();\n\t\t}\n\t}", "public function init()\r\n\t{\r\n\t\tif ( $this->arrConfig == null )\r\n\t\t{\r\n\t\t\t// locate the config file\r\n\t\t\t\r\n\t\t\t$file = $this->config_file . \".xml\";\r\n\r\n\t\t\tif ( ! file_exists($file) )\r\n\t\t\t{\r\n\t\t\t\tthrow new \\Exception( \"could not find configuration file\" );\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// load it\r\n\r\n\t\t\t$this->xml = simplexml_load_file( $file );\r\n\t\t\t\r\n\t\t\t// process it\r\n\t\t\t\r\n\t\t\t$this->process();\r\n\t\t}\r\n\t}", "private function readLogConfig(){\n\n\t\t$_config = ConfigUtil::getInstance();\n\n\t\t$this->_log_enabled = $_config->isLogEnabled();\n\t\t$this->_log_level = $_config->getLogLevel();\n\t\t$this->_log_file_path = $_config->getLogFilePath();\n\t\n\t}", "public function __construct($filename)\n {\n if (!file_exists($filename)) {\n throw new Exception(\"The given configuration file cannot be read\", 100);\n }\n\n //get the json encoded application settings\n $configContent = file_get_contents($filename);\n\n //parse the settings file\n $incompleteConfig = SerializableCollection::deserialize($configContent)->all();\n\n //complete the request\n $this->configuration = $this->getValueFromEnvironment($incompleteConfig);\n }" ]
[ "0.7547402", "0.6792228", "0.65145844", "0.6422987", "0.6400024", "0.62865716", "0.61924845", "0.61787325", "0.6087771", "0.6086889", "0.6051821", "0.6048147", "0.5990192", "0.59824723", "0.5902287", "0.5902287", "0.5902287", "0.5902287", "0.5902287", "0.5902287", "0.5902287", "0.58391404", "0.581325", "0.5788011", "0.5769996", "0.57648134", "0.57324487", "0.56945723", "0.5683497", "0.56596684", "0.5630341", "0.5630341", "0.5613531", "0.5610501", "0.5548559", "0.55400056", "0.5538821", "0.54999036", "0.5493492", "0.5490874", "0.54835075", "0.5447305", "0.54416203", "0.5438653", "0.5437507", "0.5426445", "0.5388064", "0.5384284", "0.538416", "0.5378735", "0.5377689", "0.5373956", "0.53717643", "0.53716266", "0.53441995", "0.5339405", "0.5328551", "0.5325801", "0.5324593", "0.5323124", "0.53127193", "0.53015876", "0.5276118", "0.5269379", "0.5269263", "0.52526397", "0.5250142", "0.5248342", "0.52474385", "0.5246921", "0.5246405", "0.524325", "0.5242301", "0.5239801", "0.5209425", "0.51994216", "0.5190655", "0.518712", "0.5184227", "0.517692", "0.5172524", "0.5168998", "0.5166765", "0.51654875", "0.5161779", "0.51611555", "0.5156807", "0.5142922", "0.51293314", "0.5127214", "0.5125942", "0.51228863", "0.5122633", "0.51179093", "0.51146394", "0.51115346", "0.50981474", "0.50934976", "0.50932187", "0.50927883" ]
0.72035116
1
Test reading of simple yaml file.
public function testIfItReadsLocalFile() { $path = $this->getConfigExampleFilePath(); $reader = new Reader(new Configuration()); $data = $reader->read($path); $this->assertInternalType('array', $data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testParseGoodYAMLImport()\n {\n $importer = new WorkflowDefinitionImporter();\n $source = <<<'EOD'\n---\nName: exportedworkflow\n---\nSilverStripe\\Core\\Injector\\Injector:\n ExportedWorkflow:\n class: Symbiote\\AdvancedWorkflow\\Templates\\WorkflowTemplate\n constructor:\n - 'My Workflow 4 20/02/2014 03-12-55'\n - 'Exported from localhost on 20/02/2014 03-12-55 by joe bloggs using SilverStripe versions Framework 4.0.0-beta3'\n - 0.2\n - 0\n - 3\n properties:\n structure:\n 'Step One':\n type: Symbiote\\AdvancedWorkflow\\DataObjects\\WorkflowAction\n transitions:\n - Step One T1: 'Step Two'\n 'Step Two':\n type: Symbiote\\AdvancedWorkflow\\DataObjects\\WorkflowAction\n Symbiote\\AdvancedWorkflow\\Services\\WorkflowService:\n properties:\n templates:\n - '%$ExportedWorkflow'\nEOD;\n\n $this->assertNotEmpty($importer->parseYAMLImport($source));\n }", "public function loadYamlConfig($filepath);", "function YAMLLoad($input) {\n\t\t$spyc = new Spyc;\n\t\treturn $spyc->load($input);\n\t}", "public function testConfigFromSingleFile()\n {\n $cfg = new Configuration();\n $cfg->setBaseDirectories($this->dirs);\n $config = $cfg->load(\"view\");\n\n $this->assertInternalType(\"array\", $config);\n $this->assertArrayHasKey(\"file\", $config);\n $this->assertArrayHasKey(\"config\", $config);\n $this->assertArrayNotHasKey(\"items\", $config);\n $this->assertContains(\"a view\", $config[\"config\"]);\n }", "public function testReadFile1()\n {\n IniReader::readFile('nonexist.ini');\n }", "public static function getYamlConfig()\n {\n return file_get_contents(self::fixtureDir().'/fixture_config.yml');\n }", "public function testParseBadYAMLNoHeaderImport()\n {\n $importer = new WorkflowDefinitionImporter();\n $this->expectException(\\Exception::class);\n $this->expectExceptionMessage('Invalid YAML format.');\n $source = <<<'EOD'\nSilverStripe\\Core\\Injector\\Injector\\Injector:\n ExportedWorkflow:\n class: Symbiote\\AdvancedWorkflow\\Templates\\WorkflowTemplate\n constructor:\n - 'My Workflow 4 20/02/2014 03-12-55'\n - 'Exported from localhost on 20/02/2014 03:12:55 by joe bloggs using SilverStripe versions Framework 4.0.0-beta3'\n - 0.2\n - 0\n - 3\n properties:\n structure:\n 'Step One':\n type: Symbiote\\AdvancedWorkflow\\DataObjects\\WorkflowAction\n transitions:\n - Step One T1: 'Step Two'\n 'Step Two':\n type: Symbiote\\AdvancedWorkflow\\DataObjects\\WorkflowAction\n Symbiote\\AdvancedWorkflow\\Services\\WorkflowService:\n properties:\n templates:\n - '%$ExportedWorkflow'\nEOD;\n\n $importer->parseYAMLImport($source);\n }", "public static function getSampleYamlFile()\n {\n return self::fixtureDir().'/fixture_sample.yml';\n }", "public static function getYamlContents(string $filename)\n {\n $result = null;\n if (file_exists($filename)) {\n $result = Yaml::parse(file_get_contents($filename));\n }\n return $result;\n }", "protected static function parseYaml($filename) {\n if (!file_exists($filename)) {\n throw new \\Exception('A config.yml file must exist in the project root.');\n }\n return Yaml::parse(file_get_contents($filename));\n }", "public function test_loads_config_from_files()\n {\n $config = new Bootphp_Config_File_Reader;\n\n $values = $config->load('inflector');\n\n // Due to the way the cascading filesystem works there could be\n // any number of modifications to the system config in the\n // actual output. Therefore to increase compatability we just\n // check that we've got an array and that it's not empty\n $this->assertNotSame([], $values);\n $this->assertInternalType('array', $values);\n }", "public function testLoadConfigurationFromFile()\n {\n // TODO can I mock the Yaml classes too?\n //$this->markTestSkipped('The namespace hack is actually working. Now I am missing Symfony\\'s Yaml classes. :(');\n //$this->assertEquals(expected, actual);\n\n $newHelper = $this->helper->createFromFile('/some/path');\n $this->assertInstanceOf('\\CTLib\\Helper\\ConfigValidator', $newHelper);\n $this->assertEquals(\n [\n 'activity.exec_sources',\n 'activity.filter_groups',\n 'activity.travel_distance_sources',\n 'activity.travel_time_sources',\n 'activity.export_when_alerts_cleared'\n ],\n $newHelper->getConfigKeys()\n );\n }", "public function testParseBadYAMLMalformedImport()\n {\n $importer = new WorkflowDefinitionImporter();\n $this->expectException(ValidationException::class);\n $this->expectExceptionMessage('Invalid YAML format. Unable to parse.');\n $source = <<<'EOD'\n---\nName: exportedworkflow\n---\n# Missing colon on line below\nSilverStripe\\Core\\Injector\\Injector\n ExportedWorkflow:\n class: Symbiote\\AdvancedWorkflow\\Templates\\WorkflowTemplate\n constructor:\n - 'My Workflow 4 20/02/2014 03-12-55'\n - 'Exported from localhost on 20/02/2014 03-12-55 by joe bloggs using SilverStripe versions Framework 4.0.0-beta3'\n - 0.2\n - 0\n - 3\n properties:\n structure:\n 'Step One'\n type: Symbiote\\AdvancedWorkflow\\DataObjects\\WorkflowAction\n transitions:\n - Step One T1: 'Step Two'\n 'Step Two':\n type: Symbiote\\AdvancedWorkflow\\DataObjects\\WorkflowAction\n Symbiote\\AdvancedWorkflow\\Services\\WorkflowService:\n properties:\n templates:\n - '%$ExportedWorkflow'\nEOD;\n\n $importer->parseYAMLImport($source);\n }", "function is_yml_file($string)\n {\n return yml::isValidFile($string);\n }", "public function testReadWithNonExistentFile() {\n $reader = new ConfigReader($this->path);\n $reader->read('fake_values');\n }", "private function load($file) {\n $yml = new \\Yaml($file);\n $data = $yml->parse();\n\n $this->name = \\a::get($data, 'name', NULL);\n $this->theme = \\a::get($data, 'theme', \\c::get('theme', 'grass'));\n $this->eventdate = \\a::get($data, 'eventdate', NULL);\n $this->intro = \\a::get($data, 'intro', NULL);\n $this->storeFields(\\a::get($data, 'fields', FALSE));\n $this->action = \\a::get($data, 'action', NULL);\n }", "function load($input) {\n\t// See what type of input we're talking about\n\t// If it's not a file, assume it's a string\n\tif (!empty($input) && (strpos($input, \"\\n\") === false)\n\t\t&& file_exists($input)) {\n\t\t$yaml = file($input);\n\t} else {\n\t\t$yaml = explode(\"\\n\",$input);\n\t}\n\t// Initiate some objects and values\n\t$base = new YAMLNode (1);\n\t$base->indent = 0;\n\t$this->_lastIndent = 0;\n\t$this->_lastNode = $base->id;\n\t$this->_inBlock = false;\n\t$this->_isInline = false;\n\t$this->_nodeId = 2;\n\n\tforeach ($yaml as $linenum => $line) {\n\t\t$ifchk = trim($line);\n\n\t\t// If the line starts with a tab (instead of a space), throw a fit.\n\t\tif (preg_match('/^(\\t)+(\\w+)/', $line)) {\n\t\t$err = 'ERROR: Line '. ($linenum + 1) .' in your input YAML begins'.\n\t\t\t\t' with a tab. YAML only recognizes spaces. Please reformat.';\n\t\tdie($err);\n\t\t}\n\n\t\tif ($this->_inBlock === false && empty($ifchk)) {\n\t\tcontinue;\n\t\t} elseif ($this->_inBlock == true && empty($ifchk)) {\n\t\t$last =& $this->_allNodes[$this->_lastNode];\n\t\t$last->data[key($last->data)] .= \"\\n\";\n\t\t} elseif ($ifchk{0} != '#' && substr($ifchk,0,3) != '---') {\n\t\t// Create a new node and get its indent\n\t\t$node = new YAMLNode ($this->_nodeId);\n\t\t$this->_nodeId++;\n\n\t\t$node->indent = $this->_getIndent($line);\n\n\t\t// Check where the node lies in the hierarchy\n\t\tif ($this->_lastIndent == $node->indent) {\n\t\t\t// If we're in a block, add the text to the parent's data\n\t\t\tif ($this->_inBlock === true) {\n\t\t\t$parent =& $this->_allNodes[$this->_lastNode];\n\t\t\t$parent->data[key($parent->data)] .= trim($line).$this->_blockEnd;\n\t\t\t} else {\n\t\t\t// The current node's parent is the same as the previous node's\n\t\t\tif (isset($this->_allNodes[$this->_lastNode])) {\n\t\t\t\t$node->parent = $this->_allNodes[$this->_lastNode]->parent;\n\t\t\t}\n\t\t\t}\n\t\t} elseif ($this->_lastIndent < $node->indent) {\n\t\t\tif ($this->_inBlock === true) {\n\t\t\t$parent =& $this->_allNodes[$this->_lastNode];\n\t\t\t$parent->data[key($parent->data)] .= trim($line).$this->_blockEnd;\n\t\t\t} elseif ($this->_inBlock === false) {\n\t\t\t// The current node's parent is the previous node\n\t\t\t$node->parent = $this->_lastNode;\n\n\t\t\t// If the value of the last node's data was > or | we need to\n\t\t\t// start blocking i.e. taking in all lines as a text value until\n\t\t\t// we drop our indent.\n\t\t\t$parent =& $this->_allNodes[$node->parent];\n\t\t\t$this->_allNodes[$node->parent]->children = true;\n\t\t\tif (is_array($parent->data)) {\n\t\t\t\t$chk = '';\n\t\t\t\tif (isset ($parent->data[key($parent->data)]))\n\t\t\t\t\t$chk = $parent->data[key($parent->data)];\n\t\t\t\tif ($chk === '>') {\n\t\t\t\t$this->_inBlock = true;\n\t\t\t\t$this->_blockEnd = ' ';\n\t\t\t\t$parent->data[key($parent->data)] =\n\t\t\t\t\t\tstr_replace('>','',$parent->data[key($parent->data)]);\n\t\t\t\t$parent->data[key($parent->data)] .= trim($line).' ';\n\t\t\t\t$this->_allNodes[$node->parent]->children = false;\n\t\t\t\t$this->_lastIndent = $node->indent;\n\t\t\t\t} elseif ($chk === '|') {\n\t\t\t\t$this->_inBlock = true;\n\t\t\t\t$this->_blockEnd = \"\\n\";\n\t\t\t\t$parent->data[key($parent->data)] =\n\t\t\t\t\t\tstr_replace('|','',$parent->data[key($parent->data)]);\n\t\t\t\t$parent->data[key($parent->data)] .= trim($line).\"\\n\";\n\t\t\t\t$this->_allNodes[$node->parent]->children = false;\n\t\t\t\t$this->_lastIndent = $node->indent;\n\t\t\t\t}\n\t\t\t}\n\t\t\t}\n\t\t} elseif ($this->_lastIndent > $node->indent) {\n\t\t\t// Any block we had going is dead now\n\t\t\tif ($this->_inBlock === true) {\n\t\t\t$this->_inBlock = false;\n\t\t\tif ($this->_blockEnd = \"\\n\") {\n\t\t\t\t$last =& $this->_allNodes[$this->_lastNode];\n\t\t\t\t$last->data[key($last->data)] =\n\t\t\t\t\ttrim($last->data[key($last->data)]);\n\t\t\t}\n\t\t\t}\n\n\t\t\t// We don't know the parent of the node so we have to find it\n\t\t\t// foreach ($this->_allNodes as $n) {\n\t\t\tforeach ($this->_indentSort[$node->indent] as $n) {\n\t\t\tif ($n->indent == $node->indent) {\n\t\t\t\t$node->parent = $n->parent;\n\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($this->_inBlock === false) {\n\t\t\t// Set these properties with information from our current node\n\t\t\t$this->_lastIndent = $node->indent;\n\t\t\t// Set the last node\n\t\t\t$this->_lastNode = $node->id;\n\t\t\t// Parse the YAML line and return its data\n\t\t\t$node->data = $this->_parseLine($line);\n\t\t\t// Add the node to the master list\n\t\t\t$this->_allNodes[$node->id] = $node;\n\t\t\t// Add a reference to the parent list\n\t\t\t$this->_allParent[intval($node->parent)][] = $node->id;\n\t\t\t// Add a reference to the node in an indent array\n\t\t\t$this->_indentSort[$node->indent][] =& $this->_allNodes[$node->id];\n\t\t\t// Add a reference to the node in a References array if this node\n\t\t\t// has a YAML reference in it.\n\t\t\tif (\n\t\t\t( (is_array($node->data)) &&\n\t\t\t\tisset($node->data[key($node->data)]) &&\n\t\t\t\t(!is_array($node->data[key($node->data)])) )\n\t\t\t&&\n\t\t\t( (preg_match('/^&([^ ]+)/',$node->data[key($node->data)]))\n\t\t\t\t||\n\t\t\t\t(preg_match('/^\\*([^ ]+)/',$node->data[key($node->data)])) )\n\t\t\t) {\n\t\t\t\t$this->_haveRefs[] =& $this->_allNodes[$node->id];\n\t\t\t} elseif (\n\t\t\t( (is_array($node->data)) &&\n\t\t\t\tisset($node->data[key($node->data)]) &&\n\t\t\t\t(is_array($node->data[key($node->data)])) )\n\t\t\t) {\n\t\t\t// Incomplete reference making code. Ugly, needs cleaned up.\n\t\t\tforeach ($node->data[key($node->data)] as $d) {\n\t\t\t\tif ( !is_array($d) &&\n\t\t\t\t( (preg_match('/^&([^ ]+)/',$d))\n\t\t\t\t\t||\n\t\t\t\t\t(preg_match('/^\\*([^ ]+)/',$d)) )\n\t\t\t\t) {\n\t\t\t\t\t$this->_haveRefs[] =& $this->_allNodes[$node->id];\n\t\t\t\t}\n\t\t\t}\n\t\t\t}\n\t\t}\n\t\t}\n\t}\n\tunset($node);\n\n\t// Here we travel through node-space and pick out references (& and *)\n\t$this->_linkReferences();\n\n\t// Build the PHP array out of node-space\n\t$trunk = $this->_buildArray();\n\treturn $trunk;\n\t}", "public function loadYamlFile($fullFileName)\n {\n $data = false;\n if ($fullFileName && file_exists($fullFileName)) {\n $data = sfYaml::load($fullFileName);\n }\n return $data;\n }", "public function testIfExceptionIsThrownWhenConfigurationIsNotValid()\n {\n $path = $this->getTestDataDir() . '/config.invalid.yml';\n\n $this->assertTrue(is_readable($path), 'Invalid configuration file is missing.');\n\n $reader = new Reader(new Configuration());\n $reader->read($path);\n }", "public function testConfigurationFromFile()\n {\n $path = __DIR__ . '/files/file1.config.php';\n\n $configuration = Factory::fromFile($path);\n\n $this->assertInstanceOf(Configuration::class, $configuration);\n $this->assertEquals(include $path, $configuration->getInternalContainer());\n }", "protected function loadData($file)\n {\n $path = realpath(dirname(__FILE__) . '/../fixtures/');\n\n return Yaml::parse(file_get_contents($path . '/' . $file . '.yml'));\n }", "public function parseYaml()\n {\n if ($this->getMimeType() == 'application/x-yaml' || $this->getMimeType() == 'text/yaml') {\n return yaml_parse($this->getContents());\n }\n }", "private function loadConfigYamlFile($filepath)\n {\n if (!file_exists($filepath)) {\n throw new \\Exception('Project config file could not be loaded! \"'.$filepath.'\"');\n }\n return YamlHelper::parse(file_get_contents($filepath));\n }", "public function parse($input) {\r\n try {\r\n $output = sfYaml::load($input);\r\n }\r\n catch(InvalidArgumentException $ex) {\r\n self::_throwException($ex->getMessage());\r\n } \r\n return $output; \r\n }", "public function testReadEmptyFile() {\n $reader = new ConfigReader($this->path);\n $reader->read('empty');\n }", "public function testLoadPhpConfigFile()\n {\n $config = [\n uniqid('key-') => uniqid('val-'),\n uniqid('key-') => uniqid('val-'),\n uniqid('key-') => uniqid('val-'),\n ];\n\n $vfs = vfsStream::setup('config');\n vfsStream::create(\n [\n 'config.php' => '<?php return '.var_export($config, true).';',\n ],\n $vfs\n );\n\n $subject = $this->createInstance();\n $reflect = $this->reflect($subject);\n\n $actual = $reflect->_loadPhpConfigFile($vfs->url().'/config.php');\n\n $this->assertEquals($config, $actual);\n }", "public function parseFile(string $file)\n {\n if (false === \\function_exists('yaml_parse_file')) {\n throw new Exception('Pecl YAML extension is not installed');\n }\n\n return \\yaml_parse_file($file);\n }", "public function smallestPossibleExample()\n {\n\n $data = [\"Section\" => [\"key\" => \"\"]];\n $ini = StringUtils::ensureLf(<<<'INI'\n[Section]\nkey = \"\"\n\nINI\n );\n\n $this->assertSame($ini, IniSerializer::serialize($data));\n $this->assertSame($data, IniSerializer::deserialize($ini));\n\n }", "public function testConfigFromFileAndDirectory()\n {\n $cfg = new Configuration();\n $cfg->setBaseDirectories($this->dirs);\n $config = $cfg->load(\"route\");\n\n $this->assertInternalType(\"array\", $config);\n $this->assertArrayHasKey(\"file\", $config);\n $this->assertArrayHasKey(\"config\", $config);\n $this->assertContains(\"a route\", $config[\"config\"]);\n $this->assertArrayHasKey(\"items\", $config);\n $this->assertContains(\"a 404 route\", $config[\"items\"][0][\"config\"]);\n $this->assertContains(\"an internal route\", $config[\"items\"][1][\"config\"]);\n }", "public function testGetFile() {\n\t\t$filename = 'test.json';\r\n\t textus_get_file($filename);\n\t \r\n\t}", "function yml_parse_file($ymlFile)\n {\n return yml::parseFile($ymlFile);\n }", "public function testReadFromMicrostorage()\n {\n }", "public function testRead()\n {\n }", "public function testReadConfigurationFileOrArray()\n {\n\t $method = $this->setAccessibleMethod('readConfig');\n\n\t $this->assertEquals([], $method->invoke($this->dbConfiguration->newInstanceWithoutConstructor(), __DIR__.'/dummy/configuration.php'));\n\n\t $this->assertEquals([], $method->invoke($this->dbConfiguration->newInstanceWithoutConstructor(), []));\n }", "public function testInvalidFileException() {\n\t\t$this->expectException('/Could not read file/');\n\t\tFixture::load('Foobar');\n\t}", "public function testParseIniFileIsNotAffected(): void\n {\n $result = parse_ini_file(__DIR__ . '/Fixtures/ini_file.ini', true);\n\n // Contents should not be modified despite there being a shift configured.\n static::assertEquals(\n [\n 'my_section' => [\n 'my_value' => 'mystring is here',\n ],\n ],\n $result\n );\n }", "public function testInfoParserBroken() {\n $broken_info = <<<BROKEN_INFO\n# info.yml for testing broken YAML parsing exception handling.\nname: File\ntype: module\ndescription: 'Defines a file field type.'\npackage: Core\nversion: VERSION\ncore: 8.x\ndependencies::;;\n - field\nBROKEN_INFO;\n\n vfsStream::setup('modules');\n vfsStream::create([\n 'fixtures' => [\n 'broken.info.txt' => $broken_info,\n ],\n ]);\n $filename = vfsStream::url('modules/fixtures/broken.info.txt');\n $this->expectException('\\Drupal\\Core\\Extension\\InfoParserException');\n $this->expectExceptionMessage('broken.info.txt');\n $this->infoParser->parse($filename);\n }", "public static function getYamlConfigFile()\n {\n return self::fixtureDir().'/fixture_config.yml';\n }", "private function parseYaml($yaml)\n {\n $parser = new Parser();\n return $parser->parse($yaml);\n }", "public function testFileSettings() {\n $config = $this->config('file.settings');\n $this->assertSame('textfield', $config->get('description.type'));\n $this->assertSame(128, $config->get('description.length'));\n $this->assertSame('sites/default/files/icons', $config->get('icon.directory'));\n $this->assertConfigSchema(\\Drupal::service('config.typed'), 'file.settings', $config->get());\n }", "function load_sample($filename){\n\n\t$path = SAMPLE_DIR . $filename . SAMPLE_EXT;\n\n\tif(is_readable($path)){\n\t\treturn file_get_contents($path);\n\t}\n}", "function loadFixture($fixtureFile) {\n\t\t$parser = new Spyc();\n\t\t$fixtureContent = $parser->load(Director::baseFolder().'/'.$fixtureFile);\n\t\t\n\t\t$this->fixture = new YamlFixture($fixtureFile);\n\t\t$this->fixture->saveIntoDatabase();\n\t}", "function yml_parse($yml)\n {\n return yml::parse($yml);\n }", "public function test_load_returns_empty_array_if_conf_dir_dnx()\n {\n $config = new Bootphp_Config_File_Reader('gafloogle');\n\n $this->assertSame([], $config->load('values'));\n }", "public function testReadWithDots() {\n $reader = new ConfigReader($this->path);\n $reader->read('../empty');\n }", "public static function parseYamlConfigFile($filename = null)\n {\n try {\n return Yaml::parse(file_get_contents($filename));\n } catch (ParseException $p) {\n throw $p;\n } catch (\\Exception $e) {\n return null;\n }\n }", "public function testReadDocument()\n {\n }", "public function index() {\n // Retrieves file name from parameters\n $file = $this->request->query('file');\n\n if($file == 'config_species') {\n $this->set('read', $this->readConfigSpecies());\n }\n else if( $file == 'config_bogas') {\n $this->set('read', $this->readConfigBogas());\n }\n else {\n $this->error404('Requested resource has not been found!');\n return;\n }\n\n // Sets response header as 200 OK\n $this->response->statusCode(200);\n // Defines response as yaml\n $this->RequestHandler->renderAs($this, 'application/x-yaml');\n $this->set('_serialize', 'read');\n }", "public function test_load_returns_empty_array_if_conf_dnx()\n {\n $config = new Bootphp_Config_File_Reader;\n\n $this->assertSame([], $config->load('gafloogle'));\n }", "function loadFixture($fixtureFile) {\n\t\t$parser = new Spyc();\n\t\t$fixtureContent = $parser->load(Director::baseFolder().'/'.$fixtureFile);\n\t\t\n\t\t$fixture = new YamlFixture($fixtureFile);\n\t\t$fixture->saveIntoDatabase();\n\t\t$this->fixtures[] = $fixture;\n\t}", "public function testConfigFile()\n {\n $this->assertEquals($this->path->config().'/config.php', $this->path->configFile());\n }", "protected function readFrontmatter()\n {\n $regex = '/^---\\s*\\n(.*?\\n?)^---\\s*$\\n?(.*?)\\n*\\z/ms';\n if (preg_match($regex, $this->content, $m)) {\n $this->data = [];\n foreach (Yaml::parse($m[1]) as $key => $val) {\n $key = preg_replace('/-|\\./', '_', $key);\n $this->data[$key] = $val;\n }\n $this->content = $m[2];\n } else {\n #debug\n// throw new \\InvalidEntryException;\n }\n }", "protected function loadFile($file)\n {\n if (!stream_is_local($file)) {\n throw new InvalidArgumentException(sprintf('This is not a local file \"%s\".', $file));\n }\n\n if (!file_exists($file)) {\n throw new InvalidArgumentException(sprintf('The service file \"%s\" is not valid.', $file));\n }\n\n return Yaml::parse(file_get_contents($file));\n }", "private function parseYaml($contents)\n {\n $result = Yaml::parse($contents);\n return $result;\n }", "public function testUseMapping()\n {\n $cfg = new Configuration();\n $cfg->setBaseDirectories($this->dirs);\n $cfg->setMapping(\"item\", ANAX_INSTALL_PATH . \"/test/config/test1.php\");\n $config = $cfg->load(\"item\");\n\n $this->assertInternalType(\"array\", $config);\n $this->assertArrayHasKey(\"file\", $config);\n $this->assertArrayHasKey(\"config\", $config);\n $this->assertArrayHasKey(\"key1\", $config[\"config\"]);\n $this->assertContains(\"value1\", $config[\"config\"]);\n }", "private function load()\n {\n if ($this->sites) {\n return;\n }\n $data = Yaml::parse(file_get_contents($this->file));\n $this->sites = $data['sites'];\n }", "public function testInfoParserMissingKey() {\n $missing_key = <<<MISSINGKEY\n# info.yml for testing missing type key.\nname: File\ndescription: 'Defines a file field type.'\npackage: Core\nversion: VERSION\ncore: 8.x\ndependencies:\n - field\nMISSINGKEY;\n\n vfsStream::setup('modules');\n vfsStream::create([\n 'fixtures' => [\n 'missing_key.info.txt' => $missing_key,\n 'missing_key-duplicate.info.txt' => $missing_key,\n ],\n ]);\n // Set the expected exception for the 2nd call to parse().\n $this->expectException(InfoParserException::class);\n $this->expectExceptionMessage('Missing required keys (type) in vfs://modules/fixtures/missing_key-duplicate.info.txt');\n try {\n $this->infoParser->parse(vfsStream::url('modules/fixtures/missing_key.info.txt'));\n }\n catch (InfoParserException $exception) {\n $this->assertSame('Missing required keys (type) in vfs://modules/fixtures/missing_key.info.txt', $exception->getMessage());\n\n $this->infoParser->parse(vfsStream::url('modules/fixtures/missing_key-duplicate.info.txt'));\n }\n\n }", "public function testSimple()\n {\n //$tokenizer->tokenize(__FILE__);\n }", "public function testReadAll()\n {\n }", "public function testArticleFromJson()\n {\n $articlePath = realpath(__DIR__.'/../fixture/article.json');\n $articleData = json_decode(file_get_contents($articlePath), true);\n $article = Article::fromFile($articlePath);\n $this->assertEquals($articleData, $article->toArray());\n }", "public function testLoadCliConfig()\r\n {\r\n $this->assertTrue($this->wei->getConfig('cli'));\r\n }", "public function testRead()\n {\n //For now file doesn't exist\n $this->assertFileNotExists($this->file);\n $result = $this->SerializedArray->read();\n $this->assertEmpty($result);\n $this->assertIsArray($result);\n\n //Tries some values\n foreach ([\n ['first', 'second'],\n [],\n [true],\n [false],\n [null],\n ] as $value) {\n $this->assertTrue($this->SerializedArray->write($value));\n $result = $this->SerializedArray->read();\n $this->assertEquals($value, $result);\n $this->assertIsArray($result);\n }\n\n //Creates an empty file. Now is always empty\n file_put_contents($this->file, null);\n $result = $this->SerializedArray->read();\n $this->assertEmpty($result);\n $this->assertIsArray($result);\n\n //Creates a file with a string\n file_put_contents($this->file, 'string');\n $result = $this->SerializedArray->read();\n $this->assertEmpty($result);\n $this->assertIsArray($result);\n }", "function testLoadTemplatefile()\n {\n $result = $this->tpl->loadTemplatefile('loadtemplatefile.html', false, false);\n if (PEAR::isError($result)) {\n $this->assertTrue(false, 'Error loading template file: '. $result->getMessage());\n }\n $this->assertEquals('A template', trim($this->tpl->get()));\n }", "protected function loadMappingFile($file)\n {\n return Yaml::parse(file_get_contents($file));\n }", "protected function _get_post($filename)\n {\n $configStr = \"\";\n $content = \"\";\n $handle = @fopen(\"$this->post_folder/$filename\", \"r\");\n if ($handle) {\n $cnt = 0;\n while (($buffer = fgets($handle, 4096)) !== false) {\n if (false !== strpos($buffer, '---')){\n ++$cnt;\n if ($cnt > 1)\n break;\n }\n $configStr .= $buffer;\n }\n\n while (($buffer = fgets($handle, 4096)) !== false) {\n $content .= $buffer;\n }\n\n if (!feof($handle)) {\n echo \"Error: unexpected fgets() fail\\n\";\n }\n fclose($handle);\n }\n\n $config = Spyc::YAMLLoadString($configStr);\n $config['content'] = $content;\n return $config;\n }", "function testLoadSectionStaticConfig(){\n\t\t\techo \"testing magratheaConfig loading static config... <br/>\";\n\t\t\t$thisSection = MagratheaConfig::Instance()->GetConfigSection(\"general\");\n\t\t\t$this->assertIsA($thisSection, \"array\");\n\t\t}", "function is_yml($string)\n {\n return yml::isValid($string);\n }", "public function testReadWithExistentFileWithoutExtension() {\n $reader = new ConfigReader($this->path);\n $reader->read('no_php_extension');\n }", "static protected function _setYamlConfig($file)\n {\n if (file_exists($file)) {\n self::_setConfig(Yaml::parse($file));\n return true;\n }\n \n return false;\n }", "public function configAdapterYamlConstruct(UnitTester $I)\n {\n $I->wantToTest('Config\\Adapter\\Yaml - construct');\n\n $this->checkConstruct($I, 'Yaml');\n }", "public function testIfExceptionIsThrownWhenConfigurationCannotBeRead()\n {\n $reader = new Reader(new Configuration());\n $reader->read('/does-not-exists-i-guess');\n }", "function load($filename){\n\n\t\t//Check if the input is valid\n\t\tif(!\\lib_validation\\validate($filename, LV_STRING))\n\t\t\treturn null;\n\t\t\n\t\t//Escape characters just to be safe \n\t\t$filename = addslashes($filename);\n\t\t\n\t\t//Convert namespace to a file path\n\t\t$filename = \"configs/\" . $filename . \".json\";\n\t\t\n\t\t//Checks if the file exists\n\t\tif(!file_exists($filename))\n\t\t\treturn null;\n\t\t\n\t\t//Load the file\n\t\t$json = file_get_contents($filename);\n\t\t\n\t\t//Parse the file\n\t\t$data = json_decode($json, true);\n\t\t\n\t\t//Return the results (associative array)\n\t\treturn $data;\n\t}", "public function testRead()\n {\n $category = Category::create([\n 'name' => 'Chasse',\n ]);\n\n $expected = $this->serialize($category);\n\n $this->doRead($category)->assertRead($expected);\n }", "public function testReadDocument() {\n\n $obj = new FileSystemStorageProvider($this->logger, $this->directory);\n\n $this->assertContains(\"<?php\", $obj->readDocument($this->doc1));\n }", "public function init($yamlFilePath)\n {\n if (!is_file($yamlFilePath)) {\n throw new ConfigNotFoundException();\n };\n\n try {\n $this->config = Yaml::parse(file_get_contents($yamlFilePath));\n } catch (\\Exception $e) {\n throw new ConfigSyntaxException($yamlFilePath);\n }\n }", "function load( $filename = NULL )\n\t{\n\t\tif ( is_file( $filename ) ) {\n\n\t\t} else {\n\t\t\tthrow new FileNotFound( 'config file not exist!' );\n\t\t}\n\t}", "public function loadFromFile()\n {\n $this->getLogger()->debug('Reading metadata from ' . $this->defFile);\n $fields = Yaml::parse($this->defFile);\n if (!is_array($fields)) {\n $fields = array();\n $this->getLogger()->warning('No definition found in metadata file.');\n }\n $res = array();\n foreach ($fields as $field_data) {\n $res[$field_data['id']] = $field_data;\n }\n ksort($res);\n return $res;\n }", "public function testCanBeCreatedFromGetData(): void\n {\n $this->assertEquals(\n 'C:\\Documents\\Word\\Work\\Current\\1\\2\\3<br>',\n (new Read)->getData('current')\n );\n $this->assertIsString((new Read)->getData('current'));\n\n $this->assertEquals(\n 'C:\\Documents\\Software Engineer\\Projects\\AnnualReport.xls<br>',\n (new Read)->getData('software engineer')\n );\n $this->assertIsString((new Read)->getData('software engineer'));\n\n $this->assertEquals(\n 'C:\\Documents\\Salary\\Accounting\\Accounting.xls<br>',\n (new Read)->getData('accounting')\n );\n $this->assertIsString((new Read)->getData('accounting'));\n }", "function yml_get_file($search, $ymlfile)\n {\n return yml::getFile($search, $ymlfile);\n }", "public static function fromYaml($file)\n {\n if (! file_exists($file)) {\n return new self();\n }\n\n $values = Yaml::parse(file_get_contents($file));\n\n $config = new self();\n\n if (! is_array($values)) {\n return $config;\n }\n\n if (array_key_exists('exclude', $values)) {\n $config->exclude = (array) $values['exclude'];\n }\n if (array_key_exists('directory', $values)) {\n $config->directory = trim($values['directory']);\n }\n if (array_key_exists('baseUrl', $values)) {\n $config->baseUrl = rtrim(trim($values['baseUrl']), '/');\n }\n if (array_key_exists('before', $values)) {\n $config->before = (array) $values['before'];\n }\n if (array_key_exists('after', $values)) {\n $config->after = (array) $values['after'];\n }\n\n return $config;\n }", "public static function getSampleYamlString()\n {\n return trim(\n '---'.\"\\n\".\n 'greeting: \"hello\"'.\"\\n\".\n 'to: \"you\"'.\"\\n\"\n );\n }", "public function supports_traditional_php_config_files()\n {\n $container = new ContainerBuilder;\n $loader = new PhpConfigFileLoader($container, new FileLocator);\n\n $loader->load(__DIR__ . '/Fixtures/traditional-php-config.php');\n\n self::assertEquals('bar', $container->getParameter('foo'));\n }", "public function testGetFileLinesReturnsLinesFromFile(): void\n {\n $tmpfile = (string) tempnam(sys_get_temp_dir(), 'browscaptest');\n\n $in = <<<'HERE'\n; comment\n\n[test]\ntest=test\nHERE;\n\n file_put_contents($tmpfile, $in);\n\n $parser = new IniParser($tmpfile);\n\n $out = $parser->getFileLines();\n\n unlink($tmpfile);\n\n $expected = [\n '; comment',\n '[test]',\n 'test=test',\n ];\n\n self::assertSame($expected, $out);\n }", "public function __construct($config_file)\n {\n try \n {\n self::$config_array = Yaml::parse(file_get_contents($config_file))[\"system\"];\n }\n catch (ParseException $e) \n {\n printf(\"Unable to parse the YAML String: %s\", $e->getMessage());\n }\n }", "public function testLoad()\n {\n $struct = $this->_newStruct();\n $expect = array(\n 'foo' => 'bar2',\n 'baz' => 'dib2',\n 'zim' => 'gir2',\n 'irk' => array(\n 'subfoo' => 'subbar2',\n 'subbaz' => 'subdib2',\n 'subzim' => 'subgir2',\n ),\n );\n $struct->load($expect);\n $actual = $struct->toArray();\n $this->assertSame($actual, $expect);\n }", "private function load_demo_content_from_file(): string {\n\t\t$file = WEBSTORIES_PLUGIN_DIR_PATH . 'includes/data/stories/demo.json';\n\n\t\tif ( ! is_readable( $file ) ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$content = file_get_contents( $file ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents, WordPressVIPMinimum.Performance.FetchingRemoteData.FileGetContentsUnknown\n\n\t\tif ( ! $content ) {\n\t\t\treturn '';\n\t\t}\n\n\t\treturn $content;\n\t}", "protected function parse($file) {\n self::loadSpycLibrary();\n $config = Spyc::YAMLLoad($file);\n \n if (!$config) {\n throw new Exception(\"Configuration is either empty or contains fatal errors\");\n }\n \n return $config;\n }", "public function testLoadMetadata()\n {\n $metadata = $this->driver->loadMetadataForClass(new \\ReflectionClass(Example::class));\n $this->assertInstanceOf(ClassMetadata::class, $metadata);\n $properties = $metadata->getPropertyMetadata();\n $this->assertArrayHasKey('fieldOne', $properties);\n $propertyOne = $properties['fieldOne'];\n\n $this->assertEquals('markdown', $propertyOne->getType());\n $this->assertEquals('title', $propertyOne->getRole());\n $this->assertEquals('group_one', $propertyOne->getGroup());\n $this->assertEquals([\n 'option_one' => 'Foobar',\n 'option_two' => 'Barfoo',\n 'option_three' => [\n 'sub_one' => 'One',\n 'sub_two' => 'Two',\n ],\n ], $propertyOne->getOptions()->getSharedOptions());\n\n $this->assertEquals([\n 'a' => 'A',\n 'b' => 'B',\n ], $propertyOne->getOptions()->getFormOptions());\n\n $this->assertEquals([\n 'c' => 'C',\n ], $propertyOne->getOptions()->getViewOptions());\n\n $this->assertEquals([\n 'd' => 'D',\n ], $propertyOne->getOptions()->getStorageOptions());\n\n $this->assertArrayHasKey('fieldTwo', $properties);\n }", "private function parseFile($filename) {\n if (is_null($filename) || !file_exists($filename)) {\n throw new MultidomainException('Missing config.yml file.');\n }\n $this->configFile = $filename;\n\n // get configuration values\n $this->config = json_decode(json_encode(\n Yaml::parseFile($filename)\n ));\n }", "public function testLoad()\n {\n $this->todo('stub');\n }", "public function testLoad()\n {\n $this->todo('stub');\n }", "public function testLoad()\n {\n $this->todo('stub');\n }", "protected function _get_config()\n {\n $config = Spyc::YAMLLoad(\"config.yaml\");\n return $config;\n }", "protected function readTweaksFile()\n {\n $bookDir = $this->app['publishing.dir.book'];\n $themeDir = Toolkit::getCurrentThemeDir($this->app);\n\n // first path is the book Contents dir\n $contentsDir = $bookDir.'/Contents';\n\n // second path is the theme \"<format>/Config\" dir\n $configFormatDir = sprintf('%s/%s/Config', $themeDir, $this->format);\n\n // third path is the theme \"Common/Config\" dir\n $configCommonDir = sprintf('%s/Common/Config', $themeDir);\n\n // look for either one\n $dirs = [\n $contentsDir,\n $configFormatDir,\n $configCommonDir,\n ];\n\n $file = $this->app->getFirstExistingFile('html-tweaks.yml', $dirs);\n\n if (!$file) {\n $this->writeLn('No html-tweaks.yml file found. Looked up directories:', 'error');\n foreach ($dirs as $dir) {\n $this->writeLn('- '.$dir);\n }\n\n return;\n }\n\n $this->tweaks = Yaml::parse(file_get_contents($file));\n }", "public function testIfYamlSeederWillSeedEntries(){\n\n $result = YamlSeeder::seed();\n\n $entries = \\AMBERSIVE\\Tests\\Examples\\Models\\Migration::get();\n $element = $entries->first();\n\n $this->assertEquals(2, $entries->count());\n $this->assertEquals(99, $element->id);\n\n }", "public static function load(string $file) : array\n {\n try\n {\n $data = SymfonyYaml::parse(file_get_contents($file));\n }\n catch (ParseException $e)\n {\n throw new OptionLoaderException(\n \"File $file does not appear to be valid YAML: \"\n .$e->getMessage()\n );\n }\n\n return $data;\n }", "public function testDocExample(): void\n {\n // Create Locator\n $locator = new ResourceLocator(__DIR__.'/app/');\n\n // Register Locations\n $locator->registerLocation('Floor1', 'floors/Floor1/');\n $locator->registerLocation('Floor2', 'floors/Floor2/');\n\n // Register Streams\n $locator->registerStream('config');\n $locator->registerStream('upload', '', 'uploads/', true);\n\n // Finding Files\n // 1) Find Resource\n $default = $locator->findResource('config://default.json');\n $this->assertSame($this->getBasePath().'app/floors/Floor2/config/default.json', $default);\n\n // 2) getRerouce\n $defaultResource = $locator->getResource('config://default.json');\n $this->assertInstanceOf(ResourceInterface::class, $defaultResource);\n\n $this->assertSame($this->getBasePath().'app/floors/Floor2/config/default.json', $defaultResource->getAbsolutePath());\n $this->assertSame('floors/Floor2/config/default.json', $defaultResource->getPath());\n $this->assertSame('default.json', $defaultResource->getBasePath());\n $this->assertSame('default.json', $defaultResource->getBasename());\n $this->assertSame('json', $defaultResource->getExtension());\n $this->assertSame('default', $defaultResource->getFilename());\n $this->assertSame('config://default.json', $defaultResource->getUri());\n\n // 3) GetLocation\n $defaultResourceLocation = $defaultResource->getLocation();\n $this->assertInstanceOf(ResourceLocationInterface::class, $defaultResourceLocation);\n\n $this->assertSame('Floor2', $defaultResourceLocation->getName());\n $this->assertSame('floors/Floor2/', $defaultResourceLocation->getPath());\n\n // 4) GetStream\n $defaultResourceStream = $defaultResource->getStream();\n $this->assertInstanceOf(ResourceStreamInterface::class, $defaultResourceStream);\n\n $this->assertSame('config/', $defaultResourceStream->getPath());\n $this->assertSame('', $defaultResourceStream->getPrefix());\n $this->assertSame('config', $defaultResourceStream->getScheme());\n $this->assertSame(false, $defaultResourceStream->isShared());\n\n // 5) FindResources\n $defaults = $locator->findResources('config://default.json');\n $this->assertSame([\n $this->getBasePath().'app/floors/Floor2/config/default.json',\n $this->getBasePath().'app/floors/Floor1/config/default.json',\n ], $defaults);\n\n // Finding Files - upload://profile\n // 1) Find Resource\n $upload = $locator->findResource('upload://profile');\n $this->assertSame($this->getBasePath().'app/uploads/profile', $upload);\n\n // 2) getRerouce\n $uploadResource = $locator->getResource('upload://profile');\n $this->assertInstanceOf(ResourceInterface::class, $uploadResource);\n\n $this->assertSame($this->getBasePath().'app/uploads/profile', $uploadResource->getAbsolutePath());\n $this->assertSame('uploads/profile', $uploadResource->getPath()); // N.B.: No `/` at the end, because we didn't ask for it in `findResource`\n $this->assertSame('profile', $uploadResource->getBasePath());\n $this->assertSame('profile', $uploadResource->getBasename());\n $this->assertSame('', $uploadResource->getExtension());\n $this->assertSame('profile', $uploadResource->getFilename());\n $this->assertSame('upload://profile', $uploadResource->getUri());\n\n // 3) FindResources\n $defaults = $locator->findResources('upload://profile');\n $this->assertSame([\n $this->getBasePath().'app/uploads/profile',\n ], $defaults);\n\n // ListResources\n $list = $locator->listResources('config://');\n $this->assertEquals([\n $this->getBasePath().'app/floors/Floor1/config/debug.json',\n $this->getBasePath().'app/floors/Floor2/config/default.json',\n $this->getBasePath().'app/floors/Floor2/config/foo/bar.json',\n $this->getBasePath().'app/floors/Floor2/config/production.json',\n ], $list);\n\n // ListResources - All\n $list = $locator->listResources('config://', true);\n $this->assertEquals([\n $this->getBasePath().'app/floors/Floor1/config/debug.json',\n $this->getBasePath().'app/floors/Floor1/config/default.json',\n $this->getBasePath().'app/floors/Floor2/config/default.json',\n $this->getBasePath().'app/floors/Floor2/config/foo/bar.json',\n $this->getBasePath().'app/floors/Floor2/config/production.json',\n ], $list);\n\n // ListResources - Sort\n $list = $locator->listResources('config://', false, false);\n $this->assertEquals([\n $this->getBasePath().'app/floors/Floor2/config/default.json',\n $this->getBasePath().'app/floors/Floor2/config/foo/bar.json',\n $this->getBasePath().'app/floors/Floor2/config/production.json',\n $this->getBasePath().'app/floors/Floor1/config/debug.json',\n ], $list);\n\n // ListReources - Folder\n $list = $locator->listResources('config://foo/', true);\n $this->assertEquals([\n $this->getBasePath().'app/floors/Floor2/config/foo/bar.json',\n ], $list);\n\n // listStreams\n $streams = $locator->listStreams();\n $this->assertSame([\n 'config',\n 'upload',\n ], $streams);\n\n // listLocations\n $locations = $locator->listLocations();\n $this->assertSame([\n 'Floor2',\n 'Floor1',\n ], $locations);\n }", "public function testGenerar() {\n $generador = new Generador(dirname(__DIR__) . '/preguntas.yml');\n $this->assertTrue(isset($generador)); \n }", "private function _readFile()\n {\n $content = file_get_contents($this->file);\n $this->config = json_decode(utf8_encode($content), true);\n\n if ($this->config == null && json_last_error() != JSON_ERROR_NONE)\n {\n throw new \\LogicException(sprintf(\"Failed to parse config file '%s'. Error: '%s'\", basename($this->file) , json_last_error_msg()));\n }\n }", "public static function loadFile($fileName, $faultOnEmpty)\n {\n // ensure file exists\n self::checkFileNameExists($fileName);\n\n $contents = file_get_contents($fileName);\n\n if ($contents === FALSE)\n {\n $functionContext = get_defined_vars();\n throw new gosException_RuntimeError('Could not read ' . $fileName, $functionContext);\n }\n\n $parsedYaml = syck_load($contents);\n\n // Handle situation of invalid yaml\n if (!is_array($parsedYaml))\n {\n if($faultOnEmpty)\n {\n $functionContext = get_defined_vars();\n throw new gosException_RuntimeError($fileName . ' was empty!', $functionContext);\n }\n\n return null;\n }\n\n return $parsedYaml;\n }" ]
[ "0.6851242", "0.66226053", "0.659966", "0.6296581", "0.62482804", "0.6247309", "0.62413704", "0.62125075", "0.6121576", "0.60984004", "0.6087736", "0.60502857", "0.6015512", "0.59657013", "0.5942354", "0.59292513", "0.5927359", "0.58723813", "0.5862685", "0.5853728", "0.58237976", "0.57639354", "0.57581425", "0.5744999", "0.57176715", "0.5685112", "0.567324", "0.56573725", "0.56221414", "0.55564094", "0.555409", "0.55300266", "0.55287725", "0.5526202", "0.5525204", "0.552497", "0.5516177", "0.5509252", "0.54781246", "0.5455176", "0.5412836", "0.5379745", "0.5370561", "0.5363493", "0.535385", "0.53507036", "0.5343387", "0.53239053", "0.53132266", "0.53051496", "0.53001827", "0.5298751", "0.5297631", "0.5296322", "0.5295586", "0.5291974", "0.52710336", "0.5264415", "0.52631426", "0.52587485", "0.5250907", "0.5250163", "0.5228405", "0.5226574", "0.52172685", "0.52137727", "0.5181076", "0.51760226", "0.51727605", "0.5153362", "0.5145207", "0.5138771", "0.51384205", "0.5122237", "0.51212096", "0.51197433", "0.5116987", "0.5100336", "0.5097897", "0.50935256", "0.5091821", "0.50877047", "0.50785977", "0.50749344", "0.5070369", "0.5069122", "0.5059466", "0.50581074", "0.50556076", "0.50521255", "0.50521255", "0.50521255", "0.50500953", "0.5046411", "0.50381595", "0.5037643", "0.502769", "0.50190556", "0.5014604", "0.5007454" ]
0.5986734
13
Run the database seeds.
public function run() { foreach($this->get() as $item){ DB::table('categories')->insert([ // 'id' => $item['id'], 'title' => $item['title'], 'description' => $item['description'], 'belongs_to' => $item['belongs_to'], ]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Display a listing of the resource.
public function index() { return view('admin.users.index', [ ]); }
{ "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('admin.users.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(UserStoreRequest $request) { $item = User::store($request, null, User::FILLABLE); $message = "You have successfully created {$item->renderName()}"; $redirect = $item->renderShowUrl(); return response()->json([ 'message' => $message, 'redirect' => $redirect, ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show($id) { $item = User::withTrashed()->findOrFail($id); return view('admin.users.show', [ 'item' => $item, ]); }
{ "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
Update the specified resource in storage.
public function update(UserStoreRequest $request, $id) { $item = User::withTrashed()->findOrFail($id); $message = "You have successfully updated {$item->renderName()}"; $item = User::store($request, $item, User::FILLABLE); return response()->json([ 'message' => $message, ]); }
{ "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 archive($id) { $item = User::withTrashed()->findOrFail($id); $item->archive(); return response()->json([ 'message' => "You have successfully archived {$item->renderName()}", ]); }
{ "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
Restore the specified resource from storage.
public function restore($id) { $item = User::withTrashed()->findOrFail($id); $item->unarchive(); return response()->json([ 'message' => "You have successfully restored {$item->renderName()}", ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function restore($id);", "public function restore($id);", "public function restore($id);", "public function restore($id);", "public function restored(Storage $storage)\n {\n //\n }", "public function restore() {}", "public function restore();", "public function restore()\n {\n }", "public function restore()\n {\n //\n }", "public function restore(string $id)\n {\n // TODO: ...\n }", "public function restore(User $user, Storage $storage)\n {\n //\n }", "public function restore($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::withTrashed()->findOrFail($id);\n\n /* Restore the specified resource */\n $resource->restore();\n\n /* Redirect to controller index */\n return redirect()\n ->route($this->name . '.index')\n ->with(\n 'success',\n Lang::has($this->name . '.resource-restored') ?\n $this->name . '.resource-restored' :\n 'messages.alert.resource-restored'\n );\n }", "public function restore(EntityInterface $entity) {\n $entity = $this->load($entity->id());\n }", "public function restored(Stock $stock)\n {\n //\n }", "public function restore()\n {\n $this->restoreEntrustUserTrait();\n $this->restoreSoftDeletes();\n }", "public function restore($id){\n $book_to_restore = \\App\\Book::withTrashed()->findOrFail($id);\n\n // jika ada, lakukan restore\n if($book_to_restore){\n $book_to_restore->restore();\n return redirect()->route(\"books.index\")->with(\"status\", \"Book successfully restored\");\n } else {\n return redirect()->route(\"books.index\")->with(\"status\", \"Book is not in trash\");\n }\n }", "public function restore($id){\n \\App\\Models\\Sucursal::withTrashed()->find($id)->restore();\n Flash::success('Sucursal restaurada.');\n\n return redirect(route('sucursales.deleted'));\n }", "public function restore(int $id)\n {\n //\n }", "public function restored(Remission $remission)\n {\n //\n }", "protected static function restore() {}", "public function restore(string $state);", "function restore()\n {\n }", "public function restore($id)\n {\n PurchaseRequest::withTrashed()->where('id', $id)->restore();\n }", "public function restore(int $id)\n {\n ImagingExam::withTrashed()->where('id', $id)->restore();\n return redirect()->route('admin.imagingExam.index');\n }", "public function restore($id)\n {\n //\n $result = ScanResults::find($id);\n\n $result->resote();\n }", "public function restored(Student $student)\n {\n //\n }", "public function restored(Product $producto)\n {\n //\n }", "public function restore($id)\n {\n $comic=Comic::withTrashed()->find($id);\n $comic->restore();\n return redirect()->route('comics.index')->with('success',$comic->title);\n \n }", "protected function performRestore(Model $entity): void\n {\n $entity->restore();\n }", "public function restore(){\n $this->update(['deleted_by', NULL]);\n return $this->baseRestore();\n }", "public function restored(Article $article)\n {\n //\n }", "public function restore(User $user, Load $load)\n {\n //\n }", "public function restored(Saida $saida)\n {\n //\n }", "public function restored(Patient $patient)\n {\n //\n }", "public function restored(Food $food)\n {\n //\n }", "public function restored(Job $job)\n {\n //\n }", "public function restored(Credit $credit)\n {\n //\n }", "public function restore(Product $product)\n {\n $this->products->restore($product);\n return redirect()->route(env('APP_BACKEND_PREFIX').'.products.index')->withFlashSuccess('产品恢复成功');\n }", "public function restored(Role $role)\n {\n }", "public function restoring(User $user)\n {\n //\n }", "public function restored(Transaction $transaction)\n {\n //\n }", "public function restored(Transaction $transaction)\n {\n //\n }", "public function restored(Transaction $transaction)\n {\n //\n }", "public function restored(Transaction $transaction)\n {\n //\n }", "public function restore($id)\n {\n $restore_deleted=Service::withTrashed()->find($id)->restore();\n\n $notification=array(\n 'message'=>'Service Restored',\n 'alert_type'=>'info',\n );\n return redirect()->back()->with($notification);\n }", "public function restoring($model)\n\t{\n\t}", "public function restore($id)\n {\n $model = $this->withTrashed()->find($id);\n\n if (method_exists($this, 'beforeRestore')) {\n call_user_func_array([$this, 'beforeRestore'], [$model]);\n }\n\n $restored = $model->restore();\n\n if (method_exists($this, 'beforeRestore')) {\n call_user_func_array([$this, 'beforeRestore'], [$model]);\n }\n\n return $restored;\n }", "public function restore($ref_id, $version = NULL)\n\t{\n\t\t$archive = $this->get_archive($ref_id, $version);\n\t\treturn $this->save($archive);\n\t}", "public function restore(Request $request)\n {\n $supplier = Supplier::withTrashed()->find($request->id);\n\n $this->authorize('restore', $supplier);\n\n $supplier->restore();\n\n return redirect()->route('dashboard.suppliers.index');\n }", "public function restoring(assignment $assignment)\n {\n //code...\n }", "public function restore($id)\n\t{\n\t\treturn $this->_parent->entities->restore($id);\n\t}", "public function restore($id)\n {\n $order = Order::withTrashed()->whereId($id)->restore();\n return redirect(route('orders.index'))->withToastSuccess('Successfully Restored');\n }", "public function restore(User $user, Image $image)\n {\n //\n }", "public function restore(User $user, Image $image)\n {\n //\n }", "public function restore($id) {\n $socios = socio::withTrashed()->where('id', '=', $id)->first();\n //Restauramos el registro\n $socios->restore();\n $message='El Socio '.$socios->name.' fue RESTAURADO ';\n $title =\"\";\n Toastr::success($message, $title);\n return redirect()->route(\"listasocios\");\n }", "public function restored(Expense $expense)\n {\n //\n }", "public function restoreAction()\n {\n $id = $this->params()->fromRoute('id');\n\n try {\n\n $list = ItemQuery::create()->findPk($id);\n\n if (!$list) throw new RuntimeException(\n \"Item does not exist.\"\n );\n\n $list->setRemoved(false)->save();\n\n $this->flashMessenger()->addSuccessMessage(\n \"Item Restored.\"\n );\n\n } catch (Exception $e) {\n $this->flashMessenger()->addErrorMessage($e->getMessage());\n }\n\n return $this->redirect()->toRoute('item');\n }", "public function restore($id)\n {\n if (! Gate::allows('salery_delete')) {\n return abort(401);\n }\n $salery = Salery::onlyTrashed()->findOrFail($id);\n $salery->restore();\n\n return redirect()->route('admin.saleries.index');\n }", "public function restore($id)\n {\n if (! Gate::allows('operation_type_delete')) {\n return abort(401);\n }\n $operation_type = OperationType::onlyTrashed()->findOrFail($id);\n $operation_type->restore();\n\n return redirect()->route('admin.operation_types.index');\n }", "public function restored(assignment $assignment)\n {\n //code...\n }", "public function restore($id)\n {\n if (! Gate::allows('presentacionproducto_delete')) {\n return abort(401);\n }\n $presentacionproducto = Presentacionproducto::onlyTrashed()->findOrFail($id);\n $presentacionproducto->restore();\n\n return redirect()->route('admin.presentacionproductos.index');\n }", "public function restoredItem(int $id)\n {\n return $this->withTrashed()->whereId($id)->restore();\n }", "public function restore(User $user, Carrito $carrito)\n {\n //\n }", "public function restored(Subscription $subscription)\n {\n //\n }", "public function restored(Media $media)\n {\n //\n }", "public function restore($id)\n {\n if (! Gate::allows('manifiestos')) {\n return abort(401);\n }\n\n $sector = Sector::onlyTrashed()->findOrFail($id);\n $sector->restore();\n\n return redirect()->route('admin.sectors.index');\n }", "public function restore($id){\n //get() returns a collection so we use first() to get the project model\n $project = Project::withTrashed()->where('id', $id)->first();\n\n $project->restore();\n\n Session::flash('success', 'Project Restored');\n\n return redirect()->route('projects');\n }", "public function restored(Edit $edit)\n {\n //\n }", "public function restore(): void\n\t{\n\t\t$this->processor->restore();\n\t}", "public function restoring(Wallet $wallet)\n {\n //\n }", "public function restored(Historia $historia)\n {\n //\n }", "public function restored(Candidate $candidate)\n {\n //\n }", "public function restore($taskId){\n\n $task = Task::withTrashed()->findOrFail($taskId);\n\n if(Auth::id() != $task->user_id){\n return response()->json(['message'=>'You Don\\'n own this task!'], '401');\n }\n\n if ($task->restore()){\n return response()->json(['message'=>'Resource restored successfully!']);\n }\n\n return response()->json(['message'=>'Please Try later!'], 500);\n }", "public function restore(User $user, Stagaire $stagaire)\n {\n //\n }", "public function restore($id) {\n\t\t$country = Country::withTrashed()->where('id', $id)->firstOrFail();\n\n\t\tif($country->restore()) {\n\t\t\tFlash::success('You have sucessfully restored ' . $country->country_name . ' in the list of countries!');\n\t\t}\n\t\telse {\n\t\t\tFlash::error('Error restoring ' . $country->country_name . ' in the list of countries.');\n\t\t}\n\n\t\treturn Redirect::route('countries.show', $id);\n\t}", "public function restore($id)\n {\n $article=Article::withTrashed()->find($id);\n $article->restore();\n\n return back()->with('message', 'Статтю відновлено.');\n }", "public function restored(Contribute $contribute)\n {\n //\n }", "public function restored(Document $document)\n {\n //\n }", "public function restored(User $user)\n {\n //\n }", "public function restored(User $user)\n {\n //\n }", "public function restored(User $user)\n {\n //\n }", "public function restored(User $user)\n {\n //\n }", "public function restored(User $user)\n {\n //\n }", "public function restored(User $user)\n {\n //\n }", "public function restored(User $user)\n {\n //\n }", "public function restored(User $user)\n {\n //\n }", "public function restored(User $user)\n {\n //\n }", "public function restored(User $user)\n {\n //\n }", "public function restored(User $user)\n {\n //\n }", "public function restored(User $user)\n {\n //\n }", "public function restored(User $user)\n {\n //\n }", "public function restored(User $user)\n {\n //\n }", "public function restored(User $user)\n {\n //\n }", "public function restored(User $user)\n {\n //\n }", "public function restored(PersonalAssignment $personalAssignment)\n {\n //\n }", "public function restore($id)\n {\n if($id=='0'){\n //Restore Proses\n $treaty = Treaty::onlyTrashed();\n $treaty->restore();\n //splash message\n session() -> flash('success','Semua Data berhasil dialihkan ke Production');\n }else{\n //Restore Proses\n $treaty = Treaty::onlyTrashed()->where('id',$id);\n $treaty->restore();\n //splash message\n session() -> flash('success','Data berhasil dialihkan ke Production');\n }\n \n //redirecting\n return redirect(route('treatyxsim.trashed'));\n }", "public function getRestore($id) {\n $order = Order::onlyTrashed()->where('id', $id);\n $order->restore();\n flash('Order restore sucessfully!');\n return redirect('dashboard/admin/order');\n }", "public function restore($id)\n {\n if (! Gate::allows('seccion_delete')) {\n return abort(401);\n }\n $seccion = Seccion::onlyTrashed()->findOrFail($id);\n $seccion->restore();\n\n return redirect()->route('admin.seccions.index');\n }", "public function restore($id)\n {\n if (! Gate::allows('invoice_delete')) {\n return abort(401);\n }\n $invoice = Invoice::onlyTrashed()->findOrFail($id);\n $invoice->restore();\n\n return redirect()->route('admin.invoices.index');\n }", "public function restore($id)\n {\n if (! Gate::allows('klanten_delete')) {\n return abort(401);\n }\n $klanten = Klanten::onlyTrashed()->findOrFail($id);\n $klanten->restore();\n\n return redirect()->route('admin.klantens.index');\n }", "public function restored(RideShareTransaction $rideShareTransaction)\n {\n //\n }" ]
[ "0.68889016", "0.68889016", "0.68889016", "0.68889016", "0.68794614", "0.6608496", "0.6606297", "0.6494907", "0.6409749", "0.63593894", "0.635741", "0.6307698", "0.63056177", "0.6173629", "0.6171965", "0.6143792", "0.6136032", "0.61255056", "0.608791", "0.60812014", "0.6030594", "0.60174704", "0.59925765", "0.5991544", "0.59697753", "0.5935326", "0.59152824", "0.59118813", "0.58958983", "0.58909625", "0.5884984", "0.58562446", "0.58502233", "0.58418494", "0.58339703", "0.58239716", "0.5822842", "0.5795727", "0.5780365", "0.57679725", "0.57622993", "0.57622993", "0.57622993", "0.57622993", "0.5758919", "0.57394516", "0.5718918", "0.5715066", "0.57127196", "0.57074094", "0.57058704", "0.5705257", "0.5682407", "0.5682407", "0.56591505", "0.565797", "0.5655128", "0.56498516", "0.56487924", "0.56444806", "0.56414205", "0.5636147", "0.5635293", "0.56331587", "0.5631664", "0.56249917", "0.56153214", "0.5614989", "0.56146806", "0.56078625", "0.56044465", "0.56024605", "0.5600217", "0.55985314", "0.5595348", "0.5582439", "0.5579855", "0.55753356", "0.5572039", "0.5572039", "0.5572039", "0.5572039", "0.5572039", "0.5572039", "0.5572039", "0.5572039", "0.5572039", "0.5572039", "0.5572039", "0.5572039", "0.5572039", "0.5572039", "0.5572039", "0.5572039", "0.5571934", "0.556423", "0.5562531", "0.55587554", "0.55579937", "0.5551642", "0.5551339" ]
0.0
-1
STW implementation of the function, since the data is held in our server, this function will always "suceed".
protected function testDataSourceResponsiveness($user) { $response="<user>$user</user>"; return $response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processData() ;", "public function storeIncomingData() {}", "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 }", "private function refresh() {\r\n\r\n // try & catch wär zwar besser, funktioniert aber bei fsockopen leider nicht.. deshalb das unschöne @\r\n $this->socket = @fsockopen($this->ts3_host, $this->ts3_query, $errno, $errstr, $this->socket_timeout);\r\n\r\n if ($errno > 0 && $errstr != '') {\r\n $this->errors[] = 'fsockopen connect error: ' . $errno;\r\n return false;\r\n }\r\n\r\n if (!is_resource($this->socket)) {\r\n $this->errors[] = 'socket recource not exists';\r\n return false;\r\n }\r\n\r\n stream_set_timeout($this->socket, $this->socket_timeout);\r\n\r\n if (!empty($this->serverlogin) && !$this->sendCmd('login', $this->serverlogin['login'] . ' ' . $this->serverlogin['password'])) {\r\n $this->errors[] = 'serverlogin as \"' . $this->serverlogin['login'] . '\" failed';\r\n return false;\r\n }\r\n\r\n if (!$this->sendCmd(\"use \" . ( $this->ts3_sid ? \"sid=\" . $this->ts3_sid : \"port=\" . $this->ts3_port ))) {\r\n $this->errors[] = 'server select by ' . ( $this->ts3_sid ? \"ID \" . $this->ts3_sid : \"UDP Port \" . $this->ts3_port ) . ' failed';\r\n return false;\r\n }\r\n\r\n if (!$sinfo = $this->sendCmd('serverinfo')) {\r\n return false;\r\n }\r\n else {\r\n $this->sinfo = $this->splitInfo($sinfo);\r\n $this->sinfo['cachetime'] = time();\r\n\r\n if (substr($this->sinfo['virtualserver_version'], strpos($this->sinfo['virtualserver_version'], 'Build:') + 8, -1) < 11239) { // beta23 build is required\r\n $this->errors[] = 'your TS3Server build is to low..';\r\n return false;\r\n }\r\n }\r\n\r\n if (!$clist = $this->sendCmd('channellist', '-topic -flags -voice -limits')) {\r\n return false;\r\n }\r\n else {\r\n $clist = $this->splitInfo2($clist);\r\n foreach ($clist as $var) {\r\n $this->clist[] = $this->splitInfo($var);\r\n }\r\n }\r\n\r\n if (!$plist = $this->sendCmd('clientlist', '-away -voice -groups')) {\r\n $this->errors[] = 'playerlist not readable';\r\n return false;\r\n }\r\n else {\r\n $plist = $this->splitInfo2($plist);\r\n foreach ($plist as $var) {\r\n if (strpos($var, 'client_type=0') !== FALSE) {\r\n $this->plist[] = $this->splitInfo($var);\r\n }\r\n }\r\n\r\n if (!empty($this->plist)) {\r\n foreach ($this->plist as $key => $var) {\r\n $temp = '';\r\n if (strpos($var['client_servergroups'], ',') !== FALSE) {\r\n $temp = explode(',', $var['client_servergroups']);\r\n }\r\n else {\r\n $temp[0] = $var['client_servergroups'];\r\n }\r\n $t = '0';\r\n foreach ($temp as $t_var) {\r\n if ($t_var == '6') {\r\n $t = '1';\r\n }\r\n }\r\n if ($t == '1') {\r\n $this->plist[$key]['s_admin'] = '1';\r\n }\r\n else {\r\n $this->plist[$key]['s_admin'] = '0';\r\n }\r\n }\r\n\r\n usort($this->plist, array($this, \"cmp2\"));\r\n usort($this->plist, array($this, \"cmp1\"));\r\n }\r\n }\r\n\r\n fputs($this->socket, \"quit\\n\");\r\n\r\n $this->close();\r\n\r\n return true;\r\n }", "public function processData() {}", "function PGReserveData()\r\n\t{\r\n\t}", "function process_unlock_set_king($socket, $data)\n{\n if ($socket->process === true) {\n $user_id = $data;\n $player = id_to_player($user_id, false);\n if (isset($player)) {\n $player->gainPart('head', 28, true);\n $player->gainPart('body', 26, true);\n $player->gainPart('feet', 24, true);\n $player->gainPart('eHead', 28);\n $player->gainPart('eBody', 26);\n $player->gainPart('eFeet', 24);\n $player->sendCustomizeInfo();\n }\n $socket->write('{\"status\":\"ok\"}');\n }\n}", "function en_send_transdata() {\n\t// Handle sending of data\n}", "public function afterSyncing() {}", "public function baseWrite()\n {\n $len = @fwrite($this->_socket, $this->_sendBuffer);\n if($len === strlen($this->_sendBuffer))\n {\n Worker::$globalEvent->del($this->_socket, EventInterface::EV_WRITE);\n $this->_sendBuffer = '';\n if($this->_status == self::STATUS_CLOSING)\n {\n $this->destroy();\n }\n return true;\n }\n if($len > 0)\n {\n $this->_sendBuffer = substr($this->_sendBuffer, $len);\n }\n else\n {\n if(feof($this->_socket))\n {\n self::$statistics['send_fail']++;\n $this->destroy();\n }\n }\n }", "function flush() ;", "function flush() ;", "function process_unlock_set_djinn($socket, $data)\n{\n if ($socket->process === true) {\n $user_id = $data;\n $player = id_to_player($user_id, false);\n if (isset($player)) {\n $player->gainPart('head', 35, true);\n $player->gainPart('body', 35, true);\n $player->gainPart('feet', 35, true);\n $player->gainPart('eHead', 35);\n $player->gainPart('eBody', 35);\n $player->gainPart('eFeet', 35);\n $player->sendCustomizeInfo();\n }\n $socket->write('{\"status\":\"ok\"}');\n }\n}", "protected function _completeFlush() {\r\n\r\n }", "public function sendRequestOrGetData() {\n\n\t\t$this->request()->createUrl( $this->url() );\n\n\t\t$this->times[ 'start' ] = time();\n\n\t\tif ( $this->config()->isOnCache() ) {\n\n\t\t\t$fileName = $this->fileName();\n\n\t\t\tif ( $this->cache()->checkFile( \"{$fileName}_time\" ) ) {\n\n\t\t\t\t$cacheTime = $this->cache()->readFile( \"{$fileName}_time\" );\n\n\t\t\t\tif ( $this->cache()->expired( $cacheTime ) ) {\n\n\t\t\t\t\t$this->cached = TRUE;\n\n\t\t\t\t\tif ( $this->cacheMode == 'single' ) {\n\n\t\t\t\t\t\tstatic::$data = $this->cache()->readFile( $fileName );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( ( $this->cacheMode == 'single' AND empty( static::$data ) ) OR !$this->cached ) {\n\n\t\t\t$this->request()->send( $this->config()->curlSettings() );\n\t\t}\n\t}", "public function doProcessData() {}", "public function syncDataNode() {}", "public function releaseResult(){\n $this->respond(\"Wrong Way, Go Back\",400);\n }", "protected function _write() {}", "protected abstract function handleData();", "public function largeDataIsStored() {}", "public function largeDataIsStored() {}", "public function largeDataIsStored() {}", "public function largeDataIsStored() {}", "function process_unlock_set_queen($socket, $data)\n{\n if ($socket->process === true) {\n $user_id = $data;\n $player = id_to_player($user_id, false);\n if (isset($player)) {\n $player->gainPart('head', 29, true);\n $player->gainPart('body', 27, true);\n $player->gainPart('feet', 25, true);\n $player->gainPart('eHead', 29);\n $player->gainPart('eBody', 27);\n $player->gainPart('eFeet', 25);\n $player->sendCustomizeInfo();\n }\n $socket->write('{\"status\":\"ok\"}');\n }\n}", "public function requestDataSending()\n {\n $this->start();\n }", "function send_read($data){\n\t\n\t\t$address = gethostbyname($this->vars['host']);\n\t\t$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);\n\t\t$result = socket_connect($socket, $address, $this->vars['port']);\n\n\t\t$transfer = json_encode($this->vars[function_list]);\n\t\t\n\t\t$count = strlen($transfer);\n\t\tprint \"abc\";\n\t\tsocket_send($socket,$count,strlen($count),MSG_DONTROUTE); #send length data to server\n\n\t\tsocket_recv($socket , $buf , 2 , MSG_WAITALL ); #become ack\n\n\t\tsocket_send($socket,$transfer,$count,MSG_DONTROUTE); #send data to server\n\t\t\n\t\tsocket_recv($socket , $count , 30 , MSG_WAITALL ); #income char lentgh\n\t\t\n\t\tsocket_send($socket,'ok',2,MSG_DONTROUTE); #send ack\n\t\t\n\t\tsocket_recv($socket , $buf , $count , MSG_WAITALL ); #income new data\n\n\t\t$returner = json_decode($buf,true);\n\t\tsocket_close($socket);\n\t\treturn($returner);\n\t\t\n\t}", "public function harSending() {\n try {\n $this->getSending();\n return true;\n } catch( Exception $e ) {\n if( $e->getCode() == 144001 ) {\n return false;\n }\n throw $e;\n }\n }", "public function handleData();", "protected function socketPerform() {}", "public function fine(){\n\t\treturn ob_end_flush();;\n\t}", "public function flush()\n {\n $this->data = array();\n return true;\n }", "protected function _syncTrapped() {}", "abstract function flush();", "private function flush() {\n\t\t$this->_error = '';\n\t\t$this->_last_result = array();\n\t}", "function Write($data=null) \r\n{ \r\n//** no connection is available, zero bytes can be sent. \r\n\r\nif(!$this->isOpen()) \r\n{ \r\n$this->LastError = \"No connection available for writing\"; \r\nreturn 0; \r\n} \r\n$data = strval($data); //** ensure that data is available. \r\nif(strlen($data) == 0) //** no data to be sent. \r\nreturn 0; //** zero bytes were sent. \r\nelse //** connection and data, set timeout and send. \r\n{ \r\n//$this->_SetTimeout(); //** set timeout. \r\nreturn fwrite($this->Socket, $data, strlen($data)); //** write data. \r\n} \r\n}", "abstract function doSend();", "abstract public function flush();", "function updateData() {\n global $rundata, $pagebuffer, $spambotDataLoc;\n return ( file_put_contents( $spambotDataLoc.'rundata', serialize($rundata) ) && file_put_contents( $spambotDataLoc.'pagebuffer', serialize( $pagebuffer ) ) );\n \n}", "public function process()\n {\n $this->send_status();\n $this->send_headers();\n $this->send_content();\n exit(0);\n }", "protected function _prepareFlush() {\r\n\r\n }", "function process_unlock_perk($socket, $data)\n{\n global $player_array;\n\n if ($socket->process === true) {\n list($slug, $user_id, $guild_id, $user_name, $quantity) = explode('`', $data);\n $user_id = (int) $user_id;\n $guild_id = (int) $guild_id;\n start_perk($slug, $user_id, $guild_id, time() + ($quantity * 3600));\n $player = id_to_player($user_id, false);\n $display_name = userify($player, $user_name);\n\n if ($guild_id !== 0) {\n if (strpos($slug, 'guild_') === 0) {\n $type = ucfirst(explode('_', $slug)[1]);\n $duration = format_duration($quantity * 3600);\n $msg = \"$display_name unlocked $type mode for your guild for $duration!\";\n send_to_guild($guild_id, \"systemChat`$msg\");\n } elseif ($slug === 'happy_hour') {\n global $chat_room_array;\n\n $hh_lang = $quantity > 1 ? \"$quantity Happy Hours\" : 'a Happy Hour';\n if (isset($chat_room_array['main'])) {\n $main = $chat_room_array['main'];\n $main->sendChat(\"systemChat`$display_name just triggered $hh_lang!\");\n foreach ($player_array as $player) {\n if (isset($player->chat_room) && $player->chat_room !== $main) {\n $player->write(\"systemChat`$display_name just triggered $hh_lang!\");\n }\n }\n } else {\n sendToAll_players(\"systemChat`$display_name just triggered $hh_lang!\");\n }\n }\n }\n\n $socket->write('{\"status\":\"ok\"}');\n }\n}", "public function isSent() {}", "abstract public function flush ();", "public function transferEnd() {\n $this->_transferStarted = FALSE;\n $this->_transferSize = NULL;\n $this->data = NULL;\n $this->dataPos = NULL;\n }", "static function process_schudle(){\n\t\treturn self::process_offline_leads();\n\t}", "function __destruct() {\n if(!$this->payload_is_sent) $this->sendPayload();\n\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 CheckFreeData($method_name, $data_in) {\n\n $dbTable = \"user\";\n $function = \"checkfreedata\";\n // Write in logs\n $log = \"CheckFreeData method called with: \".var_export($data_in, true);\n writeLogs($function, $log);\n\n try {\n if ($data_in[0]['user'] == user_webserv && $data_in[0]['password'] == passwd_webserv) {\n\n $connectPC = connectDB();\n if (key_exists(\"faultCode\", $connectPC)) {\n\n // Write in logs\n $log = \"Fail to open DB connection: \".var_export($connectPC, true);\n writeLogs($function, $log);\n $log = \"############################################\";\n writeLogs($function, $log);\n\n return $connectPC;\n }\n\n// Initiate variables\n $responseArray = array();\n $userName = $data_in[0]['user_name'];\n $email = $data_in[0]['email_address'];\n\n $freeUserName = checkFreeValue($connectPC, $dbTable, \"user_name\", $userName);\n $freeEmail = checkFreeValue($connectPC, $dbTable, \"email_address\", $email);\n\n if (!$freeUserName && !$freeEmail) {\n\n $responseFault[0] = array(\n 'faultCode' => \"NOK\",\n 'faultString' => \"002\"\n );\n\n // Write in logs\n $log = \"User name and email already used: \".$userName.\"/\".$email;\n writeLogs($function, $log);\n $log = \"############################################\";\n writeLogs($function, $log);\n\n return $responseFault;\n\n } else if (!$freeUserName && $freeEmail) {\n\n $responseFault[0] = array(\n 'faultCode' => \"NOK\",\n 'faultString' => \"003\"\n );\n\n // Write in logs\n $log = \"User name already used: \".$userName;\n writeLogs($function, $log);\n $log = \"############################################\";\n writeLogs($function, $log);\n\n return $responseFault;\n\n } else if ($freeUserName && !$freeEmail) {\n\n $responseFault[0] = array(\n 'faultCode' => \"NOK\",\n 'faultString' => \"004\"\n );\n\n // Write in logs\n $log = \"Email already used: \".$email;\n writeLogs($function, $log);\n $log = \"############################################\";\n writeLogs($function, $log);\n\n return $responseFault;\n\n } else {\n\n $responseArray[0]['faultCode'] = \"OK\";\n\n // Write in logs\n $log = \"User name and email available: \".$userName.\"/\".$email;\n writeLogs($function, $log);\n $log = \"############################################\";\n writeLogs($function, $log);\n\n return $responseArray;\n }\n } else {\n\n $responseFault[0] = array(\n 'faultCode' => \"NOK\",\n 'faultString' => \"001\"\n );\n\n // Write in logs\n $log = \"Unable to access web services, bad credentials.\";;\n writeLogs($function, $log);\n $log = \"############################################\";\n writeLogs($function, $log);\n\n return $responseFault;\n }\n } catch (Exception $e) {\n\n $faultCode = \"000\";\n $faultString = \"Unknown exception\";\n\n $responseFault[0] = array(\n 'faultCode' => $faultCode,\n 'faultString' => $faultString\n );\n\n // Write in logs\n $log = \"CheckFreeData failed : \".$faultString.\": \".$e;\n writeLogs($function, $log);\n $log = \"############################################\";\n writeLogs($function, $log);\n\n return $responseFault;\n }\n}", "private function walledGardenData()\n {\n $this->rowsUpdated += $this->DBF->setChilliConfigSingle('nousergardendata', true);\n }", "public function processRequest() {\n $this->server->service($GLOBALS['HTTP_RAW_POST_DATA']);\n }", "function flush()\n{\n}", "public function ping(){\n http_response_code(200);\n ob_end_flush();\n }", "function send_request() { \n if(!$this->connect()) { \n return false; \n } \n else { \n $this->result = $this->request($this->data);\n return $this->result; \n } \n }", "function serverSync() {\n\n\t\t// check server build\n\t\tif (strlen($this->server->build) == 0 ||\n\t\t ($this->server->getGame() == 'MP' && strcmp($this->server->build, MP_BUILD) < 0)) {\n\t\t\ttrigger_error(\"Obsolete server build '\" . $this->server->build . \"' - must be at least '\" . MP_BUILD . \"' !\", E_USER_ERROR);\n\t\t}\n\n\t\t// get server id, login, nickname, zone & packmask\n\t\t$this->server->isrelay = false;\n\t\t$this->server->relaymaster = null;\n\t\t$this->server->relayslist = array();\n\t\t$this->server->gamestate = Server::RACE;\n\t\t$this->server->packmask = '';\n\t\t$this->client->query('GetSystemInfo');\n\t\t$response['system'] = $this->client->getResponse();\n\t\t$this->server->serverlogin = $response['system']['ServerLogin'];\n\n\t\t$this->client->query('GetDetailedPlayerInfo', $this->server->serverlogin);\n\t\t$response['info'] = $this->client->getResponse();\n\t\t$this->server->id = $response['info']['PlayerId'];\n\t\t$this->server->nickname = $response['info']['NickName'];\n\t\t$this->server->zone = substr($response['info']['Path'], 6); // strip 'World|'\n\n\t\t$this->client->query('GetLadderServerLimits');\n\t\t$response['ladder'] = $this->client->getResponse();\n\t\t$this->server->laddermin = $response['ladder']['LadderServerLimitMin'];\n\t\t$this->server->laddermax = $response['ladder']['LadderServerLimitMax'];\n\n\t\t$this->client->query('IsRelayServer');\n\t\t$this->server->isrelay = ($this->client->getResponse() > 0);\n\t\tif ($this->server->isrelay) {\n\t\t\t$this->client->query('GetMainServerPlayerInfo', 1);\n\t\t\t$this->server->relaymaster = $this->client->getResponse();\n\t\t}\n\n\t\t// get MP packmask\n\t\t$this->client->query('GetServerPackMask');\n\t\t$this->server->packmask = $this->client->getResponse();\n\n\t\t// clear possible leftover ManiaLinks\n\t\t$this->client->query('SendHideManialinkPage');\n\n\t\t// get mode & limits\n\t\t$this->client->query('GetCurrentGameInfo', 1);\n\t\t$response['gameinfo'] = $this->client->getResponse();\n\t\t$this->server->gameinfo = new Gameinfo($response['gameinfo']);\n\n\t\t// get status\n\t\t$this->client->query('GetStatus');\n\t\t$response['status'] = $this->client->getResponse();\n\t\t$this->currstatus = $response['status']['Code'];\n\n\t\t// get game & mapdir\n\t\t$this->client->query('GameDataDirectory');\n\t\t$this->server->gamedir = $this->client->getResponse();\n\t\t$this->client->query('GetTracksDirectory');\n\t\t$this->server->mapdir = $this->client->getResponse();\n\n\t\t// get server name & options\n\t\t$this->getServerOptions();\n\n\t\t// throw 'synchronisation' event\n\t\t$this->releaseEvent('onSync', null);\n\n\t\t// get current players/servers on the server (hardlimited to 300)\n\t\t$this->client->query('GetPlayerList', 300, 0, 2);\n\t\t$response['playerlist'] = $this->client->getResponse();\n\n\t\t// update players/relays lists\n\t\tif (!empty($response['playerlist'])) {\n\t\t\tforeach ($response['playerlist'] as $player) {\n\t\t\t\t// fake it into thinking it's a connecting player:\n\t\t\t\t// it gets team & ladder info this way & will also throw an\n\t\t\t\t// onPlayerConnect event for players (not relays) to all plugins\n\t\t\t\t$this->playerConnect(array($player['Login'], ''));\n\t\t\t}\n\t\t}\n\t}", "public function success();", "public function gatherData() {\r\n\t\t$this->resource->gatherData();\r\n\t}", "function prepareData()\r\n\t{\r\n\t\treturn true;\r\n\t}", "function sendRequest()\n\t\t{\n\t\t\t$stream = $this->getRequestStream();\n\t\t\t$stream->write( $this->getRequestString() );\n\t\t\t$stream->close();\n\t\t}", "public function runSuccess();", "public function beforeSyncing() {}", "private function send_data($param) {\n\n try {\n $this->db->conn()->query('BEGIN');\n $res = $this->insert_update($param);\n $this->db->conn()->query('COMMIT');\n } catch (\\Exception $e) {\n $res = false;\n $this->db->log->write('ERROR MESSAGE:'.$e->getMessage(), __LINE__, 'send.php');\n }\n\n return $res;\n }", "public function processData() {\r\r\n if ( is_array($this->data) && isset($this->data['args']) )\r\r\n $this->args = array_merge($this->args, $this->data['args']);\r\r\n\r\r\n if ( is_array($this->data) && isset($this->data['value']) ) {\r\r\n // If called from back-end non-post context\r\r\n $this->e_data = $this->decode_param($this->data['value']);\r\r\n $this->data = $this->encode_param($this->data['value']);\r\r\n } else {\r\r\n // POST method or something else\r\r\n $this->e_data = $this->decode_param($this->data);\r\r\n $this->data = $this->encode_param($this->data);\r\r\n }\r\r\n /**\r\r\n * At this point the this->data variable surely contains the encoded data, no matter what.\r\r\n */\r\r\n }", "static function salva(){\n if(!CUtente::verificalogin())header('Location: /Progetto/Utente/homepagedef');\n else{\n session_start();\n if($_SERVER['REQUEST_METHOD'] == \"POST\"){\n $nome=$_POST['nome'];\n $descrizione=$_POST['descrizione'];\n if($_POST['accessibilità']=='Privato')$pubblico=false;\n else $pubblico=true;\n $w=new EWatchlist($nome,$descrizione,$pubblico,$_SESSION['utente']->getUsername());\n if(isset($_POST['serie'])){\n if(!empty($_POST['serie'])){\n foreach ($_POST['serie'] as $serie){\n $s=FPersistentManager::load('id',$serie,'FSerieTv');\n $w->AggiungiSerie(clone ($s[0]));\n }\n }\n }\n\n\n\n FPersistentManager::store($w);\n $u=FPersistentManager::load('username',$_SESSION['utente']->getUsername(),'FUtente');\n $_SESSION['utente']=clone($u[0]);\n $_SESSION['watchlist']= $_SESSION['utente']->getWatchlist();\n\n\n header('Location: /Progetto/Utente/user?id='.$_SESSION['utente']->getUsername());\n\n }\n else header('Location: /Progetto/Utente/homepagedef');\n }\n }", "public function flush()\n\t{\n\t\treturn true;\n\t}", "public function process() {\n\t\treturn false;\n\t}", "public function store()\n\t{\n\t\treturn false;\n\t}", "public abstract function writeBack();", "function flush();", "function act() {\n if ($_SERVER['REQUEST_METHOD'] == \"PUT\") {\n $xml = \"\";\n $fd = fopen(\"php://input\",\"r\");\n while ($line = fread($fd,2048)) {\n $xml .= $line;\n }\n fclose($fd);\n $src = $this->getParameterDefault(\"src\");\n $fd=fopen($src,\"w\");\n \n fwrite($fd,$xml);\n fclose($fd);\n // TODO: Error handling!\n $this->sitemap->setResponseCode(204);\n return array(\"message\" => \"Data saved\");\n }\n return array(\"message\" => \"Not a PUT request\");\n \n \n }", "protected function send() {}", "abstract public function updateData();", "public function flush() {}", "public function flush() {}", "public function flush() {}", "public function flush() {}", "public function flush() {}", "public function flush() {}", "public function flush() {}", "public function flush() {}", "public function flush() {}", "public function flush() {}", "public function flush() {}", "public function flush() {}", "public function flush() {}", "private function _runSensorDataUpdate()\n {\n $proccessedData = array();\n $query = \"\n SELECT\n `f_station_code`,`f_name`\n FROM\n `\" . DBT_PREFIX . \"station_info`\n WHERE\n `enable_station` = 1\n \";\n sql_select($query, $results);\n while($row = mysql_fetch_object($results))\n {\n if($this->_forcedStartingDate != false)\n {\n $getFromDate = $this->_forcedStartingDate;\n }else\n {\n $stationSensorsDataHistoryExists = $this->_stationSensorsDataHistoryExists($row->f_station_code);\n if($stationSensorsDataHistoryExists)\n {\n $stationSensorsDataHistoryExists = $stationSensorsDataHistoryExists - FIELDCLIMATE_DOWNLOAD_ROLLBACK;\n }else\n {\n $stationSensorsDataHistoryExists = strtotime('1 months ago midnight');\n }\n $getFromDate = date('Y-m-d\\TH:i:s', $stationSensorsDataHistoryExists);\n }\n if($getFromDate)\n {\n $this->_proccessOutput(\"Station \" . $row->f_station_code . \" updating from \" . $getFromDate); //date(DATE_ATOM,$stationSensorsDataHistoryExists)\n $this->_stationName = $row->f_name;\n $this->_dateFrom = $getFromDate;\n $remote_uri = $this->_buildCurlRequest('Get_Data_From_Date');\n $remoteJson = $this->_executeFcCurl($remote_uri);\n $this->_proccessOutput($remote_uri);\n if(isset($remoteJson->ReturnParams->max_date) && $remoteJson->ReturnParams->max_date >= $getFromDate)\n {\n $max_date = $remoteJson->ReturnParams->max_date;\n $next_date_row = $this->_updateSensorsData($row->f_station_code, $remoteJson->ReturnParams->max_date, $remoteJson);\n while((strtotime(preg_replace(\"#[A-Z]#i\", \" \", $next_date_row)) < strtotime(preg_replace(\"#[A-Z]#i\", \" \", $max_date))) && ($next_date_row !== false))\n {\n $this->_dateFrom = $next_date_row;\n $remote_uri = $this->_buildCurlRequest('Get_Data_From_Date');\n $remoteJson = $this->_executeFcCurl($remote_uri);\n $next_date_row = $this->_updateSensorsData($row->f_station_code, $remoteJson->ReturnParams->max_date, $remoteJson);\n }\n }else\n {\n $proccessedData[] = $remoteJson;\n }\n }else\n {\n die('no starting date date assigned');\n }\n }\n //return $out;\n }", "public function flush()\n\t{\n\n\t}", "public function flush()\n {\n return 1;\n }", "function serverSync() {\n\n\t\t// get current players on the server ...\n\t\t$this->client->query('GetPlayerList', 100, 0);\n\t\t$response['playerlist'] = $this->client->getResponse();\n\n\t\t// get game version the server runs on ...\n\t\t$this->client->query('GetVersion');\n\t\t$response['version'] = $this->client->getResponse();\n\n\t\t$this->client->query('GetCurrentGameInfo');\n\t\t$response['gameinfo'] = $this->client->getResponse();\n\n\t\t$this->client->query('GetStatus');\n\t\t$response['status'] = $this->client->getResponse();\n\n\t\t// update player list ...\n\t\tif (!empty($response['playerlist'])) {\n\t\t\tforeach ($response['playerlist'] as $player) {\n\t\t\t \n\t\t\t\t// PRELOAD\n\t\t\t\t// create player object of every player response ...\n\t\t\t\t$player_item = new Player($player);\n\t\t\t\t$player_item->mistral['displayPlayerInfo']=true;\n\n\t\t\t\t// add player object to player list ...\n\t\t\t\t$this->server->players->addPlayer($player_item);\n\n\t\t\t\t// GET ALL INFOS LATER - wtf no wins \n//\t\t\t\t$this->addCall('GetPlayerInfo', array($player['Login']), '', 'initPlayer');\n\t\t\t \n\t\t\t\t// NO RASPWAY\n//\t\t\t\t$this->playerConnect(array($player['Login'], ''));\t\t\t\t\t// fake it into thinking it's a connecting player, it gets team & ladder info this way\n\t\t\t}\n\t\t}\n\n\t\t// get game ...\n\t\t$this->server->game = $response['version']['Name'];\n\n\t\t// get mode ...\n\t\t$this->server->gameinfo = new Gameinfo($response['gameinfo']);\n\n\t\t// get status ...\n\t\t$this->server->status = $response['getstatus']['Code'];\n\n\t\t// get trackdir\n\t\t$this->client->query('GetTracksDirectory');\n\t\t$this->server->trackdir = $this->client->getResponse();\n\t\t// throw new synchronisation event ...\n\t\t$this->releaseEvent('onSync', array());\n\t}", "protected function processReceivedData() {\n\n parent::processReceivedData();\n }", "public function handleServiceRequest() {\n //\n // Create instance of SOAP server.\n //\n $SoapServer = new SoapServer($this->getWsdlFullPath()); \n $SoapServer->setClass(AblePolecat_Data::getDataTypeName($this)); \n $SoapServer->setPersistence(SOAP_PERSISTENCE_SESSION);\n $SoapServer->handle();\n }", "function ServeRequest() \n\t\t{\n\t\t\t//Startet den WebDAV Server und verarbeitet die Anfrage\n\t\t parent::ServeRequest();\n\t\t\t\n\t\t\t//Temp Dateien löschen (die bei GET entstanden sind)\n\t\t\tforeach ($this->tmp_files as $key => $value) {\n\t\t\t\tunlink($value);\n\t\t\t}\n\t\t}", "public function store_result() {}", "public function stream_flush()\n {\n return true;\n }", "public function wussy() {\r\n $this->returnJson(200, 'You wussy!!');\r\n }", "function _write($ses_id, $data) {\n\t\t$dbData = mysql_real_escape_string($data);\n\t\t$result = mysql_query (\"SELECT `start` from phpSession where id='$ses_id'\", $this->db);\n\t\tif ( mysql_num_rows($result) == 0 ) {\n\t\t\t$ipAddress = mysql_real_escape_string($_SERVER['REMOTE_ADDR']);\n\t\t\t$query = \"Insert into phpSession values('$ses_id', NOW(), NOW(), '$dbData', NULL, '$ipAddress')\";\n\t\t\t$result = mysql_query($query, $this->db);\n\t\t} else {\n\t\t\t$query = \"Update phpSession set data = '$dbData', lastAccess = NOW(), `lock`=NULL where id = '$ses_id'\";\n\t\t\t$result = mysql_query ($query, $this->db);\n\t\t}\n\t\treturn true;\n\t}", "protected function sendContent()\n {\n if ($this->stream === null) {\n $this->swoole_http_response->end($this->content);\n // 这里看到还有写session的\n return;\n }\n\n $chunkSize = 8 * 1024 * 1024; // 8MB per chunk\n\n if (is_array($this->stream)) {\n list ($handle, $begin, $end) = $this->stream;\n fseek($handle, $begin);\n while (!feof($handle) && ($pos = ftell($handle)) <= $end) {\n if ($pos + $chunkSize > $end) {\n $chunkSize = $end - $pos + 1;\n }\n $this->swoole_http_response->write(fread($handle, $chunkSize));\n }\n fclose($handle);\n } else {\n while (!feof($this->stream)) {\n $this->swoole_http_response->write(fread($this->stream, $chunkSize));\n }\n fclose($this->stream);\n }\n $this->swoole_http_response->end();\n\n // 这里看到还有写session的\n }", "public function tell()\n {\n return false;\n }", "private function flush()\n {\n $this->currentOptions = [];\n // set back send status buffer string\n $this->sendStatus = null;\n }", "public function sendPayload() { \n \n \n /* Check and add last-second data that may have been changed by public methods */\n $this->createProxyData();\n $this->createCustomDimensions();\n if(!$this->payload['cn']) $this->createCampaignParameters(); /* ie, check $_GET array for them if still unset */\n \n foreach($this->payload as $i => $v) {\n if(strlen($v) > 0) {\n $params[] = urlencode($i) . '=' . urlencode($v) ;\n }\n }\n \n \n $url = ( ( $this->testing) ? ( $this->test_url ) : ( $this->base_url ) ) . \n '?' . implode('&', $params);\n \n// $url = ( ( $this->testing) ? ( $this->test_url ) : ( $this->base_url ) ) . \n// '?' . http_build_query($this->payload, \"&\");\n\n \n switch($this->output) {\n case 'silent':\n $this->sendCurl($url);\n break;\n case 'noscript':\n /* outputs only a noscript element containing the pixel for Non-Java Operation */\n $this->displayNoScriptPixel($url);\n break;\n case 'pixel':\n echo \"<img height='1' width='1' style='border-style:none;' alt='' src='https://$url&method=NAKED_PIXEL' />\";\n break;\n case 'javascript':\n /* TODO build dynamic javascript version */\n $this->displayJavascript();\n break;\n case 'auto':\n $this->displayJavascript();\n $this->displayNoScriptPixel($url);\n break;\n case 'test':\n $this->displayTestPixel($url);\n break;\n case 'iframe':\n $this->displayIframe($url);\n \n break;\n \n } \n \n \n \n\n \n \n $this->payload_is_sent = TRUE ;\n $this->writeLog($url); \n }", "public function serve_request()\n {\n }" ]
[ "0.5874372", "0.5816446", "0.57024693", "0.56140345", "0.5545856", "0.5511371", "0.5499865", "0.5476685", "0.5418175", "0.54000944", "0.5319145", "0.5319145", "0.52847517", "0.5273776", "0.5268976", "0.52604616", "0.52599746", "0.5242801", "0.5236712", "0.5233222", "0.5230949", "0.5230949", "0.5230458", "0.5230458", "0.52118427", "0.51886", "0.51856416", "0.5179394", "0.51766187", "0.51761687", "0.51321816", "0.510967", "0.51036775", "0.50952023", "0.50937015", "0.508052", "0.5075834", "0.5071869", "0.50569797", "0.50549626", "0.5051244", "0.50367016", "0.5032591", "0.5028274", "0.50195485", "0.50120926", "0.50081044", "0.50002426", "0.49948862", "0.49907672", "0.49669865", "0.4965938", "0.49587557", "0.494884", "0.49378464", "0.49346134", "0.4933816", "0.4928508", "0.49194193", "0.4918633", "0.4917597", "0.49155593", "0.4911021", "0.4908085", "0.49033207", "0.4898656", "0.4887593", "0.48875007", "0.48734173", "0.48726246", "0.48595372", "0.48542526", "0.48536548", "0.48536548", "0.48536548", "0.48536548", "0.48536474", "0.48536474", "0.48536474", "0.48536474", "0.48536474", "0.48536474", "0.48536474", "0.48536474", "0.48536474", "0.48516217", "0.48468205", "0.4835558", "0.48354098", "0.48254934", "0.48176542", "0.48154885", "0.48100626", "0.48096502", "0.48031393", "0.47999662", "0.47994953", "0.47988164", "0.4797639", "0.47875634", "0.4785459" ]
0.0
-1
Formats $term as in STW, first letter capital.
protected function formatAsInThesaurus($term) { return ucfirst(strtolower($term)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function toCamelCase($term)\n {\n $term = preg_replace_callback(\n '/[\\s_-](\\w)/',\n function ($matches) {\n return mb_strtoupper($matches[1]);\n },\n $term\n );\n $term[0] = mb_strtolower($term[0]);\n return $term;\n }", "public static function toUpperCamelCase($term)\n {\n $term = static::toCamelCase($term);\n $term[0] = mb_strtoupper($term[0]);\n return $term;\n }", "protected static function camelCaseTransform($term, $letter)\n {\n return mb_strtolower(preg_replace('/([A-Z])/', $letter . '$1', $term));\n }", "function formatWord ($param1)\n{\n return ucfirst($param1);\n}", "public static function toSpace($term)\n {\n return static::camelCaseTransform(static::toCamelCase($term), ' ');\n }", "function the_champ_first_letter_uppercase($word){\r\n\treturn ucfirst($word);\r\n}", "protected function normalizeTerm(string $term): string\n {\n if (strpos($term, static::TERM_CASE_SEPARATOR)) {\n throw new \\InvalidArgumentException('Term cannot contain \"' . static::TERM_CASE_SEPARATOR . '\"');\n }\n\n return mb_strtolower($term) . static::TERM_CASE_SEPARATOR . $term;\n }", "public function getTermAttribute($term)\n {\n if (!$term) {\n return ucwords(\\Present::unslug($this->slug));\n }\n\n return $term;\n }", "function fmtCase($text) {\n\t\tglobal $assoc_case;\n\n\t\tif ($assoc_case == \"lower\") $newtext\t= strtolower($text);\n\t\telse if ($assoc_case == \"upper\") $newtext\t= strtoupper($text);\n\t\treturn $newtext;\n\n\t}", "function uncapitalize(){\n\t\t$first = $this->substr(0,1)->downcase();\n\t\treturn $first->append($this->substr(1));\n\t}", "function capitalize() {\n\t\t$first = $this->substr(0,1)->upcase();\n\t\treturn $first->append($this->substr(1));\n\t}", "function formatInput($param1)\n{\n return ucwords(strtolower($param1));\n}", "protected function _formatName($unformatted)\n {\n $unformatted = str_replace(array('-', '_', '.'), ' ', strtolower($unformatted));\n $unformatted = preg_replace('[^a-z0-9 ]', '', $unformatted);\n return str_replace(' ', '', ucwords($unformatted));\n }", "protected function upperCaseFirstLetter($wordtxt)\r\n\t{\r\n\t\tif (strlen($wordtxt) > 0)\r\n\t\t\t$wordtxt = strtoupper(substr($wordtxt, 0, 1)).substr($wordtxt, 1);\r\n\t\treturn $wordtxt;\r\n\t}", "public function camel($word);", "function accronym($string) {\n $out = '';\n foreach (explode(' ', $string) as $value) {\n if ($value) {\n $out .= strtoupper($value[0]);\n }\n }\n return $out;\n}", "function strtocapitalize($text) {\n\t$text = strtoupper(substr($text, 0, 1)) . substr($text, 1);\n\t$text = str_replace('_', ' ', $text);\n\treturn $text;\n}", "function LetterCapitalize($str) { \r\n return ucwords($str); \r\n}", "function prepareSearchTerms($terms) {\n $terms = ucwords($terms); // Capitalise each word.\n return $terms;\n}", "function ucfirst_sentence($str){\r\n\treturn preg_replace('/\\b(\\w)/e', 'strtoupper(\"$1\")', strtolower($str));\r\n}", "public function mayuscula($val)\n {\n return ucfirst($val);\n }", "function camel_case_with_initial_capital($s) {\n return camel_case($s, true);\n }", "function studly_case($value)\n\t{\n\t\treturn Illuminate\\Support\\Str::studly($value);\n\t}", "function uv_first_capital($string){\n //Patron para reconocer y no modificar numeros romanos\n $pattern = '/\\b(?![LXIVCDM]+\\b)([A-Z_-ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝ]+)\\b/';\n $output = preg_replace_callback($pattern, function($matches) {\n return mb_strtolower($matches[0], 'UTF-8');\n }, $string);\n $output = ucfirst($output);\n return $output;\n }", "function frase_mayuscula($frase){\n $frase = strtoupper($frase);\n return $frase;\n }", "public static function toHyphen($term)\n {\n return static::camelCaseTransform(static::toCamelCase($term), '-');\n }", "function studly_case($str){\n\t\treturn Str::studly($str);\n\t}", "private static function format($name, $value)\n {\n return $value ?: ucwords(str_replace('_', ' ', $name));\n }", "function macro_convert_camel_to_human_readable($camel)\n{\n $camel = str_replace('_', ' ', $camel);\n $camel = str_replace('\\\\', ' ', $camel);\n $camel = preg_replace_callback(\n '/ ([A-Z])([a-z0-9])/Ss',\n function (array $matches) {\n return ' ' . strtolower($matches[1]) . $matches[2];\n },\n $camel\n );\n $camel = preg_replace_callback(\n '/([a-z0-9])([A-Z])([a-z0-9])/Ss',\n function (array $matches) {\n return $matches[1] . ' ' . strtolower($matches[2]) . $matches[3];\n },\n $camel\n );\n\n return ucfirst($camel);\n}", "function upcase(){\n\t\treturn $this->_copy(Translate::Upper($this->toString(),$this->getEncoding()));\n\t}", "function capital_P_dangit($text)\n {\n }", "public function getTitleCase($value) {\n\t\t$value = str_replace('_', ' ', $value);\n\t\t$value = ucwords($value);\n\t\t$value = str_replace(' ', '', $value);\n\t\treturn $value;\n\t}", "public static function capitalize($word) {\n return ucfirst(strtolower($word)); \n }", "protected function convName($name){\n if(ctype_upper(substr($name, 0, 1))){\n $name = strtolower(preg_replace('/([^A-Z])([A-Z])/', \"$1_$2\", $name));\n }\n else{\n $name = preg_replace('/(?:^|_)(.?)/e',\"strtoupper('$1')\", $name);\n }\n return $name;\n }", "function studly_case($value)\n {\n return Str::studly($value);\n }", "function strtoproper($someString) {\n return ucwords(strtolower($someString));\n}", "function title_case($value)\n {\n return Str::title($value);\n }", "function title_case($value)\n {\n return Str::title($value);\n }", "public static function toDash($term)\n {\n return static::camelCaseTransform(static::toCamelCase($term), '_');\n }", "function convertNamingFromUnderlineToCamelCase($text,$firstLetterLowerCase=true) {\n\t\t\tpreg_match_all('/(^[a-zA-Z])|(_[a-zA-Z])/', $text, $matches, PREG_PATTERN_ORDER);\n\t\n\t\t\tfor ($i = 0; $i < count($matches[0]); $i++) {\n\t\t\t\t\t$original=$matches[0][$i];\n\t\t\t\t\t$originals[]=$original;\n\t\t\t\t\tif ($i==0 and $firstLetterLowerCase)\n\t\t\t\t\t\t\t$replacement=str_replace('_','',$matches[0][$i]);\n\t\t\t\t\telse\n\t\t\t\t\t\t\t$replacement=strtoupper(str_replace('_','',$matches[0][$i]));\n\t\t\t\t\t$replacements[]=$replacement;\n\t\t\t}\n\t\n\t\t\treturn str_replace($originals,$replacements,$text);\n\t}", "public function formatActionName($unformatted)\n {\n $formatted = $this->_formatName($unformatted, true);\n return strtolower(substr($formatted, 0, 1)) . substr($formatted, 1);\n }", "function acf_encode_term($term)\n{\n}", "public static function standardize( $name ) {\n\t\treturn self::firstUpper( self::lower( $name )) ;\n\t}", "public function getUcaseName() {\n return ucfirst($this->name);\n }", "function properCase($propername) {\n //if (ctype_upper($propername)) {\n $propername = ucwords(strtolower($propername));\n //}\n return $propername;\n }", "function prettify(string $text): string\n {\n return preg_replace('/([a-z])([A-Z])/', '$1 $2', str_replace(['_', '-'], ' ', ucwords($text, \"_- \\t\\r\\n\\f\\v\")));\n }", "function acf_get_term_title($term)\n{\n}", "protected function initials(): string\n {\n preg_match_all(\"/[A-Z]/\", ucwords(strtolower($this->value)), $matches);\n\n return implode('', $matches[0]);\n }", "public static function camelCase($val, $ucFirst = false): string\n {\n if (!$val || !\\is_string($val)) {\n return '';\n }\n\n $str = self::lowercase($val);\n\n if ($ucFirst) {\n $str = self::ucfirst($str);\n }\n\n return \\preg_replace_callback('/_+([a-z])/', function ($c) {\n return \\strtoupper($c[1]);\n }, $str);\n }", "function make_fieldname_text($fieldname) {\n\t$fieldname=str_replace(\"_\", \" \",$fieldname);\n\t$fieldname=ucfirst($fieldname);\n\treturn $fieldname;\t\t\n}", "function humanize($str){\n return ucwords(preg_replace('/[_\\-]+/', ' ', strtolower(trim($str))));\n }", "public function toCapitalizeFully() {\n \n return $this->toCapitalizeWords();\n }", "function truc(string $arg):string{\n return $arg . ' yo <br/>';\n }", "function city_name(){\n\tif(isset($_GET[\"expansion\"])){\n\t\treturn ucwords(str_replace(\"-\", \" \", $_GET[\"expansion\"]));\n\t}else{\n\t\treturn \"\";\n\t}\n}", "public function filter($value)\n {\n return ucwords((string) $value);\n }", "private function changeTerm($value)\n {\n // be-safe !!!\n if ($value == null) {\n return null;\n }\n\n return mb_strtolower($value);\n }", "function _post_format_get_term($term)\n {\n }", "public static function classify($word)\n {\n return str_replace(\" \", \"\", ucwords(strtr($word, \"_-\", \" \")));\n }", "public function titleize($word, $uppercase = '')\n\t{\n\t\t$uppercase = $uppercase == 'first' ? 'ucfirst' : 'ucwords';\n\t\treturn $uppercase(Inflector::humanize(Inflector::underscore($word)));\n\t}", "public function camelCase($input)\n {\n return str_replace(' ', '', ucwords(str_replace(['_', '-'], ' ', $input)));\n }", "private function toCamelCase(string $word): string\n {\n return lcfirst(str_replace(' ', '', ucwords(strtr($word, '_-', ' '))));\n }", "public static function humanize($lower_case_and_underscored_word) {\n return ucwords(str_replace(\"_\",\" \",$lower_case_and_underscored_word));\n }", "function atk_strtoupper($str)\n{\n\treturn atkString::strtoupper($str);\n}", "static public function humanize($str)\n\t{\n\t\treturn ucfirst(str_replace(array('-', '_'), ' ', $str));\n\t}", "public static function titleize($word, $uppercase = '')\n {\n $uppercase = $uppercase == 'first' ? 'ucfirst' : 'ucwords';\n return $uppercase(self::humanize(self::underscore($word)));\n }", "public function toCapitalizeWords() {\n $this->_value = ucwords($this->_value);\n \n return $this;\n }", "public function filter_uc_lc($value) {\n\n return ucwords(strtolower(trim($value)));\n }", "protected static function change2Token($term)\n {\n # Replace any whitespace ( ) with a holder token (ie. {WHITESPACE-1}).\n $term = preg_replace_callback(\n \"/(\\s)/\",\n function ($matches) {\n foreach ($matches as $match) {\n return '{WHITESPACE-' . ord($match) . '}';\n }\n },\n $term\n );\n # Replace any comma (,) with a holder token ({COMMA}).\n $term = preg_replace(\"/,/\", \"{COMMA}\", $term);\n\n return $term;\n }", "public static function camelize($lower_case_and_underscored_word) {\n \tif(strpos($lower_case_and_underscored_word, '_') === false)\n\t\t\treturn ucfirst($lower_case_and_underscored_word);\n\t\telse\n\t\t\treturn str_replace(' ','',ucwords(str_replace('_',' ',$lower_case_and_underscored_word)));\n }", "function camelCase($input)\n{\n $words = \\__::words(preg_replace(\"/['\\x{2019}]/u\", '', $input));\n\n return array_reduce(\n $words,\n function ($result, $word) use ($words) {\n $isFirst = \\__::first($words) === $word;\n $word = \\__::toLower($word);\n return $result . (!$isFirst ? \\__::capitalize($word) : $word);\n },\n ''\n );\n}", "function up($str) {\n\t\treturn strtoupper($str);\n\t}", "function pascal_case($value)\n {\n $value = ucwords(str_replace(['-', '_'], ' ', $value));\n\n return str_replace(' ', '', $value);\n }", "function formatName(array $name)\r\n {\r\n return $name['last_name'] . ' ' . preg_replace('/\\b([A-Z]).*?(?:\\s|$)+/','$1',$name['first_name']);\r\n }", "protected static final function unmung($thing) {\n\t\treturn lcfirst(preg_replace_callback('/_([a-z])/', function ($m) { return strtoupper($m[1]); }, $thing));\n\t}", "public function upper_case_string($emp_name){\n\t\t$let = ucwords($emp_name);\n\t\treturn $let;\t\n\t}", "public function upper_case_string($emp_name){\n\t\t$let = ucwords($emp_name);\n\t\treturn $let;\t\n\t}", "function downcase(){\n\t\treturn $this->_copy(Translate::Lower($this->toString(),$this->getEncoding()));\n\t}", "function titleDisplay($input){\n $p1= strripos($input, \" \");\n $sub_string= substr($input, 0,$p1);\n $word = explode(\" \",$sub_string);\n $end = substr($input,$p1+1,3);\n \n $short = \"\";\n\n foreach ($word as $w) {\n if (!ctype_alnum($w) && !is_numeric($w)){\n $short .= \"_\"; \n }\n else{\n \n $short .= $w[0]; \n }\n }\n if(strlen($short) == 1){\n $short = substr($input, 0,3);\n }\n $short .= \".\".$end;\n return strtolower($short) ;\n}", "function strtoproper($someString) {\n\t\treturn ucwords(strtolower($someString));\n\t}", "public function labelMaker($str) {\n $str_out = ucwords(\\strtr($str,'_',' ')); \n return $str_out; \n }", "function addSpacingNormal($string) {\r\n\t\t$spacedString = \"\";\r\n\r\n\t\t$charArray = str_split($string);\r\n\t\tforeach($charArray as $key => $value)\r\n\t\t\tif(!isUpperCase($value))\r\n\t\t\t\t$spacedString .= $value;\r\n\t\t\telse\r\n\t\t\t\t$spacedString .= \" \" . $value;\r\n\r\n\t\treturn ucfirst($spacedString);\r\n\t}", "protected static final function mung($thing) {\n\t\treturn preg_replace_callback('/([A-Z])/', function ($m) { return '_' . strtolower($m[1]); }, lcfirst($thing));\n\t}", "public static function studlyCase($str) {}", "public static function label($str, $space = ' ')\n {\n $str = preg_replace('/(?<=\\\\w)(?=[A-Z])/', $space . \"$1\", $str);\n return $space === ' ' ? ucfirst(trim(str_replace('_', ' ', strtolower($str)))) : $str;\n }", "function ucfirst_sentences($s) {\n return preg_replace_callback('/([.!?])\\s+(\\w)/', function ($matches) {\n return strtoupper($matches[1] . ' ' . $matches[2]);\n }, ucfirst(strtolower($s)));\n }", "function FormatName ($name) {\n\t\n\t\t//\tStart by lower casing the name\n\t\t$name=MBString::ToLower(MBString::Trim($name));\n\t\t\n\t\t//\tFilter the name through\n\t\t//\tthe substitutions\n\t\tforeach (array(\n\t\t\t'(?<=^|\\\\W)(\\\\w)' => function ($matches) {\treturn MBString::ToUpper($matches[0]);\t},\n\t\t\t'(?<=^|\\\\W)O\\'\\\\w' => function ($matches) {\treturn MBString::ToUpper($matches[0]);\t},\n\t\t\t'(?<=^|\\\\W)(Ma?c)(\\\\w)' => function ($matches) {\treturn $matches[1].MBString::ToUpper($matches[2]);\t}\n\t\t) as $pattern=>$substitution) {\n\t\t\n\t\t\t$pattern='/'.$pattern.'/u';\n\t\t\t\n\t\t\t$name=(\n\t\t\t\t($substitution instanceof Closure)\n\t\t\t\t\t?\tpreg_replace_callback($pattern,$substitution,$name)\n\t\t\t\t\t:\tpreg_replace($pattern,$substitution,$name)\n\t\t\t);\n\t\t\n\t\t}\n\t\t\n\t\t//\tReturn formatted name\n\t\treturn $name;\n\t\n\t}", "public static function makeTitleCase($input) {\n static $map;\n\n if (isset($map[$input])) {\n return $map[$input];\n }\n\n $output = str_replace(\"_\", \" \", strtolower($input));\n $output = ucwords($output);\n $output = str_replace(\" \", \"\", $output);\n\n $map[$input] = $output;\n\n return $output;\n }", "function makeTitleCase($input_title)\n {\n $input_array_of_words = explode(\" \", strtolower($input_title));\n $output_titlecased = array();\n $designated = array(\"a\", \"as\", \"an\", \"by\", \"of\", \"on\", \"to\", \"the\", \"or\", \"in\", \"from\", \"is\");\n foreach ($input_array_of_words as $word) {\n //if any of the words in designated array appear, lowercase them\n if (in_array($word, $designated)) {\n array_push($output_titlecased, lcfirst($word));\n //otherwise, uppercase\n } else {\n array_push($output_titlecased, ucfirst($word));\n }\n\n\n }\n\n//overrides the first if statement, making every first word capitalized no matter what\n $output_titlecased[0] = ucfirst($output_titlecased[0]);\n\n return implode(\" \", $output_titlecased);\n }", "private function normalizeHeader(string $header): string\n {\n return ucwords($header, '-');\n }", "public function getConceptName(): string\n {\n return \\ucfirst($this->toString());\n }", "function _wp_to_kebab_case($input_string)\n {\n }", "public function ucnames($string)\n {\n $format = function ($regex) {\n $word = strtolower($regex[1]);\n if ($word == 'de') {\n return str_replace($regex[1], $word, $regex[0]);\n }\n $word = ucfirst($word);\n if (substr($word, 1, 1) == \"'\") {\n if (substr($word, 0, 1) == 'D') {\n $word = strtolower($word);\n }\n $next = substr($word, 2, 1);\n $next = strtoupper($next);\n $word = substr_replace($word, $next, 2, 1);\n }\n $word = preg_replace_callback('/\n\t\t\t\t(?: ^ | \\\\b ) # assertion: beginning of string or a word boundary\n\t\t\t\t( O\\' | Ma?c | Fitz) # attempt to match Irish surnames\n\t\t\t\t( [^\\W\\d_] ) # match next char; we exclude digits and _ from \\w\n\t\t\t/x', function ($match) {\n return $match[1] . strtoupper($match[2]);\n}, $word);\n return str_replace($regex[1], $word, $regex[0]);\n };\n $string = preg_replace_callback('/(?:^|\\\\s)([\\\\w\\']+)\\\\s?/s', $format, $string);\n return $string;\n }", "private function retrieve_term_title() {\n\t\t$replacement = null;\n\n\t\tif ( ! empty( $this->args->taxonomy ) && ! empty( $this->args->name ) ) {\n\t\t\t$replacement = $this->args->name;\n\t\t}\n\n\t\treturn $replacement;\n\t}", "function dowrite($str)\n{\n global $term_bold, $term_norm;\n $str = str_replace(\"%b\", $term_bold, $str);\n $str = str_replace(\"%B\", $term_norm, $str);\n print $str;\n}", "function str_camelcase($str, $capital_first_char = false)\n{\n $str = str_replace(' ', '', ucwords(str_replace('_', ' ', $str)));\n return $capital_first_char ? $str : lcfirst($str);\n}", "public static function toCamelCase($word)\n {\n return lcfirst(str_replace(' ', '', ucwords(preg_replace('/[^A-Za-z0-9]+/', ' ', $word))));\n }", "public function humanize($lowerCaseAndUnderscoredWord);", "function humanize($str, $titleCaps = true) {\n\n $str = strtolower(trim(str_replace('_', ' ', $str)));\n if (!$str) return $str;\n\n $str = preg_replace('/\\[\\s*\\]$/', '', $str);\n\n if ($titleCaps) {\n return ucwords($str);\n } else {\n return strtoupper(substr($str, 0, 1)) . substr($str, 1);\n }\n }", "function initials(string $fullname) : string {\n\t$fullname = ltrim($fullname,\" \");\n\t$nameParts = explode(' ', $fullname);\n\tif (count($nameParts) >= 2) {\n\t\t\treturn strtoupper(substr($nameParts[0], 0, 1) . substr(end($nameParts), 0, 1));\n\t}\n\tpreg_match_all('#([A-Z]+)#', $nameParts, $capitals);\n\tif (count($capitals[1]) >= 2) {\n\t\t\treturn substr(implode('', $capitals[1]), 0, 2);\n\t}\n\treturn strtoupper(substr($nameParts, 0, 2));\n}", "public function uppercase()\n {\n return $this->getNameInstance()->uppercase();\n }" ]
[ "0.7760507", "0.73898363", "0.698323", "0.6953011", "0.67286724", "0.65569973", "0.6489413", "0.64661443", "0.62995964", "0.62509876", "0.62415284", "0.6217876", "0.61884254", "0.6128866", "0.6117983", "0.6052977", "0.6051315", "0.6029363", "0.5997284", "0.59548", "0.59361947", "0.59005964", "0.5898738", "0.589328", "0.5889888", "0.58738375", "0.58703", "0.58494115", "0.58480257", "0.583597", "0.5819109", "0.5817866", "0.5813317", "0.58070946", "0.58047223", "0.57915485", "0.5790416", "0.5782522", "0.5781578", "0.57804126", "0.5777371", "0.5776071", "0.576942", "0.5753295", "0.5752599", "0.5747226", "0.5744239", "0.57350814", "0.57349664", "0.57143986", "0.57073426", "0.57009816", "0.56992656", "0.5698885", "0.56959647", "0.5694569", "0.56827587", "0.5680438", "0.56784296", "0.56771797", "0.56695026", "0.5663317", "0.56597096", "0.5657275", "0.5649908", "0.5644642", "0.56303823", "0.562563", "0.56236684", "0.56152534", "0.5608585", "0.56041", "0.5598211", "0.55973345", "0.55844235", "0.55844235", "0.55814356", "0.5564358", "0.55623835", "0.5558439", "0.55583483", "0.55512166", "0.5539042", "0.55367374", "0.5535481", "0.5533778", "0.5520815", "0.55085266", "0.55061066", "0.5500721", "0.5498624", "0.54968864", "0.5490328", "0.5476329", "0.5467308", "0.5459726", "0.5458832", "0.54425216", "0.54395694", "0.5439282" ]
0.7958901
0
Checks if the $term matches anyone of: (LabelThsys) (LabelDescriptor) Extracts the node ID (eg. 70244) and the label (eg. LabelThsys) from the $term and returns them in a list.
protected function extractDescriptor($term) { $ok= false; $node = $label = 0; if ($this->getSrcDebug()) { print "<br><b>STWengine->extractDescriptor($term):"; } $thsysBase = "http://zbw.eu/stw/thsys/"; $descriptorBase = "http://zbw.eu/stw/descriptor/"; $regExpThsys = "/^http:\/\/zbw\.eu\/stw\/thsys\/(\d*) \((.*)\)$/"; $regExpDescriptor = "/^http:\/\/zbw\.eu\/stw\/descriptor\/(\d*)-(\d*) \((.*)\)$/"; if (preg_match($regExpThsys, $term, $match)) { $ok = true; $node = $thsysBase . $match[1]; $label = $match[2]; if($this->getSrcDebug()) { print "<br>Matched $regExpThsys in ($term), node=($node) label=($label)"; } } else if (preg_match($regExpDescriptor, $term, $match)) { $ok = true; $node = $descriptorBase . $match[1] . "-" . $match[2]; $label = $match[3]; if($this->getSrcDebug()) { print "<br>Matched $regExpDescriptor in ($term), node=($node) label=($label)"; } } else if ($this->getSrcDebug()) { print "<br><b>NO match </b> ($term)"; } return array($node,$label); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_term_object( $term ) {\n \t$vc_taxonomies_types = vc_taxonomies_types();\n \treturn array(\n \t\t'label' => $term->name,\n \t\t'value' => $term->slug,\n \t\t'group_id' => $term->taxonomy,\n \t\t'group' => isset( $vc_taxonomies_types[ $term->taxonomy ], $vc_taxonomies_types[ $term->taxonomy ]->labels, $vc_taxonomies_types[ $term->taxonomy ]->labels->name ) ? $vc_taxonomies_types[ $term->taxonomy ]->labels->name : __( 'Taxonomies', 'infinite-addons' ),\n \t\t);\n }", "function get_taxonomy_term_ids_inside_vocab($vocab_machine_name) {\n $vocab = taxonomy_vocabulary_machine_name_load($vocab_machine_name);\n if (is_object($vocab)) {\n $term_tree = taxonomy_get_tree($vocab->vid);\n if (is_array($term_tree) && !empty($term_tree)) {\n foreach ($term_tree as $key => $value) {\n $tids[] = $value->tid;\n }\n } if (empty($term_tree)) {\n $tids = array();\n }\n } else\n return \"No Vocab Found with the given name\";\n\n return ($tids);\n}", "public function getTermTypes()\n {\n $pageIds = $this->database->getPageIdsRecursive(\n $this->controller->configModel->get('storageFolder'),\n $this->controller->configModel->get('recurseDepth')\n );\n if ($pageIds === false) {\n throw new \\tx_nclib_exception('label_error_no_pages_found', $this->controller);\n }\n $fields = 'DISTINCT termtype';\n $startTime = $this->controller->dateFilter['iStartTime'];\n $endTime = $this->controller->dateFilter['iEndTime'];\n $where = array(\n 'termtype != \\'\\'',\n 'hidden=0',\n 'deleted=0',\n 'type=' . $this->getModelType(),\n 'publishdate >= ' . $startTime,\n 'publishdate <= ' . $endTime,\n sprintf('%s.pid in (%s)', $this->getTableName(), implode(',', $pageIds)),\n );\n $where = $this->database->getWhere($where);\n $orderBy = 'termtype';\n $groupBy = '';\n\n $this->database->clear();\n\n $records = $this->database->getQueryRecords($this->getTableName(), $fields, $where, $groupBy, $orderBy);\n if (!$records || !\\tx_nclib::isLoopable($records)) {\n return false;\n }\n $result = array();\n foreach ($records as $record) {\n $result[] = $record['termtype'];\n }\n return $result;\n }", "private static function _getFactorTokens($termStr)\n {\n $chars = str_split($termStr);\n $tokens = [];\n $start = 0;\n for ($j = 0; $j < count($chars); $j++) {\n $c = $chars[$j];\n switch ($c) {\n case '*':\n $tokens[] = substr($termStr, $start, $j - $start);\n $start = $j + 1;\n break;\n case '/':\n $tokens[] = substr($termStr, $start, $j - $start);\n $start = $j;\n break;\n case '(':\n $j = self::findMatching($chars, $j);\n break;\n case '[':\n $j = self::findMatching($chars, $j, '[');\n break;\n }\n }\n if ($start < $j) {\n $tokens[] = substr($termStr, $start, $j - $start);\n }\n return $tokens;\n }", "public static function getPersons($term) {\n $sql = \"SELECT \n usuarios.dni, usuarios.nombre_persona, usuarios.dni+' '+usuarios.nombre_persona as label\n FROM\n (select \n persona.CodPer as dni\n ,persona.Nombres\n ,persona.Ape1\n ,persona.Ape2\n ,(RTRIM(persona.Nombres)+' '+RTRIM(persona.Ape1)+' '+RTRIM(persona.Ape2)) as nombre_persona\n from dbo.Identis persona\n left join dbo.permis usuario ON(\n persona.CodPer = usuario.LogIn\n )\n where usuario.FHasta >= GETDATE()\n ) usuarios\n WHERE usuarios.nombre_persona+usuarios.dni LIKE '%{$term}%'\n group BY usuarios.dni, usuarios.nombre_persona \";\n\n $command = Yii::$app->chacad->createCommand($sql);\n return $command->queryAll();\n }", "private function get_term_slug_by_label($property_terms, $leabel){\n if (is_array($property_terms)) {\n foreach ($property_terms as $tax => $v) {\n if ($v['label'] == $leabel)\n return $tax;\n }\n }\n return false;\n }", "function get_nodes_directly_mapped_to_term($tid) {\n if (is_array($tid) && !empty($tid)) {\n foreach ($tid as $key => $value) {\n $nids[] = taxonomy_select_nodes($value);\n $flat_nids = multitosingle($nids);\n }\n return $flat_nids;\n }\n else {\n $nid = taxonomy_select_nodes($tid);\n return $nid;\n }\n}", "function _format_glossary_term($node) {\n if ($node->field_glossary_term[0]) {\n $all_terms = '';\n foreach ($node->field_glossary_term as $term) {\n $thisrow = '<li><dl><dt><span class=\"term\">'.check_plain($term['value']['field_term'][0]['value']).'</span> ';\n if ($term['value']['field_term_phonetic'][0]['value']) {\n $thisrow .= ' <span class=\"phonetic\">「'.check_plain($term['value']['field_term_phonetic'][0]['value']).'」</span>';\n }\n $thisrow .= ': </dt>';\n if ($term['value']['field_term_definition'][0]['value']) {\n $thisrow .= '<dd class=\"definition\">'.check_plain($term['value']['field_term_definition'][0]['value']).'</dd>';\n }\n $thisrow .= '</dl></li>';\n $all_terms .= $thisrow;\n }\n \n if (strlen($all_terms)) {\n $all_terms = '<ul class=\"glossary_terms_List\">'.$all_terms.'</ul>';\n }\n return $all_terms;\n \n } else {\n \n return '';\n }\n}", "public function find(string $term, string $namespace) : array;", "function nodeTaxTermField(&$node, $field, $value){\n\t\t\n \t\t//split piped value in array\n \t\t$values = explode('|', $value);\n \t\tsort($values);\n\n\n \t\t$thisFieldsPossibleTids = $this->taxInfo['possibleTidValues'][$field];\n \t\t$vocab_machine_name = $this->taxInfo['vocab_machine_name'][$field];\n \t\t$vocab_human_name = $this->taxInfo['vocab_human_name'][$field];\n \t\t\n \t\t//passions is a special case. The ebs_leaflets_final table\n \t\t//'passions' field contains piped names (not tids)\n \t\tif ($field == 'field_passions'):\n \t\t//dsm($values);\n \t\t\t//convert to tids\n \t\t\t$valuesTids = array();\n \t\t\n \t\t\tforeach($values as $key => $value):\n \t\t\t\n\t \t\t\tif (strlen($value) > 0)://adjacent pipes or no values at all\n\t\t \t\t\t$terms = taxonomy_get_term_by_name($value, $vocab_machine_name);\n\t\t \t\t\t$term = array_shift($terms);\n\t \t\t\t\n\t \t\t\t\tif (isset($term) && is_numeric($term->tid)): \n\t \t\t\t\t\t$valuesTids[] = $term->tid;\n\t \t\t\t\telse:\n\t\t \t\t\t\t$this->log[] = get_class($this).\": Couldn't find \\\"\".$value.\"\\\" in \".$vocab_human_name.\" taxonomy for \".$node->field_leaflet_code['und'][0]['value'].\" \".$node->title;\n\t \t\t\t\tendif;\t\t\t\n\t\t\t\tendif;\n\t\t\t\t\n \t\t\tendforeach;\n \t\t\t \t\t\t \t\t\t\n \t\t\t$values = $valuesTids;\n\n \t\tendif;\n\n \t\t//Remove duff values\n \t\tforeach ($values as $key => $value):\n \t\t\t$badValue = false;\n \t\t\tif (strlen($value) > 0 && !in_array($value, $thisFieldsPossibleTids)):\n\n\t \t\t\t$badValue = true;\n \t\t\t$this->log[] = get_class($this).\": Couldn't find \\\"\".$value.\"\\\" in \".$vocab_human_name.\" taxonomy for \".$node->field_leaflet_code['und'][0]['value'].\" \".$node->title;\n\t \t\tendif;\n\t \t\t\n\t \t\tif (strlen($value) == 0):\n\t \t\t\t$badValue = true;\n\n\t \t\tendif;\n\t \t\t\n\t \t\tif ($badValue == true):\n\t \t\t\tunset($values[$key]);\n\t \t\tendif;\n\n\t \t\t\n \t\tendforeach;\n \t\t\n \t\t\n \t\t\n \t \t\t \t\t\t\t\n \t\tif (!empty($node->nid)){\n \t\t\t//its an existing node...\n \t\t\t\n \t\t\tif (!isset($node->{$field}[$node->language][0]['tid']) && count($values)> 0){\n \t\t\t\t//...but for some reason the existing node had no values set\n \t\t\t\t$this->nodeNeedsUpdate[$node->nid] = true;\n \t\t\t\t//dsm(__FUNCTION__.\" flagging \".$node->nid);\n \t\t\t\t//dsm($node->{$field}[$node->language][0]['tid'].\" \".$value.\" \".$field);\n \t\t\t}\n \t\t\t\n \t\t\tif ((isset($node->{$field}[$node->language][0]['tid']) &&\t(!$this->sameTaxTermValues($node, $field, $values))) ){\n \t\t\t\t//...with amended incoming values to existing values\n \t\t\t\t$this->nodeNeedsUpdate[$node->nid] = true;\n \t\t\t\t//dsm(__FUNCTION__.\" flagging \".$node->nid);\n \t\t\t\t//dsm($node->{$field}[$node->language][0]['tid'].\" \".$value.\" \".$field);\n \t\t\t}\n \t\t}\n \t\t\n \t\tunset($node->{$field}[$node->language]);\n\n \t\tif (count($values) > 0){\n \t\t\tforeach ($values as $key => $value):\n \t\t\t\t//if (strlen($value) > 0):\n \t\t\t\t$node->{$field}[$node->language][$key]['tid'] = $value;\n \t\t\t\t//endif;\n \t\t\tendforeach;\n \t\t}\n \t}", "function getPossibleTidValues(){\n \t\tforeach ($this->fieldMapping as $ebsFieldName => $myArray):\n \t\t\n\t \t\tif ($myArray[1] == 'nodeTaxTermField'):\n\t \t\t\n\t \t\t\t//Get possible tids for this field\n\t\t\t\t$info = field_info_field($myArray[0]);\n\t\t\t\t$vocab_machine_name = $info['settings']['allowed_values'][0]['vocabulary'];\n\t\t\t\t$vocab = taxonomy_vocabulary_machine_name_load($vocab_machine_name);\n\t\t\t\t$tree = taxonomy_get_tree($vocab->vid);\n\t\t\t\t\t\t\n\t\t\t\t$thisFieldsPossibleTids = array();\n\t\t\t\tforeach ($tree as $key => $branch):\n\t\t\t\t\t$thisFieldsPossibleTids[] = $branch->tid;\n\t\t\t\tendforeach;\n\t\n\t\t\t\t$this->taxInfo['possibleTidValues'][$myArray[0]] = $thisFieldsPossibleTids;\n\t\t\t\t$this->taxInfo['vocab_machine_name'][$myArray[0]] = $vocab_machine_name;\n\t\t\t\t$this->taxInfo['vocab_human_name'][$myArray[0]] = $vocab->name;\n\t \t\tendif;\n \t\t\n \t\tendforeach; \n \t}", "public function getTerms($term)\n {\n return $this->terms = wp_get_post_terms($this->id, $term);\n }", "public function get_term_names(){\n\t\t\n\t\t$term_objs = $this->get_terms();\n\t\t\n\t\t$terms = array();\n\t\t\n\t\tforeach( $term_objs as $term ){\n\t\t\t\n\t\t\t$terms[ $term->term_id ] = $term->name;\n\t\t\t\n\t\t} // end foreach\n\t\t\n\t\treturn $terms;\n\t\t\n\t}", "public function taxTermExists($value, $field, $vocabulary) {\n $query = $this->typeManager->getStorage('taxonomy_term')->getQuery();\n $query->condition('vid', $vocabulary);\n $query->condition($field, $value);\n $tids = $query->accessCheck(FALSE)->execute();\n\n if (!empty($tids)) {\n foreach ($tids as $tid) {\n return $tid;\n }\n }\n return FALSE;\n }", "public function testTermNode() {\n $this->container->get('entity_type.manager')\n ->getStorage('node')\n ->resetCache([1, 2]);\n\n $nodes = Node::loadMultiple([1, 2]);\n $node = $nodes[1];\n $this->assertCount(1, $node->field_vocabulary_1_i_0_);\n $this->assertSame('1', $node->field_vocabulary_1_i_0_[0]->target_id);\n $node = $nodes[2];\n $this->assertCount(2, $node->field_vocabulary_2_i_1_);\n $this->assertSame('2', $node->field_vocabulary_2_i_1_[0]->target_id);\n $this->assertSame('3', $node->field_vocabulary_2_i_1_[1]->target_id);\n\n // Tests the Drupal 6 term-node association to Drupal 8 node revisions.\n $this->executeMigrations(['d6_term_node_revision']);\n\n $node = \\Drupal::entityTypeManager()->getStorage('node')->loadRevision(2001);\n $this->assertCount(2, $node->field_vocabulary_3_i_2_);\n $this->assertSame('4', $node->field_vocabulary_3_i_2_[0]->target_id);\n $this->assertSame('5', $node->field_vocabulary_3_i_2_[1]->target_id);\n }", "public function hasTerm() {\n return $this->_has(1);\n }", "function get_all_nodes_belong_to_taxonomy_hierarchy($tids) {\n if (is_array($tids)) {\n foreach ($tids as $key => $value) {\n if ($value <= 0) {\n return \"Please Enter a valid taxonomy term id set\";\n }\n }\n }\n if (is_array($tids) && !empty($tids)) {\n foreach ($tids as $key => $value) {\n $term = taxonomy_term_load($value);\n $hierarchical_terms_object[] = taxonomy_get_tree($term->vid, $term->tid);\n }\n $flat_terms_object = multitosingle($hierarchical_terms_object);\n if (is_array($flat_terms_object) && !empty($flat_terms_object)) {\n foreach ($flat_terms_object as $key => $value) {\n $flat_tids[] = $value->tid;\n }\n $flat_tids[] = $tids;\n return array_unique(get_nodes_directly_mapped_to_term($flat_tids));\n }\n else {\n $flat_tids = $tids;\n return array_unique(get_nodes_directly_mapped_to_term($flat_tids));\n }\n }\n elseif (!is_array($tids) && $tids > 0) {\n $flat_tids = $tids;\n return get_all_nodes_belong_to_taxonomy_hierarchy(array($flat_tids));\n }\n else {\n return \"Please Enter a valid term id\";\n }\n}", "function parse_term($bits)\n{\n if ('00' === substr($bits, 0, 2)) {\n list($body, $rest) = parse_term(substr($bits, 2));\n\n return [\n ['λ', $body],\n $rest,\n ];\n }\n\n if ('01' === substr($bits, 0, 2)) {\n $rest = substr($bits, 2);\n list($l, $rest) = parse_term($rest);\n list($r, $rest) = parse_term($rest);\n\n return [\n [$l, $r],\n $rest,\n ];\n }\n\n if ('1' === $bits[0]) {\n $i = 0;\n while ($bits[++$i] !== '0');\n\n return [\n ['offset', $i],\n substr($bits, $i + 1),\n ];\n }\n\n throw new \\InvalidArgumentException(\"Invalid binary term '$bits'\");\n}", "public function booleanAndTerm($term){\n\t\t$term = preg_replace(\"/[^ a-zA-Z0-9]/\", '', $term);\n\t\t\n\t\t$term = mysql_real_escape_string(trim($term));\n\t\t$terms = explode(' ', $term);\n\t\t$return = '';\n\t\tforeach($terms as $word){\n\t\t\tif(strlen($word)>2){\n\t\t\t\t// if has a plural then try without\n\t\t\t\tif(substr($word,-1) == 's'){\n\t\t\t\t\t$return .= '+(>' . $word. ' <' . substr($word,0,-1) . '*) ';\n\t\t\t\t}else{\n\t\t\t\t// if singular then try with an s\n\t\t\t\t\t$return .= '+(>' . $word . ' <' . $word . 's) ';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//echo $return;\n\t\t//echo ' --> ';\n\t\treturn $return;\n\t}", "public function getMappingTargets() {\n $targets = array(\n 'name' => array(\n 'name' => t('Term name'),\n 'description' => t('Name of the taxonomy term.'),\n 'optional_unique' => TRUE,\n ),\n 'description' => array(\n 'name' => t('Term description'),\n 'description' => t('Description of the taxonomy term.'),\n ),\n 'synonyms' => array(\n 'name' => t('Term synonyms'),\n 'description' => t('One synonym or an array of synonyms of the taxonomy term.'),\n ),\n );\n // Let implementers of hook_feeds_term_processor_targets() add their targets.\n $vocabulary = $this->vocabulary();\n drupal_alter('feeds_term_processor_targets', $targets, $vocabulary->vid);\n return $targets;\n }", "public function matchSearchTerm($searchTerm, $wordList){\n \n $matches = array();\n \n foreach($wordList as $type => $nodes){\n \n foreach($nodes as $node){\n\n if($node['value'] == $searchTerm){\n $matches[$node['openieId']] = $type;\n }\n }\n }\n \n return $matches;\n }", "function check_term($term, $tax) {\n\t$term_link = get_term_link( $term, $tax );\n \n // If there was an error, insert term.\n if ( is_wp_error( $term_link ) ) {\n\t\twp_insert_term($term, $tax);\n\t}\n}", "function Search($nodes, $rq) {\n $nds = array();\n Find($nodes, $nds, $rq->fid, -1, $rq->fnd);\n $rlt = array();\n $a = array_keys($nds);\n foreach ($nds as $id => $nde) {\n if (!$nde[0]) {\n for ($i = 0; $i < count($a); $i++) {\n if ($nds[$a[$i]][1] == $id && $nds[$a[$i]][0]) {\n $nde[0] = true;\n }\n }\n }\n if ($nde[0]) {\n $rlt[] = $rq->pfx . $id;\n }\n }\n return $rlt;\n}", "public function generateTaxonomyTermList() {\n $vocab = \"sports\";\n $term_list = [];\n $terms = $this->entityTypeManager\n ->getStorage('taxonomy_term')\n ->loadTree($vocab);\n foreach ($terms as $term) {\n $term_name = $this->t('@name', ['@name' => $term->name]);\n $term_list[\"$term_name\"] = $term_name;\n }\n return $term_list;\n }", "private function has_tax_children( $term_id, $tax ) {\n\t\t$child = new \\WP_Term_Query( [\n\t\t\t'taxonomy' => $tax,\n\t\t\t'parent' => $term_id,\n\t\t\t'fields' => 'ids',\n\t\t] );\n\n\t\treturn empty( $child->get_terms() ) ? [] : $child->get_terms();\n\t}", "function jit_taxonomy_validate_term($term){\r\n $validate = TRUE;\r\n\r\n if($term->vocabulary_machine_name !== 'products'){\r\n return FALSE;\r\n }\r\n\r\n if($term->name == 'Not In Menu'){\r\n return FALSE;\r\n }\r\n\r\n if(property_exists($term,'field_show_in_products_menu')){\r\n\r\n\r\n $show_in_menu = $term->field_show_in_products_menu[LANGUAGE_NONE][0]['value'];\r\n\r\n //if the term is programmatically made it is possible that there will be no\r\n //value for field_show_in_products_menu in which case we should continue to\r\n //hide from products menu.\r\n\r\n if (!isset($show_in_menu)){\r\n\r\n if($show_in_menu == 1){\r\n return FALSE;\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n\r\n\r\n\r\n return $validate;\r\n}", "public static function getHallNamesAssoc($term)\n {\n if(!isset($term)){\n throw new InvalidArgumentException('Missing term.');\n }\n\n $hallArray = array();\n\n $halls = HMS_Residence_Hall::get_halls($term);\n\n foreach ($halls as $hall){\n $hallArray[$hall->id] = $hall->hall_name;\n }\n\n return $hallArray;\n }", "function get_nodes_belong_to_vocab($vocab_machine_name) {\n $vocab_tids = get_taxonomy_term_ids_inside_vocab($vocab_machine_name);\n if (is_array($vocab_tids) && count($vocab_tids) > 0) {\n $nids_inside_vocab = get_nodes_directly_mapped_to_term($vocab_tids);\n return $nids_inside_vocab;\n }\n elseif (is_array($vocab_tids) && count($vocab_tids) == 0) {\n return array();\n }\n else {\n return \"There is no vocab found with the given machine name\";\n }\n}", "function custom_has_term($slug) {\n global $post;\n $tax = get_the_taxonomies( $post );\n foreach ($tax as $key => $value) {\n $terms = wp_get_post_terms( $post->ID, $key );\n foreach( $terms as $term ) {\n if( $term->slug == $slug ) {\n return true;\n }\n }\n }\n return false;\n}", "function get_NOTE_rows(Tree $tree, $term) {\n\treturn Database::prepare(\n\t\t\"SELECT o_id AS xref, o_gedcom AS gedcom\" .\n\t\t\" FROM `##other`\" .\n\t\t\" JOIN `##name` ON o_id = n_id AND o_file = n_file\" .\n\t\t\" WHERE o_gedcom LIKE CONCAT('%', REPLACE(:term, ' ', '%'), '%') AND o_file = :tree_id AND o_type = 'NOTE'\" .\n\t\t\" ORDER BY n_full COLLATE :collation\"\n\t)->execute(array(\n\t\t'term' => $term,\n\t\t'tree_id' => $tree->getTreeId(),\n\t\t'collation' => I18N::collation(),\n\t))->fetchAll();\n}", "public function getLabels();", "public function getLabels();", "public function getLabels();", "function atos_esuite_get_term_tid($term_name) {\n $vocabulary_name = variable_get('atos_esuite_tags_vocabulary_name', 'tags');\n $vocabulary = taxonomy_vocabulary_machine_name_load($vocabulary_name);\n\n $terms = taxonomy_get_term_by_name($term_name, $vocabulary_name);\n if (!count($terms)) {\n $term = new stdClass();\n $term->vid = $vocabulary->vid;\n $term->name = $term_name;\n taxonomy_term_save($term);\n }\n else {\n $term = reset($terms);\n }\n\n return $term->tid;\n}", "static function getIDsByLabelAndFQDNID($label, $fqdns_id, $wildcard_search = false) {\n global $DB;\n\n $label = strtolower($label);\n if ($wildcard_search) {\n $count = 0;\n $label = str_replace('*', '%', $label, $count);\n if ($count == 0) {\n $label = '%'.$label.'%';\n }\n $relation = ['LIKE', $label];\n } else {\n $relation = $label;\n }\n\n $IDs = [];\n foreach (['NetworkName' => 'glpi_networknames',\n 'NetworkAlias' => 'glpi_networkaliases'] as $class => $table) {\n $criteria = [\n 'SELECT' => 'id',\n 'FROM' => $table,\n 'WHERE' => ['name' => $relation]\n ];\n\n if (is_array($fqdns_id) && count($fqdns_id) > 0\n || is_int($fqdns_id) && $fqdns_id > 0\n ) {\n $criteria['WHERE']['fqdns_id'] = $fqdns_id;\n }\n\n $iterator = $DB->request($criteria);\n while ($element = $iterator->next()) {\n $IDs[$class][] = $element['id'];\n }\n }\n return $IDs;\n }", "private function searchTag()\n {\n $term = $_REQUEST['term'];\n \n $list = array();\n $sql = \"SELECT * \n FROM \" . TAGS_TBL . \" \n WHERE tag_title LIKE '$term%'\";\n try\n {\n $rows = $this->db->select($sql);\n }\n catch(Exception $Exception){}\n \n if($rows)\n {\n foreach($rows as $index => $row)\n {\n $list[] = stripslashes(trim(ucwords(strtolower($row->tag_title))));\n }\n }\n \n $str = implode('\",\"', $list);\n if($str)\n {\n echo '[\"' . $str . '\"]';\n }\n else\n {\n echo '[]';\n }\n \n exit;\n }", "function _post_format_get_term($term)\n {\n }", "function rets_bsf_gettid ($vname, $name) {\n\n $voc = taxonomy_vocabulary_machine_name_load($vname);\n $query = new EntityFieldQuery;\n $result = $query\n ->entityCondition('entity_type', 'taxonomy_term')\n ->propertyCondition('name', $name)\n ->propertyCondition('vid', $voc->vid)\n ->execute();\n if ($result) { \n $keys = array_keys($result['taxonomy_term']);\n } else {\n drupal_set_message(t('Error: rets_bsf_gettid (includes): Taxonomy term not found -- vname: '. $vname .'; name: '.$name));\n return '';\n }\n return $keys[0];\n}", "public static function getHallsForTerm($term)\n {\n if(!isset($term)){\n throw new InvalidArgumentException('Missing term.');\n }\n\n $halls = array();\n\n $db = new PHPWS_DB('hms_residence_hall');\n $db->addColumn('id');\n $db->addOrder('hall_name', 'DESC');\n\n $db->addWhere('term', $term);\n\n $results = $db->select();\n\n if(PHPWS_Error::logIfError($results)){\n throw new DatabaseException($result->toString());\n }\n\n //TODO this is terribly inefficient\n foreach($results as $result){\n $halls[] = new HMS_Residence_Hall($result['id']);\n }\n\n return $halls;\n }", "function drush_behat_op_delete_term(\\stdClass $term) {\n $term = $term instanceof TermInterface ? $term : Term::load($term->tid);\n if ($term instanceof TermInterface) {\n $term->delete();\n }\n}", "public function testTermQueryWhereTermDoesNotExist() {\n\t\t$taxonomy = 'category';\n\n\t\t/**\n\t\t * Create the global ID based on the term_type and the created $id\n\t\t */\n\t\t$global_id = \\GraphQLRelay\\Relay::toGlobalId( $taxonomy, 'doesNotExist' );\n\n\t\t/**\n\t\t * Create the query string to pass to the $query\n\t\t */\n\t\t$query = \"\n\t\tquery {\n\t\t\tcategory(id: \\\"{$global_id}\\\") {\n\t\t\t\tcategoryId\n\t\t\t}\n\t\t}\";\n\n\t\t/**\n\t\t * Run the GraphQL query\n\t\t */\n\t\t$actual = do_graphql_request( $query );\n\n\t\t/**\n\t\t * Establish the expectation for the output of the query\n\t\t */\n\t\t$expected = [\n\t\t\t'data' => [\n\t\t\t\t'category' => null,\n\t\t\t],\n\t\t\t'errors' => [\n\t\t\t\t[\n\t\t\t\t\t'message' => 'The ID input is invalid',\n\t\t\t\t\t'locations' => [\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t'line' => 3,\n\t\t\t\t\t\t\t'column' => 4,\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\t\t\t\t\t'path' => [\n\t\t\t\t\t\t'category',\n\t\t\t\t\t],\n\t\t\t\t\t'category' => 'user',\n\t\t\t\t],\n\t\t\t],\n\t\t];\n\n\t\t$this->assertEquals( $expected, $actual );\n\t}", "public function termId() { return $this->post->term_id; }", "public function getTerm() {\n return $this->_term;\n }", "function getTermStatuses(){\r\n $data = new \\Cars\\Data\\Common($this->app);\r\n return $data->getTermStatuses();\r\n }", "public function checkIfTermExist($term_name){\n\t\t\t$query = $this->connection()->prepare(\"SELECT name FROM termz WHERE name='$term_name'\");\n\t\t\t$query->execute();\n\t\t\treturn $query->rowCount();\n\t\t}", "function get_eioftx_terms($tax) {\n $terms = get_terms($tax);\n $names = array();\n \n // Loop through terms to get the names\n foreach($terms as $term) {\n\t array_push($names, strtolower($term->name));\n }\n \n return $names;\n}", "protected function find_existing_links( $text, $term ) {\n $url = $term[ 't_post_url' ];\n if ( substr( $term[ 't_post_url' ], -1 ) === '/' ) {\n $url = substr( $term[ 't_post_url' ], 0, strlen( $term[ 't_post_url' ] ) - 1 );\n }\n return preg_match_all( '/' . str_replace( '/', '\\/', preg_quote( $url ) ) . '\\/?(\\\"|\\'|\\s)/i', $text, $matches );\n }", "public function get_term()\n {\n }", "public function extractLabels($title, Repository $repository)\n {\n $labels = [];\n if (preg_match_all('/\\[(?P<labels>.+)\\]/U', $title, $matches)) {\n $validLabels = $this->getLabels($repository);\n foreach ($matches['labels'] as $label) {\n $label = $this->fixLabelName($label);\n\n // check case-insensitively, but the apply the correctly-cased label\n if (isset($validLabels[strtolower($label)])) {\n $labels[] = $validLabels[strtolower($label)];\n }\n }\n }\n\n $this->logger->debug('Searched for labels in title', ['title' => $title, 'labels' => json_encode($labels)]);\n\n return $labels;\n }", "function cp_match_cats($form_cats) {\r\n global $wpdb;\r\n $out = array();\r\n\r\n $terms = get_terms( APP_TAX_CAT, array(\r\n 'include' => $form_cats\r\n ));\r\n\r\n if ( $terms ) :\r\n\t\t\r\n foreach ( $terms as $term ) {\r\n $out[] = '<a href=\"edit-tags.php?action=edit&taxonomy='.APP_TAX_CAT.'&post_type='.APP_POST_TYPE.'&tag_ID='. $term->term_id .'\">'. $term->name .'</a>';\r\n }\r\n\r\n endif;\r\n\r\n return join( ', ', $out );\r\n}", "function drush_behat_op_create_term($term) {\n $term->vid = $term->vocabulary_machine_name;\n\n // Attempt to decipher any fields that may be specified.\n _drush_behat_expand_entity_fields('taxonomy_term', $term);\n\n $entity = entity_create('taxonomy_term', (array)$term);\n $entity->save();\n\n $term->tid = $entity->id();\n return $term;\n}", "public function generateNodeTypeList() {\n $type_labels = [];\n $node_types = $this->entityTypeManager\n ->getStorage('node_type')\n ->loadMultiple();\n foreach ($node_types as $type) {\n $type_labels[$type->id()] = $this->t('@label', ['@label' => $type->id()]);\n }\n return $type_labels;\n }", "function us_wpml_tr_get_term_language( $term_id ) {\r\n\t\t$term = get_term( $term_id );\r\n\t\tif ( ! ( $term instanceof WP_Term ) ) {\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\r\n\t\treturn apply_filters(\r\n\t\t\t'wpml_element_language_code',\r\n\t\t\tNULL,\r\n\t\t\tarray( 'element_id' => (int) $term_id, 'element_type' => $term->taxonomy )\r\n\t\t);\r\n\t}", "protected function fullTextWildcards($term)\n {\n // removing symbols used by MySQL\n $reservedSymbols = ['-', '+', '<', '>', '@', '(', ')', '~'];\n $term = str_replace($reservedSymbols, '', $term);\n\n $words = explode(' ', $term);\n\n foreach ($words as $key => $word) {\n /*\n * applying + operator (required word) only big words\n * because smaller ones are not indexed by mysql\n */\n if (strlen($word) >= 1) {\n $words[$key] = '+' . $word . '*';\n }\n }\n\n $searchTerm = implode(' ', $words);\n\n return $searchTerm;\n }", "public function getLabels($repo) {\n echo \"GET /repos/$repo/labels\\n\";\n $r = $this->api()->get(\"/repos/$repo/labels\", [], [], ['throw' => true]);\n\n $labels = $r->getBody();\n $labels = array_column($labels, null, 'name');\n $labels = array_change_key_case($labels);\n return $labels;\n }", "public static function searchModelTags($term)\n {\n $term = trim($term);\n return Tag::join('taggable_taggables','taggable_taggables.tag_id','=','taggable_tags.tag_id')->where('taggable_type','=',static::class)->where('name', 'like', \"%\".$term.\"%\")->offset(0)->limit(10)->pluck('name')->toArray();\n }", "function mini_get_term_id_by_pid( $pid ){\n \n $terms = get_the_terms( $pid, 'project_tax' );\n\nif ( $terms && ! is_wp_error( $terms ) ){ \n \n $p_terms = array();\n \n foreach ( $terms as $term ) {\n $p_terms[] = $term->term_id;\n }\n \n return $p_terms;\n } else {\n return [];\n //return $p_terms;\n }\n}", "protected function prepare_term( $term ) {\n if ( $term === null || !is_string( $term ) ) {\n return false;\n }\n \n $trimmed_term = trim( $term );\n if ( empty( $trimmed_term ) ) {\n return false;\n }\n \n $words = explode( '|', $trimmed_term );\n\t\t\n\t\t//removing empty terms\n\t\tforeach ( $words as $key => $word ) {\n\t\t\t$w = trim($word);\n\t\t\tif ( empty($w) ) {\n\t\t\t\tunset( $words[$key] );\n\t\t\t}\n\t\t}\n\t\t$words = array_values($words);\n \n if ( false === $words || !is_array( $words ) ) {\n return false;\n }\n \n foreach ( $words as $i => $word ) {\n $words[ $i ] = $this->prepare_term_regex( trim( $word ) );\n }\n return $words;\n }", "function get_term_custom_keys( $term_id = 0 ) {\n\t$custom = get_term_custom( $term_id );\n\n\tif ( !is_array( $custom ) )\n\t\treturn;\n\n\tif ( $keys = array_keys( $custom ) )\n\t\treturn $keys;\n}", "function has_term($term = '', $taxonomy = '', $post = \\null)\n {\n }", "public function getTaxonomyTerms();", "public static function getSentence($term_id, $term, $em, $max_width = 40) {\n $str_r = self::getContext(\n \"SELECT t.content FROM AppBundle\\Entity\\Token t WHERE t.id > ?1 ORDER BY t.id\", \n $term_id, 1, $em, $max_width);\n \n $str_l = self::getContext(\"SELECT t.content FROM AppBundle\\Entity\\Token t WHERE t.id < ?1 ORDER BY t.id DESC\", \n $term_id, 2, $em, $max_width);\n \n return array($str_l, $term, $str_r);\n }", "function _muckypup_database_get_term_ids ($vocabularies) {\n\n $terms = array ();\n \n foreach ($vocabularies as $vocabulary) {\n if ($vocabulary != 0) {\n $term_tree = taxonomy_get_tree($vocabulary);\n \n foreach ($term_tree as $term_branch) {\n $terms[] = $term_branch->tid;\n }\n }\n }\n\n\treturn $terms;\n}", "function rest_get_route_for_term($term)\n {\n }", "function autocompleteList($term = null) {\n\t\t$autocomplete_list = array();\n\t\tif ($term) {\n\t\t\t$conditions = array(\n\t\t\t\t'Category.active' => true,\n\t\t\t\t'Category.name LIKE \"%' . $term . '%\"'\n\t\t\t);\n\t\t\t\n\t\t\t$unwanted_categories_ids = $this->unwanted_subtree_ids($this->unactive_categories_ids);\n\t\t\tif (!empty($unwanted_categories_ids)) {\n\t\t\t\t$conditions[] = 'Category.id NOT IN (' . implode(',', $unwanted_categories_ids) . ')';\n\t\t\t}\n\t\n\t\t\t// do autocomplete chci vratit cestu ke kategorii\n\t\t\t$categories = $this->find('all', array(\n\t\t\t\t'conditions' => $conditions,\n\t\t\t\t'contain' => array(),\n\t\t\t\t'fields' => array('Category.id', 'Category.name'),\n\t\t\t\t'order' => array('Category.lft' => 'asc')\n\t\t\t));\n\t\n\t\t\tforeach ($categories as $category) {\n\t\t\t\t$path = $this->pathToString($category['Category']['id']);\n\t\t\t\t$autocomplete_list[] = array(\n\t\t\t\t\t'label' => $path,\n\t\t\t\t\t'value' => $category['Category']['id']\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn $autocomplete_list;\n\t}", "public function loadArrayByTaxonID($searchTerm) {\n global $connection;\n $returnvalue = array();\n $operator = \"=\";\n // change to a like search if a wildcard character is present\n if (!(strpos($searchTerm,\"%\")===false)) { $operator = \"like\"; }\n if (!(strpos($searchTerm,\"_\")===false)) { $operator = \"like\"; }\n $sql = \"SELECT DeterminationID FROM determination WHERE TaxonID $operator '$searchTerm'\";\n $preparedsql = \"SELECT DeterminationID FROM determination WHERE TaxonID $operator ? \";\n if ($statement = $connection->prepare($preparedsql)) { \n $statement->bind_param(\"s\", $searchTerm);\n $statement->execute();\n $statement->bind_result($id);\n while ($statement->fetch()) { ;\n $obj = new huh_determination();\n $obj->load($id);\n $returnvalue[] = $obj;\n }\n $statement->close();\n }\n return $returnvalue;\n }", "protected function fullTextWildcards($term)\n {\n // removing symbols used by MySQL\n $reservedSymbols = ['-', '+', '<', '>', '@', '(', ')', '~'];\n $term = str_replace($reservedSymbols, ' ', $term);\n\n $words = explode(' ', $term);\n\n foreach($words as $key => $word){\n /*\n * applying + operator (required word) only big words\n * because smaller ones are not indexed by mysql\n */\n if(strlen($word) >= 3) {\n $words[$key] = '+' . $word . '*';\n }\n }\n\n $searchTerm = implode( ' ', $words);\n\n return $searchTerm;\n }", "public function search_ticket($terms) {\n $terms = explode(\" \", $terms); //explode multiple terms into an array\n //select statement for AND serach\n $sql = \"SELECT * FROM \" . $this->tblTicket . \" WHERE \" . $this->tblTicket . \".id AND (0\";\n\n foreach ($terms as $term) {\n $sql .= \" OR arrival_location LIKE '%\" . $term . \"%' OR arrival_time LIKE '%\" . $term . \"%'\";\n }\n\n $sql .= \")\";\n\n //execute the query\n $query = $this->dbConnection->query($sql);\n\n // the search failed, return false. \n if (!$query)\n return false;\n\n //search succeeded, but no ticket was found.\n if ($query->num_rows == 0)\n return 0;\n\n //search succeeded, and found at least 1 ticket found.\n //create an array to store all the returned tickets\n $tickets = array();\n\n //loop through all rows in the returned recordsets\n while ($obj = $query->fetch_object()) {\n $ticket = new Ticket($obj->price, $obj->gate, $obj->seat, $obj->class, $obj->depart_time, $obj->arrival_location, $obj->arrival_time, $obj->image);\n\n //set the id for the ticket\n $ticket->setId($obj->id);\n\n //add the ticket into the array\n $tickets[] = $ticket;\n }\n return $tickets;\n }", "public function autoCompleteHelper($term, $what)\n {\n $term = $this->esc($term);\n $what = $this->esc($what);\n $return = array();\n foreach (array('tasks', 'events') as $where) {\n $qid = $this->query('SELECT `'.$what.'` FROM '\n .($where == 'tasks' ? $this->Tbl['cal_task'] : $this->Tbl['cal_event'])\n .' WHERE uid='.$this->uid.' AND `'.$what.'` LIKE \"%'.$term.'%\" GROUP BY `'.$what.'`');\n while ($line = $this->assoc($qid)) {\n $return[] = $line[$what];\n }\n }\n return array_values(array_unique($return, SORT_STRING));\n }", "public static function subjects_with_subscriptions($term) {\n // since it is run inside a daemon script\n $subject_ids = array();\n $results = db::$connection->query(\"SELECT subject_id FROM MyStellarSubscription \"\n . \"WHERE term='$term' GROUP BY subject_id\");\n while($results && $row = $results->fetch_assoc()) {\n $subject_ids[] = $row['subject_id'];\n }\n if($results) {\n $results->close();\n }\n return $subject_ids;\n }", "public function retrieveObjectIds( $termId = 0, $args = array() )\n\t{\n\t\tif( 0 === $termId ) {\n\t\t\treturn false;\n\t\t}\n\t\n\t\tif( !is_array($args) ) {\n\t\t\t$args = array($args);\n\t\t}\n\t\n\t\t$ids = get_objects_in_term( $termId, $this->taxomomyStr, $args );\n\t\n\t\tif( empty( $ids ) || is_wp_error( $ids ) ) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn $ids;\n\t\t}\n\t}", "function _entity_translation_taxonomy_label($term, $langcode) {\n $entity_type = 'taxonomy_term';\n if (function_exists('title_entity_label')) {\n $label = title_entity_label($term, $entity_type, $langcode);\n }\n else {\n $label = entity_label($entity_type, $term);\n }\n return (string) $label;\n}", "public function getTerms(NodeInterface $node) {\n $tids = $this->connection->query('SELECT tid FROM {taxonomy_index} WHERE nid = :nid', array(':nid' => $node->id()))->fetchCol();\n return Term::loadMultiple($tids);\n }", "private function get_topic_allowed_roles($term_id) {\n\t\t$term_meta = get_option('taxonomy_' . MKB_Options::option( 'article_cpt_category' ) . '_' . $term_id);\n\n\t\tif ($term_meta && isset($term_meta['topic_restrict_role']) && $term_meta['topic_restrict_role'] != \"\") {\n\t\t\treturn MKB_SettingsBuilder::get_role($term_meta['topic_restrict_role']);\n\t\t}\n\n\t\treturn array('guest');\n\t}", "public function show(Term $term)\n {\n //\n }", "public function show(Term $term)\n {\n //\n }", "protected function getSchemeIdsAffectingTermVisibility(): array {\n // TODO: This pattern of loading and enumerating schemes is repeated in at\n // least 7 places in the TAC Lite code . It should be refactored out into a\n // settings repository service object. That's too big a lift for a security\n // patch, so it is not being tackled at this time.\n $settings = \\Drupal::config('tac_lite.settings');\n $schemes = $settings->get('tac_lite_schemes');\n\n $scheme_ids = [];\n\n for ($scheme_index = 1; $scheme_index <= $schemes; $scheme_index++) {\n $config = SchemeForm::tacLiteConfig($scheme_index);\n\n if ($config['term_visibility']) {\n $scheme_ids[] = $scheme_index;\n }\n }\n\n return $scheme_ids;\n }", "protected function genealogySearch(string $term): string\n {\n $proxy = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance(\\Subugoe\\Mathematicians\\Proxy\\GenealogyProxy::class);\n\n return $proxy->search($term);\n }", "private function highlight_node ($n, $term) {\n // build a regular expression of the form /(term1)|(term2)/i \n $regexp = \"/\"; \n for ($i = 0; $i < count($term); $i++) {\n if ($i != 0) { $regexp .= \"|\"; }\n $regterm[$i] = str_replace(\"*\", \"\\w*\", $term[$i]); \n $regexp .= \"($regterm[$i])\";\n }\n $regexp .= \"/i\";\t// end of regular expression\n\n $children = $n->childNodes;\n foreach ($children as $i => $c) {\n if ($c instanceof domElement) {\t\t\n\t $this->highlight_node($c, $term);\t// if a generic domElement, recurse \n } else if ($c instanceof domText) {\t// this is a text node; now separate out search terms\n\n if (preg_match($regexp, $c->nodeValue)) {\n // if the text node matches the search term(s), split it on the search term(s) and return search term(s) also\n $split = preg_split($regexp, $c->nodeValue, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);\n\n // loop through the array of split text and create text nodes or span elements, as appropriate\n foreach ($split as $s) {\n\t if (preg_match($regexp, $s)) {\t// if it matches, this is one of the terms to highlight\n\t for ($i = 0; $regterm[$i] != ''; $i++) {\n\t if (preg_match(\"/$regterm[$i]/i\", $s)) { \t// find which term it matches\n $newnode = $this->xsl_result->createElement(\"span\", htmlentities($s));\n\t $newnode->setAttribute(\"class\", \"term\" . ($i+1));\t// use term index for span class (begins at 1 instead of 0)\n\t }\n\t }\n } else {\t// text between search terms - regular text node\n\t $newnode = $this->xsl_result->createTextNode($s);\n\t }\n\t // add newly created element (text or span) to parent node, using old text node as reference point\n\t $n->insertBefore($newnode, $c);\n }\n // remove the old text node now that we have added all the new pieces\n $n->removeChild($c);\n\t }\n } // end of processing domText element\n }\t\n }", "public function getVariableLabelList() {\n return $this->_get(8);\n }", "public function loadArrayByPreferredTaxonID($searchTerm) {\n global $connection;\n $returnvalue = array();\n $operator = \"=\";\n // change to a like search if a wildcard character is present\n if (!(strpos($searchTerm,\"%\")===false)) { $operator = \"like\"; }\n if (!(strpos($searchTerm,\"_\")===false)) { $operator = \"like\"; }\n $sql = \"SELECT DeterminationID FROM determination WHERE PreferredTaxonID $operator '$searchTerm'\";\n $preparedsql = \"SELECT DeterminationID FROM determination WHERE PreferredTaxonID $operator ? \";\n if ($statement = $connection->prepare($preparedsql)) { \n $statement->bind_param(\"s\", $searchTerm);\n $statement->execute();\n $statement->bind_result($id);\n while ($statement->fetch()) { ;\n $obj = new huh_determination();\n $obj->load($id);\n $returnvalue[] = $obj;\n }\n $statement->close();\n }\n return $returnvalue;\n }", "static function is_reserved_term( $term ) {\n if( ! in_array( $term, self::$_reserved ) ) return false;\n\n return new WP_Error( 'reserved_term_used', __( 'Use of a reserved term.', 'divlibrary' ) );\n }", "public static function getLabels(): array;", "function get_post_terms($tax){\n\t$product_terms = get_the_terms(get_the_ID(), $tax);\n\t$term_list = [];\n\tif ($product_terms && !is_wp_error( $product_terms)) {\n\t\tforeach ($product_terms as $term){\n\t\t\t$term_list[] = esc_html( $term->name);\n\t\t}\n\t}\n\treturn implode(', ', $term_list);\n}", "protected static function labelLookup($label, $type, array $bundles = array()) {\n $ids = array();\n\n $entity_info = entity_get_info($type);\n if (!empty($entity_info['entity keys']['label'])) {\n $label_property = $entity_info['entity keys']['label'];\n\n $query = new EntityFieldQuery();\n $query->entityCondition('entity_type', $type);\n if (!empty($bundles)) {\n $query->entityCondition('bundle', $bundles, 'IN');\n }\n $query->propertyCondition($label_property, $label, '=');\n\n $results = $query->execute();\n\n if (isset($results[$type])) {\n $ids = array_keys($results[$type]);\n }\n }\n\n return $ids;\n }", "public function labels()\n {\n return array();\n }", "function dss_elc_get_taxonomy_term($term_value, $vocab_name) {\n\n // Check for the taxonomical term containing the term\n $terms = taxonomy_get_term_by_name($term_value, $vocab_name);\n \n // If the term has not been linked to this vocabulary yet, instantiate the term\n if(!empty($terms)) {\n\n return array_pop($terms);\n } else {\n\n $vocab = taxonomy_vocabulary_machine_name_load($vocab_name);\n \n $term = new stdClass();\n $term->name = $term_value;\n $term->vid = $vocab->vid;\n\n taxonomy_term_save($term);\n return $term;\n }\n}", "public function getLabels()\n {\n $headers = $this->getDefaultHeaders();\n $response = $this->client->request(\n 'GET',\n $this->api . $this->repo . \"/labels\",\n array(\n \"headers\" => $headers\n )\n );\n \n if ($response->getStatusCode() == 200) {\n $body = $response->getBody();\n $body = json_decode($body, true);\n return $body;\n }\n\n return array();\n }", "function get_custom_type_terms($id, $tax) {\n $weekly_types = get_the_terms($id, $tax);\n if ($weekly_types) {\n return $weekly_types[0]->name;\n }\n return false;\n}", "public static function get_termlist_terms($auth, $termlist, $filter = NULL) {\n if (!is_int($termlist)) {\n $termlistFilter=array('external_key' => $termlist);\n $list = self::get_population_data(array(\n 'table' => 'termlist',\n 'extraParams' => $auth['read'] + $termlistFilter\n ));\n if (count($list)==0)\n throw new Exception(\"Termlist $termlist not available on the Warehouse\");\n if (count($list)>1)\n throw new Exception(\"Multiple termlists identified by $termlist found on the Warehouse\");\n $termlist = $list[0]['id'];\n }\n $extraParams = $auth['read'] + array(\n 'view' => 'detail',\n 'termlist_id' => $termlist\n );\n // apply a filter for the actual list of terms, if required.\n if ($filter)\n $extraParams['query'] = urlencode(json_encode(['in' => ['term', $filter]]));\n $terms = self::get_population_data([\n 'table' => 'termlists_term',\n 'extraParams' => $extraParams,\n ]);\n return $terms;\n }", "function _fullcalendar_colors_filter_term_ids($fields) {\n $term_ids = array();\n foreach ($fields as $key => $value) {\n foreach ($value as $language => $term) {\n foreach ($term as $content) {\n if (isset($content['tid'])) {\n $term_ids[] = $content['tid'];\n }\n }\n }\n }\n return $term_ids;\n}", "public function supportsTermLookup() {\n \treturn $this->manager->supportsTermLookup();\n\t}", "public function find_next_term($term) {\n // the current term as 1, 2, or 3\n $current_term = substr($term['value'], -2, 1);\n $current_year = substr($term['value'], -8, 4);\n $next_year = strval(intval($current_year) + 1);\n\n switch($current_term) {\n // Fall\n case '1':\n // So the next term is Spring\n return array('name' => 'Spring ' . $current_year,\n 'value' => $current_year . '20');\n // Spring\n case '2':\n // So the next term is Summer\n return array('name' => 'Summer ' . $current_year,\n 'value' => $current_year . '30');\n // Summer\n case '3':\n // So the next term is Fall\n return array('name' => 'Fall ' . $current_year,\n // Per CSP spec, Fall uses the next calendar \n // year for its value\n 'value' => $next_year . '10');\n default:\n return false;\n }\n\n }", "function acf_get_choice_from_term($term, $format = 'term_id')\n{\n}", "public function get_terms()\n\t{\n\t\treturn $this->terms;\n\t}", "public function termcodes() {\n\t\treturn $this->terms->termcodes();\n\t}", "private function filterTerm()\n {\n if(empty($this->term)) {\n return;\n }\n\n $this->query->andWhere(\n ['or',\n ['LIKE', 'message', $this->term],\n ['LIKE', 'category', $this->term],\n ]\n );\n }", "public function graphTerm(){\n try {\n // Sparql11query.g:363:3: ( iriRef | rdfLiteral | numericLiteral | booleanLiteral | blankNode | OPEN_BRACE ( WS )* CLOSE_BRACE ) \n $alt47=6;\n $LA47 = $this->input->LA(1);\n if($this->getToken('IRI_REF')== $LA47||$this->getToken('PNAME_NS')== $LA47||$this->getToken('PNAME_LN')== $LA47)\n {\n $alt47=1;\n }\n else if($this->getToken('STRING_LITERAL1')== $LA47||$this->getToken('STRING_LITERAL2')== $LA47||$this->getToken('STRING_LITERAL_LONG1')== $LA47||$this->getToken('STRING_LITERAL_LONG2')== $LA47)\n {\n $alt47=2;\n }\n else if($this->getToken('INTEGER')== $LA47||$this->getToken('DECIMAL')== $LA47||$this->getToken('DOUBLE')== $LA47||$this->getToken('INTEGER_POSITIVE')== $LA47||$this->getToken('DECIMAL_POSITIVE')== $LA47||$this->getToken('DOUBLE_POSITIVE')== $LA47||$this->getToken('INTEGER_NEGATIVE')== $LA47||$this->getToken('DECIMAL_NEGATIVE')== $LA47||$this->getToken('DOUBLE_NEGATIVE')== $LA47)\n {\n $alt47=3;\n }\n else if($this->getToken('TRUE')== $LA47||$this->getToken('FALSE')== $LA47)\n {\n $alt47=4;\n }\n else if($this->getToken('BLANK_NODE_LABEL')== $LA47||$this->getToken('OPEN_SQUARE_BRACE')== $LA47)\n {\n $alt47=5;\n }\n else if($this->getToken('OPEN_BRACE')== $LA47)\n {\n $alt47=6;\n }\n else{\n $nvae =\n new NoViableAltException(\"\", 47, 0, $this->input);\n\n throw $nvae;\n }\n\n switch ($alt47) {\n case 1 :\n // Sparql11query.g:364:3: iriRef \n {\n $this->pushFollow(self::$FOLLOW_iriRef_in_graphTerm1230);\n $this->iriRef();\n\n $this->state->_fsp--;\n\n\n }\n break;\n case 2 :\n // Sparql11query.g:365:5: rdfLiteral \n {\n $this->pushFollow(self::$FOLLOW_rdfLiteral_in_graphTerm1236);\n $this->rdfLiteral();\n\n $this->state->_fsp--;\n\n\n }\n break;\n case 3 :\n // Sparql11query.g:366:5: numericLiteral \n {\n $this->pushFollow(self::$FOLLOW_numericLiteral_in_graphTerm1242);\n $this->numericLiteral();\n\n $this->state->_fsp--;\n\n\n }\n break;\n case 4 :\n // Sparql11query.g:367:5: booleanLiteral \n {\n $this->pushFollow(self::$FOLLOW_booleanLiteral_in_graphTerm1248);\n $this->booleanLiteral();\n\n $this->state->_fsp--;\n\n\n }\n break;\n case 5 :\n // Sparql11query.g:368:5: blankNode \n {\n $this->pushFollow(self::$FOLLOW_blankNode_in_graphTerm1254);\n $this->blankNode();\n\n $this->state->_fsp--;\n\n\n }\n break;\n case 6 :\n // Sparql11query.g:369:5: OPEN_BRACE ( WS )* CLOSE_BRACE \n {\n $this->match($this->input,$this->getToken('OPEN_BRACE'),self::$FOLLOW_OPEN_BRACE_in_graphTerm1260); \n // Sparql11query.g:369:16: ( WS )* \n //loop46:\n do {\n $alt46=2;\n $LA46_0 = $this->input->LA(1);\n\n if ( ($LA46_0==$this->getToken('WS')) ) {\n $alt46=1;\n }\n\n\n switch ($alt46) {\n \tcase 1 :\n \t // Sparql11query.g:369:16: WS \n \t {\n \t $this->match($this->input,$this->getToken('WS'),self::$FOLLOW_WS_in_graphTerm1262); \n\n \t }\n \t break;\n\n \tdefault :\n \t break 2;//loop46;\n }\n } while (true);\n\n $this->match($this->input,$this->getToken('CLOSE_BRACE'),self::$FOLLOW_CLOSE_BRACE_in_graphTerm1265); \n\n }\n break;\n\n }\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "function jr_get_custom_taxonomy($post_id, $tax_name, $tax_class) {\r\n $tax_array = get_terms( $tax_name, array( 'hide_empty' => '0' ) );\r\n if ($tax_array && sizeof($tax_array) > 0) {\r\n foreach ($tax_array as $tax_val) {\r\n if ( is_object_in_term( $post_id, $tax_name, array( $tax_val->term_id ) ) ) {\r\n echo '<span class=\"'.$tax_class . ' '. $tax_val->slug.'\">'.$tax_val->name.'</span>';\r\n break;\r\n }\r\n }\r\n }\r\n}", "function sameTaxTermValues($node, $field, $newValues){\n \t\t//$node->field_leaflet_location['und'][0]['tid']\n \t\t//$node->field_leaflet_location['und'][1]['tid']\n \t\t$existingValues = array();\n \t\tforeach ($node->{$field}[$node->language] as $key => $existingValue):\n \t\t\t$existingValues[] = $existingValue['tid']; \t\t\n \t\tendforeach;\n \t\tsort($existingValues);\n \t\tsort($newValues);\n \t\t\n \t\tif ($existingValues == $newValues){\n \t\t\treturn true;\n \t\t}else{\n \t\t\treturn false;\n \t\t}\n \t}" ]
[ "0.5655602", "0.5420572", "0.5275965", "0.5226129", "0.5166262", "0.5154597", "0.5151268", "0.5123557", "0.5091878", "0.5053576", "0.5031773", "0.50012606", "0.50006723", "0.494908", "0.49420235", "0.49285126", "0.49161765", "0.48656225", "0.48645797", "0.4844143", "0.48421404", "0.4829591", "0.48197442", "0.4816404", "0.4797398", "0.47849664", "0.47837922", "0.47572562", "0.47320256", "0.47193426", "0.46837685", "0.46837685", "0.46837685", "0.46798098", "0.46785778", "0.46762475", "0.4661206", "0.4643719", "0.46182483", "0.4614348", "0.46096492", "0.46065605", "0.46003053", "0.4598972", "0.4597582", "0.45967296", "0.4583266", "0.45729533", "0.45647624", "0.4553646", "0.45233727", "0.45226353", "0.45191786", "0.4518793", "0.45147488", "0.451367", "0.45082736", "0.4503268", "0.44977716", "0.4479178", "0.44751927", "0.447499", "0.4474945", "0.44676822", "0.4464388", "0.44565564", "0.44425794", "0.44255385", "0.4424564", "0.4415765", "0.441084", "0.4408102", "0.4401792", "0.4401648", "0.4393677", "0.4393677", "0.43913025", "0.43891996", "0.43890932", "0.43838552", "0.43790507", "0.4358076", "0.43535638", "0.434583", "0.43334848", "0.4326784", "0.4325794", "0.43238577", "0.43211964", "0.43173498", "0.43165407", "0.43157512", "0.43146935", "0.43130302", "0.4312121", "0.4311204", "0.43092832", "0.4307668", "0.43018907", "0.42943832" ]
0.6858113
0
Checks if $term is contained as a label in the SKOS ontology, returns a suggested term or ''.
protected function checkterm_in_stw($term, $SearchType, $lang, $store) { // if ($this->getSrcDebug()) { // print "<br>STORE: <br>"; // var_dump($store); // } switch($SearchType) { case 'X': $QUERY = <<<EOQ prefix skos: <http://www.w3.org/2004/02/skos/core#> select ?d2 where { { ?d2 skos:prefLabel '$term' . } UNION { ?d2 skos:altLabel '$term' . } } EOQ; break; case 'XX': $QUERY=<<<EOQ prefix skos: <http://www.w3.org/2004/02/skos/core#> select ?d2 where { { ?d2 skos:prefLabel ?p . FILTER regex(?p, "$term", "i") } } EOQ; break; case ('XXL'): $QUERY=<<<EOQ prefix skos: <http://www.w3.org/2004/02/skos/core#> select ?d2 where { { ?d2 skos:prefLabel ?p . FILTER regex(?p, "$term", "i") } UNION { ?d2 skos:altLabel ?p . FILTER regex(?p, "$term", "i") } } EOQ; } if ($this->getSrcDebug()) { print "<br><br>checkterm_in_stw($exactSearch): $QUERY <br>"; } $found = false; if ($rows = $store->query($QUERY, 'rows')) { $found = count($rows); if ($this->getSrcDebug()) { print "<br>DUMP RESULTS: <br>"; var_dump($rows); } } else { if ($this->getSrcDebug()) { print "!!! NO RESULTS OR NO QUERY LAUNCHED!!!"; } } if ($this->getSrcDebug()) { print "<br><br>checkterm_in_stw($exactSearch): returning found=$found<br>"; } if ($found) { $suggested_term = $term; } else { $suggested_term = ''; } return $suggested_term; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function formatAsInThesaurus($term) {\n\t\treturn ucfirst(strtolower($term));\n\t}", "public function booleanAndTerm($term){\n\t\t$term = preg_replace(\"/[^ a-zA-Z0-9]/\", '', $term);\n\t\t\n\t\t$term = mysql_real_escape_string(trim($term));\n\t\t$terms = explode(' ', $term);\n\t\t$return = '';\n\t\tforeach($terms as $word){\n\t\t\tif(strlen($word)>2){\n\t\t\t\t// if has a plural then try without\n\t\t\t\tif(substr($word,-1) == 's'){\n\t\t\t\t\t$return .= '+(>' . $word. ' <' . substr($word,0,-1) . '*) ';\n\t\t\t\t}else{\n\t\t\t\t// if singular then try with an s\n\t\t\t\t\t$return .= '+(>' . $word . ' <' . $word . 's) ';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//echo $return;\n\t\t//echo ' --> ';\n\t\treturn $return;\n\t}", "private function get_term_slug_by_label($property_terms, $leabel){\n if (is_array($property_terms)) {\n foreach ($property_terms as $tax => $v) {\n if ($v['label'] == $leabel)\n return $tax;\n }\n }\n return false;\n }", "protected function fullTextWildcards($term)\n {\n // removing symbols used by MySQL\n $reservedSymbols = ['-', '+', '<', '>', '@', '(', ')', '~'];\n $term = str_replace($reservedSymbols, '', $term);\n\n $words = explode(' ', $term);\n\n foreach ($words as $key => $word) {\n /*\n * applying + operator (required word) only big words\n * because smaller ones are not indexed by mysql\n */\n if (strlen($word) >= 1) {\n $words[$key] = '+' . $word . '*';\n }\n }\n\n $searchTerm = implode(' ', $words);\n\n return $searchTerm;\n }", "function check_term($term, $tax) {\n\t$term_link = get_term_link( $term, $tax );\n \n // If there was an error, insert term.\n if ( is_wp_error( $term_link ) ) {\n\t\twp_insert_term($term, $tax);\n\t}\n}", "private function retrieve_term_title() {\n\t\t$replacement = null;\n\n\t\tif ( ! empty( $this->args->taxonomy ) && ! empty( $this->args->name ) ) {\n\t\t\t$replacement = $this->args->name;\n\t\t}\n\n\t\treturn $replacement;\n\t}", "protected function get_taxonomy_name($label) {\n\t\t\tif(!$options = $this->options) {\n\t\t\t\t$options = $this->pro_class->options;\n\t\t\t}\n\n\t\t\tforeach($options['taxonomies'] as $taxonomy => $value) {\n\t\t\t\tif($value['label'] == $label) {\n\t\t\t\t\treturn $taxonomy;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $label; // if no match found, try to use the label\n\t\t}", "protected function fullTextWildcards($term)\n {\n // removing symbols used by MySQL\n $reservedSymbols = ['-', '+', '<', '>', '@', '(', ')', '~'];\n $term = str_replace($reservedSymbols, ' ', $term);\n\n $words = explode(' ', $term);\n\n foreach($words as $key => $word){\n /*\n * applying + operator (required word) only big words\n * because smaller ones are not indexed by mysql\n */\n if(strlen($word) >= 3) {\n $words[$key] = '+' . $word . '*';\n }\n }\n\n $searchTerm = implode( ' ', $words);\n\n return $searchTerm;\n }", "protected function genealogySearch(string $term): string\n {\n $proxy = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance(\\Subugoe\\Mathematicians\\Proxy\\GenealogyProxy::class);\n\n return $proxy->search($term);\n }", "public function getTermAttribute($term)\n {\n if (!$term) {\n return ucwords(\\Present::unslug($this->slug));\n }\n\n return $term;\n }", "private function lookup($word) {\n\n $query = $this->dm->getRepository('\\FYP\\Database\\Documents\\Lexicon');\n $result = $query->findOneBy(array('phrase' => $word));\n if (empty($result)) {\n $result = $query->findOneBy(array('phrase' => strtolower($word)));\n }\n\n if (empty($result)) {\n return self::DEFAULT_TAG;\n } else {\n return $result->getTags()[0];\n }\n\n }", "static function is_reserved_term( $term ) {\n if( ! in_array( $term, self::$_reserved ) ) return false;\n\n return new WP_Error( 'reserved_term_used', __( 'Use of a reserved term.', 'divlibrary' ) );\n }", "protected function fullTextWildcards($term)\n {\n return str_replace(' ', '*', $term) . '*';\n \n }", "public function hasTerm() {\n return $this->_has(1);\n }", "function has_term($term = '', $taxonomy = '', $post = \\null)\n {\n }", "function _entity_translation_taxonomy_label($term, $langcode) {\n $entity_type = 'taxonomy_term';\n if (function_exists('title_entity_label')) {\n $label = title_entity_label($term, $entity_type, $langcode);\n }\n else {\n $label = entity_label($entity_type, $term);\n }\n return (string) $label;\n}", "public function getTerm() {\n return $this->_term;\n }", "public function search_label( $query ) {\n\t\tglobal $pagenow, $typenow;\n\n\t\tif ( 'edit.php' !== $pagenow || 'product' !== $typenow || ! get_query_var( 'product_search' ) || ! isset( $_GET['s'] ) ) { // WPCS: input var ok.\n\t\t\treturn $query;\n\t\t}\n\n\t\treturn wc_clean( wp_unslash( $_GET['s'] ) ); // WPCS: input var ok, sanitization ok.\n\t}", "private function isStemmable($term)\n {\n for ($i = 0; $i < strlen($term); $i++) {\n // Discard terms that contain non-letter characters.\n if (!ctype_alpha($term[$i])) {\n return false;\n }\n }\n return true;\n }", "protected function matchSuggestion($path, $label, $searchTerm)\n {\n return fnmatch($searchTerm, $label, FNM_CASEFOLD) || fnmatch($searchTerm, $path, FNM_CASEFOLD);\n }", "protected function mactut_search(string $term): string\n {\n $proxy = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance(\\Subugoe\\Mathematicians\\Proxy\\MactutProxy::class);\n\n return $proxy->search($term);\n }", "private function retrieve_term404() {\n\t\t$replacement = null;\n\n\t\tif ( $this->args->term404 !== '' ) {\n\t\t\t$replacement = sanitize_text_field( str_replace( '-', ' ', $this->args->term404 ) );\n\t\t}\n\t\telse {\n\t\t\t$error_request = get_query_var( 'pagename' );\n\t\t\tif ( $error_request !== '' ) {\n\t\t\t\t$replacement = sanitize_text_field( str_replace( '-', ' ', $error_request ) );\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$error_request = get_query_var( 'name' );\n\t\t\t\tif ( $error_request !== '' ) {\n\t\t\t\t\t$replacement = sanitize_text_field( str_replace( '-', ' ', $error_request ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $replacement;\n\t}", "function testTermExistsExpectsStringUsed() {\n\t\t// Arrange\n\t\tglobal $post;\n\t\t$form = new TestNumberField();\n\t\t$form->fields['field_one']['type'] = 'taxonomyselect';\n\t\t$form->fields['field_one']['taxonomy'] = 'category';\n\t\t$form->fields['field_one']['multiple'] = false;\n\t\t$_POST = array( 'field_one' => 'term' );\n\t\t$existing = new \\StdClass;\n\t\t$existing->name = 'Sluggo';\n\t\t\\WP_Mock::wpFunction('sanitize_text_field', array('times' => 1));\n\t\t\\WP_Mock::wpFunction(\n\t\t\t'get_term_by', \n\t\t\tarray('times' => 1, 'return' => $existing));\n\t\t\\WP_Mock::wpFunction('wp_set_object_terms', array( 'times' => 1 ) );\n\n\t\t// act\n\t\t$form->validate_taxonomyselect(1, $form->fields['field_one'], 'field_one');\n\n\t\t// Assert: test will fail if wp_set_object_terms, get_term_by or\n\t\t// sanitize_text_field do not fire or fire more than once\n\t}", "private function findOrCreateLabel($label)\n {\n $labels = $this->client->api('repo')->labels()->all($this->user, $this->repository);\n\n if (!$this->containsLabel($label, $labels)) {\n $response = $this->client->api('repo')->labels()->create($this->user, $this->repository, $label);\n\n return $response['name'];\n } else {\n return $label['name'];\n }\n }", "function _post_format_get_term($term)\n {\n }", "private function termNotFound()\n {\n exit('No posts found with the search term supplied. :(');\n }", "public function get_term()\n {\n }", "public function search($term = null);", "function acf_get_term_title($term)\n{\n}", "public function testTermQueryWhereTermDoesNotExist() {\n\t\t$taxonomy = 'category';\n\n\t\t/**\n\t\t * Create the global ID based on the term_type and the created $id\n\t\t */\n\t\t$global_id = \\GraphQLRelay\\Relay::toGlobalId( $taxonomy, 'doesNotExist' );\n\n\t\t/**\n\t\t * Create the query string to pass to the $query\n\t\t */\n\t\t$query = \"\n\t\tquery {\n\t\t\tcategory(id: \\\"{$global_id}\\\") {\n\t\t\t\tcategoryId\n\t\t\t}\n\t\t}\";\n\n\t\t/**\n\t\t * Run the GraphQL query\n\t\t */\n\t\t$actual = do_graphql_request( $query );\n\n\t\t/**\n\t\t * Establish the expectation for the output of the query\n\t\t */\n\t\t$expected = [\n\t\t\t'data' => [\n\t\t\t\t'category' => null,\n\t\t\t],\n\t\t\t'errors' => [\n\t\t\t\t[\n\t\t\t\t\t'message' => 'The ID input is invalid',\n\t\t\t\t\t'locations' => [\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t'line' => 3,\n\t\t\t\t\t\t\t'column' => 4,\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\t\t\t\t\t'path' => [\n\t\t\t\t\t\t'category',\n\t\t\t\t\t],\n\t\t\t\t\t'category' => 'user',\n\t\t\t\t],\n\t\t\t],\n\t\t];\n\n\t\t$this->assertEquals( $expected, $actual );\n\t}", "function dss_elc_get_taxonomy_term($term_value, $vocab_name) {\n\n // Check for the taxonomical term containing the term\n $terms = taxonomy_get_term_by_name($term_value, $vocab_name);\n \n // If the term has not been linked to this vocabulary yet, instantiate the term\n if(!empty($terms)) {\n\n return array_pop($terms);\n } else {\n\n $vocab = taxonomy_vocabulary_machine_name_load($vocab_name);\n \n $term = new stdClass();\n $term->name = $term_value;\n $term->vid = $vocab->vid;\n\n taxonomy_term_save($term);\n return $term;\n }\n}", "function get_term_title($term, $field, $post_id = 0)\n {\n }", "public function place_term(\\Twig\\Environment $env, array $context, $term, $term_view = 'full') {\n if (empty($term)) {\n return '';\n }\n else {\n return entity_view($term, $term_view);\n }\n }", "public function getLabel(): \\Magento\\Framework\\Phrase;", "public function actionScientificName($term) {\n $pieces = explode(' ', $term);\n\n // Check for valid input\n if (count($pieces) <= 0 || empty($pieces[0])) {\n die('Invalid request');\n }\n\n // Construct default search criteria\n $where_fields = array('AND', 'ts.external = 0', 'tg.genus LIKE :genus');\n $where_fields_data = array(':genus' => $pieces[0] . '%');\n\n // Create basic SQL-command;\n $dbHerbarInput = $this->getDbHerbarInput();\n $command = $dbHerbarInput->createCommand()\n ->select(\"ts.taxonID, herbar_view.GetScientificName( ts.taxonID, 0 ) AS ScientificName\")\n ->from(\"tbl_tax_species ts\")\n ->leftJoin(\"tbl_tax_genera tg\", \"tg.genID = ts.genID\")\n ->order(\"ScientificName\");\n\n // Check if we search the first epithet as well\n if (count($pieces) >= 2 && !empty($pieces[1])) {\n $command->leftJoin(\"tbl_tax_epithets te0\", \"te0.epithetID = ts.speciesID\");\n\n $where_fields[] = 'te0.epithet LIKE :epithet0';\n $where_fields_data[':epithet0'] = $pieces[1] . '%';\n } else {\n $where_fields[] = 'ts.speciesID IS NULL';\n }\n\n // Add where condition\n $command->where($where_fields, $where_fields_data);\n\n $rows = $command->queryAll();\n\n $results = array();\n foreach ($rows as $row) {\n $taxonID = $row['taxonID'];\n $scientificName = $row['ScientificName'];\n\n //$scientificName = $this->getTaxonName($taxonID);\n\n if (!empty($scientificName)) {\n $results[] = array(\n \"label\" => $scientificName,\n \"value\" => $scientificName,\n \"id\" => $taxonID,\n );\n }\n }\n\n // Output results as service response\n $this->serviceOutput($results);\n }", "protected function prepare_term( $term ) {\n if ( $term === null || !is_string( $term ) ) {\n return false;\n }\n \n $trimmed_term = trim( $term );\n if ( empty( $trimmed_term ) ) {\n return false;\n }\n \n $words = explode( '|', $trimmed_term );\n\t\t\n\t\t//removing empty terms\n\t\tforeach ( $words as $key => $word ) {\n\t\t\t$w = trim($word);\n\t\t\tif ( empty($w) ) {\n\t\t\t\tunset( $words[$key] );\n\t\t\t}\n\t\t}\n\t\t$words = array_values($words);\n \n if ( false === $words || !is_array( $words ) ) {\n return false;\n }\n \n foreach ( $words as $i => $word ) {\n $words[ $i ] = $this->prepare_term_regex( trim( $word ) );\n }\n return $words;\n }", "function has_no_show( $term ) {\n if( $term && $term->slug == '' ) /* originally 'other'. modified 09-21-2011 PWinnick */ {\n return true;\n } else {\n return false;\n }\n}", "function oo_ensure_term($taxonomy, $term_name) {\n $term_slug = sanitize_title($term_name);\n\n $term = get_term_by('slug', $term_slug, $taxonomy);\n\n if (!$term) {\n $term_id = wp_insert_term(\n $term_name,\n $taxonomy,\n array(\n 'slug' => $term_slug\n )\n )['term_id'];\n } else {\n $term_id = $term->term_id;\n }\n\n return $term_id;\n}", "protected function oberwolfachSearch(string $term): string\n {\n $proxy = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance(\\Subugoe\\Mathematicians\\Proxy\\OberwolfachProxy::class);\n\n return $proxy->search($term);\n }", "abstract public function lookupWord($word);", "public function retrieveTaxLabel( $needle = 'name' )\n\t{\n\t\t$needle = (string) $needle;\n\t\t$taxonomy = get_taxonomy( $this->taxomomyStr );\n\n\t\tif( isset( $taxonomy->labels->{$needle} ) ) {\n\t\t\treturn $taxonomy->labels->{$needle};\n\t\t} else {\n\t\t\treturn '';\n\t\t}\n\t}", "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 }", "function drush_behat_op_create_term($term) {\n $term->vid = $term->vocabulary_machine_name;\n\n // Attempt to decipher any fields that may be specified.\n _drush_behat_expand_entity_fields('taxonomy_term', $term);\n\n $entity = entity_create('taxonomy_term', (array)$term);\n $entity->save();\n\n $term->tid = $entity->id();\n return $term;\n}", "private function filterTerm()\n {\n if(empty($this->term)) {\n return;\n }\n\n $this->query->andWhere(\n ['or',\n ['LIKE', 'message', $this->term],\n ['LIKE', 'category', $this->term],\n ]\n );\n }", "public function getSearchTerm(): ?string\n {\n return $this->searchTerm;\n }", "function term_exists( $term, $taxonomy = '', $parent = 0 ) {\n\t\tif ( function_exists( 'term_exists' ) ) { // 3.0 or later\n\t\t\treturn term_exists( $term, $taxonomy, $parent );\n\t\t} else {\n\t\t\treturn is_term( $term, $taxonomy, $parent );\n\t\t}\n\t}", "public function find($term) {\n raise('lang.MethodNotImplementedException', 'Find', __METHOD__);\n }", "function is_movie_tag( $term = '' ) {\n return is_tax( 'movie_tag', $term );\n }", "protected function _prepare_term($term)\n {\n }", "public function stem($term)\n {\n //$altered = false; // altered the term\n // creates CT\n $this->createCT($term);\n\n if (!$this->isIndexable($this->CT)) {\n return null;\n }\n if (!$this->isStemmable($this->CT)) {\n return $this->CT;\n }\n\n $this->R1 = $this->getR1($this->CT);\n $this->R2 = $this->getR1($this->R1);\n $this->RV = $this->getRV($this->CT);\n $this->TERM = $term . ';' . $this->CT;\n\n $altered = $this->step1();\n if (!$altered) {\n $altered = $this->step2();\n }\n\n if ($altered) {\n $this->step3();\n } else {\n $this->step4();\n }\n\n $this->step5();\n\n return $this->CT;\n }", "function get_primaryTermName($taxonomy,$id) {\n $primary_term = new WPSEO_Primary_Term($taxonomy,$id); \n $term = get_term_by('id',$primary_term->get_primary_term(),$taxonomy);\n return $term->name; \n}", "public function getLabel(): ?string;", "abstract protected function singularLabel(): string;", "function getSearchTerm() {\n if(isset($_POST['searchStr']))\n return $_POST['searchStr'];\n else\n return \"\";\n }", "function buildLabel($label) {\n return check_plain($label);\n }", "public function checkIfTermExist($term_name){\n\t\t\t$query = $this->connection()->prepare(\"SELECT name FROM termz WHERE name='$term_name'\");\n\t\t\t$query->execute();\n\t\t\treturn $query->rowCount();\n\t\t}", "public function lookupIndex(string $label)\n {\n return $this->labels[$label] ?? null;\n }", "public function show(Term $term)\n {\n //\n }", "public function show(Term $term)\n {\n //\n }", "function matchStrings($userValue, $label)\n{\n// debug(\"matchStrings $label\", $userValue);\n\n if(!strcasecmp($userValue, $label)) return true;\n \n $firstWord = substringBefore($label, \" \");\n return startsWith($userValue, $firstWord);\n}", "public function disambiguate($word)\n {\n if (preg_match('/^kau(.*)$/', $word, $matches)) {\n return $matches[1];\n }\n }", "private function retrieve_ct_desc_custom_tax_name( $var ) {\n\t\tglobal $post;\n\t\t$replacement = null;\n\n\t\tif ( is_string( $var ) && $var !== '' ) {\n\t\t\t$tax = substr( $var, 8 );\n\t\t\tif ( is_object( $post ) && isset( $post->ID ) ) {\n\t\t\t\t$terms = get_the_terms( $post->ID, $tax );\n\t\t\t\tif ( is_array( $terms ) && $terms !== array() ) {\n\t\t\t\t\t$term = current( $terms );\n\t\t\t\t\t$term_desc = get_term_field( 'description', $term->term_id, $tax );\n\t\t\t\t\tif ( $term_desc !== '' ) {\n\t\t\t\t\t\t$replacement = wp_strip_all_tags( $term_desc );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $replacement;\n\t}", "private function searchTag()\n {\n $term = $_REQUEST['term'];\n \n $list = array();\n $sql = \"SELECT * \n FROM \" . TAGS_TBL . \" \n WHERE tag_title LIKE '$term%'\";\n try\n {\n $rows = $this->db->select($sql);\n }\n catch(Exception $Exception){}\n \n if($rows)\n {\n foreach($rows as $index => $row)\n {\n $list[] = stripslashes(trim(ucwords(strtolower($row->tag_title))));\n }\n }\n \n $str = implode('\",\"', $list);\n if($str)\n {\n echo '[\"' . $str . '\"]';\n }\n else\n {\n echo '[]';\n }\n \n exit;\n }", "public function search($term, $returnObject = false) {\n\t\t///implicitly remove error reporting can be changed to 1 to turn on\n\t\terror_reporting(0);\n\n\t\t$data = \"\";\n\t\t$dataObj = null;\n\n\t\t// check the cache to save a remote request\n\t\t$cachedResult = $this->_getCache($term);\n\t\t// anything?\n\t\tif ($cachedResult === false) {\n\t\t\t// no cache. let's ask for help\n\t\t\t\n\t\t\t// we'll attempt to search on each of these fields\n\t\t\t$searchAttempts = array('openfda.brand_name', 'openfda.generic_name');\n\t\t\tforeach ($searchAttempts as $search) {\n\t\t\t\t// grab the search results\n\t\t\t\t$data = file_get_contents(\"https://api.fda.gov/drug/label.json?api_key=TwOhEwWWk1eGlkFl8n1HHCn93bmJity6AZbQGHpj&search={$search}:\\\"{$term}\\\"\");\n\t\t\t\t// grab the object from the JSON response\n\t\t\t\t$dataObj = json_decode($data);\n\n\t\t\t\t// have we encountered an error?\n\t\t\t\tif (!isset($dataObj->error)) {\n\t\t\t\t\t// nope. use what we've got\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->_setCache($term, $data);\n\t\t}\n\t\telse {\n\t\t\t// cache hit. use it\n\t\t\t$data = $cachedResult;\n\t\t\t$dataObj = json_decode($data);\n\t\t}\n\n\t\treturn $returnObject ? $dataObj : $data;\n\t}", "function atos_esuite_get_term_tid($term_name) {\n $vocabulary_name = variable_get('atos_esuite_tags_vocabulary_name', 'tags');\n $vocabulary = taxonomy_vocabulary_machine_name_load($vocabulary_name);\n\n $terms = taxonomy_get_term_by_name($term_name, $vocabulary_name);\n if (!count($terms)) {\n $term = new stdClass();\n $term->vid = $vocabulary->vid;\n $term->name = $term_name;\n taxonomy_term_save($term);\n }\n else {\n $term = reset($terms);\n }\n\n return $term->tid;\n}", "public function find_next_term($term) {\n // the current term as 1, 2, or 3\n $current_term = substr($term['value'], -2, 1);\n $current_year = substr($term['value'], -8, 4);\n $next_year = strval(intval($current_year) + 1);\n\n switch($current_term) {\n // Fall\n case '1':\n // So the next term is Spring\n return array('name' => 'Spring ' . $current_year,\n 'value' => $current_year . '20');\n // Spring\n case '2':\n // So the next term is Summer\n return array('name' => 'Summer ' . $current_year,\n 'value' => $current_year . '30');\n // Summer\n case '3':\n // So the next term is Fall\n return array('name' => 'Fall ' . $current_year,\n // Per CSP spec, Fall uses the next calendar \n // year for its value\n 'value' => $next_year . '10');\n default:\n return false;\n }\n\n }", "function single_term_title($prefix = '', $display = \\true)\n {\n }", "public function getTermName($id) {\n $term = Term::load($id);\n return $term->getName();\n }", "function drush_behat_op_delete_term(\\stdClass $term) {\n $term = $term instanceof TermInterface ? $term : Term::load($term->tid);\n if ($term instanceof TermInterface) {\n $term->delete();\n }\n}", "function get_the_show_term( $post_id ) {\n $terms = wp_get_object_terms($post_id, 'shows');\n if ( !is_wp_error($terms) && isset($terms[0]) ) {\n return $terms[0];\n }\n return false;\n}", "function jit_taxonomy_validate_term($term){\r\n $validate = TRUE;\r\n\r\n if($term->vocabulary_machine_name !== 'products'){\r\n return FALSE;\r\n }\r\n\r\n if($term->name == 'Not In Menu'){\r\n return FALSE;\r\n }\r\n\r\n if(property_exists($term,'field_show_in_products_menu')){\r\n\r\n\r\n $show_in_menu = $term->field_show_in_products_menu[LANGUAGE_NONE][0]['value'];\r\n\r\n //if the term is programmatically made it is possible that there will be no\r\n //value for field_show_in_products_menu in which case we should continue to\r\n //hide from products menu.\r\n\r\n if (!isset($show_in_menu)){\r\n\r\n if($show_in_menu == 1){\r\n return FALSE;\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n\r\n\r\n\r\n return $validate;\r\n}", "function check_for_attribute_term( $term_name ) {\n\tglobal $wpdb;\n\n\t$terms_table = $wpdb->prefix . \"terms\";\n\t$terms_sql = \"SELECT * FROM \" . $terms_table . \" WHERE name = '$term_name'\";\n\n\tif ( $wpdb->get_results($terms_sql, ARRAY_A) ) {\n\t\t$response = true;\n\t} else {\n\t\t$response = false;\n\t}\n\n\treturn $response;\n}", "function rest_get_route_for_term($term)\n {\n }", "private function retrieve_term_description() {\n\t\t$replacement = null;\n\n\t\tif ( isset( $this->args->term_id ) && ! empty( $this->args->taxonomy ) ) {\n\t\t\t$term_desc = get_term_field( 'description', $this->args->term_id, $this->args->taxonomy );\n\t\t\tif ( $term_desc !== '' ) {\n\t\t\t\t$replacement = wp_strip_all_tags( $term_desc );\n\t\t\t}\n\t\t}\n\n\t\treturn $replacement;\n\t}", "function _vaxia_dice_roller_small_label($string) {\n $small_label = strtolower($string);\n $small_label = substr($small_label, 0, 3);\n if ($small_label == 'ref') {\n $small_label = 'fin';\n }\n return $small_label;\n}", "public static function singular($str)\n {\n // Shortcut references (readability)\n $sp = &self::$singular;\n $pp = &self::$plural;\n $sm = &$sp['merged'];\n $sd = &self::$data['singular'];\n\n // Check the internal cache (performance)\n if (isset($sd[$str])) {\n\n // Return matches from the cache\n return $sd[$str];\n }\n\n // Check against irregular singulars\n if (preg_match('/(.*)\\\\b('.$sp['cacheIrregular'].')$/i', $str, $regs)) {\n\n // Return match while also setting the internal cache (faster next time this word is referenced)\n return $sd[$str] = $regs[1].substr($str, 0, 1).substr($sm['irregular'][strtolower($regs[2])], 1);\n }\n\n // Check against the uninflected singulars\n if (preg_match('/^('.$sp['cacheUninflected'].')$/i', $str, $regs)) {\n\n // Return and cache\n return $sd[$str] = $str;\n }\n\n // Normal word (not irregular or uninflected)\n foreach ($sp['rules'] as $rule => $replacement) {\n\n // Find a matching rule\n if (preg_match($rule, $str)) {\n\n // Cache the word for next time and return the inflected\n return preg_replace($rule, $replacement, $str);\n }\n }\n\n return $sd[$str] = $str;\n }", "protected function extractDescriptor($term) {\n\t\t$ok= false;\n\t\t$node = $label = 0;\n \n\t\tif ($this->getSrcDebug()) {\n\t\t\tprint \"<br><b>STWengine->extractDescriptor($term):\";\n\t\t}\n\t\t$thsysBase = \"http://zbw.eu/stw/thsys/\";\n\t\t$descriptorBase = \"http://zbw.eu/stw/descriptor/\";\n\t\t$regExpThsys = \"/^http:\\/\\/zbw\\.eu\\/stw\\/thsys\\/(\\d*) \\((.*)\\)$/\";\n\t\t$regExpDescriptor = \"/^http:\\/\\/zbw\\.eu\\/stw\\/descriptor\\/(\\d*)-(\\d*) \\((.*)\\)$/\";\n\t\t\n\t\tif (preg_match($regExpThsys, $term, $match)) {\n\t\t\t$ok = true;\n\t\t\t$node = $thsysBase . $match[1];\n\t\t\t$label = $match[2];\n\t\t\t\n\t\t\tif($this->getSrcDebug()) {\n\t\t\t\tprint \"<br>Matched $regExpThsys in ($term), node=($node) label=($label)\";\n\t\t\t}\n\t\t} else if (preg_match($regExpDescriptor, $term, $match)) {\n\t\t\t$ok = true;\n\t\t\t$node = $descriptorBase . $match[1] . \"-\" . $match[2];\n\t\t\t$label = $match[3];\n\t\t\t\n\t\t\tif($this->getSrcDebug()) {\n\t\t\t\tprint \"<br>Matched $regExpDescriptor in ($term), node=($node) label=($label)\";\n\t\t\t}\n\t\t} else if ($this->getSrcDebug()) {\n\t\t\tprint \"<br><b>NO match </b> ($term)\";\n\t\t}\n\t\t\n\t\treturn array($node,$label);\t\t\n\t}", "public function taxTermExists($value, $field, $vocabulary) {\n $query = $this->typeManager->getStorage('taxonomy_term')->getQuery();\n $query->condition('vid', $vocabulary);\n $query->condition($field, $value);\n $tids = $query->accessCheck(FALSE)->execute();\n\n if (!empty($tids)) {\n foreach ($tids as $tid) {\n return $tid;\n }\n }\n return FALSE;\n }", "function testTermDoesNotExistExpectsStringUsed() {\n\t\t// Arrange\n\t\t$form = new TestNumberField();\n\t\t$form->fields['field_one']['type'] = 'taxonomyselect';\n\t\t$form->fields['field_one']['taxonomy'] = 'category';\n\t\t$form->fields['field_one']['multiple'] = false;\n\t\t$field = $form->fields['field_one'];\n\t\t$_POST = array('post_ID' => 1, 'field_one' => 'term');\n\t\t$term = \\WP_Mock::wpFunction(\n\t\t\t'sanitize_text_field',\n\t\t\tarray(\n\t\t\t\t'times' => 1,\n\t\t\t\t'args' => array( $_POST['field_one'] ),\n\t\t\t\t'return' => 'term',\n\t\t\t)\n\t\t);\n\t\t\\WP_Mock::wpFunction('get_term_by', array('times' => 1, 'return' => false));\n\t\t\\WP_Mock::wpFunction(\n\t\t\t'wp_set_object_terms',\n\t\t\tarray(\n\t\t\t\t'times' => 1,\n\t\t\t)\n\t\t);\n\n\t\t// act\n\t\t$form->validate_taxonomyselect($_POST['post_ID'], $form->fields['field_one'], 'field_one');\n\n\t\t// Assert: test will fail if wp_set_object_terms, get_term_by or\n\t\t// sanitize_text_field do not fire or fire more than once\n\t}", "protected function normalizeTerm(string $term): string\n {\n if (strpos($term, static::TERM_CASE_SEPARATOR)) {\n throw new \\InvalidArgumentException('Term cannot contain \"' . static::TERM_CASE_SEPARATOR . '\"');\n }\n\n return mb_strtolower($term) . static::TERM_CASE_SEPARATOR . $term;\n }", "function be_default_category_title( $headline, $term ) {\n\tif( ( is_category() || is_tag() || is_tax() ) && empty( $headline ) )\n\t\t$headline = $term->name;\n\n\treturn $headline;\n}", "private function changeTerm($value)\n {\n // be-safe !!!\n if ($value == null) {\n return null;\n }\n\n return mb_strtolower($value);\n }", "function wp_unique_term_slug($slug, $term)\n {\n }", "function is_product_tag( $term = '' ) {\n\t\treturn is_tax( 'product_tag', $term );\n\t}", "function getLabel(): string;", "function kwight_term_id_by_slug( $slug, $tax = 'category' ) {\r\n\r\n\t$term = get_term_by( 'slug', $slug, $tax );\r\n\t$id = ( $term ) ? $term->term_id : false;\r\n\r\n\treturn intval( $id );\r\n\r\n}", "public function get_term() {\n $m = date('M');\n \n //if it is jan. - april, we're in the spring\n if ($m < 5)\n return '01';\n \n //if it's May - August, we're in the summer\n else if ($m < 9) {\n return '02';\n } \n \n //otherwise, it's fall\n else return '03';\n }", "public function for_term( $params ) {\n\t\t$obj = $this->head_action->for_term( $params['id'] );\n\n\t\tif ( $obj->status === 404 ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn $obj->head;\n\t}", "public function singularize($word)\n {\n $result = array_search($word, $this->specials, true);\n if ($result !== false) {\n return $result;\n }\n foreach ($this->singulars as $rule => $replacement) {\n if (preg_match($rule, $word)) {\n return preg_replace($rule, $replacement, $word);\n }\n }\n\n return $word;\n }", "function acf_get_choice_from_term($term, $format = 'term_id')\n{\n}", "public function get_term_id_by_term_name($vid, $term_name) {\n $term = taxonomy_term_load_multiple_by_name($term_name, $vid);\n if (!empty($term)) {\n if (count($term) == 1) {\n $s_id = key($term);\n } else {\n $s_id = 'null';\n }\n } else {\n $s_id = key($term);\n }\n return $s_id;\n }", "public function varOrTerm(){\n try {\n // Sparql11query.g:339:3: ( variable | graphTerm ) \n $alt44=2;\n $LA44_0 = $this->input->LA(1);\n\n if ( (($LA44_0>=$this->getToken('VAR1') && $LA44_0<=$this->getToken('VAR2'))) ) {\n $alt44=1;\n }\n else if ( (($LA44_0>=$this->getToken('TRUE') && $LA44_0<=$this->getToken('FALSE'))||$LA44_0==$this->getToken('IRI_REF')||$LA44_0==$this->getToken('PNAME_NS')||$LA44_0==$this->getToken('PNAME_LN')||$LA44_0==$this->getToken('INTEGER')||$LA44_0==$this->getToken('DECIMAL')||$LA44_0==$this->getToken('DOUBLE')||($LA44_0>=$this->getToken('INTEGER_POSITIVE') && $LA44_0<=$this->getToken('DOUBLE_NEGATIVE'))||($LA44_0>=$this->getToken('STRING_LITERAL1') && $LA44_0<=$this->getToken('STRING_LITERAL_LONG2'))||$LA44_0==$this->getToken('BLANK_NODE_LABEL')||$LA44_0==$this->getToken('OPEN_BRACE')||$LA44_0==$this->getToken('OPEN_SQUARE_BRACE')) ) {\n $alt44=2;\n }\n else {\n $nvae = new NoViableAltException(\"\", 44, 0, $this->input);\n\n throw $nvae;\n }\n switch ($alt44) {\n case 1 :\n // Sparql11query.g:340:3: variable \n {\n $this->pushFollow(self::$FOLLOW_variable_in_varOrTerm1158);\n $this->variable();\n\n $this->state->_fsp--;\n\n\n }\n break;\n case 2 :\n // Sparql11query.g:341:5: graphTerm \n {\n $this->pushFollow(self::$FOLLOW_graphTerm_in_varOrTerm1164);\n $this->graphTerm();\n\n $this->state->_fsp--;\n\n\n }\n break;\n\n }\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "public function find(string $term, string $namespace) : array;", "public function setTerm($term) {\n $this->_term = $term;\n return $this;\n }", "private function suggestKeyword($system, $chardef) {\n\t\t$allInheritedIds=$system->allInheritedIds;\n\t\t\n\t\t//get the keywords out of the dict\n\t\t$relevantDicts=Dictionary::model()->findAllByAttributes(array(\n\t\t\t\t'languageId'=>$system->language,\n\t\t\t\t'targetLanguageId'=>$system->targetLanguage\n\t\t));\n\t\t\n\t\t$relevantDicts=CHtml::listData($relevantDicts, 'id', 'id');\n\t\t\n\t\t$criteria=new CDbCriteria();\n\t\t$criteria->addInCondition('dictionaryId', $relevantDicts);\n\t\t$criteria->compare('simplified', $chardef);\n\t\t$criteria->compare('traditional', $chardef, false, \"OR\");\n\n\t\t$candidates=DictEntryChar::model()->findAll($criteria);\n\t\t\n\t\t//find the first one which is not yet used\n\t\tforeach($candidates as $candidate) {\n\t\t\t\n\t\t\tforeach($candidate->translationsArray as $kw) {\n\t\t\t\t$criteria=new CDbCriteria();\n\t\t\t\t$criteria->addInCondition('system', $allInheritedIds);\n\t\t\t\t$criteria->compare('keyword', $kw);\n\t\t\t\t$result=Char::model()->find($criteria);\n\t\t\t\t\t\n\t\t\t\tif($result===NULL) { //the keyword is not yet used, so return it\n\t\t\t\t\treturn $kw;\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\n\t}", "public function __construct( $term ) {\n\t\t$this->term = $term;\n\t}", "public function get_term_object( $term ) {\n \t$vc_taxonomies_types = vc_taxonomies_types();\n \treturn array(\n \t\t'label' => $term->name,\n \t\t'value' => $term->slug,\n \t\t'group_id' => $term->taxonomy,\n \t\t'group' => isset( $vc_taxonomies_types[ $term->taxonomy ], $vc_taxonomies_types[ $term->taxonomy ]->labels, $vc_taxonomies_types[ $term->taxonomy ]->labels->name ) ? $vc_taxonomies_types[ $term->taxonomy ]->labels->name : __( 'Taxonomies', 'infinite-addons' ),\n \t\t);\n }", "function search($word) {\n $node = $this->find($word);\n return $node != null && $node->is_word; // 查找单词比较严格,必须is_word为真\n }", "function sanitize_term($term, $taxonomy, $context = 'display')\n {\n }", "function emc_the_term_title() {\r\n\r\n\t$term = get_queried_object();\r\n\r\n\tif ( is_tax( 'emc_content_format' ) ) {\r\n\t\t$html = sprintf( __( '%ss', 'emc' ),\r\n\t\t\t$term->name\r\n\t\t);\r\n\t} elseif ( is_tax( 'emc_series' ) ) {\r\n\t\t$html = sprintf( __( 'Series: %s', 'emc' ),\r\n\t\t\t$term->name\r\n\t\t);\r\n\t} elseif ( is_tax( 'emc_grade_level' ) ) {\r\n\t\t$html = sprintf( __( 'Grade Level: %s', 'emc' ),\r\n\t\t\t$term->name\r\n\t\t);\r\n\t} else {\r\n\t\t$html = $term->name;\r\n\t}\r\n\r\n\techo esc_html( $html );\r\n\r\n}" ]
[ "0.5996785", "0.5933398", "0.5892284", "0.5835731", "0.5798144", "0.5750582", "0.57216805", "0.5686211", "0.5627132", "0.5614647", "0.5531025", "0.5508393", "0.55004346", "0.5496375", "0.54529065", "0.5444737", "0.539476", "0.53881586", "0.5387793", "0.5382973", "0.53569466", "0.5337371", "0.5325614", "0.5310115", "0.5308597", "0.5306441", "0.5293917", "0.5247305", "0.5244641", "0.5240498", "0.52288276", "0.51977", "0.5193059", "0.51864004", "0.51656693", "0.5163", "0.512178", "0.5098483", "0.5073408", "0.50607777", "0.50546193", "0.5036017", "0.5016174", "0.5015478", "0.5011855", "0.49975193", "0.49940172", "0.49938357", "0.49931327", "0.49894518", "0.49787977", "0.49753466", "0.4974733", "0.49742615", "0.49635166", "0.49576062", "0.49506518", "0.49475935", "0.49475935", "0.4932756", "0.49129003", "0.49113443", "0.4903341", "0.4896241", "0.48926508", "0.48848063", "0.48815492", "0.48684976", "0.48602176", "0.48543453", "0.48480737", "0.48248288", "0.48241746", "0.48188415", "0.48111567", "0.47907978", "0.4782056", "0.4780436", "0.47519788", "0.47483763", "0.4743738", "0.47420228", "0.47209916", "0.47201684", "0.47170317", "0.47155377", "0.4700743", "0.4700488", "0.46998352", "0.46816832", "0.46709877", "0.4660672", "0.465004", "0.46474388", "0.4637757", "0.4632892", "0.46305653", "0.46298063", "0.46116754", "0.46104512" ]
0.47880802
76
Create a new controller instance.
public function __construct() { $this->middleware('jwt.auth', ['only' => ['check_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
Check if user is authenticated.
public function check_auth(Request $request) { return response()->json(['authenticated' => true]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isUserAuthenticated () : bool {\n return $this->mainController->isUserAuthenticated();\n }", "public function isAuthenticated()\n {\n return $this->getUser() !== null;\n }", "public function is_authenticated() {\n \n // get user\n $user = $this->CI->_auth->get_user($this->get_user_name());\n \n // does the user exist?\n if ($user == NULL) return false;\n \n return $this->CI->session->userdata(self::KEY_AUTH) == true;\n \n }", "public static function isAuthenticated() {\n\n return isset($_SESSION[Security::SESSION_USER]) && $_SESSION[Security::SESSION_USER]->id > 0;\n\n }", "public function isAuthenticated();", "public function isAuthenticated();", "public function isAuthenticated();", "public function isAuthenticated();", "public function isAuthenticated(): bool\n {\n return null !== $this->getUser();\n }", "public function isAuthenticated(): bool;", "public function isAuthenticated(): bool;", "public function userIsLoggedIn() {\n return auth()->check() ;\n }", "private function _isAuthenticated()\n\t{\n\t\treturn true;\n\t}", "protected function isAuthenticatedUser() {\n\t\treturn !$this->getUser()->isAnon();\n\t}", "public function isAuthenticated() {\n\t}", "public function isAuthenticated()\n {\n return $this->getAuth()->hasIdentity();\n }", "public function IsAuthenticated() {\n\t\treturn ($this->session->GetAuthenticatedUser() != false);\n\t}", "public function isAuthenticated()\n {\n $token = $this->app['security']->getToken();\n \n if ( !is_null($token) ) {\n return ($token->getUser() instanceof SecurityUser);\n }\n \n return false;\n }", "public function isAuthenticated(): bool {\n return true;\n }", "public function isAuthenticated(): bool\n {\n return getApp()->security()->isAuthenticated();\n }", "public function isAuthenticated(): bool {\n return $this->check('id');\n }", "protected function isUserLoggedIn() {}", "protected function isUserLoggedIn() {}", "public function isAuthenticated()\r\n {\r\n return true; \r\n }", "public function isAuthenticated() : bool;", "public function isAuth()\n {\n return $this->session->hasAuthorisation();\n }", "public function isUserLoggedIn()\n {\n return $this->container->get('security.authorization_checker')\n ->isGranted('IS_AUTHENTICATED_FULLY');\n }", "private function _checkAuth()\n {\n // check login or not\n if (!$this->getUser()->isAuthenticated()) {\n $this->redirect('login');\n }\n }", "public function isAuthenticated()\n {\n return ($this->getAccessToken()) ? true : false;\n }", "public function isAuthenticated(){\n return $_SESSION['loggedIn'];\n }", "public function is_authenticated(){\n\t\tif(isset($_SESSION['uid']) && $_SESSION['ip'] == $_SERVER['REMOTE_ADDR']){\n\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\t}", "public function authenticated(){\n if(isset($_SESSION['user'])){\n if($this->load($_SESSION['user']) == false){\n header('Location: /logout.php');\n die;\n }\n return true;\n }\n return false;\n }", "public function isAuthenticated()\n {\n return $this->authenticated;\n }", "public static function isAuthenticated() {\n $auth = self::get('auth');\n\n return empty($auth['isauthenticated']) ? FALSE : TRUE;\n }", "public function is_user_auth(){\n if($this->user_id==auth()->user()->id){\n return true;\n }else{\n return false;\n }\n }", "public function isAuthenticated()\n\t{\n\t\treturn $this->authenticated;\n\t}", "public function isUserLoggedIn() {\r\n\t\treturn ($this->coreAuthenticationFactory->isUserLoggedIn ());\r\n\t}", "private function checkAuth()\n {\n $this->isAuthenticated = false;\n $isLoggedIn = is_user_logged_in();\n\n if ($isLoggedIn) {\n $this->username = wp_get_current_user()->user_login;\n $id = wp_get_current_user()->ID;\n $meta = get_user_meta($id, 'wp_capabilities', false);\n foreach ($meta[0] as $key => $value) {\n $k = strtoupper($key);\n if (($k == $this->PluginRole) or\n ($k == $this->AdminRole)) {\n $this->isAuthenticated = true;\n }\n }\n }\n }", "public function isAuthenticated()\n\t{\n\t\treturn $this->_authenticationInstance->isAuthenticated();\n\t}", "function isLoggedIn()\n{\n\treturn auth()->check();\n}", "public function isAuthenticated()\n {\n $userToken = $this->securityContext->getToken();\n\n if ($userToken) {\n $user = $userToken->getUser();\n\n if ($user !== 'anon.') {\n $roles = $user->getRoles();\n\n if (in_array('ROLE_USER', $roles)) return true;\n }\n }\n\n return false;\n }", "public function isAuthenticated(){\n return $this->authenticated;\n }", "public function auth() {\n\t\t\t// Check if user has not a session\n\t\t\tif (!$this->session->has('user')) return false;\n\n\t\t\t// Get the user from session\n\t\t\t$user = $this->session->get('user');\n\t\t\t$field = array_keys($user)[1] ?? null;\n\t\t\t$value = array_values($user)[1] ?? null;\n\n\t\t\t// If user does not exists\n\t\t\tif (!$this->user->exists($field, $value)) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Else\n\t\t\treturn true;\n\t\t}", "public function checkAuth ()\n {\n if ($this->storage->isAvailable()) {\n if ($this->storage->get(self::$prefix . 'userId') !== NULL) {\n return true;\n } else {\n $this->logout();\n return false;\n }\n }\n\n return false;\n }", "public function isAuthenticated()\n {\n return $this->authenticator->isAuthenticated();\n }", "private function is_authenticated()\n {\n if($this->mode == rabkTwttr::MODE_APP)\n return isset($_SESSION['access_token']);\n \n if($this->mode == rabkTwttr::MODE_USER)\n return isset($_SESSION['access_token']) && isset($_SESSION['access_token_secret']);\n }", "function is_authenticated()\n{\n global $app;\n return (is_object($app->auth) && $app->auth->isValid());\n}", "public function isAuth()\n {\n $u = $this->session->userdata('username');\n if ($u) {\n return $u;\n }\n\n return false;\n }", "public static function check()\n {\n if(isset($_SESSION['auth_user'])) {\n return true;\n }\n\n return false;\n }", "public function isAuthenticated() {\n\t\treturn $this->isAuthenticated;\n\t}", "public function isAuthenticated()\n {\n return $this->isAuthenticated;\n }", "function is_authenticated(){\n\n\t// some pages are used by both frontend and backend, so check for backend...\n\tif(defined(\"BACKEND\")){\n\t\treturn is_backend_authenticated();\n\t\t}\n\n\tif(isset($_SESSION[\"user_id\"]))\n\t\treturn true;\n\n\treturn false;\n\t}", "public static function check()\n {\n return (new Authenticator(request()))->isAuthenticated();\n }", "public function isLoggedIn()\r\n {\r\n $storage = new AuthenticationSession();\r\n return (!$storage->isEmpty() && $storage->read() instanceof AuthenticationResult);\r\n }", "public function loggedIn()\n {\n if($this->di->session->get('user'))\n {\n return true;\n }\n return false;\n }", "private function isAuth()\n\t{\n\t\treturn $this->session->userdata('auth') ? true : false;\n\t}", "public function isLoggedIn()\n {\n return $this->session->has('user');\n }", "public function isAuthenticated()\n {\n return $this->_isAuthenticated;\n }", "public function isAuthenticated()\r\n {\r\n if (!isset($_SESSION[\"ed\"])) {\r\n echo '<meta http-equiv=\"refresh\" content=\"0; url=' . (new CodeFlirt\\Handlers)->path(\"login\") . '\">';\r\n exit(0);\r\n }\r\n }", "public function isLoggedIn()\n {\n return isset($_SESSION['user']);\n }", "function isLoggedIn(){\n return $this->auth->isLoggedIn();\n }", "function isLoggedIn() {\n\t\t\tif(!$this->params['requested']) $this->cakeError('error404');\n\t\t\treturn $this->User->isLoggedIn();\n\t\t}", "public function checkUser()\n {\n $response = $this->di->get(\"response\");\n $user = $this->di->get(\"user\");\n\n if (!$user->isLoggedIn()) {\n $response->redirect(\"login\");\n }\n }", "public static function isAuth() {\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 }", "public function isAuth()\n {\n return !empty($this->getAuth());\n }", "public function isAuthenticated()\n\t{\n\t\t$token = $this->getToken();\n\n\t\tif (!$token || !array_key_exists('access_token', $token))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telseif (array_key_exists('expires_in', $token) && $token['created'] + $token['expires_in'] < time() + 20)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}", "public function isAuth();", "function verifyAuth()\n\t{\n\t\tsanitizeRequest($_POST);\n\t\tsanitizeRequest($_GET);\n\t\t\n\t\t$currentUser = UserService::getInstance()->getCurrentUser();\n\t\tif (!$currentUser || !$currentUser->getSessionId()) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\ttry {\n\t\t\t$payload = JWT::decode($currentUser->getSessionId(), SERVER_KEY, array('HS256'));\n\t\t\t$sessionId = UserService::getInstance()->getSessionId($currentUser->getId());\n\t\t\tif ($sessionId === $currentUser->getSessionId() &&\n\t\t\t\t\t$currentUser->getId() === $payload->id &&\n\t\t\t\t\t$currentUser->getEmail() === $payload->email) {\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\tif ($currentUser->isRemember() && $e->getMessage() === 'Expired token') {\n\t\t\t\t$currentUser->extendSession();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\treturn false;\n\t}", "public function isAuthenticated() {return $this->isauthenticated;}", "public function isAuth() {\n $connector = Mage::getSingleton('vidtest/connector')->getApiModel($this->getApiModelCode());\n return $connector->isLoggedIn();\n }", "public function IsAuthenticated()\n {\n $acronym = isset($_SESSION['user']) ? $_SESSION['user']->acronym : null;\n\n if($acronym) \n {\n $this->IsAuthenticated = true;\n }\n else \n {\n $this->IsAuthenticated = false;\n }\n \n return $this->IsAuthenticated;\n }", "public function isLoggedIn()\r\n {\r\n if ($this->session->has('AUTH_NAME') AND $this->session->has('AUTH_EMAIL') AND $this->session->has('AUTH_CREATED') AND $this->session->has('AUTH_UPDATED')) {\r\n return true;\r\n }\r\n return false;\r\n }", "public function isAuthenticated()\n {\n return $this->hasRole(RoleInterface::ROLE_AUTHENTICATED);\n }", "public function loggedIn()\n {\n return $this->user() != null;\n }", "public static function isLoggedIn(): bool {\n return Session::instance()->has(AccessControl::SESSION_AUTH_KEY);\n }", "function isLoggedIn()\n\t{\n\t\tif ( $this->_isAuthorized() ){\t\n\t\t\treturn true;\n\t\t} else return false;\n\t\n\t}", "public function isLoggedIn()\n {\n return ($this->userInfo->userid ? true : false);\n }", "public static function isLoggedIn()\n {\n return (bool)Users::getCurrentUser();\n }", "public function isAuth(){\n\t\t$sess = Core::getSingleton(\"system/session\");\n\t\tif( $sess->has(\"account\") ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public static function checkAuth() {\n if(session(\"auth_token\", null) == null){ return false; }\n \n $apiresponse = ApiController::doRequest(\"GET\", \"/users/me\", [\"bearer\" => session(\"auth_token\")], []);\n if($apiresponse->getStatusCode() == 200) {\n $apibodystr = (string)$apiresponse->getBody();\n $apibody = \\GuzzleHttp\\json_decode($apibodystr);\n session([\"auth_user\" => new User($apibody)]);\n return true; \n }\n \n return false;\n }", "public function isAuthenticatedSuccessfully(): bool;", "function auth_check()\n\t{\n\t\t$ci =& get_instance();\n\t\treturn $ci->auth_model->is_logged_in();\n\t}", "function auth_check()\n\t{\n\t\t$ci =& get_instance();\n\t\treturn $ci->auth_model->is_logged_in();\n\t}", "function isLoggedIn(){\r\n APP::import('Component','Auth');\r\n $auth = new AuthComponent;\r\n $auth ->Session = $this->Session;\r\n $user = $auth->user();\r\n return !empty($user);\r\n \r\n }", "function authenticateUser() {\n\t\tif(!isset($_SESSION[\"authenticated\"])) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\telse{\n\t\t\t//checking session variable has info \n\t\t\tif($_SESSION[\"authenticated\"] != true){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\n\t}", "public function isLoggedIn() {\n $auth_cookie = Cookie::get(\"auth_cookie\"); //get hash from browser\n //check if cookie is valid\n if ($auth_cookie != '' && $this->cookieIsValid($auth_cookie)) {\n return true;\n } else {\n return false;\n }\n }", "function isAuthenticated(){\n return Session::has('SESSION_USER_NAME') ? true:false;\n}", "public static function isAuthenticated() \n\t{\n\t\tacPhpCas::setReporting();\n\t\treturn phpCAS::isAuthenticated();\t\t\n\t}", "public function isLoggedIn()\n {\n return true;\n }", "function is_already_authenticated()\n {\n /**\n * Checks is user already authenticated\n * If it's true, sends to main page\n */\n $session = Session::getInstance();\n $username = $session->username;\n $logged = $session->logged;\n if (self::check($username,$logged))\n {\n header(\"Location: /admin\");\n }\n }", "private function checkUserLoggedIn(): bool\n {\n $user = JFactory::getUser();\n if ($user->id > 0) {\n return true;\n } else {\n return false;\n }\n }", "public function isLoggedIn()\n {\n $loggedIn = $this->di->get(\"session\")->has(\"user\");\n if (!$loggedIn) {\n $this->di->get(\"response\")->redirect(\"user/login\");\n return false;\n }\n return true;\n }", "public function isAuth() {\n\t\tif($this->auth === null) {\n\t\t\treturn false;\n\t\t}\n\t\telse {\n\t\t\treturn true;\n\t\t}\n\t}", "static function isLoggedIn() {\n $user = self::currentUser();\n return isset($user) && $user != null;\n }", "public function is_logged_in()\n {\n return isset($this->user);\n }", "public function isUserLoggedIn()\n {\n return $this->user_is_logged_in;\n }", "public function isLoggedIn();", "public function isLoggedIn();", "public function isAuth() {}", "function user_AuthIsUser() {\n\tglobal $AUTH;\n\t\n\treturn isset($AUTH['user']) && ($AUTH['user'] !== 0);\n}", "public static function getAuth()\n {\n if( !isset($_SESSION['FOXY_userid']) ) {\n return false;\n }\n return true;\n }" ]
[ "0.84951776", "0.8449064", "0.831693", "0.8192529", "0.8145774", "0.8145774", "0.8145774", "0.8145774", "0.8121842", "0.8056788", "0.8056788", "0.8045541", "0.80297184", "0.80122435", "0.7988381", "0.7943443", "0.79418695", "0.7935825", "0.79350364", "0.79242605", "0.79196674", "0.7914821", "0.7914821", "0.7853885", "0.78450435", "0.7833947", "0.7802243", "0.7781237", "0.7768488", "0.7761218", "0.77552795", "0.77509993", "0.77455246", "0.7741929", "0.7722249", "0.77121377", "0.77095973", "0.7706498", "0.77039313", "0.77005726", "0.7699949", "0.7691459", "0.7691309", "0.7674318", "0.7673568", "0.7654392", "0.7636409", "0.76352257", "0.7629369", "0.7623199", "0.7612217", "0.76063365", "0.76043516", "0.7586538", "0.75799936", "0.75758", "0.75486153", "0.753858", "0.7533207", "0.7532825", "0.75249356", "0.75153375", "0.74988294", "0.7498549", "0.7489629", "0.7483967", "0.7478614", "0.7473721", "0.7467905", "0.746741", "0.7451676", "0.745021", "0.74405015", "0.7430887", "0.7427855", "0.7426929", "0.7424916", "0.7419324", "0.74175256", "0.7407823", "0.7394831", "0.7390548", "0.7390548", "0.73872715", "0.7376354", "0.73715264", "0.7363447", "0.7349256", "0.734498", "0.73385096", "0.7335912", "0.73352236", "0.732594", "0.7308496", "0.73078495", "0.7307198", "0.7304573", "0.7304573", "0.7304491", "0.7300249", "0.72927624" ]
0.0
-1
Log in user to the application.
public function login(Request $request) { $credentials = $request->only('email', 'password'); if (!$token = JWTAuth::attempt($credentials)) { return response()->json(['authenticated' => false], 401); } $user = Auth::user(); $roles = $user->roles->pluck('name'); $authenticated = true; return response()->json(compact('authenticated', 'token', 'user', 'roles')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function login() {\n return $this->run('login', array());\n }", "public function loginAction()\n {\n $data = $this->getRequestData();\n if ($this->getDeviceSession(false)) {\n $this->setErrorResponse('Your device is already running a session. Please logout first.');\n }\n $session = Workapp_Session::login($data['username'], $data['password']);\n if (!$session) {\n $this->setErrorResponse('No user with such username and password');\n }\n $session->registerAction($_SERVER['REMOTE_ADDR']);\n $this->_helper->json(array('session_uid' => $session->getSessionUid()));\n }", "public static function login()\n {\n (new Authenticator(request()))->login();\n }", "public function login(){\n \t\t//TODO redirect if user already logged in\n \t\t//TODO Seut up a form\n \t\t//TODO Try to log in\n \t\t//TODO Redirect\n \t\t//TODO Error message\n \t\t//TODO Set subview and load layout\n\n \t}", "public function login()\n\t{\n\t\t$mtg_login_failed = I18n::__('mtg_login_failed');\n\t\tR::selectDatabase('oxid');\n\t\t$sql = 'SELECT oxid, oxfname, oxlname FROM oxuser WHERE oxusername = ? AND oxactive = 1 AND oxpassword = MD5(CONCAT(?, UNHEX(oxpasssalt)))';\n\t\t$users = R::getAll($sql, array(\n\t\t\tFlight::request()->data->uname,\n\t\t\tFlight::request()->data->pw\n\t\t));\n\t\tR::selectDatabase('default');//before doing session stuff we have to return to db\n\t\tif ( ! empty($users) && count($users) == 1) {\n\t\t\t$_SESSION['oxuser'] = array(\n\t\t\t\t'id' => $users[0]['oxid'],\n\t\t\t\t'name' => $users[0]['oxfname'].' '.$users[0]['oxlname']\n\t\t\t);\n\t\t} else {\n\t\t\t$_SESSION['msg'] = $mtg_login_failed;\n\t\t}\n\t\t$this->redirect(Flight::request()->data->goto, true);\n\t}", "public function it_logs_in_the_user()\n {\n $user = factory(User::class)->create([\n 'password' => '123123',\n ]);\n\n $this->browse(function ($browser) use ($user) {\n $browser->visit(new Login)\n ->type('@email', $user->email)\n ->type('@password', '123123')\n ->click('@submit')\n ->assertPathIs('/app');\n });\n }", "public function login()\n {\n self::$facebook = new \\Facebook(array(\n 'appId' => $this->applicationData[0],\n 'secret' => $this->applicationData[1],\n ));\n\n $user = self::$facebook->getUser();\n if (empty($user) && empty($_GET[\"state\"])) {\n \\Cx\\Core\\Csrf\\Controller\\Csrf::header('Location: ' . self::$facebook->getLoginUrl(array('scope' => self::$permissions)));\n exit;\n }\n\n self::$userdata = $this->getUserData();\n $this->getContrexxUser($user);\n }", "public function do_login()\n {\n $this->userObject = new User();\n\n // grab the uID of the person signing in\n $uid = $this->userObject->checkUser($_POST['user_email'], $_POST['user_password']);\n\n // if the uID exists\n if ($uid) {\n\n $this->set('message', 'You logged in!');\n\n // grab the array of user-data from the database\n $user = $this->userObject->getUser($uid);\n\n // leave out the password\n unset($user['password']);\n unset($user[4]);\n\n // if (strlen($_SESSION['redirect']i) > 0) { // basically, if someone types in the url with the funciton after,\n // // supposed to redirect people to the pages they want.\n // $view = $_SESSION['redirect'];\n // unset($_SESSION['redirect']);\n // header('Location: ' . BASE_URL . $view);\n\n // make the SESSION key 'user' and set it equal to the aray of user-data\n $_SESSION['user'] = $user;\n\n header('Location: /index.php/');\n\n } else {\n\n $this->set('error', 'Sorry! Looks like something might be messed up with your Username or Password! :p');\n }\n }", "public function login() {\n\t\treturn $this->login_as( call_user_func( Browser::$user_resolver ) );\n\t}", "public function loginUser()\n {\n $request = new Request();\n\n $email = $request->input('email');\n $password = $request->input('password');\n\n // Check email\n if (!$email) {\n $this->showLoginForm(['Please enter email']);\n }\n // Check password\n if (!$password) {\n $this->showLoginForm(['Please enter password']);\n }\n\n // Check user exist and then password\n $user = $this->getUser($email);\n $password = md5($password);\n if (!$user || $password !== $user['password']) {\n $this->showLoginForm(['Error on login']);\n }\n\n // Save login details to cookies\n if (!defined('APP_USERS_COOKIES_EMAIL')\n || !defined('APP_USERS_COOKIES_PASSWORD')) {\n $this->showLoginForm(['Error on login']);\n }\n setcookie(APP_USERS_COOKIES_EMAIL, $email);\n setcookie(APP_USERS_COOKIES_PASSWORD, $password);\n\n // Redirect to endpoint\n header(\"Location: \" . self::ENDPOINTS['success_login']);\n }", "public function signInAction()\n {\n $userData = $this->manager->findOneBy(['username' => $this->httpParameters['login']]);\n\n //If no user were found, redirects\n if(empty($userData))\n {\n $this->response->redirect('/auth',HttpResponse::WRONG_LOGIN);\n }\n\n //Instantiates the user\n $user = new User($userData);\n\n //Checks if typed password matches user's password\n if($this->passwordMatch($this->httpParameters['loginPassword'],$user,'/auth'))\n {\n //Sets the user instance as a the new $_SESSION['user']\n $_SESSION['user'] = $user;\n\n $this->response->redirect('/admin');\n }\n }", "public function login() {\r\n\r\n // signal any observers that the user has logged in\r\n $this->setState(\"login\");\r\n }", "public function login()\n {\n if(is_logged_in()) {\n redirect_to(url('thread/index'));\n }\n\n $user = new User;\n $page = Param::get('page_next', 'login');\n\n switch($page) {\n case 'login':\n break;\n\n case 'lobby':\n $user->username = Param::get('username');\n $user->password = Param::get('password');\n\n try {\n $user = $user->verify();\n $_SESSION['id'] = $user['id'];\n } catch (UserNotFoundException $e) {\n $page = 'login';\n }\n break;\n\n default:\n throw new UserNotFoundException(\"User not found\");\n }\n\n $this->set(get_defined_vars());\n $this->render($page);\n }", "protected function login()\n {\n $this->send(Response::nick($this->config['nick']));\n $this->send(Response::user(\n $this->config['nick'],\n $this->config['hostname'],\n $this->config['servername'],\n $this->config['realname']\n ));\n }", "public function login();", "public function login();", "public function login(){\n\t\t\t$this->modelLogin();\n\t\t}", "public function loginAction()\n {\n // get the view vars\n $errors = $this->view->errors;\n $site = $this->view->site;\n $loginUser = $this->view->loginUser;\n\n if ( $loginUser ) {\n $homeUrl = $site->getUrl( 'home' );\n return $this->_redirect( $homeUrl );\n }\n\n // set the input params\n $this->processInput( null, null, $errors );\n\n // check if there were any errors\n if ( $errors->hasErrors() ) {\n return $this->renderPage( 'errors' );\n }\n\n return $this->renderPage( 'authLogin' );\n }", "public function login()\n {\n if ($this->getCurrentUser()->get('id')) {\n $this->redirect($this->Auth->redirectUrl());\n }\n\n if ($user = $this->Auth->identify()) {\n $this->Auth->setUser($user);\n\n // set cookie\n if (!empty($this->getRequest()->getData('remember_me'))) {\n if ($CookieAuth = $this->Auth->getAuthenticate('Lil.Cookie')) {\n $CookieAuth->createCookie($this->getRequest()->getData());\n }\n }\n } else {\n if ($this->getRequest()->is('post') || env('PHP_AUTH_USER')) {\n $this->Flash->error(__d('lil', 'Invalid username or password, try again'));\n }\n }\n\n if ($this->getCurrentUser()->get('id')) {\n $redirect = $this->Auth->redirectUrl();\n $event = new Event('Lil.Auth.afterLogin', $this->Auth, [$redirect]);\n $this->getEventManager()->dispatch($event);\n\n return $this->redirect($redirect);\n }\n }", "public function actionLoginAsUser()\n {\n \t$user = UserAdmin::findOne(Yii::$app->request->get('id'));\n \tif ($user && Yii::$app->getRequest()->isPost)\n \t{\n \t\tYii::$app->user->login(UserAdminIdentity::findIdentity($user->id));\n \t\treturn $this->redirect([\"/admin/index/index\"]);\n \t}\n \t\n \t$this->layout = '@app/layouts/layout-popup-sm';\n \treturn $this->render('login-as-user', ['model' => $user]);\n }", "private function login(){\n \n }", "public function actionLogin() {\n\t\tif (Yii::app()->user->isGuest) {\n\t\t\t$userLogin = new UserLogin;\n\t\t\t$this->performAjaxValidation($userLogin, 'login-user-form');\n\t\t\t// collect user input data\n\t\t\tif (isset($_POST['UserLogin'])) {\n\t\t\t\t$userLogin->attributes = $_POST['UserLogin'];\n\t\t\t\t// validate that the username and password are valid\n\t\t\t\tif ($userLogin->login()) {\n\t\t\t\t\t$this->redirect(Yii::app()->user->returnUrl);\n\t\t\t\t}else{\n\t\t\t\t\t// check domain\n\t\t\t\t\tif($userLogin->isValidButWrongDomain()){\n\t\t\t\t\t\t$this->transferToDomain($userLogin->getUserIdentity());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// display the login form\n\t\t\t$this->render('login', array('model' => $userLogin));\n\t\t} else {\n\t\t\t$this->redirect(Yii::app()->user->returnUrl);\n\t\t}\n\t}", "public function login()\n {\n\t\t$login = Input::get('login');\n\t\t$password = Input::get('password');\n\t\ttry{\n\t\t\n\t\t\t$user = Auth::authenticate([\n\t\t\t\t'login' => $login,\n\t\t\t\t'password' => $password\n\t\t\t]);\n\t\t\t$this->setToken($user);\n\t\t\treturn $this->sendResponse('You are now logged in');\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\treturn $this->sendResponse($e->getMessage());\n\t\t}\n }", "public static function LogIn ($userName = '', $password = '');", "public function dologinpage()\n\t\t{\n\t\t\t$userdata = array(\n\t\t\t\t'email' => Input::get('email'),\n\t\t\t\t'password' => Input::get('password')\n\t\t\t);\n\n\t\t\tif(Auth::attempt($userdata)) {\n\t\t\t\tSession::flash('successMessage', \"Welcome back, \" . Auth::user()->username . \"!\");\n\t\t\t\tSession::put('loggedinuser', Auth::user()->username);\n\t\t\t\treturn Redirect::intended('/posts');\n\t\t\t\t// $userid = DB::table('users')->where('username', Session::get('loggedinuser'))->pluck('id');\n\t\t\t\t// Session::put('loggedinid', $userid);\n\t\t\t\t\n\t\t\t\t// return Redirect::action('PostsController@index');\n\t\t\t} else {\n\t\t\t\tSession::flash('errorMessage', 'Your username or password is incorrect');\n\t\t\t\treturn Redirect::to('login');\n\t\t\t}\n\t\t}", "public function loginUser() {\n self::$isLoggedIn = true;\n $this->session->setLoginSession(self::$storedUserId, self::$isLoggedIn);\n $this->session->setFlashMessage(1);\n }", "public function login()\n {\n return Yii::$app->user->login($this);\n }", "public function login() {\r\n\t\t\r\n\t\t$back = $this->hybrid->get_back_url();\r\n\t\t$user_profile = $this->hybrid->auth();\r\n\t\t\r\n\t\t$email = $user_profile->emailVerified;\r\n\t\tif(!$email)\r\n\t\t\t$email = $user_profile->email;\r\n\t\t\r\n\t\tif(!$email)\r\n\t\t\t$this->hybrid->throw_error($this->ts(\"You don't have any email address associated with this account\"));\r\n\t\t\r\n\t\t/* check if user exists */\r\n\t\t$user = current($this->a_session->user->get(array(\"email\" => $email)));\r\n\t\tif(!$user) {\r\n\t\t\t/* create user */\r\n\t\t\t$uid = $this->hybrid->add_user($email, $user_profile);\r\n\t\t\t$user = current($this->a_session->user->get(array(\"id\" => $uid)));\r\n\t\t\t\r\n\t\t\tif(!$user)\r\n\t\t\t\t$this->wf->display_error(500, $this->ts(\"Error creating your account\"), true);\r\n\t\t}\r\n\t\t\r\n\t\t/* login user */\r\n\t\t$sessid = $this->hybrid->generate_session_id();\r\n\t\t$update = array(\r\n\t\t\t\"session_id\" => $sessid,\r\n\t\t\t\"session_time\" => time(),\r\n\t\t\t\"session_time_auth\" => time()\r\n\t\t);\r\n\t\t$this->a_session->user->modify($update, (int)$user[\"id\"]);\r\n\t\t$this->a_session->setcookie(\r\n\t\t\t$this->a_session->session_var,\r\n\t\t\t$sessid,\r\n\t\t\ttime() + $this->a_session->session_timeout\r\n\t\t);\r\n\t\t\r\n\t\t/* save hybridauth session */\r\n\t\t$this->a_session->check_session();\r\n\t\t$this->hybrid->save();\r\n\t\t\r\n\t\t/* redirect */\r\n\t\t$redirect_url = $this->wf->linker('/');\r\n\t\tif(isset($uid))\r\n\t\t\t$redirect_url = $this->wf->linker('/account/secure');\r\n\t\t$redirect_url = $back ? $back : $redirect_url;\r\n\t\t$this->wf->redirector($redirect_url);\r\n\t}", "public function actionLogin()\n {\n $this->layout = '/login';\n $manager = new Manager(['userId' => UsniAdaptor::app()->user->getId()]);\n $userFormDTO = new UserFormDTO();\n $model = new LoginForm();\n $postData = UsniAdaptor::app()->request->post();\n $userFormDTO->setPostData($postData);\n $userFormDTO->setModel($model);\n if (UsniAdaptor::app()->user->isGuest)\n {\n $manager->processLogin($userFormDTO);\n if($userFormDTO->getIsTransactionSuccess())\n {\n return $this->goBack();\n }\n }\n else\n {\n return $this->redirect($this->resolveDefaultAfterLoginUrl());\n }\n return $this->render($this->loginView,['userFormDTO' => $userFormDTO]);\n }", "public function login()\n\t{\n\t\t//Compute the hash code of the password submited by user\n\t\t$user_password_hash = $this->passwordEncrypt($this->user_info['user_password']);\n\t\t\n\t\t//Do datebase query to get the hash code of the password\n\t\t$db = BFL_Database :: getInstance();\n\t\t$stmt = $db->factory('select `user_id`,`user_password` from '.DB_TABLE_USER.' WHERE `user_name` = :user_name');\n\t\t$stmt->bindParam(':user_name', $this->user_info['user_name']);\n\t\t$stmt->execute();\n\t\t$rs = $stmt->fetch();\n\t\tif (empty($rs))\n\t\t\tthrow new MDL_Exception_User_Passport('user_name');\n\t\t\n\t\tif ($rs['user_password'] != $user_password_hash)\n\t\t\tthrow new MDL_Exception_User_Passport('user_password');\n\n\t\t//Set user session\n\t\t$auth = BFL_ACL :: getInstance();\n\t\t$auth->setUserID($rs['user_id']);\n\t}", "public function actionLogin()\n {\n // user is logged in, he doesn't need to login\n if (!Yii::$app->user->isGuest) {\n return $this->goHome();\n }\n\n // get setting value for 'Login With Email'\n $lwe = Yii::$app->params['lwe'];\n\n // if 'lwe' value is 'true' we instantiate LoginForm in 'lwe' scenario\n $model = $lwe ? new LoginForm(['scenario' => 'lwe']) : new LoginForm();\n\n // monitor login status\n $successfulLogin = true;\n\n // posting data or login has failed\n if (!$model->load(Yii::$app->request->post()) || !$model->login()) {\n $successfulLogin = false;\n }\n\n // if user's account is not activated, he will have to activate it first\n if ($model->status === User::STATUS_INACTIVE && $successfulLogin === false) {\n Yii::$app->session->setFlash('error', Yii::t('app', \n 'You have to activate your account first. Please check your email.'));\n return $this->refresh();\n } \n\n // if user is not denied because he is not active, then his credentials are not good\n if ($successfulLogin === false) {\n return $this->render('login', ['model' => $model]);\n }\n\n // login was successful, let user go wherever he previously wanted\n return $this->goBack();\n }", "public function Login()\n\t{\n\t\t$this->user->email = $_POST['email'];\n\t\t$this->user->password = $_POST['password'];\n // Here we verify the nonce, so that only users can try to log in\n\t\t// to whom we've actually shown a login page. The first parameter\n\t\t// of Nonce::Verify needs to correspond to the parameter that we\n\t\t// used to create the nonce, but otherwise it can be anything\n\t\t// as long as they match.\n\t\tif (isset($_POST['nonce']) && ulNonce::Verify('login', $_POST['nonce'])){\n\t\t\t// We store it in the session if the user wants to be remembered. This is because\n\t\t\t// some auth backends redirect the user and we will need it after the user\n\t\t\t// arrives back.\n\t\t\t//echo \"login successful\";\n\t\t\t\n\t\t\t///echo $this->input->post('email');\n\n\t\t\tif (isset($_POST['autologin']))\n\t\t\t\t$_SESSION['appRememberMeRequested'] = true;\n\t\t\telse\n\t\t\t\tunset($_SESSION['appRememberMeRequested']);\n \n\t\t\t// This is the line where we actually try to authenticate against some kind\n\t\t\t// of user database. Note that depending on the auth backend, this function might\n\t\t\t// redirect the user to a different page, in which case it does not return.\n\t\t\t$this->ulogin->Authenticate($_POST['email'], $_POST['password']);\n\t\t\tif ($this->ulogin->IsAuthSuccess()){\n\t\t\t\t$_SESSION[\"loggedIn\"] = true;\n\t\t\t\techo \"success\";\n\t\t\t}else echo \"failed\";\n\t\t}else echo 'refresh';\n\t\t//$this->load->view('layout/home.php');\n\t}", "public function login(){\n\n\t\t$this->Login_model->login();\t\n\n\t\n\n\t}", "public function login() {\n\t\tif(!empty(Session::get('http_response'))) {\n\t\t\thttp_response_code(Session::get('http_response'));\n\t\t\tSession::delete('http_response');\n\t\t}\n\t\tif($_POST && isset($_POST['login']) && isset($_POST['password'])) {\n\t\t\t$user = $this->_model->getLogin(strtolower($_POST['login']));\n\t\t\tif($user && $user->enabled) {\n\t\t\t\tif(hash_equals($user->password,crypt($_POST['password'],$user->password))) {\n\t\t\t\t\tif($user->blocked) {\n\t\t\t\t\t\thttp_response_code(403);\n\t\t\t\t\t\tSession::setMessage(array('alert'=>'warning','icon'=>'exclamation','text'=>\"User is blocked\"));\n\t\t\t\t\t} elseif($user->verified) {\n\t\t\t\t\t\tSession::set('user',$user);\n\t\t\t\t\t\tSession::setMessage(array('alert'=>'success','icon'=>'check','text'=>\"User has logged in successfully\"));\n\t\t\t\t\t\t$redirect = Session::get('login_redirect');\n\t\t\t\t\t\tRouter::redirect(Session::get('login_redirect'));\n\t\t\t\t\t} else {\n\t\t\t\t\t\thttp_response_code(401);\n\t\t\t\t\t\tSession::setMessage(array('alert'=>'warning','icon'=>'exclamation','text'=>\"User is not yet confirmed\"));\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\thttp_response_code(401);\n\t\t\t\t\tSession::setMessage(array('alert'=>'danger','icon'=>'ban','text'=>\"Invalid login name or password\"));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thttp_response_code(401);\n\t\t\t\tSession::setMessage(array('alert'=>'danger','icon'=>'ban','text'=>\"Invalid login name or password\"));\n\t\t\t}\t\n\t\t}\n\t}", "public function loginAction()\r\n\t{\r\n\t\t$this->setSubTitle($this->loginSubTitle);\r\n\t\t\r\n\t\t$this->view->form = new $this->loginFormClassName();\r\n\t\t\r\n\t\t$this->checkAuth();\r\n\t}", "public function doLogin()\n\t{\n $userData = array(\n 'username' => \\Input::get('username'),\n 'password' => \\Input::get('password'),\n );\n\t\t\n\t\t$rememberMe = \\Input::get('remember-me');\n\t\t\n // Declare the rules for the form validation.\n $rules = array(\n 'username' => 'Required',\n 'password' => 'Required'\n );\n\n // Validate the inputs.\n $validator = \\Validator::make($userData, $rules);\n\n // Check if the form validates with success.\n if ($validator->passes())\n {\n // Try to log the user in.\n if (\\Auth::attempt($userData, (bool)$rememberMe))\n {\n // Redirect to dashboard\n\t\t\t\treturn \\Redirect::intended(route('dashboard'));\n }\n else\n {\n // Redirect to the login page.\n return \\Redirect::route('login')->withErrors(array('password' => \\Lang::get('site.password-incorrect')))->withInput(\\Input::except('password'));\n }\n }\n\n // Something went wrong.\n return \\Redirect::route('login')->withErrors($validator)->withInput(\\Input::except('password'));\n\t}", "public function login() {\r\n if (!empty($_POST)) {\r\n $username = filter_input(INPUT_POST, 'username', FILTER_SANITIZE_STRING);\r\n $password = filter_input(INPUT_POST, 'password', FILTER_SANITIZE_STRING);\r\n\r\n $hash = hash('sha512', $password . Configuration::USER_SALT);\r\n unset($password);\r\n\r\n $user = UserModel::getByUsernameAndPasswordHash($username, $hash);\r\n unset($hash);\r\n\r\n if ($user) {\r\n Session::set('user_id', $user->user_id);\r\n Session::set('username', $username);\r\n Session::set('ip', filter_input(INPUT_SERVER, 'REMOTE_ADDR'));\r\n Session::set('ua', filter_input(INPUT_SERVER, 'HTTP_USER_AGENT', FILTER_SANITIZE_STRING));\r\n\r\n Misc::redirect('');\r\n } else {\r\n $this->set('message', 'Nisu dobri login parametri.');\r\n sleep(1);\r\n }\r\n }\r\n }", "public function login() {\n if (isset($_SESSION['userid'])) {\n $this->redirect('?v=project&a=show');\n } else {\n $this->view->login();\n }\n }", "public function authentication(): void\n {\n $userData = $this->getValidated([\n 'name',\n 'password',\n ]);\n\n $user = $this->getUserByName($userData['name']);\n\n if (password_verify($userData['password'], $user->password)) {\n NotificationService::sendInfo('Hello! You are logged in as ' . $user->name);\n $_SESSION['name'] = $user->name;\n $this->redirect(APP_URL);\n }\n\n NotificationService::sendError('failed authentication!');\n $_SESSION['login_modal_show'] = ' show';\n $this->redirect(APP_URL);\n }", "function login() {\n\t\t$this->getModule('Laravel4')->seeCurrentUrlEquals('/libraries/login');\n\t\t$this->getModule('Laravel4')->fillField('Bibliotek', 'Eksempelbiblioteket');\n\t\t$this->getModule('Laravel4')->fillField('Passord', 'admin');\n\t\t$this->getModule('Laravel4')->click('Logg inn');\n }", "public function loginAction() : object\n {\n $title = \"Logga in\";\n\n // Deal with incoming variables\n $user = getPost('user');\n $pass = getPost('pass');\n $pass = MD5($pass);\n\n if (hasKeyPost(\"login\")) {\n $sql = loginCheck();\n $res = $this->app->db->executeFetchAll($sql, [$user, $pass]);\n if ($res != null) {\n $this->app->session->set('user', $user);\n return $this->app->response->redirect(\"content\");\n }\n }\n\n // Add and render page to login\n $this->app->page->add(\"content/login\");\n return $this->app->page->render([\"title\" => $title,]);\n }", "public function login (){\n\t\t$user = $this->get_by(array(\n\t\t\t'email' => $this->input->post('email'),\n\t\t\t'password' => $this->hash($this->input->post('password')),\n\t\t\t), TRUE);\n\t\t\n\t\tif (count($user)) {\n\t\t\t// Log in user\n\t\t\t$data = array(\n\t\t\t\t'username' => $user->username,\n\t\t\t\t'email' => $user->email,\n\t\t\t\t'id' => $user->id,\n\t\t\t\t'loggedin' => TRUE,\n\t\t\t);\n\t\t\t$this->session->set_userdata($data);\n\t\t}\n\t\t}", "public function login()\n {\n //die if application login is requested outside of authorised domains\n $domain = str_replace(['http://', 'https://'], \"\", Router::fullBaseUrl());\n $isAllowed = $this->Settings->isDomainWhitelisted($domain);\n if (!$isAllowed) {\n $this->response = $this->response->withType('text/plain');\n $this->response = $this->response->withStringBody('Not Allowed!');\n return $this->response;\n }\n\n if (Cache::read('first_run', 'quick_burn') === true) {\n return $this->redirect(['controller' => 'installers', 'action' => 'configure']);\n }\n\n $dbDriver = ($this->Users->getConnection())->getDriver();\n if ($dbDriver instanceof Sqlite) {\n $caseSensitive = true;\n } else {\n $caseSensitive = false;\n }\n $this->set('caseSensitive', $caseSensitive);\n\n $this->viewBuilder()->setLayout('login');\n\n //see if they are already logged in\n if ($this->Auth->user()) {\n return $this->redirect($this->Auth->redirectUrl());\n }\n\n $user = $this->Users->newEntity();\n\n if ($this->request->is('post')) {\n\n //allow switching between email and username for authentication\n if (Validation::email($this->request->getData('username'))) {\n $this->Auth->setConfig('authenticate', [\n 'Form' => [\n 'fields' => ['username' => 'email', 'password' => 'password']\n ]\n ]);\n $this->Auth->constructAuthenticate();\n } else {\n $this->Auth->setConfig('authenticate', [\n 'Form' => [\n 'fields' => ['username' => 'username', 'password' => 'password']\n ]\n ]);\n $this->Auth->constructAuthenticate();\n }\n\n $userDetails = $this->Auth->identify();\n\n //check if need to reset password\n if ($userDetails) {\n if ($this->Users->isPasswordExpired($userDetails)) {\n $this->Flash->warning(__('Your password has expired, please enter a new password.'));\n $options = [\n 'expiration' => new FrozenTime('+ 1 hour'),\n 'user_link' => $userDetails['id'],\n ];\n $autoLoginToken = $this->Seeds->createSeedReturnToken($options);\n\n $options = [\n 'url' => ['controller' => 'users', 'action' => 'reset', '{token}', $autoLoginToken],\n 'expiration' => new FrozenTime('+ 1 hour'),\n 'user_link' => $userDetails['id'],\n ];\n $token = $this->Seeds->createSeedReturnToken($options);\n\n return $this->redirect(['controller' => 'users', 'action' => 'reset', $token, $autoLoginToken]);\n }\n }\n\n //login process\n if ($userDetails) {\n $accountStatus = $this->Users->validateAccountStatus($userDetails);\n if ($accountStatus) {\n $this->Auth->setUser($userDetails);\n $this->Auditor->trackLogin($userDetails);\n return $this->redirect($this->Auth->redirectUrl());\n } else {\n $messages = $this->Users->getAuthError();\n foreach ($messages as $message) {\n $this->Flash->error($message);\n }\n }\n } else {\n $this->Flash->error(__('Invalid username or password, try again.'));\n }\n }\n\n $this->set(compact('user'));\n $this->set('_serialize', ['user']);\n\n return null;\n }", "public function actionLogin()\n {\n if (!Yii::$app->user->isGuest) {\n return $this->goHome();\n }\n\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login()) {\n $user = User::find()->where(['id' => Yii::$app->user->id])->one();\n return $this->goBack();\n } else {\n $model->password = '';\n\n return $this->render('login', [\n 'model' => $model,\n ]);\n }\n }", "public function login()\n {\n //$this->username = $username; // we are gonnna use the above property: $username here\n //$this->password = $password;\n // we want to call authuser from within login so\n $this->auth_user(); // we don't need to pass any arguments here because we know the class properties above this line\n\n }", "public function login() {\n $this->FormHandler->setRequired('employeeCode');\n $this->FormHandler->setRequired('employeePassword');\n\n\n if ($this->FormHandler->run() === true) {\n $employeeCode = $this->FormHandler->getPostValue('employeeCode');\n $employePassword = $this->FormHandler->getPostValue('employeePassword');\n if ($this->User->checkLoginCredentials($employeeCode, $employePassword) === true) {\n // Log them in and redirect\n $this->User->loginClient($_SESSION, $employeeCode);\n redirect('employee/dashboard');\n }\n }\n else if ($this->User->checkIfClientIsLoggedIn($_SESSION) === true) {\n redirect('employee/dashboard');\n }\n\n loadHeader();\n include APP_PATH . '/view/user/login.php';\n loadFooter();\n }", "protected function login( )\r\n {\r\n $this->sendData( 'USER', $this->_nick, $this->_nick . ' ' . $this->_user . ' : ' . $this->_realName );\r\n \r\n $this->sendData( 'NICK', $this->_nick );\r\n \r\n $this->_loggedOn = true;\r\n }", "public function login(){\n\t\t$this->user = $this->user->checkCredentials();\n\t\t$this->user = array_pop($this->user);\n\t\tif($this->user) {\n\t\t\t$_SESSION['id'] = $this->user['id'];\n\t\t\t$_SESSION['name'] = $this->user['name'];\n\t\t\t$_SESSION['admin'] = $this->user['admin'];\n\t\t\t$this->isAdmin();\n\t \t\theader('location: ../view/home.php');\n\t \t\texit;\n\t \t}\n\t\t$dados = array('msg' => 'Usuário ou senha incorreto!', 'type' => parent::$error);\n\t\t$_SESSION['data'] = $dados;\n\t\theader('location: ../view/login.php');\n \t\texit;\n\t}", "public function actionLogin() {\n\t\t// If user is already logged in, go to \"todos\" page\n\t\tif( Yii::app()->user->isGuest===false )\n\t\t\t$this->redirect(array('todo/index'));\n\t\t\n\t\t$loginModel = new LoginForm();\n\t\t$registerModel = new RegisterForm();\n\t\t\n\t\t// Check if login data is present & login if so\n\t\tif( isset($_POST['LoginForm'])===true ) {\n\t\t\t// Populate login model with post data.\n\t\t\t$loginModel->attributes = $_POST['LoginForm'];\n\t\t\t\n\t\t\t// validate user input and redirect to the todo page\n\t\t\tif( $loginModel->validate()===true && $this->login($_POST['LoginForm'])===true )\n\t\t\t\t$this->redirect(array('todo/index'));\n\t\t}\n\t\t\n\t\t// Check if register data is present & register a new user if so.\n\t\tif( isset($_POST['RegisterForm'])===true ) {\n\t\t\t// Populate register model with post data.\n\t\t\t$registerModel->attributes = $_POST['RegisterForm'];\n\t\t\t\n\t\t\t// Validate the model & create a new user if the validation was ok.\n\t\t\tif( $registerModel->validate()===true ) {\n\t\t\t\t$user = new User();\n\t\t\t\t// User can be populated with the register form's post data since the\n\t\t\t\t// attribute names match together.\n\t\t\t\t$user->attributes = $_POST['RegisterForm'];\n\t\t\t\t\n\t\t\t\t// Save the user & login. Then redirect to the \"todos\" page.\n\t\t\t\tif( $user->save()===true && $this->login($_POST['RegisterForm'])===true )\n\t\t\t\t\t$this->redirect(array('todo/index'));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Render the login page.\n\t\t$this->render('login', array(\n\t\t\t'loginModel'=>$loginModel,\n\t\t\t'registerModel'=>$registerModel,\n\t\t));\n\t}", "public function login() {\n $userName = Request::post('user_name');\n $userPassword = Request::post('user_password');\n if (isset($userName) && isset($userPassword)) {\n // perform the login method, put result (true or false) into $login_successful\n $login_successful = LoginModel::login($userName, $userPassword);\n\n // check login status: if true, then redirect user login/showProfile, if false, then to login form again\n if ($login_successful) {\n //if the user successfully logs in, reset the count\n $userID = Session::get('user_id');\n LoginModel::validLogin($userID);\n Redirect::to('login/loginHome');\n } else {\n Redirect::to('login/index');\n }\n }\n }", "function login() {\n\t $login_parameters = array(\n\t\t \"user_auth\" => array(\n\t\t \"user_name\" => $this->username,\n\t\t \"password\" => $this->hash,\n\t\t \"version\" => \"1\"\n\t\t ),\n\t\t \"application_name\" => \"mCasePortal\",\n\t\t \"name_value_list\" => array(),\n\t );\n\n\t $login_result = $this->call(\"login\", $login_parameters);\n\t $this->session = $login_result->id;\n\t return $login_result->id;\n\t}", "public function p_login() {\n\n\t\t# Sanitize the user entered data to prevent any funny-business (re: SQL Injection Attacks)\n\t\t$_POST = DB::instance(DB_NAME)->sanitize($_POST);\n\n\t\t# Hash submitted password so we can compare it against one in the db\n\t\t$_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\n\t\t# Search the db for this email and password\n\t\t# Retrieve the token if it's available\n\t\t$q = \"SELECT token \n\t\t\tFROM users \n\t\t\tWHERE email = '\".$_POST['email'].\"' \n\t\t\tAND password = '\".$_POST['password'].\"'\";\n\n\t\t$token = DB::instance(DB_NAME)->select_field($q);\n\n\t\t# If we didn't find a matching token in the database, it means login failed\n\t\tif(!$token) {\n\n\t\t\t# Send them back to the login page\n\t\t\tRouter::redirect(\"/users/login/error\");\n\n\t\t# But if we did, login succeeded! \n\t\t} else {\n\t\t\tsetcookie(\"token\", $token, strtotime('+1 year'), '/');\n\t\t\t# Send them to the main page - or whever you want them to go\n\t\t\tRouter::redirect(\"/\");\n\t\t}\n\t}", "private function _logUserIn($inputs)\n\t{\n\t\tCraft::log('Logging in user.');\n\n\t\tif (craft()->userSession->login($inputs['username'], $inputs['password']))\n\t\t{\n\t\t\tCraft::log('User logged in successfully.');\n\t\t}\n\t\telse\n\t\t{\n\t\t\tCraft::log('Could not log the user in.', LogLevel::Warning);\n\t\t}\n\t}", "public function actionLogin() {\n $model = new LoginForm;\n // collect user input data\n if (Yii::app()->user->isGuest) {\n if ($this->getPost('LoginForm') != null) {\n $model->setAttributes($this->getPost('LoginForm'));\n // validate user input and redirect to the previous page if valid\n $validate = $model->validate();\n $login = $model->login();\n if ($validate && $login) {\n if (Yii::app()->session['Rol'] == \"Cliente\") {\n if (Yii::app()->session['Usuario']->Activo == 1)\n $this->redirect(Yii::app()->user->returnUrl);\n else\n $this->redirect('Logout');\n }else {\n $this->redirect(Yii::app()->user->returnUrl);\n }\n }\n }\n // display the login form\n $this->render('login', array('model' => $model));\n } else {\n $this->redirect(Yii::app()->homeUrl);\n }\n }", "public function login()\n {\n }", "public function login()\n {\n }", "public function login() {\r\n $this->response->disableCache();\r\n\r\n if ($this->Session->read('User.user_id')) {\r\n $this->redirect('/');\r\n exit;\r\n }\r\n if ($this->request->is('post')) {\r\n if ($this->People->validates()) {\r\n $userAllData = $this->People->getLoginPeopleData($this->request->data['People']['mobile_number'], $this->request->data['People']['password']);\r\n\r\n if ($this->Auth->login($userAllData['People'])) {\r\n $cookie['email'] = $userAllData['People']['mobile_number'];\r\n //$cookie['password'] = $userAllData['User']['password'];\r\n $this->setCakeSession($userAllData);\r\n $this->Cookie->write('Auth.User', $cookie, true, '+2 weeks');\r\n $this->redirect($this->Auth->redirect('/family/details/' . $userAllData['People']['group_id']));\r\n }\r\n $this->Session->setFlash(__('Invalid username or password, try again'), 'default', array(), 'authlogin');\r\n }\r\n }\r\n }", "public function login(){\n \n $this->data[\"title_tag\"]=\"Lobster | Accounts | Login\";\n \n $this->view(\"accounts/login\",$this->data);\n }", "public function login()\n\t{\n\t\tredirect($this->config->item('bizz_url_ui'));\n\t\t// show_404();\n\t\t// ////import helpers and models\n\n\t\t// ////get data from database\n\n\t\t// //set page info\n\t\t// $pageInfo['pageName'] = strtolower(__FUNCTION__);\n\n\t\t// ////sort\n\t\t\n\t\t// //render\n\t\t// $this->_render($pageInfo);\n\t}", "public function login()\n {\n $authorized = $this->authorize( $_POST );\n if( !empty( $authorized ) && $authorized !== false ){\n $this->register_login_datetime( $authorized );\n ( new Events() )->trigger( 1, true );\n } else {\n ( new Events() )->trigger( 2, true );\n }\n }", "public function usersLogin() {\n // login uses its own handle\n $httpLogin = $this->_prepareLoginRequest();\n $url = $this->_appendApiKey($this->uriBase . '/users/login.json');\n $data = array('login' => $this->username, 'password' => $this->password);\n return $this->_processRequest($httpLogin, $url, 'post', $data);\n }", "static function logIn($user) {\n if (isset($user)) {\n session_start();\n $_SESSION['userId'] = $user->id;\n }\n }", "public function loginAction() {\n $user_session = new Container('user');\n $user_session->username = 'Andy0708';\n \n return $this->redirect()->toRoute('welcome');\n }", "public function login(){\n\n }", "public function login(){\n\t\t// if already logged-in then redirect to index\n\t\tif($this->Session->check('Auth.User')){\n\t\t\t$this->redirect(array('action'=>'index'));\n\t\t}\n\n\t\t// if we got a post information, try to authenticate\n\t\tif($this->request->is('post')){\n\t\t\t// do login\n\t\t\tif($this->Auth->login()){\n\t\t\t\t// login successful\n\t\t\t\t$this->Session->setFlash(__('Welcome, ' . $this->Auth->user('username')));\n\t\t\t\t$this->redirect($this->Auth->redirectUrl());\n\t\t\t} else {\n\t\t\t\t// login fail\n\t\t\t\t$this->Session->setFlash(__('Invalid username and password'));\n\t\t\t}\n\t\t}\n\t}", "public function Login(AuthUser $user) \n {\n $_SESSION[\"valid_login\"] = true;\n $_SESSION[\"user_id\"] = $user->id;\n }", "private function formLogin(){\n\t\tView::show(\"user/login\");\n\t}", "public function doLogin()\r\n {\r\n $input = Request::all();\r\n \r\n if (Auth::attempt(['username' => $input['email'], 'password' => $input['password'], 'deleted_at' => null, 'user_type' => 1]))\r\n {\r\n \r\n $user = Auth::user();\r\n Session::set('current_user_id',$user->id);\r\n return Redirect::intended('/dashboard');\r\n }\r\n else { \r\n Session::flash(\r\n 'systemMessages', ['error' => Lang::get('pages.login.errors.wrong_credentials')]\r\n );\r\n return Redirect::action('UserController@login')\r\n ->withInput(Request::except('password'));\r\n }\r\n }", "public function login()\n\t{\n\t\tif($this->_identity===null)\n\t\t{\n\t\t\t$this->_identity=new UserIdentity($this->phone,$this->password);\n\t\t\t$this->_identity->authenticate();\n\t\t}\n\t\tif($this->_identity->errorCode===UserIdentity::ERROR_NONE)\n\t\t{\n $duration = 3600*24*30;\n\t\t\tYii::app()->user->login($this->_identity,$duration);\n\t\t\treturn true;\n\t\t}\n\t\t\t\n return false;\n\t}", "public function login()\n {\n if ($this->UserManager_model->verifUser($_POST['user_id'], $_POST['user_password'])) {\n\n $arrUser = $this->UserManager_model->getUserByIdentifier($_POST['user_id']);\n $data = array();\n $objUser = new UserClass_model;\n $objUser->hydrate($arrUser);\n $data['objUser'] = $objUser;\n\n $user = array(\n 'user_id' => $objUser->getId(),\n 'user_pseudo' => $objUser->getPseudo(),\n 'user_img' => $objUser->getImg(),\n 'user_role' => $objUser->getRole(),\n );\n\n $this->session->set_userdata($user);\n redirect('/');\n } else {\n $this->signin(true);\n }\n }", "public function login()\n {\n require_once(app_path().'/config/id.php');\n\n // if user is already logged in, redirect to current page\n if (Session::has('user'))\n {\n try {\n return Redirect::back();\n }\n catch (Exception $e) {\n return Redirect::to('/');\n }\n }\n\n // else redirect user to CS50 ID\n else\n {\n //store url in session\n Session::put('redirect', URL::previous());\n\n return Redirect::to(CS50::getLoginUrl(TRUST_ROOT, RETURN_TO));\n }\n }", "public function index() {\n $this->login();\n }", "public function testApplicationLogin()\n {\n $this->visit('/login')\n ->type($this->user->email, 'email')\n ->type('password', 'password')\n ->press('submit')\n ->seeIsAuthenticatedAs($this->user)\n ->seePageIs('/admin/post');\n }", "public function login() {\n\t\t/* if($this->Session->check('Auth.User')){\n\t\t\t$this->redirect(array('action' => 'home'));\t\n\t\t\t\t\t\n\t\t} */\n\t\t\n\t\t// if we get the post information, try to authenticate\n\t\tif ($this->request->is('post')) {\n\t\t\tif ($this->Auth->login()) {\n\t\t\t\t$this->Session->setFlash(__('Welcome, '. $this->Auth->user('username')));\n\t\t\t\t//$this->redirect($this->Auth->redirectUrl());\n\t\t\t\t$this->User->id = $this->Auth->user('id'); // target correct record\n\t\t\t\t$this->User->saveField('last_login_time', date(DATE_ATOM)); // save login time\n\t\t\t\t\n\t\t\t\t$this->redirect(array('action' => 'home'));\t\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash('Invalid username or password');\n\t\t\t}\n\t\t}\n\n\t}", "public function log_user_into_facebook()\n {\n // TODO: Parameterise redirect_url and scope values\n $login_config = array(\n \"redirect_uri\" => \"http://sociable.local/account/facebooklogin\",\n \"scope\" => \"user_birthday, read_stream, user_location, publish_stream, email, read_friendlists, publish_checkins, user_education_history, user_work_history\"\n );\n $login_url = self::getLoginUrl($login_config);\n header('Location: ' . $login_url, true);\n exit;\n }", "function login() {\n \t$this->set('indata',$this->data);\n\t\tif(empty($this->data)){\n\t\t\t$this->pageTitle = 'Log in';\n\t\t\t$cookie = $this->Cookie->read('Auth.User');\n\t\t}\n }", "public function run() {\r\n $this->session->invalidate();\r\n\r\n /*\r\n * Get username and password from the $_POST\r\n */\r\n $username = $this->request->request->get(\"user\", null);\r\n $password = $this->request->request->get(\"pass\", null);\r\n /*\r\n * If username or password is empty, throw error\r\n */\r\n if ( empty($username) || empty($password)) {\r\n $this->failure(\"User name or password cannot be empty\");\r\n }\r\n\r\n $user = new CoreUser($username);\r\n\r\n $login_manager = new LoginManager($user);\r\n $login_manager->authenticateUser($password);\r\n \r\n if (!$user->isAuth()) {\r\n $this->failure(\"Login failed. Please check your password and try again.\");\r\n }\r\n\r\n try {\r\n if (!$login_manager->getAccountInfo()) {\r\n $this->failure(\"Could not load user account\");\r\n }\r\n } catch (SystemException $e) {\r\n $client_error = $e->getUIMsg();\r\n\r\n if (empty($client_error)) {\r\n $client_error = \"Operation failed: Error code \" . $e->getCode();\r\n }\r\n\r\n $this->failure($client_error);\r\n } catch (\\Exception $e) {\r\n $err_msg = \"Unexpected error: \" . $e->getCode();\r\n $this->failure($err_msg);\r\n }\r\n\r\n /*\r\n * User authenticated. Save user object in the session.\r\n */\r\n $this->session->set('coreuser', $user);\r\n\r\n $this->success();\r\n }", "public function executeLogin()\n {\n }", "function Login()\n{\n\tglobal $txt, $context;\n\n\t// You're not a guest, why are you here?\n\tif (we::$is_member)\n\t\tredirectexit();\n\n\t// We need to load the Login template/language file.\n\tloadLanguage('Login');\n\tloadTemplate('Login');\n\twetem::load('login');\n\n\t// Get the template ready.... not really much else to do.\n\t$context['page_title'] = $txt['login'];\n\t$context['default_username'] =& $_REQUEST['u'];\n\t$context['default_password'] = '';\n\t$context['never_expire'] = false;\n\t$context['robot_no_index'] = true;\n\n\t// Add the login chain to the link tree.\n\tadd_linktree($txt['login'], '<URL>?action=login');\n\n\t// Set the login URL - will be used when the login process is done (but careful not to send us to an attachment).\n\tif (isset($_SESSION['old_url']) && strpos($_SESSION['old_url'], 'dlattach') === false && strhas($_SESSION['old_url'], array('board=', 'topic=', 'board,', 'topic,')))\n\t\t$_SESSION['login_url'] = $_SESSION['old_url'];\n\telse\n\t\tunset($_SESSION['login_url']);\n}", "public function login()\n\t{\n\t\tif($this->_identity===null)\n\t\t{\n\t\t\t$this->_identity=new UserIdentity($this->UserName,$this->passWd);\n\t\t\t$this->_identity->authenticate();\n\t\t}\n\t\tif($this->_identity->errorCode===UserIdentity::ERROR_NONE)\n\t\t{\n\t\t\t$duration=$this->rememberMe ? 3600*24*30 : 0; // 30 days\n\t\t\tuser()->login($this->_identity,$duration);\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "private function logIn()\n {\n $element = new Submit('login');\n $element->setAttribute('class', 'btn btn-info btn-lg btn-block text-uppercase waves-effect waves-light');\n $element->setUserOption('mainClass', 'form-group text-center m-t-20');\n $this->add($element);\n }", "public function actionLogin() {\n\n if (Yii::app()->user->isGuest) {\n\n $model = new UserLoginForm();\n\n// collect user input data\n if (isset($_POST['UserLoginForm'])) {\n\n $model->attributes = $_POST['UserLoginForm'];\n\n if ($model->validate()) {\n\n $model->login();\n\n//redirect accordingly\n $actionPath = $this->redirectAuthenticatedUser(Yii::app()->user->returnUrl);\n Yii::app()->controller->redirect($actionPath);\n }\n }\n\n// display the login form\n $this->render('userLogin', array('model' => $model));\n } else {\n//if user already logged in\n\n $actionPath = $this->redirectAuthenticatedUser(Yii::app()->user->returnUrl);\n Yii::app()->controller->redirect($actionPath);\n }\n }", "protected function Login()\n {\n $this->redirectParams[\"openid.realm\"] = $this->config[\"realm\"];\n $this->redirectParams[\"openid.return_to\"] = $this->config[\"return_to\"];\n\n $params = http_build_query($this->redirectParams);\n\n $url = $this->urlAuthorize . \"?$params\";\n\n header(\"Location: $url\");\n exit();\n }", "public function runAction() {\n\t\t$user = new User();\n\n\t\tif($user->isLoggedIn()){\n\t\t\theader(\"Location: /\");\n\t\t\treturn;\n\t\t}\n\n\t\tView::renderTemplate('Home/login.twig');\n\t}", "function login() {\n\t\t//$salt = Configure::read('Security.salt');\n\t\t//echo md5('password'.$salt);\n\n\t\t// redirect user if already logged in\n\t\tif( $this->Session->check('User') ) {\n\t\t\t$this->redirect(array('controller'=>'dashboard','action'=>'index','admin'=>true));\n\t\t}\n\n\t\tif(!empty($this->data)) {\n\t\t\t// set the form data to enable validation\n\t\t\t$this->User->set( $this->data );\n\t\t\t// see if the data validates\n\t\t\tif($this->User->validates()) {\n\t\t\t\t// check user is valid\n\t\t\t\t$result = $this->User->check_user_data($this->data);\n\n\t\t\t\tif( $result !== FALSE ) {\n\t\t\t\t\t// update login time\n\t\t\t\t\t$this->User->id = $result['User']['id'];\n\t\t\t\t\t$this->User->saveField('last_login',date(\"Y-m-d H:i:s\"));\n\t\t\t\t\t// save to session\n\t\t\t\t\t$this->Session->write('User',$result);\n\t\t\t\t\t//$this->Session->setFlash('You have successfully logged in');\n\t\t\t\t\t$this->redirect(array('controller'=>'dashboard','action'=>'index','admin'=>true));\n\t\t\t\t} else {\n\t\t\t\t\t$this->Session->setFlash('Either your Username of Password is incorrect');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function login() {\n $db = Db::getInstance();\n $user = new User($db);\n\n// preventing double submitting\n $token = self::setSubmitToken();\n\n// if user is already logged in redirect him to gallery\n if( $user->is_logged_in() ){\n call('posts', 'index');\n } else {\n// otherwise show login form\n require_once('views/login/index.php');\n// and refresh navigation (Login/Logout)\n require('views/navigation.php');\n }\n }", "public function login(){\n echo $this->name . ' logged in';\n }", "protected function loginUser()\n {\n // Set login data for this user\n /** @var User $oUserModel */\n $oUserModel = Factory::model('User', Constants::MODULE_SLUG);\n $oUserModel->setLoginData($this->mfaUser->id);\n\n // If we're remembering this user set a cookie\n if ($this->remember) {\n $oUserModel->setRememberCookie(\n $this->mfaUser->id,\n $this->mfaUser->password,\n $this->mfaUser->email\n );\n }\n\n // Update their last login and increment their login count\n $oUserModel->updateLastLogin($this->mfaUser->id);\n\n // --------------------------------------------------------------------------\n\n // Generate an event for this log in\n createUserEvent('did_log_in', ['method' => $this->loginMethod], null, $this->mfaUser->id);\n\n // --------------------------------------------------------------------------\n\n // Say hello\n if ($this->mfaUser->last_login) {\n\n /** @var Config $oConfig */\n $oConfig = Factory::service('Config');\n\n $sLastLogin = $oConfig->item('authShowNicetimeOnLogin')\n ? niceTime(strtotime($this->mfaUser->last_login))\n : toUserDatetime($this->mfaUser->last_login);\n\n if ($oConfig->item('authShowLastIpOnLogin')) {\n $this->oUserFeedback->success(lang(\n 'auth_login_ok_welcome_with_ip',\n [\n $this->mfaUser->first_name,\n $sLastLogin,\n $this->mfaUser->last_ip,\n ]\n ));\n\n } else {\n $this->oUserFeedback->success(lang(\n 'auth_login_ok_welcome',\n [\n $this->mfaUser->first_name,\n $sLastLogin,\n ]\n ));\n }\n\n } else {\n $this->oUserFeedback->success(lang(\n 'auth_login_ok_welcome_notime',\n [\n $this->mfaUser->first_name,\n ]\n ));\n }\n\n // --------------------------------------------------------------------------\n\n // Delete the token we generated, it's no needed, eh!\n /** @var Authentication $oAuthService */\n $oAuthService = Factory::model('Authentication', Constants::MODULE_SLUG);\n $oAuthService->mfaTokenDelete($this->data['token']['id']);\n\n // --------------------------------------------------------------------------\n\n $sRedirectUrl = $this->returnTo != siteUrl() ? $this->returnTo : $this->mfaUser->group_homepage;\n redirect($sRedirectUrl);\n }", "public function login()\n {\n $this->vista->index();\n }", "static function login($app) {\n $result = AuthControllerNative::login($app->request->post());\n if($result['authenticated']) {\n return $app->render(200, $result);\n } else {\n return $app->render(401, $result);\n }\n }", "public function login() {\n\n $user_login = trim(in('id'));\n $user_pass = in('password');\n $remember_me = 1;\n\n $credits = array(\n 'user_login' => $user_login,\n 'user_password' => $user_pass,\n 'rememberme' => $remember_me\n );\n\n $re = wp_signon( $credits, false );\n\n if ( is_wp_error($re) ) {\n $user = user( $user_login );\n if ( $user->exists() ) ferror( -40132, \"Wrong password\" );\n else ferror( -40131, \"Wrong username\" );\n }\n else if ( in('response') == 'ajax' ) {\n // $this->response( user($user_login)->session() ); // 여기서 부터..\n }\n else {\n $this->response( ['data' => $this->get_button_user( $user_login ) ] );\n }\n\n }", "public function action_login()\n {\n if(\\Auth::check())\n {\n \\Response::redirect('admin/dashboard');\n }\n\n // Set validation\n $val = \\Validation::forge('login');\n $val->add_field('username', 'Name', 'required');\n $val->add_field('password', 'Password', 'required');\n\n // Run validation\n if($val->run())\n {\n if(\\Auth::instance()->login($val->validated('username'), $val->validated('password')))\n {\n \\Session::set_flash('success', \\Lang::get('nvadmin.public.login_success'));\n \\Response::redirect('admin/dashboard');\n }\n else\n {\n $this->data['page_values']['errors'] = \\Lang::get('nvadmin.public.login_error');\n }\n }\n else\n {\n $this->data['page_values']['errors'] = $val->show_errors();\n }\n\n // Set templates variables\n $this->data['template_values']['subtitle'] = 'Login';\n $this->data['template_values']['description'] = \\Lang::get('nvadmin.public.login');\n $this->data['template_values']['keywords'] = 'login, access denied';\n }", "public function loginUser()\r\n {\r\n $req = $this->login->authenticate($this->user);\r\n $req_result = get_object_vars($req);\r\n print(json_encode($req_result));\r\n }", "public function login()\n {\n if (!empty($_SESSION['user_id'])) {\n return redirect()->to('/');\n }\n // Working with form data if POST request\n if ($this->request->getPost()) {\n $data = $this->request->getPost();\n $validation = Services::validation();\n $validation->setRules(\n [\n 'password' => 'required|min_length[6]',\n 'email' => 'required',\n ]\n );\n // Checking reCAPTCHA\n if (empty($data['g-recaptcha-response'])) {\n $validation->setError('g-recaptcha-response', 'Please activate recaptcha');\n return $this->renderPage('login', $validation->listErrors());\n }\n // Data validation\n if ($validation->withRequest($this->request)->run()) {\n unset($data['g-recaptcha-response']);\n $result = User::checkUser($data);\n // Logging in if user with such data exists\n if ($result) {\n $_SESSION['user_id'] = $result;\n return redirect()->to('/');\n } else {\n $validation->setError('email', 'Invalid parameters');\n return $this->renderPage('login', $validation->listErrors());\n }\n } else {\n // Data validation fails, return with validation errors\n return $this->renderPage('login', $validation->listErrors());\n }\n } else {\n // Render page if GET request\n return $this->renderPage('login');\n }\n }", "public static function LoggedIn() {\n\t\tif (empty($_SESSION['current_user'])) {\n\t\t\tnotfound();\n\t\t}\n\t}", "public static function login()\n {\n //when you add the method you need to look at my find one, you need to return the user object.\n //then you need to check the password and create the session if the password matches.\n //you might want to add something that handles if the password is invalid, you could add a page template and direct to that\n //after you login you can use the header function to forward the user to a page that displays their tasks.\n // $record = accounts::findUser($_POST['email']);\n $user = accounts::findUserbyEmail($_REQUEST['email']);\n print_r($user);\n //$tasks = accounts::findTasksbyID($_REQUEST['ownerid']);\n // print_r($tasks);\n if ($user == FALSE) {\n echo 'user not found';\n } else {\n\n if($user->checkPassword($_POST['password']) == TRUE) {\n session_start();\n $_SESSION[\"userID\"] = $user->id;\n header(\"Location: index.php?page=tasks&action=all\");\n } else {\n echo 'password does not match';\n }\n }\n }", "public function actionLogin()\n {\n if (!Yii::$app->user->isGuest) {\n return $this->redirect(['site/account']);\n }\n\n $model = new LoginForm();\n\n if (Yii::$app->request->isPost) {\n $postData = Yii::$app->request->post();\n\n if ($model->load($postData) && $model->login()) {\n return $this->redirect(['site/account']);\n }\n }\n\n $model->password = '';\n\n return $this->render('login', [\n 'model' => $model,\n ]);\n }", "public function login()\n\t{\t\t\n\t\t$credentials['email'] = Input::get('email');\n\t\t$credentials['password'] = Input::get('password');\n\t\t$remember = (is_null(Input::get('remember'))?false:true);\t\t\n\n\t\t$user = $this->repo->login($credentials, $remember);\t\t\n\t\tif (!$user)\n\t\t{\n\t\t\tRedirect::route('login')->withInput(Input::except('password'));\n\t\t}\n\t\tif(Session::has('redirect'))\n\t\t{\n\t\t\t$url = Session::get('redirect');\n\t\t\tSession::forget('redirect');\t\t\t\n\t\t\treturn Redirect::to(Session::get('redirect'))->with('afterlogin', true);\t\n\t\t}\n\t\treturn Redirect::route('home')->with('afterlogin', true);\n\t}", "function login()\r\n {\r\n if ($this->data)\r\n {\r\n // Use the AuthComponent's login action\r\n if ($this->Auth->login($this->data))\r\n {\r\n // Retrieve user data\r\n $results = $this->User->find(array('User.username' => $this->data['User']['username']), array('User.active'), null, false);\r\n // Check to see if the User's account isn't active\r\n\r\n if ($results['User']['active'] == 0)\r\n {\r\n // account has not been activated\r\n $this->Auth->logout();\r\n $this->flashNotice('Hello ' . $this->Session->read('Auth.User.username') . '. Your account has not been activated yet! Please check your mail and activate your account.', 'login');\r\n }\r\n // user is active, redirect post login\r\n else\r\n {\r\n $this->User->id = $this->Auth->user('id');\r\n $this->flashSuccess('Hello ' . $this->Session->read('Auth.User.username') . '. You have successfully logged in. Please choose your destination on the left menu.');\r\n $this->User->saveField('last_login', date('Y-m-d H:i:s') );\r\n $this->redirect(array('controller' => 'users', 'action' => 'login'));\r\n }\r\n }\r\n $this->flashWarning('You could not be logged in. Maybe wrong username or password?');\r\n }\r\n }", "public function action_login()\n {\n $user = Model_User::current();\n\n $form = new Form_Backend_Login($user);\n\n if ($form->is_submitted())\n {\n // User is trying to log in\n if ($form->validate())\n {\n $result = Auth::instance()->login(\n $form->get_element('email')->value,\n $form->get_element('password')->value,\n $form->get_element('remember')->value\n );\n\n if ($result)\n {\n // User was succesfully authenticated\n // Is he authorized to access backend?\n if (Auth::granted('backend_access'))\n {\n $this->request->redirect(Request::current()->uri);\n }\n else\n {\n $form->error('Доступ к панели управления запрещён!');\n }\n }\n else\n {\n $form->errors(Auth::instance()->errors());\n }\n }\n }\n\n $view = new View('backend/form');\n $view->caption = 'Аутентификация';\n $view->form = $form;\n\n $this->request->response = $this->render_layout($view, 'layouts/backend/login');\n }", "public function actionLogin()\n {\n if (!\\Yii::$app->user->isGuest) {\n return $this->goHome();\n }\n\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login()) {\n return $this->goBack();\n } else {\n return $this->render('login', [\n 'model' => $model,\n ]);\n }\n }" ]
[ "0.71017283", "0.70816016", "0.7041446", "0.69946975", "0.69833624", "0.69736516", "0.697311", "0.69681525", "0.6946743", "0.6927658", "0.6911417", "0.69030803", "0.68708295", "0.6768826", "0.67604274", "0.67604274", "0.67515016", "0.6750276", "0.6741941", "0.6735311", "0.6724642", "0.67046857", "0.6701305", "0.66673106", "0.6660129", "0.6659057", "0.6643872", "0.6640196", "0.66364616", "0.66351116", "0.6632156", "0.6602959", "0.65919006", "0.65899587", "0.6583337", "0.657974", "0.6576679", "0.65667987", "0.65624315", "0.65619534", "0.6561199", "0.6554461", "0.6523808", "0.6505683", "0.65020853", "0.6489887", "0.6489338", "0.648476", "0.6473808", "0.64611894", "0.6442093", "0.64388436", "0.64274365", "0.6418421", "0.6405553", "0.6405553", "0.6400627", "0.6399911", "0.6397538", "0.63969797", "0.63897574", "0.63882893", "0.63846743", "0.63815373", "0.63799495", "0.63773495", "0.6376903", "0.6373314", "0.63665485", "0.63651425", "0.63641727", "0.6363418", "0.63567114", "0.6353044", "0.6350628", "0.63490236", "0.6346455", "0.6345662", "0.63420945", "0.6337114", "0.6332841", "0.6327148", "0.631827", "0.63130015", "0.63040245", "0.63026667", "0.63016266", "0.62975985", "0.6296283", "0.62922734", "0.62887824", "0.6286865", "0.6286038", "0.62842077", "0.6282634", "0.6281802", "0.628083", "0.62781775", "0.62780446", "0.62626165", "0.62620854" ]
0.0
-1
Register a new user.
public function register(Request $request) { $user_data = $request->all(); $validator = $this->validator($user_data); if ($validator->fails()) return response()->json(['registered' => false]); $user_data['password'] = bcrypt($user_data['password']); $user = \App\User::create($user_data); $user->roles()->attach(\App\Role::where('name', 'user')->get()[0]->id); return response()->json(['registered' => true]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function register() {\n\t\tif ($this -> Auth -> loggedIn()) {\n\t\t\t$this -> Session -> setFlash('You are already registered.');\n\t\t\t$this -> redirect($this -> referer());\n\t\t}\n\t\tif ($this -> request -> is('post')) {\n\t\t\t$this -> User -> create();\n\t\t\t$data = $this -> request -> data;\n\t\t\t$data['User']['public_key'] = uniqid();\n\t\t\t$data['User']['role'] = \"user\";\n\t\t\t$data['User']['api_key'] = md5(microtime().rand());\n\t\t\tif ($this -> User -> save($data)) {\n\t\t\t\t$this -> Session -> setFlash(__('You have succesfully registered. Now you can login.'));\n\t\t\t\t$this -> redirect('/users/login');\n\t\t\t} else {\n\t\t\t\t$this -> Session -> setFlash(__('The user could not be saved. Please, try again.'));\n\t\t\t}\n\t\t}\n\n\t\t$this -> set('title_for_layout', 'User Registration');\n\t}", "public function register() {\n\t\tif ($this->Session->check('Auth.User')) {\n\t\t\t$this->redirect('/');\n\t\t}\n\t\t\n\t\tif ($this->request->is('post')) {\n\t\t\t$this->User->create();\n\t\t\t$data = $this->request->data;\n\t\t\tif ($this->User->save($data)) {\n\t\t\t\t$this->Session->setFlash(\"User has been created.\", 'default', array(), 'register');\n\t\t\t\t$this->redirect('/login');\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(\"This user couldn't created. Please try again.\");\n\t\t\t}\n\t\t} else\n\t\t\t$this->Session->delete('Message.register');\n\t}", "private function register(): void\n {\n $user = User::factory()->create();\n $this->actingAs($user);\n }", "public function action_register()\n\t{\n Auth::create_user(\n 'promisemakufa',\n 'pass123',\n '[email protected]',\n 1,\n array(\n 'fullname' => 'P K systems',\n )\n );\n\n $this->template->title = \"User\";\n $this->template->content = View::forge('user/register');\n }", "public function register () : void\n {\n $this->getHttpReferer();\n\n // if the user is already logged in,\n // redirection to the previous page\n if ($this->session->exist(\"auth\")) {\n $url = $this->router->url(\"admin\");\n Url::redirect(301, $url);\n }\n\n $errors = []; // form errors\n $flash = null; // flash message\n\n $tableUser = new UserTable($this->connection);\n $tableRole = new RoleTable($this->connection);\n\n // form validator\n $validator = new RegisterValidator(\"en\", $_POST, $tableUser);\n\n // check that the form is valid and add the new user\n if ($validator->isSubmit()) {\n if ($validator->isValid()) {\n $role = $tableRole->find([\"name\" => \"author\"]);\n\n $user = new User();\n $user\n ->setUsername($_POST[\"username\"])\n ->setPassword($_POST[\"password\"])\n ->setSlug(str_replace(\" \", \"-\", $_POST[\"username\"]))\n ->setRole($role);\n\n $tableUser->createUser($user, $role);\n\n $this->session->setFlash(\"Congratulations {$user->getUsername()}, you are now registered\", \"success\", \"mt-5\");\n $this->session\n ->write(\"auth\", $user->getId())\n ->write(\"role\", $user->getRole());\n\n // set the token csrf\n if (!$this->session->exist(\"token\")) {\n $csrf = new Csrf($this->session);\n $csrf->setSessionToken(175, 658, 5);\n }\n\n $url = $this->router->url(\"admin\") . \"?user=1&create=1\";\n Url::redirect(301, $url);\n } else {\n $errors = $validator->getErrors();\n $errors[\"form\"] = true;\n }\n }\n\n // form\n $form = new RegisterForm($_POST, $errors);\n\n // url of the current page\n $url = $this->router->url(\"register\");\n\n // flash message\n if (array_key_exists(\"form\", $errors)) {\n $this->session->setFlash(\"The form contains errors\", \"danger\", \"mt-5\");\n $flash = $this->session->generateFlash();\n }\n\n $title = App::getInstance()\n ->setTitle(\"Register\")\n ->getTitle();\n\n $this->render(\"security.auth.register\", $this->router, $this->session, compact(\"form\", \"url\", \"title\", \"flash\"));\n }", "public function registerUser()\n {\n $request = new Request();\n\n $email = $request->input('email');\n $password = $request->input('password');\n $password_repeat = $request->input('password_repeat');\n\n\n // Check email\n if (!$email) {\n $this->showRegisterForm(['Please enter email']);\n }\n // Check password\n if(!$password){\n $this->showRegisterForm(['Please enter password']);\n }\n if (!$password || !$password_repeat || $password != $password_repeat) {\n $this->showRegisterForm(['Passwords do not match']);\n }\n\n // Check user exist\n if ($this->getUser($email)) {\n $this->showRegisterForm(['User already isset']);\n }\n\n // Save user to DB\n $user = new User();\n $user->email = $email;\n $user->password = md5($password);\n $user->rights = 20;\n\n // Check save process\n if (!$user->save()) {\n $this->showRegisterForm(['Something goes wrong']);\n }\n\n // Redirect to endpoint\n header(\"Location: \" . self::ENDPOINTS['success_register']);\n }", "public function register() {\n\t\t\n\t\t// DB connection\n\t\t$db = Database::getInstance();\n \t$mysqli = $db->getConnection();\n\t\t\n $data = (\"INSERT INTO user (username,password,first_name,\n last_name,dob,address,postcode,email)\n VALUES ('{$this->_username}',\n '{$this->_sha1}',\n '{$this->_first_name}',\n '{$this->_last_name}',\n '{$this->_dob}',\n '{$this->_address}',\n '{$this->_postcode}',\n '{$this->_email}')\");\n\t\t\t\t\t\t \n\t\t\t$result = $mysqli->query($data);\n if ( $mysqli->affected_rows < 1)\n // checks if data has been succesfully inputed\n $this->_errors[] = 'could not process form';\n }", "public function registerUser()\n {\n $sql = \"INSERT INTO user (username, password, email, firstname, lastname, address, date_of_birth, id_role)\n VALUES (\\\"\" . $this->getUsername().\"\\\", \\\"\" . $this->getPassword().\"\\\", \\\"\" . $this->getEmail().\"\\\",\\\"\" . $this->getFirstname().\"\\\", \\\"\" . $this->getLastname().\"\\\", \\\"\" . $this->getAddress().\"\\\", \\\"\" . $this->getDateOfBirth().\"\\\", \\\"\" . $this->getIdRole().\"\\\")\";\n $result = mysqli_query($this->_connection, $sql);\n if (!$result) {\n print \"Error: \" . $result . \"<br>\" . mysqli_error($this->_connection);\n } else {\n print \"erfolg\";\n\n }\n }", "function registerUser()\n\t{\n\t\t$userName = $_POST['userName'];\n\n\t\t# Verify that the user doesn't exist in the database\n\t\t$result = verifyUser($userName);\n\n\t\tif ($result['status'] == 'COMPLETE')\n\t\t{\n\t\t\t$email = $_POST['email'];\n\t\t\t$userFirstName = $_POST['userFirstName'];\n\t\t\t$userLastName = $_POST['userLastName'];\n\n\t\t\t$userPassword = encryptPassword();\n\n\t\t\t# Make the insertion of the new user to the Database\n\t\t\t$result = registerNewUser($userFirstName, $userLastName, $userName, $email, $userPassword);\n\n\t\t\t# Verify that the insertion was successful\n\t\t\tif ($result['status'] == 'COMPLETE')\n\t\t\t{\n\t\t\t\t# Starting the session\n\t\t\t\tstartSession($userFirstName, $userLastName, $userName);\n\t\t\t\techo json_encode($result);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t# Something went wrong while inserting the new user\n\t\t\t\tdie(json_encode($result));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t# Username already exists\n\t\t\tdie(json_encode($result));\n\t\t}\n\t}", "public function register()\n {\n if ($this->getIsNewRecord() == false) {\n throw new \\RuntimeException('Calling \"' . __CLASS__ . '::' . __METHOD__ . '\" on existing user');\n }\n\n if ($this->module->enableConfirmation == false) {\n $this->confirmed_at = time();\n }\n\n if ($this->module->enableGeneratingPassword) {\n $this->password = Password::generate(8);\n }\n\n $this->trigger(self::USER_REGISTER_INIT);\n\n if ($this->save(false)) {\n Yii::getLogger()->log($this->getErrors(), Logger::LEVEL_INFO);\n $this->trigger(self::USER_REGISTER_DONE);\n if ($this->module->enableConfirmation) {\n $token = \\Yii::createObject([\n 'class' => \\dektrium\\user\\models\\Token::className(),\n 'type' => \\dektrium\\user\\models\\Token::TYPE_CONFIRMATION,\n ]);\n $token->link('user', $this);\n $this->mailer->sendConfirmationMessage($this, $token);\n } else {\n \\Yii::$app->user->login($this);\n }\n if ($this->module->enableGeneratingPassword) {\n $this->mailer->sendWelcomeMessage($this);\n }\n \\Yii::$app->session->setFlash('info', $this->getFlashMessage());\n \\Yii::getLogger()->log('User has been registered', Logger::LEVEL_INFO);\n return true;\n }\n\n \\Yii::getLogger()->log('An error occurred while registering user account', Logger::LEVEL_ERROR);\n\n return false;\n }", "public function register_user()\n {\n \n return true;\n \n }", "public function registerUser()\n {\t\n\t\t/**\n\t\t * Our UserModel will return an error \n\t\t * if the email already exists, \n\t\t * or if the passwords do not match\n\t\t */\n\t\ttry{\n\t\t$user = new UserModel();\n\t\t$user->name = Input::get('name');\n\t\t$user->email = Input::get('email');\n\t\t$user->password = Input::get('password');\n\t\t$user->password_confirmation = Input::get('password_confirmation');\n\t\t$user->save();\t\n\t\t$this->setToken($user);\n\t\treturn $this->sendResponse('You have been registered and are logged in');\n\t\t}\n\t\tcatch(Exeption $e){\n\t\t\treturn $this->sendResponse(false, $e->getMessage());\n\n\t\t}\n }", "public function registerUserAction() {\n\t\n\t\t\t$request = $this->getRequest();\n\t\t\t\n\t\t\t\n\t\t\tif ($request->isPost()) {\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// get the json raw data\n\t\t\t\t$handle = fopen(\"php://input\", \"rb\");\n\t\t\t\t$http_raw_post_data = '';\n\t\t\t\t\n\t\t\t\twhile (!feof($handle)) {\n\t\t\t\t $http_raw_post_data .= fread($handle, 8192);\n\t\t\t\t}\n\t\t\t\tfclose($handle); \n\t\t\t\t\n\t\t\t\t// convert it to a php array\n\t\t\t\t$json_data = json_decode($http_raw_post_data, true);\n\t\t\t\t\n\t\t\t\t//echo json_encode($json_data);\n\t\t\t\t\n\t\t\t\tif (is_array($json_data)) {\n\t\t\t\t\t// convert it back to json\n\t\t\t\t\t\n\t\t\t\t\t// write the user back to database\n\t\t\t\t\t$registered = Application_Model_User::registerUser($json_data);\n\t\t\t\t\t\n\t\t\t\t\tif($registered) {\n\t\t\t\t\t\techo json_encode($registered);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\techo 0;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t \n\t\t\t\t \n\t\t\t}\n\t\t\t\n\t}", "function register_user($new) {\n \n $this->db->insert('users', $new);\n }", "public function register(){\n $user = Container::getModel('User');\n $user->__set('name',$_POST['name']);\n $user->__set('email',$_POST['email']);\n if(isset($_POST['password']) && $_POST['password'] != ''){\n $user->__set('password',md5($_POST['password'])); \n }\n\n //if the fields are correct\n if($user->validateRegister()){\n //if user doesn't alredy exist\n if(count($user->getUserByEmail()) == 0){\n //success\n $user->save();\n $this->render('register');\n }else{\n //user does alredy exist\n $this->render('email_alredy_exists');\n }\n\n }else{\n //error if any of the fields are incorrect\n //this array will be use to auto-fill the fields\n $this->view->user = array(\n 'name' => $_POST['name'],\n 'email' => $_POST['email'],\n 'password' => $_POST['password']\n\n );\n $this->view->erroRegister = true;\n $this->render('inscreverse');\n }\n }", "public function registerNewUser()\n\t{\n\t\t# make the call to the API\n\t\t$response = App::make('ApiClient')->post('register', Input::all());\n\n\t\t# if we successfully register a new user\n\t\tif(isset($response['success']))\n\t\t{\n\t\t\tUser::startSession($response['success']['data']['user']);\n\n\t\t\t# grab the data array from the response\n\t\t\tSession::flash('success', $response['success']['data']);\n\n\t\t\t# show the user profile screen\n\t\t\treturn Redirect::route('profile');\n\t\t}\n\t\t# there was a problem registering the user\n\t\telse \n\t\t{\n\t\t\t# save the API response to some flash data\n\t\t\tSession::flash('registration-errors', getErrors($response));\n\n\t\t\t# also flash the input so we can replay it out onto the reg form again\n\t\t\tInput::flash();\n\n\t\t\t# ... and show the sign up form again\n\t\t\treturn Redirect::back();\n\t\t}\n\t}", "public function registerAction() {\n $user = new User();\n // Create new User Form.\n $form = $this->formFactory->create(UserType::class, $user);\n // Handle Request.\n $form->handleRequest($this->request);\n\n // Check if the information is valid, when form is submitted.\n if ($form->isSubmitted() && $form->isValid()) {\n $plainPassword = $form->get('password')->getData();\n $encoder = $this->container->get('security.password_encoder');\n $encoded = $encoder->encodePassword($user, $plainPassword);\n\n // Set encoded password.\n $user->setPassword($encoded);\n\n // Tell the database to watch for this object.\n $this->em->persist($user);\n\n // Insert object into database. (Create user row)\n $this->em->flush();\n\n\n return new RedirectResponse($this->router->generate('register_success', array(\n )));\n }\n\n return new Response($this->templating->render('security/register.html.twig', [\n 'form' => $form->createView()\n ]));\n }", "public function createUser();", "public function createUser();", "public function createUser();", "public function createUser();", "function register_user() {\n\t\tglobal $ID, $lang, $conf, $auth, $yubikey_associations;\n\n\t\tif(!$auth->canDo('addUser')) return false;\n\n\t\t$_POST['login'] = $_POST['nickname'];\n\n\t\t// clean username\n\t\t$_POST['login'] = preg_replace('/.*:/','',$_POST['login']);\n\t\t$_POST['login'] = cleanID($_POST['login']);\n\t\t// clean fullname and email\n\t\t$_POST['fullname'] = trim(preg_replace('/[\\x00-\\x1f:<>&%,;]+/','',$_POST['fullname']));\n\t\t$_POST['email'] = trim(preg_replace('/[\\x00-\\x1f:<>&%,;]+/','',$_POST['email']));\n\n\t\tif (empty($_POST['login']) || empty($_POST['fullname']) || empty($_POST['email'])) {\n\t\t\tmsg($lang['regmissing'], -1);\n\t\t\treturn false;\n\t\t} else if (!mail_isvalid($_POST['email'])) {\n\t\t\tmsg($lang['regbadmail'], -1);\n\t\t\treturn false;\n\t\t}\n\n\t\t// okay try to create the user\n\t\tif (!$auth->createUser($_POST['login'], auth_pwgen(), $_POST['fullname'], $_POST['email'])) {\n\t\t\tmsg($lang['reguexists'], -1);\n\t\t\treturn false;\n\t\t}\n\n\t\t$user = $_POST['login'];\n\t\t$yubikey = $_SERVER['REMOTE_USER'];\n\n\t\t// if our yubikey id is based on a non-registered user, we need to chunk off the \"yubikey:\"\n\t\t// part of it\n\t\tif (preg_match('!^yubikey:!', $yubikey)) {\n\t\t\t$yubikey = substr($yubikey, 8);\n\t\t}\n\n\t\t// we update the YubiKey associations array\n\t\t$this->register_yubikey_association($user, $yubikey);\n\n\t\t$this->update_session($user);\n\n\t\t// account created, everything OK\n\t\t$this->_redirect(wl($ID));\n\t}", "public function registerUser($data);", "private static function register() {\n if ( !self::validatePost() ) {\n return;\n }\n\n if ( !self::validEmail($_POST['email']) ) {\n self::setError('E-Mail Adresse ist nicht g&uuml;ltig!<br>');\n return;\n }\n \n $_POST['email'] = strtolower($_POST['email']);\n \n $password = Helper::hash($_POST['password'].$_POST['email']);\n \n $verified = md5($_POST['email'].$password.microtime(true));\n \n $result = Database::createUser($_POST['email'],$password,$verified);\n \n if ( $result === false || !is_numeric($result) ) {\n return;\n }\n \n $_SESSION['user']['id'] = $result;\n $_SESSION['user']['email'] = $_POST['email'];\n $_SESSION['user']['verified'] = $verified;\n $_SESSION['loggedin'] = true;\n self::$loggedin = true;\n \n self::registerMail($verified);\n }", "function registerUser()\n {\n $DBA = new DatabaseInterface();\n $fields = array(0 => 'title', 1 => 'first_name', 2 => 'last_name', 3 => 'contacttelephone', 4 => 'contactemail', 5 => 'password', 6 => 'username', 7 => 'dob', 8 => 'house', 9 => 'street', 10 => 'town', 11 => 'county', 12 => 'pcode', 13 => 'optout', 14 => 'newsletter', 15 => 'auth_level', 16 => 'store_owner');\n $fieldvals = array(0 => $this->Title, 1 => $this->FirstName, 2 => $this->LastName, 3 => $this->ContactTelephone, 4 => $this->ContactEmail, 5 => $this->Password, 6 => $this->Username, 7 => $this->DOB, 8 => $this->House, 9 => $this->Street, 10 => $this->Town, 11 => $this->County, 12 => $this->PCode, 13 => $this->Optout, 14 => $this->NewsletterSubscriber, 15 => $this->AuthLevel, 16 => 1);\n $rs = $DBA->insertQuery(DBUSERTABLE, $fields, $fieldvals);\n if ($rs == 1)\n {\n $this->RegistrationSuccess = 1;\n }\n if (isset($this->PCode))\n {\n $this->geoLocate();\n }\n }", "public function register()\n {\n $create_from = $this->request->get_body_params();\n\n $input = (object) array_intersect_key( $create_from,\n array_fill_keys(['username', 'password', 'email'], false)\n );\n\n $update = [\n 'first_name',\n 'last_name',\n ];\n\n /** @var \\WP_Error|integer $user */\n $user_id = \\wp_create_user($input->username, $input->password, $input->email);\n\n if (\\is_wp_error($user_id)) {\n throw new UnauthorizedException($user_id->get_error_message());\n }\n\n /** @var \\WP_User $user */\n $user = \\get_userdata($user_id);\n\n foreach ($update as $att) {\n $user->$att = $create_from[$att];\n }\n\n \\wp_update_user($user);\n\n return $this->response->ok([\n 'message' => sprintf(__('Hello %s', PMLD_TD), $user->nickname),\n 'user' => User::make($user),\n ]);\n\n }", "public function registerUser(){\r\n\t\t$name = $_POST['register_name'];\r\n\t\t$email = $_POST['register_email'];\r\n\t\t$password = $_POST['register_password'];\r\n\r\n\t\t$sql = \"INSERT INTO users values (null,?,?,?)\";\r\n\t\t$query = $this->db->prepare($sql);\r\n\t\t$query->execute([$name,$email,$password]);\r\n\t\t//ako je registracija uspela pojavice se div u formu sa ispisom notifikacije!!!\r\n\t\tif ($query) {\r\n\t\t\t$this->register_result=true;\r\n\t\t}\r\n\t}", "public function register( CreateUserRequest $request ) {\n // store the user in the database\n $credentials = $request->only( 'name', 'email', 'password');\n $credentials[ 'password' ] = bcrypt( $credentials[ 'password' ] );\n $user = User::create($credentials);\n\n // now wire up the provider account (e.g. facebook) to the user, if provided.\n if ( isset( $request['provider'] ) && isset( $request['provider_id'] ) && isset( $request['provider_token'] ) ) {\n $user->accounts()->save( new Account( [\n 'provider' => $request['provider'],\n 'provider_id' => $request['provider_id'],\n 'access_token' => $request['provider_token'],\n ] ) );\n }\n\n // return the JWT to the user\n $token = JWTAuth::fromUser( $user );\n return response( compact( 'token' ), 200 );\n }", "public function register()\n\t{\n\t\tif ($this->request->is('post')) {\n\t\t\t$this->User->create();\n\n\t\t\t// CakePHP automatically call $this->User->validates() for us before saving it.\n\t\t\tif ($this->User->save($this->request->data)) {\n\t\t\t\t// we set the id of our newly created User to the request->data params\n\t\t\t\t$this->request->data['User']['id'] = $this->User->id;\n\t\t\t\t// so we can log in directly. (We don't use $this->User because the password is now encrypted so it would not match).\n\t\t\t\t$this->Auth->login($this->request->data['User']);\n\t\t\t\treturn $this->redirect(array('controller' => 'messages', 'action' => 'index'));\n\t\t\t}\n\t\t}\n\t}", "public function registerAction() {\n\n $user = new User();\n\n // データを保存し、エラーをチェックする\n// $success = $user->save($this->request->getPost(), array('name', 'email'));\n\n $user->findFirst($this->request->getPost());\n\n if ($success) {\n echo \"Thanks for registering!\";\n } else {\n echo \"Sorry, the following problems were generated: \";\n foreach ($user->getMessages() as $message) {\n echo $message->getMessage(), \"<br/>\";\n }\n }\n\n $this->view->disable();\n\n }", "public function register() {\n \n $this->form_validation->set_rules('email', 'Email', 'required|valid_email');\n $this->form_validation->set_rules('password', 'Passwort', 'required');\n $this->form_validation->set_rules('dataprotection', 'Datenschutz', 'required');\n \n if ($this->form_validation->run() === FALSE) {\n \t$this->error(400, 'Validation error');\n }\n \n if (strtolower($this->input->post('dataprotection')) == 'true') {\n \t// TODO: save acceptance or acceptance date to db, i.e. hand over to model\n } else {\n \t$this->error(404, 'Dataprotection error');\n } \n \n $this->user_model->setValue('email', $this->input->post('email'));\n $this->user_model->setValue(\n \t'hashed_password', \n \tpassword_hash($this->input->post('password'), PASSWORD_DEFAULT));\n\n if (! $this->user_model->newUser()) {\n\t\t\t$this->error(409, 'Duplicate');\n }\n\n\t\t$this->sendConfirmationMail($this->input->post('email'));\n\t\t$data['msg'] = $this->input->post('email') . ' registered.';\n\t\t$this->responseWithCode(201, $data);\n }", "public function addUserToDatabase($user) {\n $name = $user->getName();\n $password = $user->getHashedPassword();\n $sql = \"INSERT INTO users (name, password) VALUES (:name, :password)\";\n $insertToDb = $this->connection->prepare($sql);\n $insertToDb->bindParam(':name', $name);\n $insertToDb->bindParam(':password', $password);\n $insertToDb->execute();\n $this->registerStatus = true;\n }", "public function registerNewUser($user) {\n if ($this->isUsernameAvailable($user)) {\n $this->addNewUserToDatabase($user);\n } else {\n throw new Exception('User exists, pick another username.');\n }\n }", "public function addUser(){}", "public function doRegister(){\n\t\t\t$requestUser = $this->registerView->getRequestUserName();\n\t\t\t$requestPassword = $this->registerView->getRequestPassword();\n\t\t\t$requestRePassword = $this->registerView->getRequestRePassword();\n\t\t\t\n\t\t\tif($this->registerView->didUserPressRegister() ){\n\t\t\t\ttry{\n\t\t\t\tif($this->checkUsername($requestUser) && $this->checkPassword($requestPassword,$requestRePassword)){\n\t\t\t\t\t//create and add new user\n\t\t\t\t\t$newUser = new User($requestUser,$requestPassword);\n\t\t\t\t\t$this->userList->add($newUser);\n\t\t\t\t\t\n\t\t\t\t\t$this->model->toggleJustRegistered();\n\t\t\t\t\t$this->model->setSessionUsername($requestUser);\n\t\t\t\t\t$this->navView->clearURL();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t\tcatch (UserFewCharException $ufce){\n\t\t\t\t\t$this->registerView->setErrorUsernameFewChar();\n\t\t\t\t\t$this->registerView->setUsernameField($requestUser);\n\t\t\t\t} \n\t\t\t\tcatch (UserBadCharException $udce){\n\t\t\t\t\t$this->registerView->setErrorUsernameInvalidChar();\n\t\t\t\t\t$this->registerView->setUsernameField(strip_tags($requestUser));\n\t\t\t\t} \n\t\t\t\tcatch (UserExistsException $uee){\n\t\t\t\t\t$this->registerView->setErrorUsernameExists();\n\t\t\t\t\t$this->registerView->setUsernameField($requestUser);\n\t\t\t\t} \n\t\t\t\tcatch (PasswordLenException $ple){\n\t\t\t\t\t$this->registerView->setErrorPasswordFewChar();\n\t\t\t\t\t$this->registerView->setUsernameField($requestUser);\n\t\t\t\t} \n\t\t\t\tcatch (PasswordMissmatchException $pme){\n\t\t\t\t\t$this->registerView->setErrorPasswordMatch();\n\t\t\t\t\t$this->registerView->setUsernameField($requestUser);\n\t\t\t\t}\n\t\t\t\tif(empty($requestUser) && empty($requestPassword) && empty($requestRePassword))\n\t\t\t\t\t$this->registerView->setErrorMissingFields();\t\t\n\t\t\t}\n\t\t}", "public function register($u) {\n $this->user_id = $u; \n }", "public function action_register(){\n\t\t\n\t\t$user = CurUser::get();\n\t\t\n\t\tif($user->save($_POST, User_Model::SAVE_REGISTER)){\n\t\t\t$user->login($user->{CurUser::LOGIN_FIELD}, $_POST['password']);\n\t\t\tApp::redirect('user/profile/greeting');\n\t\t\treturn TRUE;\n\t\t}else{\n\t\t\tMessenger::get()->addError('При регистрации возникли ошибки:', $user->getError());\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function reg_user($name, $email, $username, $password)\n\t{\n\t\t$encrypt_password = sha1($password);\n\t\t\n\t\t//Creates an array which includes the field names and the values assigned\n\t\t$details = array(\n\t\t\t\t'u_name' => $name,\n\t\t\t\t'u_email' => $email,\n\t\t\t\t'u_username' => $username,\n\t\t\t\t'u_password' => $encrypt_password\n\t\t);\n\t\t\n\t\t//Executes the insert query\n\t\t$this->db->insert('tbl_user',$details);\n\t}", "public function doRegister()\n {\n\n //check if all the fields are filled\n if (!Request::checkVars(Request::postData(), array('username', 'password'))) {\n echo json_encode(array(\"swal\" => array(\"title\" => \"Oops!\", \"text\" => \"Complete all the fields!\", \"type\" => \"error\")));\n exit;\n }\n\n //create the user entity based on filled data\n $userEntity = new User(Request::postData());\n\n //check if the user exists and get it as entity if exists\n if ($this->repository->findUser($userEntity)) {\n echo json_encode(array(\"swal\" => array(\"title\" => \"Oops!\", \"text\" => \"The username/email already exists!\", \"type\" => \"error\")));\n exit;\n }\n\n //add the user into DB\n $this->repository->addUser($userEntity);\n\n echo json_encode(\n array(\n \"swal\" => array(\"title\" => \"Success!\", \"text\" => \"Your account has been created!\", \"type\" => \"success\", \"hideConfirmButton\" => true),\n \"redirect\" => array(\"url\" => BASE_URL . '/index.php?page=home', 'time' => 1)\n )\n );\n }", "public function register(){\n\t\t//Better to be implemented through db table\n\t\t$userRole = array('Job Seeker'=>'Job Seeker', 'Employer'=>'Employer');\n\t\t$this->set('userRole',$userRole);\n\n\t\tif($this->request->is('post')){\n\t\t\t$this->User->create();\n\t\t\t\n\t\t\tif($this->User->save($this->request->data)){\n\t\t\t\t$this->Session->setFlash(__('You are now registered and may login'));\n\t\t\t\treturn $this->redirect(array('controller'=>'jobs','action'=>'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('Unable to create new user'));\n\n\t\t\t}\n\t\t}\n\t}", "public function register(string $username, string $password, string $email);", "public function store(RegisterUserRequest $request)\n {\n $user = null;\n DB::transaction(function () use ($request, &$user) {\n\n $input = $request->all();\n $input['password'] = Hash::make($request->password);\n\n $user = UsUser::create($input);\n $user->token = null;\n\n // registro en us_userlogins\n $user->us_socialnetworks()->attach(\n 1,\n ['id_social' => 'peru_'.Str::random(20), 'us_users_email' => $request->email, 'user_add' => $user->id, 'date_add' => $user->date_add]\n );\n\n // registro en us_subscribes_and_follows\n // Aqui Invocar a la Api de Sites para subscribir al usuario con su SITE (¿Como trabajo los registros transaccionales con 2 apis?)\n\n });\n\n return $this->successResponse(true, new UsUserResource($user));\n }", "public function store(Requests\\UserRegisterRequest $request)\n {\n $data=array_merge($request->except('password_confirmation'),['avatar'=>asset('/image/default.jpg')]);\n User::create($data);\n session()->flash('msg','注册成功 开心⸂⸂⸜(രᴗര๑)⸝⸃⸃ ⸂⸂⸜(രᴗര๑)⸝⸃⸃ 请登录');\n return redirect('/user/login');\n }", "function registerUser ($username, $email, $pass, $nik, $isuser, $isspv, $isadmin)\n\t{\n\t\tif (!$this->isUserExist($email)) {\n\t\t\t\n\t\t\t\n\t\t\t$password = md5($pass);\n\t\t\t$apikey = $this->generateApiKey();\n\t\t\t$stmt = $this->con->prepare(\"INSERT INTO users (username, email, password, nik, apikey, isuser, isspv, isadmin) VALUES (?, ?, ?, ?, ?, ?, ?, ?)\");\n\t\t\t$stmt->bind_param(\"sssssiii\", $username, $email, $password, $nik, $apikey, $isuser, $isspv, $isadmin);\n\t\t\tif ($stmt->execute())\n\t\t\treturn USER_CREATED;\n\t\t\treturn USER_CREATION_FAILED;\n\t\t}\n\t\treturn USER_EXIST;\n\t\n\t\t\n\t}", "public function registerUser() {\n $this->form_validation->set_rules('username', 'Username', 'trim|required|min_length[5]|max_length[12]|is_unique[user.username]',\n array('min_length' => 'Username length has to be between 5 & 12 characters.',\n 'max_length' => 'Username length has to be between 5 & 12 characters.',\n 'is_unique' => 'Username is already in use.'));\n $this->form_validation->set_rules('password', 'Password', 'required|min_length[8]|max_length[16]|matches[confirmPassword]',\n array('min_length' => 'Password length has to be between 8 & 16 characters.',\n 'max_length' => 'Password length has to be between 8 & 16 characters.',\n 'matches' => 'Passwords do not match.'));\n $this->form_validation->set_rules('confirmPassword', 'Password Confirmation', 'required');\n $this->form_validation->set_rules('emailAddress', 'Email Address', 'trim|required|valid_email|is_unique[user.userEmail]',\n array('valid_email' => 'Email is not valid.',\n 'is_unique' => 'Email is already in use.'));\n\n if ($this->form_validation->run() == FALSE) {\n $this->registration();\n\n } else {\n $formUsername = $this->input->post('username');\n $formPassword = $this->input->post('password');\n $formEmailAddress = $this->input->post('emailAddress');\n $this->UserManager->registerUser($formUsername, $formPassword, $formEmailAddress);\n $this->login();\n }\n }", "public function register (){\n $msg=\"\";\n if (isset($_POST[\"register\"])) {\n if ($this->isValidInput($_POST)){\n $firstName = $_POST[\"firstName\"];\n $lastName = $_POST[\"lastName\"];\n $email = $_POST[\"email\"];\n $password = password_hash(trim($_POST[\"password\"]), PASSWORD_BCRYPT);\n $age = $_POST[\"age\"];\n $isAdmin = null;\n //if user is not empty - the email from input already exists\n $user = UserDao::getByEmail($email);\n if($user != null){\n $msg .= \"Вече съществува потребител с този email\";\n $this->triggerError($msg, 'register.tpl');\n }\n else {\n $newUser = new User(null, $firstName,$lastName,$email,$password,$age,$isAdmin);\n UserDao::addUser($newUser);\n $_SESSION[\"user\"] = $newUser;\n header(\"Location: \".BASE_PATH);\n }\n }\n else {\n $msg .= \"Въведени са невалидни данни\";\n $this->triggerError($msg, 'register.tpl');\n }\n }\n else {\n $GLOBALS[\"smarty\"]->assign('isLoggedIn', isset($_SESSION[\"user\"]));\n $GLOBALS[\"smarty\"]->assign('msg', $msg);\n $GLOBALS[\"smarty\"]->display('register.tpl');\n }\n }", "function userRegister($userDetails){\n\ttry {\n\t\t$user = new MangoPay\\UserNatural();\n\t\t$user->FirstName \t\t\t= $userDetails['FirstName'];\n\t\t$user->LastName \t\t\t= $userDetails['LastName'];\n\t\t$user->Email \t\t\t\t= $userDetails['Email'];\n\t\t$user->Address \t\t\t\t= $userDetails['Address'];\n\t\t$user->Birthday \t\t\t= strtotime($userDetails['Birthday']);\n\t\t$user->Nationality \t\t\t= $userDetails['Nationality'];\n\t\t$user->CountryOfResidence \t= $userDetails['CountryOfResidence'];\n\t\t$user->Occupation \t\t\t= $userDetails['Occupation'];\n\t\t$user->IncomeRange \t\t\t= $userDetails['IncomeRange'];\n\t\t//call create function\n\t\t$createdUser \t\t\t\t= $mangoPayApi->Users->Create($user);\n\t\tif(isset($createdUser->Id)) {\n\t\t\treturn $createdUser->Id;\n\t\t}\n\t\telse {\n\t\t\treturn 0;\n\t\t}\n\t}\n\tcatch(Exception $e) {\n\t\treturn $e;//error in field values\n\t\t\n\t}\n}", "public function register()\n {\n $user = new UserManager;\n $request = new Request;\n $errorMessage = '';\n $method = $request->getMethode();\n if ($method == \"POST\") {\n $mailUser = $request->getPost('mail');\n $password = $request->getPost('mdp');\n $checkPassword = $request->getPost('cmdp');\n $userName = $request->getPost('userName');\n $userData = array();\n $userData['mail'] = $mailUser;\n $userData['pass'] = $password;\n $userData['userName'] = $userName;\n $userData['role'] = 'user';\n $mailUsed = $user->checkMail($mailUser);\n $userNameUsed = $user->checkUserName($userName);\n\n //if true register user on session \n if (!$mailUsed) {\n if (!$userNameUsed) {\n if ($password == $checkPassword) {\n if (filter_var($mailUser, FILTER_VALIDATE_EMAIL)) {\n $errorMessage = 'Vous êtes connecté avec succés ';\n $request->newSession(\"user\", $userData);\n $hashPassword = hash(\"sha256\", $password);\n $user->newUser($userName, $mailUser, $hashPassword);\n } else {\n $errorMessage = 'Le format de l\\'email est incorrect ';\n }\n } else {\n $errorMessage = 'Les mots de passe ne sont pas identique ';\n }\n } else {\n $errorMessage = 'Le nom d\\'utilisateur entré n\\'est pas disponible ';\n }\n } else {\n $errorMessage = 'Cette email est déja utilisé';\n }\n return $this->render('user/register.html.twig', ['errorMessage' => $errorMessage]);\n }\n return $this->render('user/register.html.twig', ['errorMessage' => $errorMessage]);\n }", "public function register() {\n\n // If it is not a valid password\n if (!$this->valid_password()) {\n return \"Invalid Password. It must be six characters\";\n }\n\n // If the mobile is valid\n if (!$this->valid_mobile()) {\n return \"Mobile Number is Invalid. It must be 10 numeric digits\";\n }\n\n // If there is a user with that username\n if (User::find($this->username, 'username') !== null) {\n return \"Username already taken\";\n }\n\n // Now we create the user on the database\n if ($this->create_record()) {\n echo \"<br><br>Record Created\";\n // We update the sync the object with the database\n if ($this->update_object('username')) {\n return true;\n echo \"<br><br>Object Updated\";\n }\n }\n\n return \"Sorry, an error has ocurred. Try again later\";\n }", "protected function _createUser()\n {\n $data = [\n 'email' => '[email protected]',\n 'password' => 'test',\n ];\n\n $user = $this->Users->newEntity($data);\n\n $user->set('active', true);\n $user->set('role_id', 1);\n\n $this->Users->save($user);\n }", "public function register_user($data) \n\t{\n\t\t$user = array(\n\t\t\t'login' => $data['inputPseudo'],\n\t\t\t'mail' => $data['inputEmail'],\n\t\t\t'password' => md5($this->hash_key . $data['inputPassword']),\n\t\t\t'user_group' => 3,\n\t\t);\n\t\t$result = $this->user->create($user);\n\t\treturn $result;\n\t}", "public function registerUser() {\n\t\t\t\t//check for email id existence\n\t\t\t\t$userExistence = $this->checkUserExistence();\n\t\t\t\tif(!$userExistence) {\n\t\t\t\t\t$this->response['status'] = 0;\n\t\t\t\t\t$this->response['message'] = 'Email id already exists. Please try different email id!';\n\t\t\t\t\treturn false;\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\t$sql = \"insert into register(name, email, password, orig_password, address, mobile, landline, logo, photo, licence_aggrement,token, create_time) \";\n\t\t\t\t$sql .= \" values('$this->name', '$this->email', '$this->crypPwd', '$this->password', '$this->addr', '$this->mobile', '$this->landline', '$this->logoPath', '$this->photoPath', $this->licence, '$this->token', NOW())\";\n\t\t\t\t\n\t\t\t\t//store it in db now\n\t\t\t\t$result = returnQueryResult($sql);\n\t\t\t\tif($result == false) {\n\t\t\t\t\t$this->response['status'] = 0;\n\t\t\t\t\t$this->response['message'] = 'Sorry! Something went wrong. Try Again';\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t//create user directory\n\t\t\t\t$dir = \"../registered_users/$this->email\";\n\t\t\t\tmkdir($dir, 0777, true);\n\t\t\t\tchmod($dir, 0777);\n\n\t\t\t\t//now move files to user directory\n\t\t\t\tmove_uploaded_file($this->logo['tmp_name'], $this->logoPath); //logo\n\t\t\t\tmove_uploaded_file($this->yourPhoto['tmp_name'], $this->photoPath); //your photo\n\n\t\t\t\t//now send confirmation mail to user\n\t\t\t\t$this->sendConfirmationMail();\n\t\t\t}", "function register_user() {\n\n\t\tif ( ! class_exists( 'QuadMenu' ) ) {\n\t\t\twp_die();\n\t\t}\n\n\t\tif ( ! check_ajax_referer( 'quadmenu', 'nonce', false ) ) {\n\t\t\tQuadMenu::send_json_error( esc_html__( 'Please reload page.', 'quadmenu' ) );\n\t\t}\n\n\t\t$mail = isset( $_POST['mail'] ) ? $_POST['mail'] : false;\n\t\t$pass = isset( $_POST['pass'] ) ? $_POST['pass'] : false;\n\n\t\tif ( empty( $mail ) || ! is_email( $mail ) ) {\n\t\t\tQuadMenu::send_json_error( sprintf( '<div class=\"quadmenu-alert alert-danger\">%s</div>', esc_html__( 'Please provide a valid email address.', 'quadmenu' ) ) );\n\t\t}\n\n\t\tif ( empty( $pass ) ) {\n\t\t\tQuadMenu::send_json_error( sprintf( '<div class=\"quadmenu-alert alert-danger\">%s</div>', esc_html__( 'Please provide a password.', 'quadmenu' ) ) );\n\t\t}\n\n\t\t$userdata = array(\n\t\t\t'user_login' => $mail,\n\t\t\t'user_email' => $mail,\n\t\t\t'user_pass' => $pass,\n\t\t);\n\n\t\t$user_id = wp_insert_user( apply_filter( 'ml_qmpext_register_user_userdata', $userdata ) );\n\n\t\tif ( ! is_wp_error( $user_id ) ) {\n\n\t\t\t$user = get_user_by( 'id', $user_id );\n\n\t\t\tif ( $user ) {\n\t\t\t\twp_set_current_user( $user_id, $user->user_login );\n\t\t\t\twp_set_auth_cookie( $user_id );\n\t\t\t\tdo_action( 'wp_login', $user->user_login, $user );\n\t\t\t}\n\n\t\t\tQuadMenu::send_json_success( sprintf( '<div class=\"quadmenu-alert alert-success\">%s</div>', esc_html__( 'Welcome! Your user have been created.', 'quadmenu' ) ) );\n\t\t} else {\n\t\t\tQuadMenu::send_json_error( sprintf( '<div class=\"quadmenu-alert alert-danger\">%s</div>', $user_id->get_error_message() ) );\n\t\t}\n\t\twp_die();\n\t}", "public function register(Request $request)\n\t{\n\t\t$this->validate($request, [\n\t\t\t'username' => 'required|unique:users',\n\t\t\t'password' => 'required|min:10',\n\t\t\t'options' => 'array'\n\t\t]);\n\n\t\t$user = User::make([\n\t\t\t'username' => $request->input('username'),\n\t\t\t'options' => \\json_encode($request->input('options', []))\n\t\t]);\n\t\t$user->password = Hash::make($request->input('password'));\n\t\t$user->generateToken();\n\t\t$user->save();\n\n\t\treturn response()->json([\n\t\t\t'status' => 'Account created',\n\t\t\t'token' => $user->token\n\t\t], 201);\n\t}", "private function registerNewUser()\n {\n if (empty($_POST['user_name'])) {\n $this->errors[] = \"Empty Username\";\n } elseif (empty($_POST['user_password_new']) || empty($_POST['user_password_repeat'])) {\n $this->errors[] = \"Empty Password\";\n } elseif ($_POST['user_password_new'] !== $_POST['user_password_repeat']) {\n $this->errors[] = \"Password and password repeat are not the same\";\n } elseif (strlen($_POST['user_password_new']) < 6) {\n $this->errors[] = \"Password has a minimum length of 6 characters\";\n } elseif (strlen($_POST['user_name']) > 64 || strlen($_POST['user_name']) < 2) {\n $this->errors[] = \"Username cannot be shorter than 2 or longer than 64 characters\";\n } elseif (!preg_match('/^[a-z\\d]{2,64}$/i', $_POST['user_name'])) {\n $this->errors[] = \"Username does not fit the name scheme: only a-Z and numbers are allowed, 2 to 64 characters\";\n } elseif (empty($_POST['user_email'])) {\n $this->errors[] = \"Email cannot be empty\";\n } elseif (strlen($_POST['user_email']) > 64) {\n $this->errors[] = \"Email cannot be longer than 64 characters\";\n } elseif (!filter_var($_POST['user_email'], FILTER_VALIDATE_EMAIL)) {\n $this->errors[] = \"Your email address is not in a valid email format\";\n } elseif (!empty($_POST['user_name'])\n && strlen($_POST['user_name']) <= 64\n && strlen($_POST['user_name']) >= 2\n && preg_match('/^[a-z\\d]{2,64}$/i', $_POST['user_name'])\n && !empty($_POST['user_email'])\n && strlen($_POST['user_email']) <= 64\n && filter_var($_POST['user_email'], FILTER_VALIDATE_EMAIL)\n && !empty($_POST['user_password_new'])\n && !empty($_POST['user_password_repeat'])\n && ($_POST['user_password_new'] === $_POST['user_password_repeat'])\n ) {\n // create a database connection\n $this->db_connection = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);\n\n // change character set to utf8 and check it\n if (!$this->db_connection->set_charset(\"utf8\")) {\n $this->errors[] = $this->db_connection->error;\n }\n\n // if no connection errors (= working database connection)\n if (!$this->db_connection->connect_errno) {\n\n // escaping, additionally removing everything that could be (html/javascript-) code\n $user_name = $this->db_connection->real_escape_string(strip_tags($_POST['user_name'], ENT_QUOTES));\n $user_last = $this->db_connection->real_escape_string(strip_tags($_POST['user_last'], ENT_QUOTES));\n $user_email = $this->db_connection->real_escape_string(strip_tags($_POST['user_email'], ENT_QUOTES));\n\n $user_password = $_POST['user_password_new'];\n\n // crypt the user's password with PHP 5.5's password_hash() function, results in a 60 character\n // hash string. the PASSWORD_DEFAULT constant is defined by the PHP 5.5, or if you are using\n // PHP 5.3/5.4, by the password hashing compatibility library\n $user_password_hash = password_hash($user_password, PASSWORD_DEFAULT);\n\n // check if user or email address already exists\n $sql = \"SELECT * FROM users WHERE user_email = '\" . $user_email . \"';\";\n $query_check_user_name = $this->db_connection->query($sql);\n\n if ($query_check_user_name->num_rows == 1) {\n $this->errors[] = \"<div class='alert alert-danger center' role='alert'> Sorry, that username / email address is already taken. </div>\";\n } else {\n // write new user's data into database\n $sql = \"INSERT INTO users (user_name, user_last, user_password_hash, user_email)\n VALUES('\" . $user_name . \"', '\" . $user_last . \"', '\" . $user_password_hash . \"', '\" . $user_email . \"');\";\n $query_new_user_insert = $this->db_connection->query($sql);\n\n // if user has been added successfully\n if ($query_new_user_insert) {\n $this->messages[] = \"<div class='alert alert-success center' role='alert'> Your account has been created successfully. Please check your emails.</div>\";\n\n // Load username and datejoined for verifcation via email hashing\n $sql=\"SELECT `user_id`, `user_name`, `user_date_joined` FROM `users` WHERE `user_email` = '\" . $user_email . \"';\";\n $query_load_hash_verify = $this->db_connection->query($sql);\n\n // if loaded then include send email and display message\n if ( $query_load_hash_verify) {\n $result_row = $query_load_hash_verify -> fetch_object();\n $codeid = $result_row->user_id;\n $code2 = md5($result_row->user_name);\n $code3 = md5($result_row->user_date_joined);\n\n // created a hash of when the user joined split it into two parts\n $cuthashtime = substr($code3, 0, 4);\n $endhashtime = substr($code3, -4); \n\n $hashedname = $code2;\n $middlehashname = substr($hashedname, 0, 4);\n\n include 'Email.php';\n } else {\n $this->errors[] = \"<div class='alert alert-danger center' role='alert'> Sorry, but we couldn't send your email. Please contact support.</div>\";\n }\n } else {\n $this->errors[] = \"<div class='alert alert-danger center' role='alert'> Sorry, your registration failed. Please go back and try again. </div>\";\n }\n }\n } else {\n $this->errors[] = \"<div class='alert alert-danger center' role='alert'> Sorry, no database connection. </div>\";\n }\n } else {\n $this->errors[] = \"<div class='alert alert-danger center' role='alert'> An unknown error occurred. </div>\";\n }\n }", "public function registerUserRequest()\n {\n $user = factory(User::class)->make();\n\n return $this->json('POST', '/api/v2/user', array_merge($user->toArray(), ['password' => 'secret1234', 'agb_check' => true]));\n }", "public function register(Request $request)\n {\n //validate incoming request\n $this->validate($request, [\n 'first_name' => 'required|string',\n 'last_name' => 'required|string',\n 'email' => 'required|email|unique:users',\n 'password' => 'required|confirmed',\n ]);\n\n try {\n\n $user = new User;\n $user->first_name = $request->input('first_name');\n $user->last_name = $request->input('last_name');\n $user->email = $request->input('email');\n $plainPassword = $request->input('password');\n $user->password = app('hash')->make($plainPassword);\n\n $user->save();\n\n //return successful response\n return response()->json(['user' => $user, 'message' => 'CREATED'], 200);\n\n } catch (\\Exception $e) {\n //return error message\n return response()->json(['message' => 'User Registration Failed!'], 409);\n }\n\n }", "public function register (Request $request) {\n // First, the input fields are passed through validation. All fields are required, the username must be unique, the description can't be over 255 characters, the password must be at least 6 characters and there must be a password_confirmation field in the request that matches the password. If these requirements are not met, appropriate messages are sent to the register page.\n $fields = $request->validate([\n 'username' => 'required|unique:users',\n 'description' => 'required|max:255',\n 'password' => 'required|min:6|confirmed'\n ]);\n \n // If validation is successful, we use the User model to create a new record in the users table. The make function of the Hash facade passes the password through bcrypt encryption. The default options for how many rounds the value is hashed is 10, but we can configure the rounds option to increase the time it takes for the password to be hashed.\n $user = User::create([\n 'username' => $fields['username'],\n 'password' => Hash::make($fields['password'], [\n 'rounds' => 12\n ]),\n 'description' => $fields['description']\n ]);\n \n if($user) {\n return redirect()->route('login')->with('message', 'User registered successfully.');\n } else {\n return back()->with('message', 'Registration error occured.');\n }\n }", "private function registerNewUser()\n {\n if (empty($_POST['user_name'])) {\n $this->errors[] = \"Nome Vazio\";\n } elseif (empty($_POST['user_password_new']) || empty($_POST['user_password_repeat'])) {\n $this->errors[] = \"Senha Vazia\";\n } elseif ($_POST['user_password_new'] !== $_POST['user_password_repeat']) {\n $this->errors[] = \"Senha e repetir senha não são a mesma\";\n } elseif (strlen($_POST['user_password_new']) < 6) {\n $this->errors[] = \"Senha tem tamanho mínimo de 6 caracteres\";\n } elseif (strlen($_POST['user_name']) > 64 || strlen($_POST['user_name']) < 2) {\n $this->errors[] = \"Nome não pode ser menor que 2 ou maior que 64 caracteres\";\n } elseif (empty($_POST['user_email'])) {\n $this->errors[] = \"Email não pode ser vazio\";\n } elseif (strlen($_POST['user_email']) > 64) {\n $this->errors[] = \"Email não pode ser maior que 64 caracteres\";\n } elseif (!filter_var($_POST['user_email'], FILTER_VALIDATE_EMAIL)) {\n $this->errors[] = \"Seu email não está com um formato de email válido\";\n } elseif (!empty($_POST['user_name'])\n && strlen($_POST['user_name']) <= 64\n && strlen($_POST['user_name']) >= 2\n && !empty($_POST['user_email'])\n && strlen($_POST['user_email']) <= 64\n && filter_var($_POST['user_email'], FILTER_VALIDATE_EMAIL)\n && !empty($_POST['user_password_new'])\n && !empty($_POST['user_password_repeat'])\n && ($_POST['user_password_new'] === $_POST['user_password_repeat'])\n ) {\n // create a database connection\n $this->db_connection = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME, DB_PORT);\n\n // change character set to utf8 and check it\n if (!$this->db_connection->set_charset(\"utf8\")) {\n $this->errors[] = $this->db_connection->error;\n }\n\n // if no connection errors (= working database connection)\n if (!$this->db_connection->connect_errno) {\n\n // escaping, additionally removing everything that could be (html/javascript-) code\n $user_name = $this->db_connection->real_escape_string(strip_tags($_POST['user_name'], ENT_QUOTES));\n $user_email = $this->db_connection->real_escape_string(strip_tags($_POST['user_email'], ENT_QUOTES));\n\n $user_type = $_POST['tipo'];\n $user_inst_id = $_POST['instituicao'];\n \n if (!isset($_POST['matricula']))\n {\n $user_mat = \"\";\n }\n else\n {\n $user_mat = $this->db_connection->real_escape_string(strip_tags($_POST['matricula'], ENT_QUOTES));\n }\n $user_password = $_POST['user_password_new'];\n\n // crypt the user's password with PHP 5.5's password_hash() function, results in a 60 character\n // hash string. the PASSWORD_DEFAULT constant is defined by the PHP 5.5, or if you are using\n // PHP 5.3/5.4, by the password hashing compatibility library\n $user_password_hash = password_hash($user_password, PASSWORD_DEFAULT);\n\n // check if user or email address already exists\n $sql = \"SELECT * FROM users WHERE user_email = '\" . $user_email . \"';\";\n $query_check_user_email = $this->db_connection->query($sql);\n\n if ($query_check_user_email->num_rows == 1) {\n $this->errors[] = \"Desculpe, este email já está em uso.\";\n } else {\n // write new user's data into database\n $sql = \"INSERT INTO users (user_name, user_password_hash, user_email, user_type, inst_id, user_mat)\n VALUES('\" . $user_name . \"', '\" . $user_password_hash . \"', '\" . $user_email . \"', '\" . $user_type . \"', '\" . $user_inst_id . \"', '\" . $user_mat . \" ');\";\n $query_new_user_insert = $this->db_connection->query($sql);\n\n // if user has been added successfully\n if ($query_new_user_insert) {\n $this->messages[] = \"Sua conta foi criada com sucesso. Você pode logar agora.\";\n } else {\n $this->errors[] = \"Desculpe, seu registro falhou. Por favor volte e tente novamente.\";\n }\n }\n } else {\n $this->errors[] = \"Desculpe, sem conexão com o banco de dados.\";\n }\n } else {\n $this->errors[] = \"Um erro desconhecido aconteceu.\";\n }\n }", "function registerUser()\n {\n $DBA = new DatabaseInterface();\n $fields = array(0 => 'title', 1 => 'first_name', 2 => 'last_name', 3 => 'contacttelephone', 4 => 'contactemail', 5 => 'password', 6 => 'username', 7 => 'dob', 8 => 'house', 9 => 'street', 10 => 'town', 11 => 'county', 12 => 'pcode', 13 => 'optout', 14 => 'newsletter', 15 => 'auth_level');\n $fieldvals = array(0 => $this->Title, 1 => $this->FirstName, 2 => $this->LastName, 3 => $this->ContactTelephone, 4 => $this->ContactEmail, 5 => $this->Password, 6 => $this->Username, 7 => $this->DOB, 8 => $this->House, 9 => $this->Street, 10 => $this->Town, 11 => $this->County, 12 => $this->PCode, 13 => $this->Optout, 14 => $this->NewsletterSubscriber, 15 => $this->AuthLevel);\n $rs = $DBA->insertQuery(DBUSERTABLE, $fields, $fieldvals);\n if ($rs == 1)\n {\n $this->RegistrationSuccess = 1;\n }\n if (isset($this->PCode))\n {\n $this->geoLocate();\n }\n unset($DBA, $rs, $fields, $fieldvals);\n $DBA = new DatabaseInterface();\n $fields = array(0 => 'id');\n $idfields = array(0 => 'username');\n $idvals = array(0 => $this->Username);\n $rs = $DBA->selectQuery(DBUSERTABLE, $fields, $idfields, $idvals);\n if (!isset($rs[2]))\n {\n while ($res = mysql_fetch_array($rs[0]))\n {\n $this->setUserVar('ID', $res['id']);\n }\n }\n unset($DBA, $rs, $fields, $idfields, $idvals);\n }", "public function registerNewUser($name, $email, $password){\n\n\t\t//echo 'Email'.$email;\n\n\t\t$stmt = $this->conn->prepare(\"INSERT INTO User(name, email, password) VALUES (:name,:email,:password)\");\n\t\t$stmt->execute(['name'=>$name,'email'=>$email,'password'=>$password]);\n\n\t\t$stmt = $this->conn->prepare(\"SELECT * FROM User WHERE email=:email and password=:password\");\n\t\t$stmt->execute(['email'=>$email,'password'=>$password]);\n\t\t$user = $stmt->fetchAll();\n\t\t$num_rows = count($user);\n\n\t\tif($num_rows > 0){\n\t\t\t$items = array();\n\t\t\t$items[\"error_msg\"] = false;\n\t\t\t$items[\"user\"] = $user[0];\n\t\t\techo json_encode($items);\n\t\t}else{\n\t\t\techo '{\"error_msg\":true}';\n\t\t}\n\t}", "public function register(Request $request){\n\n $user = $this->user->create([\n 'cpf_cnpj' => $request->cpf_cnpj,\n 'nome_razaosocial' => $request->nome_razaosocial,\n 'tipo_pessoa' => $request->tipo_pessoa,\n 'password' => bcrypt($request->password),\n 'senha' => md5($request->password)\n ]);\n \n return response()->json(['status'=>true,'messagem'=>'Usuário criado com successo','data'=>$user],200);\n }", "public function actionRegister($username, $email, $password)\r\n {\r\n $user = new User();\r\n $user->username = $username;\r\n $user->email = $email;\r\n $user->status = User::STATUS_ACTIVE;\r\n $user->setPassword($password);\r\n $user->generateAuthKey();\r\n $user->generateEmailVerificationToken();\r\n\r\n if ($user->save()) {\r\n echo 'User registered successfully';\r\n } else {\r\n echo 'error';\r\n }\r\n }", "public function registerAction(Request $request){\n //for the view\n $params = array(\"title\" => _(\"Sign up\"), \"errors\" => array());\n\n $params['username'] = \"\";\n $params['email'] = \"\";\n\n //handle register form\n if ($request->isMethod('post')){\n\n $username = $request->input('username');\n $params['username'] = $username;\n $email = $request->input('email');\n $params['email'] = $email;\n $password = $request->input('password');\n $password_bis = $request->input('password_bis');\n\n //validation\n $validator = new CustomValidator();\n\n $validator->validateUsername($username);\n $validator->validateUniqueUsername($username);\n $validator->validateEmail($email);\n $validator->validateUniqueEmail($email);\n $validator->validatePassword($password);\n $validator->validatePasswordBis($password_bis, $password);\n\n if ($validator->isValid()){\n //hydrate user obj\n $securityHelper = new SH();\n $user = new User();\n \n $user->setNewUuid();\n $user->setUsername( $username );\n $user->setEmail( $email );\n $user->setEmailValidated(false);\n $user->setRole( \"user\" );\n $user->setSalt( SH::randomString() );\n $user->setToken( SH::randomString() );\n $user->setSiteLanguage( 'en' );\n $user->setActive( true );\n\n $hashedPassword = $securityHelper->hashPassword( $password, $user->getSalt() );\n \n $user->setPassword( $hashedPassword );\n// $user->setIpAtRegistration( $_SERVER['REMOTE_ADDR'] );\n $user->setIpAtRegistration($request->ip());\n $user->setDateCreated( time() );\n $user->setDateModified( time() );\n\n //save it\n $userManager = new UserManager();\n $userManager->save($user);\n// @TODO: MAILER\n// send email confirmation message\n// $mailer = new Mailer();\n//\n// $mailerResult = $mailer->sendRegistrationConfirmation($user);\n\n //log user in right now (will redirect home)\n $this->logUser($request, $user);\n// $this->logUser($request, $user);\n $json = new JsonResponse();\n $json->setData(array(\"redirectTo\" => Route('graph')));\n $json->send();\n }\n //not valid\n else {\n $errors = $validator->getErrors();\n $params[\"errors\"] = $errors;\n return response()->json([\n 'error' => $errors\n ],400);\n }\n\n }\n return view('auth.register',['params'=> $params]);\n// $view = new View(\"register.php\", $params);\n// $view->setLayout(\"../View/layouts/modal.php\");\n// $view->send(true);\n }", "public function registerUser( \n $email, \n $name, \n $password, \n $surname, \n $cell_phone_number, \n $gender, \n $province, \n $type_of_study,\n $institution,\n $field_of_study\n ) {\n\n \theader( \"Access-Control-Allow-Origin: *\" ) ;\n\n $user = User::create([\n 'name' => $name,\n 'email' => $email,\n 'password' => Hash::make( $password ),\n ]);\n\n $details = new UserDetail ;\n\n $details->surname = $surname ;\n $details->age = \"0\" ;\n $details->cell_phone_number = $cell_phone_number ;\n $details->gender = $gender ;\n $details->province = $province ;\n $details->type_of_study = $type_of_study ;\n $details->institution = $institution ;\n $details->field_of_study = $field_of_study ;\n\n $details->save() ;\n\n\n $user->roles()->attach( Role::where( 'name', 'student' )->first() ) ;\n\n if ( $user ) {\n \treturn [ 'message' => 'success' ] ;\n } else {\n \treturn [ 'message' => 'failed' ] ;\n }\n\n }", "public function createUserAction() {\n $this->authService->createUser();\n die();\n }", "public function register() {\n\n define('KDEBUG_JSON', true);\n\n $errors = array();\n $success = true;\n\n $slug = user::generateUniqueUsername($_REQUEST['username']);\n if (!isset($_REQUEST['username']) || empty($_REQUEST['username']) || $_REQUEST['username'] == 'Full name') {\n $errors['register_username'] = 'You must specify your Full Name';\n $success = false;\n } elseif (user::findOne(array('slug' => $slug))) {\n $errors['register_username'] = 'This username already exists';\n $success = false;\n }\n\n if (!isset($_REQUEST['email']) || empty($_REQUEST['email']) || $_REQUEST['email'] == 'email address') {\n $errors['register_email'] = 'You must specify an e-mail address';\n $success = false;\n } elseif (!filter_var($_REQUEST['email'], FILTER_VALIDATE_EMAIL)) {\n $errors['register_email'] = 'Invalid e-mail address';\n $success = false;\n } elseif (user::findOne(array('email' => $_REQUEST['email'])) != null) {\n $errors['register_email'] = 'This e-mail address already exists';\n $success = false;\n }\n\n\n if (!isset($_REQUEST['password']) || empty($_REQUEST['password']) || $_REQUEST['password'] == 'password') {\n $errors['register_password'] = 'You must specify a password';\n $success = false;\n } elseif (user::verify('password', $_REQUEST['password']) !== true) {\n $errors['register_password'] = user::verify('password', $_REQUEST['password']);\n $success = false;\n }\n\n if ($_REQUEST['password'] != $_REQUEST['verify']) {\n $errors['register_verify'] = 'Your passwords do not match';\n $success = false;\n }\n\n if ($success) {\n\n // create our new user\n $user = new user();\n $user->email = $_REQUEST['email'];\n $user->username = $_REQUEST['username'];\n $user->slug = $slug;\n\n $user->public = 1;\n $user->created = time();\n $user->updated = time();\n $user->password = crypt($_REQUEST['password']);\n $user->save();\n $user->login();\n\n }\n\n echo json_encode(array('success' => $success, 'errors' => $errors));\n return true;\n\n }", "public function registerAction(Request $request)\r\n {\r\n $user = new User();\r\n $form = $this->createForm(UserType::class, $user);\r\n\r\n // 2) handle the submit (will only happen on POST)\r\n $form->handleRequest($request);\r\n if ($form->isSubmitted() && $form->isValid()) {\r\n\r\n // 3) Encode the password (you could also do this via Doctrine listener)\r\n $password = $this->get('security.password_encoder')\r\n ->encodePassword($user, $user->getPlainPassword());\r\n $user->setPassword($password);\r\n\r\n // 4) save the User!\r\n $em = $this->getDoctrine()->getManager();\r\n $em->persist($user);\r\n $em->flush();\r\n\r\n // ... do any other work - like sending them an email, etc\r\n // maybe set a \"flash\" success message for the user\r\n\r\n //return $this->redirectToRoute('agencia_actors_backend_homepage');\r\n return $this->render('AgenciaActorsBackendBundle:Default:objecteAdded.html.twig', array(\r\n 'titol' => 'Usuari registrat',\r\n 'name' => $user->getUsername()));\r\n }\r\n\r\n return $this->render(\r\n 'AgenciaActorsBackendBundle:Default:register.html.twig',\r\n array('form' => $form->createView())\r\n );\r\n }", "public function register(){\n // 2- check post submitted\n $post = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);\n\n if ($post['submit']){\n\n if ($post['name']=== \"\" || $post['email']=== \"\" ||\n $post['password']=== \"\" || $post['confirm_password']=== \"\" ){\n\n Messages::setMessage('Please Fill All Fields!', 'error');\n return;\n }\n\n // prepare query\n $this->query('INSERT INTO users (name, email, password) VALUES(:name, :email, :password)');\n\n // bind params\n $this->bind(':name',$post['name']);\n $this->bind(':email',$post['email']);\n $this->bind(':password',md5($post['password']));\n\n\n // execute\n $this->execute();\n // check if inserted\n if ($this->lastInsertId()){\n header('Location: '.'users/login');\n }\n\n }\n }", "public function registerAction() {\n if($this->getAuthService()->hasIdentity()) {\n return $this->redirect()->toRoute(self::SUCCESS_URL);\n }\n\n $form = $this->getForm();\n $form->get('submit')->setValue('Register');\n\n $authErrors = array();\n /**\n * @var $request \\Zend\\Http\\Request\n */\n $request = $this->getRequest();\n if($request->isPost()) {\n $form->setData($request->getPost());\n\n if($form->isValid()) {\n\n $user = new User();\n $user->exchangeArray($form->getData());\n\n if($this->getUserTable()->hasUser(array('email' => $user->email))) {\n\n $authErrors[] = 'Another user has registered with this email.';\n\n } else {\n\n $this->getUserTable()->saveUser($user);\n\n //check authentication...\n $this->getAuthService()->getAdapter()\n ->setIdentity($request->getPost('email'))\n ->setCredential($request->getPost('password'));\n\n $result = $this->getAuthService()->authenticate();\n $authErrors = $result->getMessages();\n\n if($result->isValid()) {\n\n //check if it has rememberMe :\n if($request->getPost('rememberme') == 1) {\n $this->getAuthStorage()\n ->setRememberMe(1);\n //set storage again\n $this->getAuthService()->setStorage($this->getAuthStorage());\n }\n $this->getAuthService()->getStorage()->write($request->getPost('email'));\n\n $this->redirect()->toRoute(self::SUCCESS_URL);\n }\n }\n\n }\n }\n\n return new ViewModel(array(\n 'form' => $form,\n 'messages' => $authErrors\n ));\n }", "public function register(Request $request)\n {\n //validate incoming request \n $this->validate($request, [\n 'name' => 'required|string',\n 'email' => 'required|email|unique:users',\n 'password' => 'required|confirmed',\n 'rol' => 'required|string',\n ]);\n\n try {\n\n $user = new User;\n $user->name = $request->input('name');\n $user->email = $request->input('email');\n $user->rol = $request->input('rol');\n $plainPassword = $request->input('password');\n $user->password = app('hash')->make($plainPassword);\n\n $user->save();\n\n //return successful response\n return response()->json(['user' => $user, 'message' => 'CREATED'], 201);\n\n } catch (\\Exception $e) {\n //return error message\n return response()->json(['message' => 'User Registration Failed!'], 409);\n }\n\n }", "protected function registerUser ($username,$email,$password,$roleName = NULL) {\n\t\t$rolId = $this->getRolId($roleName);\n\t\tif (is_object($rolId)) {\n\t\t\t$userRole = $rolId->rol_id;\n\t\t}else {\n\t\t\t$userRole = NULL;\n\t\t}\n\t\t$sql = \"INSERT INTO users (user_name,user_email,user_password,rol_id) VALUES (?,?,MD5(?),?)\";\n\t\t$data = [$username,$email,$password,$userRole];\n\t\t//create stdStatemment object | call to Model method from core/Database.php\t\n\t\t$this->setStatement($sql,$data);\n\t}", "public function register() {\n\t\t\tif($this->Session->read('Auth.User.id')){\n\t\t\t\t$this->redirect('/');\n\t\t\t}\n\t\t\telse {\n\n\t\t\t\tif(!empty($this->request->data)){\n\n\t\t\t\t\t$this->User->create($this->request->data);\n\t\t\t\t\t// Validation des données\n\t\t\t\t\tif($this->User->validates()) {\n\n\t\t\t\t\t\t$token = md5(time() .' - '. uniqid());\n\n\t\t\t\t\t\t$this->User->create(array(\n\t\t\t\t\t\t\t\"email\" \t\t=> $this->request->data['User']['email'],\n\t\t\t\t\t\t\t\"password\" \t\t=> $this->Auth->password($this->request->data['User']['password']),\n\t\t\t\t\t\t\t\"token\" \t\t=> $token\n\t\t\t\t\t\t\t));\n\n\t\t\t\t\t\t// Si tout est ok, on sauvegarde\n\t\t\t\t\t\t$this->User->save();\n\n\t\t\t\t\t\t// Envoie de l'email d'activation à l'utilisateur\n\t\t\t\t\t\t$CakeEmail = new CakeEmail('default');\n\t\t\t\t\t\t$CakeEmail->to($this->request->data['User']['email']);\n\t\t\t\t\t\t$CakeEmail->subject('Dezordre: Confirmation d\\'inscription');\n\t\t\t\t\t\t$CakeEmail->viewVars($this->request->data['User'] + array(\n\t\t\t\t\t\t\t'token' => $token,\n\t\t\t\t\t\t\t'id'\t=> $this->User->id,\n\n\t\t\t\t\t\t\t));\n\t\t\t\t\t\t$CakeEmail->emailFormat('text');\n\t\t\t\t\t\t$CakeEmail->template('register');\n\t\t\t\t\t\t$CakeEmail->send();\n\n\n\t\t\t\t\t\t$this->Session->setFlash(\"Votre compte à bien été créer. Un lien vous à été envoyé par email afin d'activer votre compte.\", 'alert', array('class' => 'success'));\n\t\t\t\t\t\t$this->redirect(array('controller' => 'pages', 'action' => 'display', 'home'));\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t\telse {\n\t\t\t\t\t\t\t$this->Session->setFlash(\"Erreur, merci de corriger\", 'alert', array('class' => 'danger'));\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function register()\n {\n echo 'User Registered';\n }", "public function addUser() {\n $db = new ClassDB();\n $db->connect();\n\n $result = $db->getConnection()->prepare('INSERT INTO users (user_email,\n user_password,\n user_first_name,\n user_last_name) \n VALUES (:email,\n :pass,\n :firstName,\n :lastName)');\n\n $result->bindParam(':email', $this->user_email); \n $result->bindParam(':pass', $this->user_password); \n $result->bindParam(':firstName', $this->user_first_name);\n $result->bindParam(':lastName', $this->user_last_name);\n \n $result->execute();\n $db->disconnect();\n }", "public function addUser($name, $email, $password)\n {\n\n //\n }", "public function create()\n\t{\n\t\tif (!isset($_POST) || empty($_POST))\n\t\t{\n\t\t\theader(\"Location: /myrecipe/users/registry\");\n\t\t\texit;\n\t\t}\n\t\t// TODO need to validate data\n\t\t$data = array('username' => $_POST['username'], 'password' => $_POST['password'], 'cpassword' => $_POST['cpassword'], 'email' => $_POST['email']);\n\t\t// validate the input data\n\t\t$errorArray = User::validates($data);\n\t\tif (count($errorArray))\n\t\t{\n\t\t\t// store errors in session and redirect\n\t\t\t$_SESSION['user'] = $data;\n\t\t\t$_SESSION['user']['errors'] = $errorArray;\n\t\t\theader(\"Location: /myrecipe/users/registry\");\n\t\t\texit;\n\t\t}\n\t\t// create a new user, assume all new users are not staff\n\t\t$values = array('username'=>$_POST['username'],'password'=>$_POST['password'],'email'=>$_POST['email'],'user_type'=>'1');\n\t\t$id = User::createUser($values);\n\t\t// log the user in\n\t\t$_SESSION['user']['id'] = $id;\n\t\t$_SESSION['user']['name'] = $_POST['username'];\n\t\t$_SESSION['user']['type'] = '1';\n\t\techo \"id = \" . $id;\n\t\theader(\"Location: /myrecipe/users/\" . $id);\n\t\texit;\n\t}", "public function store(UserCreateRequest $request)\n {\n\t\t\t$user = User::create([\n\t\t\t\t'name' \t\t\t\t=> $request->input('name'),\n\t\t\t\t'lastname' \t\t=> $request->input('lastname'),\n\t\t\t\t'idNumber'\t\t=> $request->input('idNumber'),\n\t\t\t\t'email' \t\t\t=> $request->input('email'),\n\t\t\t\t'phone' \t\t\t=> $request->input('phone'),\n\t\t\t\t'address' \t\t=> $request->input('address'),\n\t\t\t\t'birthdate' \t=> $request->input('birthdate'),\n\t\t\t\t'category_id' => $request->input('category_id'),\n\t\t\t\t'password'\t\t=> 'password', // I NEED TO ADD LOGIN FUNCTIONALITY\n\t\t\t\t'is_admin'\t\t=> 0,\n\t\t\t\t'status' \t\t\t=> 'non live' // As default in the db?\n\t\t\t]);\n\n\t\t\treturn redirect('/users')->with('success', 'User Registered');\n }", "public function createUser()\n {\n }", "public function register(RegisterRequest $request, User $user)\n {\n \t$user = $user->create([\n\n \t\t'name'\t\t\t\t=> ucwords($request->name), \n \t\t'email'\t\t\t\t=> $request->email,\n \t\t'password'\t\t\t=> Hash::make($request->password),\n \t\t'activation_token'\t=> str_random(60)\n\n \t]);\n\n\t\t\t$credentials = $request->only('email', 'password');\n\n\t\t\ttry {\n // attempt to verify the credentials and create a token for the user\n\t if (! $token = JWTAuth::attempt($credentials)) {\n\t return response()->json(['error' => 'invalid_credentials'], 401);\n\t }\n\t } catch (JWTException $e) {\n\t // something went wrong whilst attempting to encode the token\n\t return response()->json(['error' => 'could_not_create_token'], 500);\n\t }\n\n\t // to send verify at gmail\n\t $user->notify(new SignupActivate($user));\n\n\t // response with fractal\n\t\t\t$response = fractal()\n\t\t\t\t->item($user)\n\t\t\t\t->transformWith(new UserTransformer)\n\t\t\t\t->toArray();\n\n\t\t\t$response['access_token'] = compact('token');\n\n\t // all good so return the token\n\t return response()->json($response, 201);\n }", "public function registerNewUser()\n\t{\n\t\t$Request= new Request();\n\t\t\n\t\t$Controler_Main= Controler_Main::getInstance();\n\t\t$ErrorString=\"\";\n\t\tif(strlen($Request->getAsString(\"tb_Name\"))<3){$ErrorString.=\":T_REGISTER_ERROR1: <br />\";}\n\t\tif(strlen($Request->getAsString(\"tb_Pass\"))<5){$ErrorString.=\":T_REGISTER_ERROR2: <br />\";}\n\t\tif(strlen($Request->getAsString(\"tb_Pass\"))===$Request->getAsString(\"tb_PassConfirme\")){$ErrorString.=\":T_REGISTER_ERROR3:<br />\";}\n\t\t$UserFinder= new UserFinder();\n\t\tif(strlen($Request->getAsString(\"tb_Mail\"))>3)\n\t\t{\n\t\t\t$User=$UserFinder->findByMail($Request->getAsString(\"tb_Mail\"));\n\t\t\tif($User->getId()!=0)\n\t\t\t{\n\t\t\t\t$ErrorString.=\":T_REGISTER_ERROR4: <br />\";\n\t\t\t}\n\t\t}else\n\t\t{\n\t\t\t$ErrorString.=\":T_REGISTER_ERROR5: <br />\";\n\t\t}\t\n\t\tif(strlen($Request->getAsString(\"tb_Mail\"))===$Request->getAsString(\"tb_MailConfirme\")){$ErrorString.=\":T_REGISTER_ERROR6:<br />\";}\n\t\tif(strlen($Request->getAsString(\"tb_Name\")))\n\t\t{\n\t\t\t$User=$UserFinder->findByName($Request->getAsString(\"tb_Name\"));\n\t\t\tif($User->getId()!=0){$ErrorString.=\":T_REGISTER_ERROR7: <br />\";}\n\t\t}\n\t\t\n\t\t\n\t\tif(!$this->isMailCorrect($Request->getAsString(\"tb_Mail\")))\n\t\t{\n\t\t\t$ErrorString.=\":T_REGISTER_ERROR8: <br />\";\n\t\t}\t\n\t\t\n\t\tif(strtolower($_SESSION['Captcha'])!=(strtolower($Request->getAsString(\"tb_Captcha\"))))\n\t\t{\n\t\t\t$ErrorString.=\":T_REGISTER_ERROR9: <br />\";\n\t\t}\n\t\t\t\n\t\tif(strlen($ErrorString)!=0)\n\t\t{\n\t\t\t$this->showRegister($ErrorString);\n\t\t\t$this->setCaptchaCode();\n\t\t\treturn false;\n\t\t}\n\t\t$User= new User(0,$Request->getAsString(\"tb_Name\"),md5($Request->getAsString(\"tb_Pass\")),$Request->getAsString(\"tb_Mail\"),0,1,0,0);\t\n\t\t$UserManager= new UserManager();\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t// user Ordner anlegen\n\t\t\n\t\t// htaccess zugriff legen\n\t\tif(!is_dir(STORE_FOLDER.\"/\".md5($User->getName())))\n\t\t{\n\t\t\tmkdir(STORE_FOLDER.\"/\".md5($User->getName()), 0777);// ordner erstellen\n\t\t\t$User->setFolder(STORE_FOLDER.\"/\".md5($User->getName()));\n\t\t}else\n\t\t{\n\t\t\t$Folder=STORE_FOLDER.\"/\".md5($User->getName()+mktime());\n\t\t\tmkdir($Folder, 0777);\n\t\t\t$User->setFolder($Folder);\n\t\t}\n\t\t\n\t\t$User->setSpaceMax(MAXSPACE);\n\t\t//var_dump(\"und den UserFinder eintragen\");\n\t\t$UserManager->insertUser($User);// user in die db eintragen\n\t\tif(!$UserManager->getLastInsertId())\n\t\t{\n\t\t\t$this->showRegister($ErrorString);\n\t\t\treturn false;\n\t\t}\n\t\t$User->setId($UserManager->getLastInsertId());\n\t\t$this->userLogin();\n\t\t\n\n\t}", "public function register(RegisterRequest $request): void\n {\n $user = User::register(\n $request['name'],\n $request['email'],\n $request['password']\n );\n\n $this->mailer->to($user->email)->send(new VerifyMail($user));\n $this->dispatcher->dispatch(new Registered($user));\n }", "public function registerUser(array $userData)\n {\n $user = $this->loadUserByUsername($userData['username']);\n\n if (!$user) {\n $user = new FrontendUser();\n $user->setEmail($userData['email']);\n $user->setUsername($userData['username']);\n $user->setPlainPassword($userData['password']);\n $user->setEnabled(true);\n $user->setLocked(false);\n\n $this->dm->persist($user);\n $this->dm->flush();\n\n // Send user info via email\n try {\n $message = \\Swift_Message::newInstance()\n ->setSubject('New Account!')\n ->setFrom($this->websiteEmail)\n ->setTo($user->getEmail())\n ->setBody(\n $this->templating->render(\n 'AiselFrontendUserBundle:Email:registration.txt.twig',\n array(\n 'username' => $user->getUsername(),\n 'password' => $userData['password'],\n 'email' => $user->getEmail(),\n )\n )\n );\n\n $this->mailer->send($message);\n } catch (\\Swift_TransportException $e) {\n }\n\n return $user;\n\n } else {\n return false;\n }\n\n }", "public function registerAction()\n {\n if (!isset($this->post['name'])) {\n return new ResponseModel(ResponseModel::ERRORMSG, \"No name was supplied\");\n }\n $name = $this->post['name'];\n if (strlen($name) < 3) {\n return new ResponseModel( ResponseModel::ERRORMSG, \"Name is too short\");\n }\n\n $session = QuizSessionService::getSession();\n $user = $this->quizService->registerUser($name);\n $session->userId = $user->id;\n return new ResponseModel(ResponseModel::USER, $user);\n }", "public function newUser() {\n $this->checkValidUser();\n\n $this->db->sql = 'INSERT INTO '.$this->db->dbTbl['users'].' (username, salt, hash) VALUES (:username, :salt, :hash)';\n\n $salt = $this->getNewSalt();\n\n $res = $this->db->execute(array(\n ':username' => $this->getData('username'),\n ':salt' => $salt,\n ':hash' => md5($salt . $this->getData('password'))\n ));\n\n if($res === false) {\n $this->output = array(\n 'success' => false,\n 'key' => 'xxT5r'\n );\n } else {\n $this->output = array(\n 'success' => true,\n 'key' => 'dU4r5'\n );\n }\n\n $this->renderOutput();\n }", "public function register()\n {\n // make sure request is post\n if( ! SCMUtility::requestIsPost())\n {\n View::make('templates/system/error.php',array());\n return;\n }\n\n // get inputs and clean\n $inputs = array();\n foreach($_POST as $k => $v)\n {\n $inputs[$k] = SCMUtility::stripTags($v);\n }\n\n // validate Course info\n $validator = Validator::make($inputs,User::$rules,User::$rulesMessages);\n\n if($validator->fails())\n {\n SCMUtility::setFlashMessage($validator->messages()->first(),'danger');\n View::make('templates/front/account-login-register-form.php',array());\n return;\n }\n\n if( SCMUtility::emailExists($inputs['email']) )\n {\n SCMUtility::setFlashMessage('Email is already used!','danger');\n View::make('templates/front/account-login-register-form.php',array());\n return;\n }\n\n // begin create the new user registration\n $user = new User();\n $user->first_name = $inputs['first_name'];\n $user->middle_name = $inputs['middle_name'];\n $user->last_name = $inputs['last_name'];\n $user->email = $inputs['email'];\n $user->password = $inputs['password'];\n $user->suffix = $inputs['suffix'];\n $user->employers_company_name = $inputs['employers_company_name'];\n $user->home_mailing_address_1 = $inputs['home_mailing_address_1'];\n $user->home_mailing_address_2 = $inputs['home_mailing_address_2'];\n $user->city = $inputs['city'];\n $user->state = $inputs['state'];\n $user->zip_code = $inputs['zip_code'];\n $user->personal_cell_number = $inputs['personal_cell_number'];\n\n if( ! $user->save())\n {\n SCMUtility::setFlashMessage('Failed to store user','danger');\n View::make('templates/front/account-login-register-form.php',array());\n return;\n }\n\n // login the new registered user\n if( ! Session::loginUserByEmail($user->email) )\n {\n SCMUtility::setFlashMessage('Failed to automatically logged in.','danger');\n View::make('templates/front/account-login-register-form.php',array());\n return;\n }\n\n // send sign up thank you email\n $studentMailerService = new StudentMailerService();\n try {\n $studentMailerService->sendSignUpEmailToStudent($user->email,$inputs['password']);\n } catch (\\Exception $e){\n $log = new Log();\n $log->systemLog(\"\\nFailed to notify user/student about its welcome sign up. \\nError: {$e}\");\n }\n\n // notify admin for the new user registration\n $adminMailerService = new AdminMailerService();\n try {\n $adminMailerService->notifyForNewUserRegistration(\n $user->first_name.' '.$user->middle_name.' '.$user->last_name,\n $user->email\n );\n } catch (\\Exception $e) {\n $log = new Log();\n $log->systemLog(\"\\nFailed to notify admin about the new user registration. \\nError: {$e}\");\n }\n\n\n SCMUtility::frontRedirectTo('?page=scmCourseModule&state=Front&action=myAccount');\n }", "public static function create($user){\n\t\tApp::get('database')->add('users',$user);\n\t}", "public function register(Request $request)\n {\n //validate incoming request \n $this->validate($request, [\n 'username' => 'required|string|unique:users',\n 'password' => 'required|confirmed',\n \n ]);\n\n try \n {\n $user = new User;\n $user->username= $request->input('username');\n $user->password = app('hash')->make($request->input('password'));\n $user->user_ip = $request->ip();\n $user->register_date =Carbon::now();\n $user->isAdmin = true;\n $user->save();\n\n return response()->json( [\n 'entity' => 'users', \n 'action' => 'create', \n 'result' => 'success'\n ], 201);\n\n } \n catch (\\Exception $e) \n {\n return response()->json( [\n 'entity' => 'users', \n 'action' => 'create', \n 'result' => 'failed'\n ], 409);\n }\n }", "public function newRegistration() {\n $this->registerModel->getUserRegistrationInput();\n $this->registerView->setUsernameValue($this->registerView->getUsername());\n $this->registerModel->validateRegisterInputIfSubmitted();\n if ($this->registerModel->isValidationOk()) {\n $this->registerModel->hashPassword();\n $this->registerModel->saveUserToDatabase();\n $this->loginView->setUsernameValue($this->registerView->getUsername());\n $this->loginView->setLoginMessage(\"Registered new user.\");\n $this->layoutView->render(false, $this->loginView);\n } else {\n $this->layoutView->render(false, $this->registerView);\n }\n \n }", "public function register($user_name, $user_email, $user_password)\n {\n try {\n $new_password = password_hash($user_password, PASSWORD_DEFAULT);\n\n // SQL statement to be held in variable\n $stmt = $this->db->prepare(\n 'INSERT INTO user(user_name, user_email, user_password)\n VALUES(:user_name, :user_email, :user_password)');\n\n $stmt->bindparam(':user_name', $user_name);\n $stmt->bindparam(':user_email', $user_email);\n $stmt->bindparam(':user_password', $new_password);\n $stmt->execute();\n\n return $stmt;\n } catch (PDOException $e) {\n echo $e->getMessage();\n }\n }", "function give_register_and_login_new_user( $user_data = array() ) {\n\t// Verify the array.\n\tif ( empty( $user_data ) ) {\n\t\treturn - 1;\n\t}\n\n\tif ( give_get_errors() ) {\n\t\treturn - 1;\n\t}\n\n\t$user_args = apply_filters( 'give_insert_user_args', array(\n\t\t'user_login' => isset( $user_data['user_login'] ) ? $user_data['user_login'] : '',\n\t\t'user_pass' => isset( $user_data['user_pass'] ) ? $user_data['user_pass'] : '',\n\t\t'user_email' => isset( $user_data['user_email'] ) ? $user_data['user_email'] : '',\n\t\t'first_name' => isset( $user_data['user_first'] ) ? $user_data['user_first'] : '',\n\t\t'last_name' => isset( $user_data['user_last'] ) ? $user_data['user_last'] : '',\n\t\t'user_registered' => date( 'Y-m-d H:i:s' ),\n\t\t'role' => give_get_option( 'donor_default_user_role', 'give_donor' ),\n\t), $user_data );\n\n\t// Insert new user.\n\t$user_id = wp_insert_user( $user_args );\n\n\t// Validate inserted user.\n\tif ( is_wp_error( $user_id ) ) {\n\t\treturn - 1;\n\t}\n\n\t// Allow themes and plugins to filter the user data.\n\t$user_data = apply_filters( 'give_insert_user_data', $user_data, $user_args );\n\n\t/**\n\t * Fires after inserting user.\n\t *\n\t * @since 1.0\n\t *\n\t * @param int $user_id User id.\n\t * @param array $user_data Array containing user data.\n\t */\n\tdo_action( 'give_insert_user', $user_id, $user_data );\n\n\t/**\n\t * Filter allow user to alter if user when to login or not when user is register for the first time.\n\t *\n\t * @since 1.8.13\n\t *\n\t * return bool True if login with registration and False if only want to register.\n\t */\n\tif ( true === (bool) apply_filters( 'give_log_user_in_on_register', true ) ) {\n\t\t// Login new user.\n\t\tgive_log_user_in( $user_id, $user_data['user_login'], $user_data['user_pass'] );\n\t}\n\n\t// Return user id.\n\treturn $user_id;\n}", "public function registerUser()\n\t\t{\n\t\t\ttry{\n\t\t\t\t\n\t\t\t\t$client = OrientDb::connection();\n\t\t\t\t$insert = $client->command('SELECT createUser({username: \"' . $this->email . '\", email : \"' . $this->email . '\", password: \"' . $this->password . '\", nameFirst:\"' . $this->name . '\", nameLast: \"' . $this->lastname . '\", authData : null, phone: \"' . $this->phone . '\"})');\n\t\t\t\t$response = $insert->getOData();\n\t\t\t\treturn $response;\n\n\t\t\t}catch(PhpOrientException $e){\n\t\t\t\t\n\t\t\t\treturn $e;\n\n\t\t\t}\n\t\t}", "public function register_user()\n {\n if (isset($_POST['btnRegister'])) {\n $username = $_POST['username_reg'];\n $password = $_POST['password'];\n $role = 2;\n\n //check Username ton tai hay khong ton tai\n $checkUsername = $this->UserModel->checkUsername($username);\n if ($checkUsername == 'true') {\n header(\"Location:../Register\");\n } else {\n // 2.INSERT DATA EQUAL USERS\n $rs = $this->UserModel->InserNewUser($username,$password,$role);\n // 3.SHOW OK/FAILS ON SCREENS\n header(\"Location:../Login\");\n }\n }\n }", "public function registerNewUser($fullName,$email,$password);", "public function register()\n {\n if(is_logged_in()) {\n redirect_to(url('thread/index'));\n }\n\n $user = new User;\n $page = Param::get('page_next', 'register');\n\n switch ($page) {\n case 'register':\n break;\n\n case 'register_end':\n $user->username = Param::get('username');\n $user->password = Param::get('password');\n $user->email = Param::get('email');\n\n try {\n $user->register();\n } catch (ValidationException $e) {\n $page = 'register';\n }\n break;\n\n default:\n throw new PageNotFoundExcpetion(\"{$page} not found\");\n }\n\n $this->set(get_defined_vars());\n $this->render($page);\n }", "public function store(UserRegisterRequest $request)\n {\n $pwd = bcrypt($request->password);\n dd($pwd);\n $instance = User::create([\n 'name' => $request->name,\n 'email' => $request->email,\n 'phone' => $request->phone,\n 'password' => $pwd\n ]);\n\n if($instance){\n return redirect()->back()->with('callback', '新增成功');\n }else{\n //还是 throw new E?\n return redirect()->back()->withErrors('新增失败,请重试');\n }\n }", "public function create() {\n $username = Input::get('reg_username');\n $email = Input::get('email');\n $password = Input::get('reg_password');\n $confirm_password = Input::get('confirm_password');\n\n // Make sure that both passwords are identical\n if (strcmp($password, $confirm_password) == 0) {\n $hashed_password = Hash::make($password);\n try {\n $user = new User;\n $user -> username = $username;\n $user -> email = $email;\n $user -> password = $hashed_password;\n $user -> save();\n } catch (\\Illuminate\\Database\\QueryException $e) {\n return Redirect::route('register') -> with(array(\n 'alert-message' => 'Error: Failed to register user in database.',\n 'alert-class' => 'alert-danger'\n ));\n }\n\n // Login the new user automatically\n $user = User::where('username', '=', $username) -> first();\n Auth::login($user);\n\n return Redirect::route('home') -> with(array(\n 'alert-message' => 'Welcome! You have successfully created an account, and have been logged in.',\n 'alert-class' => 'alert-success'\n ));\n }\n\n return Redirect::route('register') -> with(array(\n 'alert-message' => 'The attempt to create an account was unsuccessful!',\n 'alert-class' => 'alert-danger'\n ));\n }", "public function registration(UserCreateRequest $request)\n {\n $credentials = request()->all(['phone', 'password']);\n\n if ($token = auth()->attempt($credentials)) {\n return $this->respondWithToken($token);\n }\n if (User::where('phone', $credentials['phone'])->count() > 0) {\n return response()->json([\n 'errors' => [\n 'wrong' => 'Already exist'\n ]\n ], 401);\n }\n\n $user = User::store($request->all());\n auth()->login($user);\n\n $token = auth()->attempt($credentials);\n return $this->respondWithToken($token);\n }", "public function registerNewUser($nickname, $real_name, $password, $password_again){\n $userHandler = new UserHandler();\n $userHandler->register(new RegisterData($nickname, $real_name, $password, $password_again, null, null));\n }", "public function create(RegisterRequest $request)\n {\n $role = Role::findById(1);\n $user = new User;\n $user->email = $request->email;\n $user->name = $request->name;\n $user->password = bcrypt($request->password);\n $user->assignRole($role);\n $user->save();\n return $this->sendResponse($user);\n }", "function user_register($user_info)\n {\n }" ]
[ "0.809836", "0.7926072", "0.78862864", "0.76646274", "0.76519436", "0.760792", "0.74082655", "0.73868763", "0.73660284", "0.73586243", "0.73045146", "0.7300225", "0.7286076", "0.72756267", "0.72569776", "0.7249064", "0.7236494", "0.7195184", "0.7195184", "0.7195184", "0.7195184", "0.7175699", "0.71623003", "0.71513575", "0.7148906", "0.7131152", "0.7121998", "0.7094561", "0.70844334", "0.70803756", "0.70604557", "0.703843", "0.70241404", "0.6994343", "0.69943076", "0.69909465", "0.69855624", "0.6959541", "0.6959425", "0.69451576", "0.69376373", "0.6915667", "0.6907481", "0.6902179", "0.6890026", "0.68875057", "0.6880455", "0.6880322", "0.6877939", "0.68677515", "0.6865729", "0.6849479", "0.68401974", "0.68369824", "0.68314594", "0.68279135", "0.682486", "0.6816017", "0.68130785", "0.6805225", "0.6803236", "0.67988896", "0.67985356", "0.67963225", "0.67951435", "0.6787215", "0.6781503", "0.67779076", "0.6775838", "0.6774825", "0.67745197", "0.6766582", "0.676378", "0.67616177", "0.67513055", "0.67489326", "0.6746195", "0.67374873", "0.67334926", "0.67286456", "0.6726986", "0.67211026", "0.67134327", "0.67088217", "0.67036206", "0.6702123", "0.66987085", "0.66929096", "0.6689257", "0.66869926", "0.66840154", "0.66778547", "0.6677206", "0.66688323", "0.6661444", "0.66611016", "0.6660497", "0.6658315", "0.6656324", "0.66559124", "0.66552114" ]
0.0
-1
Check email address registered to a user.
public function check_email(Request $request) { $email = $request->input('email'); $id = $request->input('id'); $user = \App\User::where('id', '!=', $id)->where('email', $email)->get(); if ($user->count() > 0) return response()->json(false); else return response()->json(true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function useremail_check($str) {\r\n $res = $this->auth_model->is_email_exists($str);\r\n if ($res <= 0) {\r\n $this->form_validation->set_message('useremail_check', lang_key('email_not_matched'));\r\n return FALSE;\r\n } else {\r\n return TRUE;\r\n }\r\n }", "public function hasEmailAddress()\n {\n return $this->_hasVar('user_email') && $this->_getVar('user_email');\n }", "public function _check_email_exists($email = ''){\n\t\t\n\t}", "function email_check($email)\r\n\t{\r\n\t\tif ( $user = $this->generic_model->get_where_single_row('users', array('email' => $email))) \r\n\t\t{\r\n\t\t\t$this->form_validation->set_message('email_check', 'This %s is already registered.');\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse { return true; }\r\n\t}", "public function email_exists() {\n\t\t\n\t\t$email = $this->input->post('users_email');\n\t\t$edit_id = $this->input->post ( 'edit_id' );\n\t\t$where = array (\n\t\t\t'users_email' => trim ( $email )\n\t\t);\n\n\t\tif ($edit_id != \"\") {\n\n\t\t\t$where = array_merge ( $where, array (\n\t\t\t\t\t\"users_id !=\" => $edit_id \n\t\t\t) );\n\t\n\t\t} \n\n\t\t$result = $this->Mydb->get_record( 'users_id', $this->table, $where );\n\t\t\n\t\tif ( !empty ( $result ) ) {\n\t\t\t$this->form_validation->set_message ( 'email_exists', get_label ( 'user_email_exist' ) );\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "function is_valid_email( $user_email, $user_id = 0 )\n\t{\t\t\n\t\tif ( strtolower( $this->user->get_info( $user_id )->user_email ) == strtolower( $user_email )) {\n\n\t\t\treturn true;\n\t\t} else if ( $this->user->exists( array( 'user_email' => $_REQUEST['user_email'] ))) {\n\n\t\t\t$this->form_validation->set_message('is_valid_email', 'Email Address is already existed in the system');\n\t\t\treturn false;\n\t\t} else {\n\n\t\t\treturn true;\n\t\t}\n\t}", "public function checkRegisteredEmail()\n {\n $email = $this->input->post('email');\n\n $user_login_id = $this->authentication_helper->checkEmail($email);\n \n if (isset($user_login_id) && !empty($user_login_id)) {\n echo json_encode(true);\n }\n else\n {\n echo json_encode(false);\n }\n }", "public function check_email_existence() {\n\t\t$email = $_GET['email'];\n\t\t$checkExistEmail = $this->User->find('count', array('conditions'=>array('User.email' => $email)));\n\t\techo $checkExistEmail;\n\t\texit();\n\t}", "public function checkIfEmailExists($email);", "public function CheckEmail($email, $userId);", "function email_exists($email)\n {\n global $connection;\n $query = \"select user_email from users where user_email = '{$email}'\";\n $result = mysqli_query($connection, $query);\n confirmQuery($result);\n if(mysqli_num_rows($result) > 0)\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "private static function is_email_address(string $username)\n {\n }", "public function check_email() {\n\t\t$email = urldecode($_GET['email']);\n\n\t\t$result = $this->Member_Model->check_email_if_exists($email);\n\n\t\tif ($result > 0) {\n\t\t\techo json_encode(false);\n\t\t} else {\n\t\t\techo json_encode(true);\n\t\t}\n\t}", "public function checkEmailAvailability()\n {\n $email = $this->input->post('email');\n\n $user_login_id = $this->authentication_helper->checkEmail($email);\n if (isset($user_login_id) && !empty($user_login_id)) {\n echo json_encode(true);\n }\n else\n {\n echo json_encode(false);\n }\n }", "public function usermail() {\n\n $mail = $_POST['mail'];\n\n $dmn = substr($mail, strpos($mail, '@') + 1);\n\n $fmt = filter_var($mail, FILTER_VALIDATE_EMAIL);\n\n return checkdnsrr($dmn) && $fmt;\n\n }", "public function check_email( $email )\n\t{\n\t\t// Check the e-mail address\n\t\t$user_email = apply_filters( 'user_registration_email', $email );\n\t\tif (! is_email( $user_email ) ) {\n\t\t\t$this->errors['email'] = apply_filters( \"{$this->prefix}/create_object/error/email_invalid\", $this->settings['strings']['email_invalid'] );\n\t\t\t$user_email = '';\n\t\t} elseif ( email_exists( $user_email ) ) {\n\t\t\t$this->errors['email'] = apply_filters( \"{$this->prefix}/create_object/error/email_exists\", $this->settings['strings']['email_exists'] );\n\t\t}\n\t\treturn $user_email;\n\t}", "public function checkEmail($email){\r\n $requete = \"select * from users where (Email='\" . $email . \"') \";\r\n //error_log(\"check email requete = (\" . $requete . \")\\n\");\r\n if ($this->getRequete($requete)){\r\n //$this->display();\r\n if ($this->Email == $email){\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "function checkMAIL($account, $email)\n {\n while ($users = $account->fetch()) {\n if ($users['email'] == $email) {\n return true;\n }\n }\n return false;\n }", "private function _emailIsRegistered($email_address) {\r\n\t\t$model = Mage::getModel('customer/customer');\r\n $model->setWebsiteId(Mage::app()->getStore()->getWebsiteId())->loadByEmail($email_address);\r\n\t\tif ($model->getId()) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function checkEmail(){\n\t\t\t$user = new User;\n\t\t\t$doubleCount = $user->where('login','=', Input::get('new_user_email'))->count();\n\t\t\t\n\t\t\tif($doubleCount > 0){\n\t\t\t\t$result = array(\n\t\t\t\t\t'cmd'=>1,\n\t\t\t\t\t'msg'=>trans('alerts.exist_email')\n\t\t\t\t);\n\t\t\t}else{\n\t\t\t\t$result = array(\n\t\t\t\t\t'cmd'=>0,\n\t\t\t\t\t'msg'=>'good email'\n\t\t\t\t);\n\t\t\t}\n\t\t\t\n\t\t\treturn Response::json($result);\n\t\t}", "public function validateUserEmail()\n {\n if (!$this->hasErrors() && !$this->getUser()) {\n $this->addError('id', Yii::t('skeleton', 'Your email was not found.'));\n }\n }", "public function hasEmail(): bool;", "public function isEmail();", "public function email_check($str){\n $con['returnType'] = 'count';\n $con['conditions'] = array('email'=>$str);\n $checkEmail = $this->user->getRows($con);\n if($checkEmail > 0){\n $this->form_validation->set_message('email_check', 'The given email already exists.');\n return FALSE;\n } else {\n return TRUE;\n }\n }", "public function emailExists(User $user) {\n\t\t$email = $user->getEmail();\n\t\t$req = \"SELECT EXISTS (SELECT login FROM users WHERE email=?) AS email_exist\";\n\t\t$response = $this->getDb()->fetchAssoc($req, array($email));\n\t\treturn $response;\n\t\t\n\t}", "function chk_email($email)\n\t{\n\t\t$str = \"Select u_email from tbl_user where u_email = ?\";\n\t\t\n\t\t//Executes the query\n\t\t$res = $this -> db -> query($str, $email);\n\t\t\n\t\t//Checks whether the result is available in the table\n\t\tif($res -> num_rows() > 0)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "function check_email($str){\n\t\t$this->db->where('user_email',$str);\n\t\t$rs\t=\t$this->db->get('reseller_store');\t\n\t\t$is_email_exits\t=\t$rs->num_rows();\n\t\tif($is_email_exits>0){\n\t\t\t$user_email_exits_msg\t=\tRegisterMessages(1);\n\t\t\t$this->form_validation->set_message('check_email', $user_email_exits_msg);\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t\treturn true;\n\t}", "public function checkEmailAction() {\n\t\t\n\t\t$request = $this->getRequest();\n\t\t\t\n\t\t\t\n\t\tif ($request->isPost()) {\n\t\t\t// get the json raw data\n\t\t\t$handle = fopen(\"php://input\", \"rb\");\n\t\t\t$http_raw_post_data = '';\n\t\t\t\n\t\t\twhile (!feof($handle)) {\n\t\t\t $http_raw_post_data .= fread($handle, 8192);\n\t\t\t}\n\t\t\tfclose($handle); \n\t\t\t\n\t\t\t// convert it to a php array\n\t\t\t$json_data = json_decode($http_raw_post_data, true);\n\t\t\t\t\t\n\t\t\t$isFreeEmail = Application_Model_User::checkEmail($json_data);\n\t\t\t\n\t\t\tif($isFreeEmail) {\n\t\t\t\t// continue\n\t\t\t\techo 1;\n\t\t\t}\n\t\t\t\n\t\t\telse {\n\t\t\t\t// email exists already\n\t\t\t\techo 0;\n\t\t\t}\n\t\t}\n\t}", "function checkEmail()\n {\n\t\t\t$email = $_POST['email'];\n\n\t\t\t// Check its existence (for example, execute a query from the database) ...\n\t\t\t$email_cek = $this->account_model->Check_TblUsers('email',$email);\n\t\t\t\n\t\t\tif($email_cek == 0)\n\t\t\t{\n\t\t\t\t$isAvailable = true;\n\t\t\t}else{\n\t\t\t\t$isAvailable = False;\n\t\t\t} \n\n\t\t\t// Finally, return a JSON\n\t\t\techo json_encode(array(\n\t\t\t\t'valid' => $isAvailable,\n\t\t\t));\n\t\t}", "function is_registered($email) {\n\t\tglobal $pdo;\n\n\t\t//delete old registration attempts\n\t\t$pdo->query(\"DELETE FROM user WHERE verified = 0 AND TIME_TO_SEC(TIMEDIFF(CURRENT_TIMESTAMP, code_generation_time)) > 600\");\n\n\t\t//empty or array check\n\t\tif(empty($email) || is_array($email)) {\n\t\t\treturn null;\n\t\t}\n\n\t\t//check if user exists\n\t\t$sql = \"SELECT id FROM user WHERE REPLACE(email, \\\".\\\", \\\"\\\") = REPLACE(:email, \\\".\\\", \\\"\\\")\";\n\t\t$sth = $pdo->prepare($sql);\n\t\t$sth->bindValue(\":email\", mail_simplify($email), PDO::PARAM_STR);\n\t\t$sth->execute();\n\n\t\tif($sth->rowCount() == 0) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "public function uniqueEmail() {\n if (CmsUser::model()->exists(\"id != \" . userId() . \" AND email='{$this->register_email}'\")) {\n $this->addError('register_email', 'Email already exist');\n }\n }", "public function validateEmailConfirmedUnique()\n\t{ \n\t\tif ( $this->email )\n\t\t{\n\t\t\t$exists = User::findOne([\n\t\t\t\t'email' => $this->email,\n\t\t\t]);\n\n\t\t\tif ( $exists )\n\t\t\t{\n\t\t\t\t$this->addError('email', 'This E-mail has already been taken.');\n\t\t\t}\n\t\t}\n\t}", "private function checkEmail(){\n\n $request = $this->_connexion->prepare(\"SELECT COUNT(*) AS num FROM Users WHERE user_email=?\");\n $request->execute(array($this->_userEmail));\n $numberOfRows = $request->fetch();\n\n if($numberOfRows['num'] == 0)\n return false;\n else\n return true;\n\n }", "public function is_valid_emailAction() {\r\n\t\t$validator = new Zend_Validate_EmailAddress();\r\n\t\t$email_address = $this->getRequest()->getPost('email_address');\r\n\t\t$message = 'Invalid';\r\n\t\tif ($email_address != '') {\r\n\t\t\t// Check if email is in valid format\r\n\t\t\tif(!$validator->isValid($email_address)) {\r\n\t\t\t\t$message = 'invalid';\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t//if email is valid, check if this email is registered\r\n\t\t\t\tif($this->_emailIsRegistered($email_address)) {\r\n\t\t\t\t\t$message = 'exists';\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t$message = 'valid';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t$result = array('message' => $message);\r\n\t\t$this->getResponse()->setBody(Zend_Json::encode($result));\r\n\t}", "function isUserRegistered($email) {\n\t\ttry {\n \t\tif($email==null) {\n \treturn false;\n \texit();\n\t\t}\n\t\t$mailCheck = $this->connection->prepare(\"SELECT `EMAIL` from win WHERE `email` = ?\");\n\t\t$mailCheck->bindValue(1, $email);\n\t\t$mailCheck->execute();\n\t\tif ($mailCheck->rowCount() > 0) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n \treturn false;\n \texit();\n\t\t}\n\t}\n\t\tcatch(Exception $e) {\n\t\t}\n\t}", "public function checkemail() {\n\n if (env(\"NEW_ACCOUNTS\") == \"Disabled\" && env(\"GUEST_SIGNING\") == \"Disabled\") {\n\n $account = Database::table(\"users\")->where(\"email\", input(\"email\"))->first();\n if (!empty($account)){\n response()->json(array(\"exists\" => true));\n }else{\n response()->json(array(\"exists\" => false));\n }\n\n }\n\n }", "function is_email_address_unsafe($user_email)\n {\n }", "function ValidateEmail( $email ) {\n // Check if address is valid\n if( ! filter_var( $email, FILTER_VALIDATE_EMAIL ) )\n return false;\n\n // Break up into parts\n $parts = explode( '@', $email );\n $user = $parts[0];\n $domain = $parts[1];\n\n // Check if domain resolves\n if( ! checkdnsrr( $domain, 'MX' ) && ( ! checkdnsrr( $domain, 'A' ) || ! checkdnsrr( $domain, 'AAAA' ) ) )\n return false;\n\n return true;\n}", "function userEmailTaken($email){\r\n\t $email = mysql_real_escape_string($email);\r\n if(!get_magic_quotes_gpc()){\r\n $email = addslashes($email);\r\n }\r\n $q = \"SELECT email FROM users WHERE email = '$email'\";\r\n $result = mysql_query($q, $this->connection);\r\n return (mysql_numrows($result) > 0);\r\n }", "public function is_email_registered($userEmail){\n $query = $this->db->get_where('user', array ('usr_email' => $userEmail));\n $query->row_array();\n\n if ($query->num_rows() > 0){return true;}\n return false;\n }", "function _os2dagsorden_create_agenda_meeting_create_user_form_email_validate($element, $form, &$form_state) {\r\n $value = $element['#value'];\r\n if (!valid_email_address($value)) {\r\n form_error($element, t('Indtast en gyldig email adresse.'));\r\n }\r\n if (db_query(\"SELECT COUNT(*) FROM {users} WHERE mail = :mail;\", array(':mail' => $value))->fetchField()) {\r\n form_error($element, t('Der findes allerede en bruger med denne email.'));\r\n }\r\n}", "public function is_valid_email()\r\n {\r\n // email address.\r\n\r\n return (!empty($this->address) && preg_match($this->re_email, $this->address));\r\n }", "public function validate_email()\n\t{\n\t\t$user = JFactory::getUser();\n\t\t$config = OSMembershipHelper::getConfig();\n\t\t$email = $this->input->get('fieldValue', '', 'string');\n\t\t$validateId = $this->input->getString('fieldId');\n\t\t$arrayToJs = array();\n\t\t$arrayToJs[0] = $validateId;\n\t\t$arrayToJs[1] = true;\n\n\t\tif ($this->app->isSite() && $config->registration_integration && !$user->id)\n\t\t{\n\t\t\t$db = JFactory::getDbo();\n\t\t\t$query = $db->getQuery(true);\n\t\t\t$query->select('COUNT(*)')\n\t\t\t\t->from('#__users')\n\t\t\t\t->where('email = ' . $db->quote($email));\n\t\t\t$db->setQuery($query);\n\t\t\t$total = $db->loadResult();\n\n\t\t\tif ($total)\n\t\t\t{\n\t\t\t\t$arrayToJs[1] = false;\n\t\t\t}\n\t\t}\n\n\t\techo json_encode($arrayToJs);\n\n\t\t$this->app->close();\n\t}", "public function isEmailRegistered()\n {\n return $this->isEmailAvailable($this->getEmailAddress());\n\n }", "public function check_email() {\n\n\t\t$email = Input::post('email');\n \n\t\tif(is_string($email)) {\n\t\t\t\n\t\t\t$this->_password_reset->_unlocked_me($email);\n\t\t\t$row = $this->_password_reset->_validate_email($email);\n\t\t\t$res = $this->_password_reset->getData($email);\n\t\t\t$_res = $this->_password_reset->_check_if_reg($email);\n\t\t\t$ques = $this->_question->getquestion($res['question_id']);\n\n\t\t\tif($row > 0) {\n\t\t\t\tif($_res > 0) {\n\t\t\t\t\tif($res['status'] != 0) {\n\t\t\t\t\t\t$_arr = array('msg' =>Constant::EMAIL_CONFIRM, 'question' => $ques['security_question']);\n\t\t\t\t\t\techo json_encode($_arr);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$_arr = array('msg' =>Constant::LOCKED);\n\t\t\t\t\t\techo json_encode($_arr);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$_arr = array('msg' =>Constant::NOT_REGISTERED);\n\t\t\t\t\techo json_encode($_arr);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\theader(\"HTTP/1.0 404 Not Found\");\n\t\t\t\texit;\n\t\t\t}\n\n\t\t} else {\n\t\t\theader(\"HTTP/1.0 404 Not Found\");\n\t\t\texit;\n\t\t}\n\t}", "public function testEmailAvailable()\n {\n $user = factory(User::class)->make();\n $this->assertTrue(User::isEmailAvailable($user->email));\n }", "function check_existing_email($email){\n $sql = \"SELECT * from mbf_user WHERE email='$email'\";\n $query = $query = $this->db->query($sql);\n if ($query->num_rows() > 0){\n return true;\n }else{\n return false;\n }\n }", "function checkemail() {\n\t\tConfigure::write('debug', 0);\n\t\t$this->autoRender = false;\n\t\t$this->layout = \"\";\n\t\t\n\t\t$email = $_REQUEST['data']['Member']['email'];\n\t\t\n\t\t$count = $this->Member->find('count', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'email' => $email\n\t\t\t)\n\t\t));\n\t\t\n\t\t\n\t\tif ($count > 0) {\n\t\t\techo \"false\";\n\t\t} else {\n\t\t\techo \"true\";\n\t\t}\n\t}", "function verify_email()\n\t{\n\t\tlog_message('debug', 'Account/verify_email');\n\t\t$data = filter_forwarded_data($this);\n\t\t$data['msg'] = get_session_msg($this);\n\t\tlog_message('debug', 'Account/verify_email:: [1] post='.json_encode($_POST));\n\t\t# skip this step if the user has already verified their email address\n\t\tif($this->native_session->get('__email_verified') && $this->native_session->get('__email_verified') == 'Y'){\n\t\t\tredirect(base_url().'account/login');\n\t\t}\n\n\t\t# otherwise continue here\n\t\tif(!empty($_POST['emailaddress'])){\n\t\t\t$response = $this->_api->post('account/resend_link', array(\n\t\t\t\t'emailAddress'=>$this->native_session->get('__email_address'),\n\t\t\t\t'baseLink'=>base_url()\n\t\t\t));\n\n\t\t\t$data['msg'] = (!empty($response['result']) && $response['result']=='SUCCESS')?'The verification link has been resent':'ERROR: The verification link could not be resent';\n\t\t}\n\n\t\t$data = load_page_labels('sign_up',$data);\n\t\t$this->load->view('account/verify_email', $data);\n\t}", "public function iN_CheckEmailExistForRegister($email) {\n\t\t$email = mysqli_real_escape_string($this->db, $email);\n\t\t$checkEmail = mysqli_query($this->db, \"SELECT i_user_email FROM i_users WHERE i_user_email = '$email'\") or die(mysqli_error($this->db));\n\t\tif (mysqli_num_rows($checkEmail) == 1) {\n\t\t\treturn true;\n\t\t} else {return false;}\n\t}", "public function email_check($str){ \n $con = array( \n 'returnType' => 'count', \n 'conditions' => array( \n 'email' => $str \n ) \n ); \n $checkEmail = $this->User->getRows($con); \n if($checkEmail > 0){ \n $this->form_validation->set_message('email_check', 'The given email already exists.'); \n return FALSE; \n }else{ \n return TRUE; \n } \n }", "public function checkEmail($data){\n $this->stmt = $this->query('SELECT * FROM users WHERE email = :email');\n $this->stmt->bindValue(':email', $data['email']);\n $row = $this->single();\n // Check row\n if($this->stmt->rowCount() > 0){\n return true;\n } else {\n return false;\n }\n\n }", "public function check_email($str){\n\n\t\t$data = array(\n\t\t\t'id_usuario'=>$this->input->post('id_usuario'),\n\t\t\t'email' =>$str\n\t\t);\n\n\t\tif($this->Usuarios_model->check_email($data)){\n\t\t\t$this->form_validation->set_message('check_email', 'El email ya se encuentra registrado para otro usuario');\n\t\t\treturn false;\n\t\t}else{\n\t\t\treturn true;\n\t\t}\n\n\t}", "private function checkEmail($data) {\n\t\tif(filter_var($data, FILTER_VALIDATE_EMAIL)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function checkEmail($email){\n\n\t\t\t$query = \"SELECT Email FROM tbl_userinfo WHERE Email=$email LIMIT 1\";\n\t\t\t\n\t\t\t$result = $this->conn->query($query); \n\n\t\t\tif (var_dump($result) > 0){\n\t\t\t\treturn true;\n\n\t\t\t}else{\n\t\t\t\treturn false;\n\n\t\t\t}\n\n\t\t}", "public function verifyContainsEmail(): bool\n {\n $words = explode(' ', $this->input);\n foreach ($words as $word) {\n if (static::isValidEmail($word)) {\n return true;\n }\n }\n \n return false;\n }", "public function userEmailCheck($uName,$uEmail){\n \n $username = [\n 'conditions' => ['user_name = ?'],\n 'bind' => [\"$uName\"]\n ];\n $email = [\n 'conditions' => ['user_email = ?'],\n 'bind' => [\"$uEmail\"]\n ];\n if($this->findFirst($username,$operator = \"and\") && $this->findFirst($email,$operator = \"and\")){\n header(REGISTER_REDIRECT . \"?error=usernameemailexist&uname=\" . $this->uName . \"&udisplay=\" . $this->uDisplayName . \"&umail=\" . $this->uEmail);\n exit(); \n }\n elseif($this->findFirst($username,$operator = \"and\")){\n header(REGISTER_REDIRECT . \"?error=usernameexist&uname=\" . $this->uName . \"&udisplay=\" . $this->uDisplayName . \"&umail=\" . $this->uEmail);\n exit(); \n }\n elseif($this->findFirst($email,$operator = \"and\")){\n header(REGISTER_REDIRECT . \"?error=emailexist&uname=\" . $this->uName . \"&udisplay=\" . $this->uDisplayName . \"&umail=\" . $this->uEmail);\n exit(); \n }\n return true;\n }", "public function checkEmail($sender,$param)\r\n\t{\r\n\t\t$userRecord=TblUsers::finder()->findBy_email($this->Email->Text);\r\n\r\n\t\tif($userRecord != null)\r\n\t\t\t$param->IsValid = false;\r\n\t}", "function is_email($value)\r\n{\r\n\treturn preg_match('/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$/i', $value);\r\n}", "function user_email_exists($email){\n global $connection;\n\n $query = \"SELECT user_email FROM users WHERE user_email = '{$email}'\";\n $result = mysqli_query($connection, $query);\n confirm($result);\n\n //if the user_email column name already has a value that is given by the user when registering\n if (mysqli_num_rows($result) > 0) {\n return true;\n }else{\n return false;\n }\n}", "public function checkEmail()\n {\n $email = $this->input->post('email');\n\n $user_login_id = $this->authentication_helper->checkEmail($email);\n\n if (isset($user_login_id) && !empty($user_login_id)) {\n echo json_encode(false);\n }\n else\n {\n echo json_encode(true);\n }\n }", "function checkUsername_Email(){\n\t\t\t$value = $_POST[\"value\"];\n\t\t\t$field = $_POST[\"field\"];\n\t\t\t//echo \"$value\".' '.$field;\n\t\t\t$query = $this->db->query(\"SELECT $field FROM users WHERE $field='$value' LIMIT 1\");\n\t\t\t$valid = $query->num_rows();\n\t\t\tif($valid == 0){\n\t\t\t\tif($field == 'email'){\n\t\t\t\t\techo \"Eunique\";\n\t\t\t\t}else{\n\t\t\t\t\techo \"U_unique\";\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tif($field == 'email'){\n\t\t\t\t\techo \"This \".$field.\" is already registered with another user.\";\n\t\t\t\t}else{\n\t\t\t\t\techo \"This \".$field.\" is not available, please choose something different\";\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function emailOk ($email) {\r\n return filter_var($email, FILTER_VALIDATE_EMAIL);\r\n }", "private function checkuseremail($email){\n\t\t$this->db->where('Email',$email);\n\t\t$this->db->select('Email,Status');\n\n\t\t$query=$this->db->get('tbl_userdetails');\n\t\tif($query->num_rows()==1){\n\t\t\treturn false;\n\t\t}\n\t\telse{\n\t\t\treturn true;\n\t\t}\n\n\t}", "private function checkUserEmailAvailability($username, $email) {\n $query1 = \"call getUsername(:username)\";\n $query2 = \"call getEmailAddress(:email)\";\n try {\n if (self::$connection == NULL) {\n require 'php/credentials.php';\n self::connectionInit($dbconn);\n }\n $stmt = self::$connection->prepare($query1);\n $stmt->bindParam(':username', $username);\n $stmt->execute();\n $q1 = $stmt->fetch();\n\n $stmt = self::$connection->prepare($query2);\n $stmt->bindParam(':email', $email);\n $stmt->execute();\n $q2 = $stmt->fetch();\n // if any of them exists, return false\n return !($q1 || $q2);\n } catch (PDOException $e) {\n echo \"<div style='color: red;'>**${query1}**<br>**${query2}</div> \" . $e->getMessage();\n exit();\n }\n }", "public function checkEmail($email){\n\t\t\t$sql = \"SELECT Email FROM tbl_user WHERE Email=:Email LIMIT 1\";\n\t\t\t$query = $this->db->conn->prepare($sql);\n\n\t\t\t$query->bindValue(':Email', $email);\n\t\t\t$query->execute();\n\n\t\t\tif ($query->rowCount() > 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}", "function check_email()\n\t{\n\t\tif($this->user_model->check_email($_POST['email'])>0)\n\t\t\techo json_encode(false);\n\t\telse\n\t\t\techo json_encode(true);\n\t}", "public function user_email_check($uemail) {\r\n $this->db->select('user_email');\r\n $this->db->where('user_email', $uemail);\r\n $query = $this->db->get('users');\r\n $data = $query->result();\r\n return $data;\r\n }", "function checkUserByEmail($email){\n\t\t$rec\t= $this->query(\"SELECT `id` from `users` where `email` = '$email' AND `user_type` = '1'\");\t\t\n\t\tif($rec && mysql_num_rows($rec)>0){\t\t\t\n\t\t\t//if user with the email got found\n\t\t\treturn true;\n\t\t}else{\n\t\t\t//if user with the email got not found\n\t\t\treturn false;\n\t\t}\n\t}", "public function email_check($email)\n {\n session_check();\n $user_id = $this->uri->segment(3);\n $user_id = empty($user_id) ? $this->session->userdata('user_id') : $user_id;\n if($this->uri->segment(2) == 'add' || $this->uri->segment(2) == 'Add')\n $user_id = 0;\n if($this->users_model->isemailexist($email, $user_id))\n {\n $this->form_validation->set_message('email_check', $this->lang->line('validation_email_exist'));\n return FALSE;\n }\n return TRUE; \n }", "public function emailEntryIsValid() {\r\n \r\n $email = $this->getEmail();\r\n \r\n if ( empty($email) ) {\r\n $this->errors[\"email\"] = \"Email is missing.\";\r\n } else if ( !Validator::emailIsValid($this->getEmail()) ) {\r\n $this->errors[\"email\"] = \"Email is not valid.\"; \r\n }\r\n \r\n return ( empty($this->errors[\"email\"]) ? true : false ) ;\r\n }", "function verify_email($email) // Colorize: green\n { // Colorize: green\n return isset($email) // Colorize: green\n && // Colorize: green\n is_string($email) // Colorize: green\n && // Colorize: green\n filter_var($email, FILTER_VALIDATE_EMAIL); // Colorize: green\n }", "public function validateEmail($userId,$email){\n $con=$GLOBALS['con'];\n $sql=\"SELECT 1 FROM user WHERE user_email='$email' AND user_id!='$userId'\";\n $results = $con->query($sql);\n if($results->num_rows>0)\n {\n return false;\n }\n else\n {\n return true;\n }\n }", "private function checkEmailAvailable($value, $message)\n {\n $user = User::find_email_exists(strtolower($value));\n\n if($user !== false)\n {\n $this->errors [] = $message;\n return false;\n } else {\n return true;\n }\n }", "public function emailCheck($email){\n\t\t\t$sql = \"SELECT email FROM customer WHERE Email = :Email\";\n\t\t\t$query = $this->db->pdo->prepare($sql);\n\t\t\t$query->bindValue(':Email', $email);\n\t\t\t$query->execute();\n\n\t\t\tif ($query->rowCount() > 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}", "function emailExist($link, $useremail) {\n\t\t// use escape function to avoid sql injection attacks\n\t\t$email = mysqli_real_escape_string($link, $_POST[$useremail]);\n\t\t$query = \"SELECT `email` FROM users WHERE email='\".$email.\"'\";\n\n\t\t$result = mysqli_query($link, $query);\n\t\treturn mysqli_num_rows($result);\n\t}", "public function testMyGmailAddressIsEvaluatedAsTrue()\n {\n $this->assertTrue(EmailValidator::validate(\"[email protected]\"));\n }", "public function email_check($str){\n\t\tif ($this->user_model->count(array('email' => $str)) > 0){\n $this->form_validation->set_message('email_check', 'Email sudah digunakan, mohon ganti dengan yang lain');\n return FALSE;\n }\n else{\n return TRUE;\n }\n\t}", "function femail_user_add_validate($form, &$form_state){\n if(!valid_email_address($form_state['values']['femail_email'])){\n form_set_error('femail_email', t('Email address provided is not valid'));\n }\n // Check for existing entries.\n if(db_result(db_query(\"SELECT email FROM {femail_user_emails} WHERE email='%s' UNION SELECT mail FROM {users} WHERE mail='%s'\", $form_state['values']['femail_email'], $form_state['values']['femail_email']))){\n form_set_error('femail_email', t('Email is already in use on this site.'));\n }\n}", "function checkEmailExists()\n {\n $userId = $this->input->post(\"userid\");\n $email = $this->input->post(\"email\");\n\n if (empty($userId)) {\n $result = $this->user_model->checkEmailExists($email);\n } else {\n $result = $this->user_model->checkEmailExists($email, $userId);\n }\n\n if (empty($result)) {\n echo(\"true\");\n } else {\n echo(\"false\");\n }\n }", "public function verify_email($email){\n $query = $this->db->where('01_email', $email)\n ->get('register_01');\n if(sizeof($query->result_array())>0){\n return true;\n }\n else{\n return false;\n }\n }", "function isUserExisted($email) {\n $result = mysql_query(\"SELECT email from users WHERE email = '$email'\",$first);\n $no_of_rows = mysql_num_rows($result);\n if ($no_of_rows > 0) {\n // user existed \n return true;\n } else {\n // user not existed\n return false;\n }\n }", "function checkEmail($checkemail) {\r\n if(preg_match(\"/^([a-zA-Z0-9])+([a-zA-Z0-9\\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\\._-]+)+$/\" , $checkemail))\r\n {\r\n list($username,$domain)=split('@',$checkemail);\r\n \r\n if(!getmxrr ($domain,$mxhosts)) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n return false;\r\n}", "function email_exists($email){\n\t\t$emailexistsql = \"SELECT email FROM users WHERE email = :email\";\n\n\t\t$stmt = $database->prepare();\n\n\t\t$stmt->bindParam(':email', $email);\n\n\t\t$stmt->execute();\n\n\t\tif ($stmt->rowCount() > 0){\n\t\t\techo(\"Email Exists\");\n\t\t\treturn true;\n\t\t}\n\t}", "function validate_email ($address) {\n return preg_match('/^[a-z0-9!#$%&\\'*+\\/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&\\'*+\\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i', $address);\n }", "function isEmailRegistered ($email) {\n $connect = $GLOBALS['connect'];\n \n $queryCheck = \"SELECT * FROM user WHERE email = '$email'\";\n \n $mysqlQueryCheck = mysqli_query ($connect,$queryCheck);\n \n if (!mysqli_affected_rows ($connect)){\n \n // Save to database\n \n return true;\n \n }\n else {\n \n echo false;\n \n }\n}", "public function emailExists($email)\n {\n $e = \"'\".$email.\"'\";\n $qb = new QB;\n $qb->conn = static::getDB();\n $results = $qb->select('users', 'email')\n ->where('email', '=', $e)\n ->all();\n if(count($results) > 0){\n $this->errors[] = \"Sorry! This email has already been taken.\";\n }\n }", "public function email_check($str){\n\t\tif($this->user_model->exist_row_check('email', $str) > 0){\n $this->form_validation->set_error_delimiters('', '');\n\t\t\t$this->form_validation->set_message('email_check', 'Email telah digunakan');\n\t\t\treturn FALSE;\n\t\t}\n\t\telse{\n\t\t\treturn TRUE;\n\t\t}\n\t}", "function isValidEmail($email, &$acountInfo)\n {\n $retval = true;\n $acountInfo = modApiFunc(\"Users\", \"getAcountInfoByEmail\", $email);\n if (sizeof($acountInfo)==0)\n {\n $retval=false;\n }\n return $retval;\n }", "public function hasEmail() {\n return $this->_has(4);\n }", "function emailExists($f): bool\n {\n $exists = false;\n if(!empty($this->load(array('email=?',$f->get('POST.login_email'))))){\n $exists = true;\n }\n return $exists;\n }", "public function emailExists($email) {\n\n\t $app = getApp();\n\n\t $sql = 'SELECT ' . $app->getConfig('security_email_property') . ' FROM ' . $this->table .\n\t ' WHERE ' . $app->getConfig('security_email_property') . ' = :email LIMIT 1';\n\n\t $dbh = ConnectionModel::getDbh();\n\t $sth = $dbh->prepare($sql);\n\t $sth->bindValue(':email', $email);\n\n\t if($sth->execute()) {\n\t $foundUser = $sth->fetch();\n\t if($foundUser){\n\t return true;\n\t }\n\t }\n\t return false;\n\t}", "function checkEmail($email){\n\t\t\t$database = new connect();\n\t\t\t$result = false;\n\t\t\t\n\t\t\t$query = \"SELECT * FROM users WHERE email='$email'\";\n\t\t\t$resultQuery = mysql_query($query); \n\t\t\t\n\t\t\tif(mysql_num_rows($resultQuery) == 1){\n\t\t\t\t$result = true;\n\t\t\t}\n\t\t\treturn $result;\n\t\t}", "public function check_mail($email) {\n\n\n\t\treturn (mysql_result($this->query(\"SELECT COUNT(`id`) FROM `users` WHERE `email` = '$email'\"), 0) ? true: false);\n\n\t}", "function _email_callback($email)\n {\n $id = $this->uri->segment(4);\n $data = $this->user_model->email_validation($id, $email);\n \n if ($data->num_rows() > 0) {\n $this->form_validation->set_message('_email_callback', '%s already taken.');\n return FALSE;\n } else {\n return TRUE;\n }\n }", "function email_exists($email) {\n $email = sanitize($email);\n $query = mysql_query(\"SELECT COUNT(`user_id`) FROM `users` WHERE `email` = '$email'\");\n return (mysql_result($query, 0) == 1) ? true : false;\n}", "function check_email($Email)\n\t{\n\n\tif ($this->Logeo_model->check_email($Email)) {\n\t\t\t$this->form_validation->set_message('check_email', \"$Email ya esta registrado \");\n\t\t\treturn FALSE;\n }\n else\n {\n return TRUE;\n }\n\t}", "public function checkEmail() {\n $result = $this->model->checkEmail($_POST);\n if($result) {\n echo \"true\"; \n } else {\n echo \"false\";\n }\n }", "function check_email ($email) {\n\t\n if (preg_match ('/^[-!#$%&\\'*+\\\\.\\/0-9=?A-Z^_{|}~]+' . '@' . '([-0-9A-Z]+\\.)+' . '([0-9A-Z]){2,4}$/i', trim ($email))) {\n \n return true;\n \n } else {\n \n return false;\n \n }\n}", "public static function testAvailableEmailAddress( $email_address, $exception_message = null ){\r\n \r\n $email_address = \\Altumo\\Validation\\Emails::assertEmailAddress( $email_address, $exception_message );\r\n $email_address = strtolower( $email_address );\r\n \r\n $count = UserQuery::create()\r\n ->usesfGuardUserQuery()\r\n ->filterByUsername( $email_address )\r\n ->endUse()\r\n ->count();\r\n \r\n if( $count === 0 ){\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n \r\n }", "Public Function emailExists($Email)\n\t{\n\t\t$Result = $this->_db->fetchRow('SELECT * FROM bevomedia_user WHERE email = ?', $Email);\n\t\tif(sizeOf($Result) == 0 || !$Result)\n\t\t\treturn false;\n\t\telse\n\t\t\treturn true;\n\t}" ]
[ "0.7513657", "0.74119896", "0.736107", "0.73391783", "0.7255019", "0.7183093", "0.71828276", "0.71618676", "0.7157971", "0.7145045", "0.7120983", "0.7079642", "0.70697737", "0.70628375", "0.7052354", "0.70347524", "0.7023175", "0.70123315", "0.6986402", "0.69732946", "0.69551164", "0.6952812", "0.6948264", "0.69459176", "0.69423205", "0.6941589", "0.6935736", "0.6927171", "0.69164836", "0.69161487", "0.6912642", "0.6910876", "0.69097316", "0.69090074", "0.6897694", "0.6886349", "0.6884832", "0.6878484", "0.6861206", "0.68590224", "0.6856265", "0.6849937", "0.6848564", "0.6838296", "0.6836047", "0.6835341", "0.68323267", "0.6831822", "0.6826726", "0.681976", "0.68128896", "0.68046206", "0.68016124", "0.6801328", "0.6800616", "0.6794854", "0.6792985", "0.67716", "0.67710567", "0.6764653", "0.6762924", "0.6762198", "0.6762108", "0.6761215", "0.67581284", "0.6752038", "0.67488635", "0.6747607", "0.67462915", "0.67445165", "0.67273176", "0.67240155", "0.67189145", "0.67174935", "0.6705117", "0.67046994", "0.6701212", "0.66975427", "0.6694751", "0.6685433", "0.6684351", "0.6682794", "0.6681178", "0.6676814", "0.6676305", "0.6675948", "0.66717404", "0.66678774", "0.6664562", "0.66585404", "0.665469", "0.66530144", "0.66515064", "0.6647667", "0.6643631", "0.6643004", "0.664016", "0.6639267", "0.6636118", "0.6634951", "0.6634299" ]
0.0
-1
Helper to get a validator for an incoming registration request.
protected function validator(array $data) { return Validator::make($data, [ 'name' => 'required|max:255', 'email' => 'required|email|max:255|unique:users', 'password' => 'required|min:6', ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getValidator() {}", "public function getValidator();", "public function getValidator();", "protected function getValidatorInstance()\n {\n // cause comes json, we need to change it to array to validate it\n $this->request->set('postHashtag', json_decode($this->input()['postHashtag'], true));\n $this->request->set('activeLocales', json_decode($this->input()['activeLocales'], true));\n // clean alias from unnecessary symbols\n $this->request->set('postAlias', Helpers::cleanToOnlyLettersNumbers($this->input()['postAlias']));\n\n\n return parent::getValidatorInstance();\n }", "public function getValidator()\n {\n return $this->validator;\n }", "public function getValidator()\n {\n return $this->validator;\n }", "public function getValidator()\n {\n return $this->validator;\n }", "protected function createValidator() {\n return $this->validator;\n }", "protected function getValidatorInstance()\n {\n return app(ValidationFactory::class);\n }", "public function getValidatorService();", "private function getValidator()\n {\n return Validation::createValidatorBuilder()->enableAnnotationMapping()->getValidator();\n }", "protected function getValidator($request)\n {\n $rules = [\n 'page_title' => 'required',\n 'status' => 'required|integer|between:0,1'\n ];\n \n $customMessages = [\n 'page_title.required' => __('admin.pages.field_validation.title_field_required_msg'),\n 'status.required' => __('admin.pages.field_validation.status_field_required_msg')\n ];\n\n return Validator::make($request->all(), $rules, $customMessages);\n }", "protected function get9c2345652e8ae3f87ba009d0f8fedee27bb751398014908e9ab2fb6d5bf1300f(): \\Viserio\\Component\\Validation\\Validator\n {\n return $this->services[\\Viserio\\Contract\\Validation\\Validator::class] = new \\Viserio\\Component\\Validation\\Validator();\n }", "public static function getValidatorInstance()\n {\n if (static::$validator === null)\n {\n static::$validator = new Validator();\n }\n\n return static::$validator;\n }", "public function getValidator()\n\t{\n\t\treturn $this->validation->validator->validator;\n\t}", "public function validator()\n {\n return $this->validator;\n }", "public function getValidator() {\n return $this->__validator;\n }", "private function getValidator()\n {\n $v = new Validator();\n $v->addRules([\n ['label', 'Label', 'required'],\n ['num_value', 'Number', 'exists type=number'],\n ['comment', 'Comment', 'exists'],\n ]);\n return $v;\n }", "public function createValidator();", "public function getValidator() \n {//--------------->> getValidator()\n return $this->_validator;\n }", "public function getValidator()\n\t{\n\t\tif (!is_object($this->_validator)) {\n\t\t\t$validatorClass = $this->xpdo->loadClass('validation.xPDOValidator', XPDO_CORE_PATH, true, true);\n\t\t\tif ($derivedClass = $this->getOption(xPDO::OPT_VALIDATOR_CLASS, null, '')) {\n\t\t\t\tif ($derivedClass = $this->xpdo->loadClass($derivedClass, '', false, true)) {\n\t\t\t\t\t$validatorClass = $derivedClass;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($profitClass = $this->getOption('mlmsystem_handler_class_profit_validator', null, '')) {\n\t\t\t\tif ($profitClass = $this->xpdo->loadClass($profitClass, $this->getOption('mlmsystem_core_path', null, MODX_CORE_PATH . 'components/mlmsystem/') . 'handlers/validations/', false, true)) {\n\t\t\t\t\t$validatorClass = $profitClass;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($validatorClass) {\n\t\t\t\t$this->_validator = new $validatorClass($this);\n\t\t\t}\n\t\t}\n\t\treturn $this->_validator;\n\t}", "protected function getValidationFactory()\n {\n return app('validator');\n }", "protected function getValidatorInstance()\n {\n $factory = $this->container->make('Illuminate\\Validation\\Factory');\n if (method_exists($this, 'validator')) {\n return $this->container->call([$this, 'validator'], compact('factory'));\n }\n\n $rules = $this->container->call([$this, 'rules']);\n $attributes = $this->attributes();\n $messages = [];\n\n $translationsAttributesKey = $this->getTranslationsAttributesKey();\n\n foreach ($this->requiredLocales() as $localeKey => $locale) {\n $this->localeKey = $localeKey;\n foreach ($this->container->call([$this, 'translationRules']) as $attribute => $rule) {\n $key = $localeKey . '.' . $attribute;\n $rules[$key] = $rule;\n $attributes[$key] = trans($translationsAttributesKey . $attribute);\n }\n\n foreach ($this->container->call([$this, 'translationMessages']) as $attributeAndRule => $message) {\n $messages[$localeKey . '.' . $attributeAndRule] = $message;\n }\n }\n\n return $factory->make(\n $this->all(),\n $rules,\n array_merge($this->messages(), $messages),\n $attributes\n );\n }", "public function createValidator()\n {\n $validator = Validation::createValidatorBuilder()\n ->setMetadataFactory(new ClassMetadataFactory(new StaticMethodLoader()))\n ->setConstraintValidatorFactory(new ConstraintValidatorFactory($this->app))\n ->setTranslator($this->getTranslator())\n ->setApiVersion(Validation::API_VERSION_2_5)\n ->getValidator();\n\n return $validator;\n }", "public function getValidator($name = 'default') {\n\t\t\t//\n\t\t\tif ($name == 'default') { return new Validator();}\n\t\t\trequire (VALIDATORS . $name . '_validator.php');\n\t\t\t$name = $name . '_Validator';\n\t\t\treturn new $name();\n\t\t}", "public function getValidatorService()\n {\n return $this->validatorService;\n }", "public function getCreateTaskValidator()\n : Validators\\ValidatorInterface\n {\n return $this->app->make(\n Validators\\CreateTaskValidator::class\n );\n }", "function validator() {\n if ($this->validator) return $this->validator;\n $options = array();\n foreach ($this->fields_options as $field => $field_options) {\n if (!@$field_options['validation']) continue;\n $options[$field] = $field_options['validation'];\n }\n return $this->validator = new xValidatorStore($options, $_REQUEST);\n }", "protected function validator($request)\n {\n $data = $request->all();\n $vcode = $request->session()->get('p'.$data['phone']);\n return Validator::make($data, [\n 'name' => 'required|max:255|unique:users,name',\n 'phone' => 'required|phone|max:255|unique:users,phone',\n 'email' => 'required|email|max:255|unique:users,email',\n 'phonecode' => 'required|regex:/' . $vcode['verifycode'] . '/',\n 'password' => 'required|confirmed|min:6|max:20',\n ]);\n }", "protected function getValidatorService()\n {\n return $this->services['validator'] = $this->get('validator.builder')->getValidator();\n }", "protected function getValidatorInstance()\n {\n $validator = parent::getValidatorInstance();\n\n $validator->sometimes('family_member_id.*', 'distinct', function($input)\n {\n return $input->family_member == 1;\n });\n\n $validator->sometimes('family_member_id.*', 'not_in:'. $this->request->get('patriarch'), function($input)\n {\n return $input->family_member == 1;\n });\n\n return $validator;\n }", "private function createValidator()\n {\n // add custom validation rules\n \\Validator::extend('contains_caps',\n function($field, $value, $params)\n {\n return preg_match('#[A-Z]#', $value);\n }\n );\n\n \\Validator::extend('contains_digit',\n function($field, $value, $params)\n {\n return preg_match('#[0-9]#', $value);\n }\n );\n\n // set array of messages for custom rules\n $messages = array(\n 'contains_caps' => ':attribute must contain at least one capital letter.',\n 'contains_digit' => ':attribute must contain at least one numeric digit.'\n );\n\n // set array of rules to use for validation (many are Laravel's built-ins)\n $rules = array(\n 'email' => 'required|email|max:255',\n 'password' => 'required|between:8,50|contains_caps|contains_digit', // password has some \"strength\" requirements\n 'first_name' => 'required|max:50',\n 'last_name' => 'required|max:50',\n 'city' => 'required|max:100',\n 'state' => 'required|max:2',\n 'zip' => 'required|max:20',\n 'biography' => 'required',\n );\n\n $validator = \\Validator::make(\\Input::all(), $rules, $messages);\n\n return $validator;\n }", "public function getValidator()\n {\n if ($this->_validator === null) {\n\n if (class_exists('\\Klikasi\\\\Validator\\Newsletter')) {\n\n $this->setValidator(new \\Klikasi\\Validator\\Newsletter);\n }\n }\n\n return $this->_validator;\n }", "public function validator()\n {\n return UserValidator::class;\n }", "protected function getValidatorInstance()\n {\n // cause comes json, we need to change it to array to validate it\n $this->request->set('categories_names', json_decode($this->input()['categories_names'], true));\n // clean alias from unnecessary symbols\n $this->request->set('category_alias', Helpers::cleanToOnlyLettersNumbers($this->input()['category_alias']));\n\n return parent::getValidatorInstance();\n }", "public function validator()\n {\n\n return UserValidator::class;\n }", "public function validator()\n {\n\n return UserValidator::class;\n }", "public function validator()\n {\n\n return UserValidator::class;\n }", "public function validator()\n {\n\n return UserValidator::class;\n }", "public function validator()\n {\n\n return UserValidator::class;\n }", "function getCMSValidator()\n {\n return $this->getValidator();\n }", "function getValidator() {\n\t\tif ( !$this->_Validator instanceof utilityValidator ) {\n\t\t\t$this->_Validator = new utilityValidator();\n\t\t}\n\t\treturn $this->_Validator;\n\t}", "function getValidator() {\n\t\tif ( !$this->_Validator instanceof utilityValidator ) {\n\t\t\t$this->_Validator = new utilityValidator();\n\t\t}\n\t\treturn $this->_Validator;\n\t}", "function getValidator() {\n\t\tif ( !$this->_Validator instanceof utilityValidator ) {\n\t\t\t$this->_Validator = new utilityValidator();\n\t\t}\n\t\treturn $this->_Validator;\n\t}", "private function validator(Request $request)\n {\n //validate the form...\n }", "protected function validator(Request $request)\n\t{\n\t\treturn Validator::make($request->all(), [\n\t\t\t'title' => 'required',\n\t\t\t]);\n\t}", "public function withContext(mixed $context): ValidatorInterface;", "public function getValidator()\n {\n if ($this->_validator === null) {\n\n if (class_exists('\\Klikasi\\\\Validator\\Kanpaina')) {\n\n $this->setValidator(new \\Klikasi\\Validator\\Kanpaina);\n }\n }\n\n return $this->_validator;\n }", "public function getValidator()\n {\n if ($this->_validator === null) {\n\n if (class_exists('\\Atezate\\\\Validator\\Cubos')) {\n\n $this->setValidator(new \\Atezate\\Validator\\Cubos);\n }\n }\n\n return $this->_validator;\n }", "public static function getValidator($name, array $options = []);", "protected function getValidator(): void\n {\n // TODO: Implement getValidator() method.\n }", "public function getDelegatedValidator()\n {\n return $this->validator;\n }", "protected function getValidator()\n {\n if ($form = $this->owner->getForm()) {\n \n if (($validator = $form->getValidator()) && $validator instanceof Validator) {\n return $validator;\n }\n \n }\n }", "public function createFooResponseValidator(): ResponseValidatorInterface\n {\n return new AcmeFooResponseValidator();\n }", "public function makeValidator()\r\n {\r\n if (10 == $this->countDigits($this->string)) {\r\n return new Validator10($this->string);\r\n }\r\n\r\n if (13 == $this->countDigits($this->string)) {\r\n return new Validator13($this->string);\r\n } \r\n }", "protected function createUserValidator($request) {\n \treturn Validator::make($request,[\n 'first_name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users',\n 'last_name' => 'required',\n 'password' => 'required|min:6',\n 'status' => 'required'\n ]);\n \t}", "protected function validator(Request $request)\n {\n return Validator::make($request, [\n 'first_name' => 'required',\n 'last_name' => 'required',\n 'suburb' => 'required',\n 'zipcode' => 'required',\n\t\t\t\n ]);\n }", "public function validator()\n {\n\n return FormInfoValidator::class;\n }", "protected function validator(Request $request)\n {\n return Validator::make($request, [\n 'name' => ['required', 'string', 'max:255'],\n 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],\n 'password' => ['required', 'string', 'min:8', 'confirmed'],\n ]);\n }", "protected function getValidatorInstance()\n {\n $validator = parent::getValidatorInstance();\n $validator->setAttributeNames(trans('mconsole::personal.form'));\n\n return $validator;\n }", "public function validator()\n {\n $validator = validator($this->all(), [\n 'name' => 'required|max:255',\n 'server_provider_id' => ['required', Rule::exists('server_providers', 'id')->where(function ($query) {\n $query->where('user_id', $this->user()->id);\n })],\n 'region' => 'required|string',\n 'source_provider_id' => ['required', Rule::exists('source_providers', 'id')->where(function ($query) {\n $query->where('user_id', $this->user()->id);\n })],\n 'repository' => [\n 'required',\n 'string',\n new ValidRepository(SourceProvider::find($this->source_provider_id))\n ],\n 'database' => 'string|alpha_dash|max:255',\n 'database_size' => 'string',\n ]);\n\n return $this->validateRegionAndSize($validator);\n }", "protected function validation($request)\n {\n\n $validator = Validator::make($request->all(), [\n 'firstname' => 'required',\n 'lastname' => 'required',\n 'email' => 'required',\n 'pocketmoney' => 'required',\n 'password' => 'required',\n 'age' => 'required',\n 'city' => 'required',\n 'state' => 'required',\n 'zip' => 'required',\n 'country' => 'required',\n ]);\n\n return $validator;\n }", "protected function validator(Request $request)\n {\n return Validator::make($request->all(), [\n 'userid' => 'required|max:11',\n 'password' => 'required'\n ]);\n }", "public function validator()\n {\n $validator = $this->baseValidator([\n 'stripe_token' => 'required',\n 'vat_id' => 'nullable|max:50|vat_id',\n ]);\n\n if (Spark::collectsBillingAddress()) {\n $this->validateBillingAddress($validator);\n }\n\n return $validator;\n }", "public function get($codename) {\n\t\treturn $this->validators[$codename];\n\t}", "protected function getAjaxValidationFactory()\n {\n return app()->make('validator');\n }", "public function validator()\n {\n\n return ConfigValidator::class;\n }", "protected function validator(Request $request)\n {\n return Validator::make($request->all(), [\n 'userid' => 'required|max:11',\n 'page' => ''\n ]);\n }", "protected function getForm_TypeGuesser_ValidatorService()\n {\n return $this->services['form.type_guesser.validator'] = new \\Symfony\\Component\\Form\\Extension\\Validator\\ValidatorTypeGuesser($this->get('validator'));\n }", "public function validator()\n {\n\n return ProvidersValidator::class;\n }", "public function getValidatorInstance() {\n $validator = parent::getValidatorInstance();\n\n $validator->after(function() use ($validator) {\n\n // Does the event exist?\n if( !$this->checkEventExists()){\n $validator->errors()->add('event.Exists', 'This event does not longer exist.');\n } else {\n\n // Does the booker is not the creator?\n if( !$this->checkEventNotBookedByCreator()){\n $validator->errors()->add('event.BookedCreator', 'You can\\'t unbook this event because since you are the owner.'); \n }\n\n // Does the event is not already finished/has begun?\n if( !$this->checkEventDateNotDue()){\n $validator->errors()->add('event.DateDue', 'You can\\'t unbook this event because it\\'s already begun or is terminated.'); \n }\n }\n\n });\n\n return $validator;\n }", "public function validator()\n {\n\n return BabyInfoValidator::class;\n }", "public function getValidatorInstance()\n {\n $validator = parent::getValidatorInstance();\n\n\n $validator->after(\n function () use ($validator) {\n $input = $this->all();\n }\n );\n\n return $validator;\n }", "public function createUserValidator() {\n return Validator::make($this->request->all(), [\n 'first_name' => 'required||string',\n 'last_name' => 'required||string',\n 'email' => 'required|email|string',\n 'password' => 'required',\n 'username' => 'required||string',\n ]);\n }", "public static function signupValidation($request)\n {\n // validate form register\n $val = Validation::forge();\n\n // validate username\n $val->add('username', 'Username')\n ->add_rule('required')\n ->add_rule('min_length', 6)\n ->add_rule('max_length', 32)\n ->add_rule('valid_string', array('alpha', 'numeric'));\n\n // validate password\n $val->add('password', 'Password')\n ->add_rule('required')\n ->add_rule('min_length', 6)\n ->add_rule('max_length', 32);\n\n // validate email\n $val->add('email', 'Email')\n ->add_rule('required')\n ->add_rule('min_length', 6)\n ->add_rule('max_length', 32)\n ->add_rule('valid_email');\n\n // validate fullname\n $val->add('fullname', 'Fullname')\n ->add_rule('required')\n ->add_rule('max_length', 32)\n ->add_rule('valid_string', array('alpha', 'specials'));\n\n // custom message field\n $val->set_message('required', 'The :label is required');\n $val->set_message('min_length', 'The :label min length is :param:1');\n $val->set_message('max_length', 'The :label max length is :param:1');\n $val->set_message('valid_string', 'The :label is not valid');\n $val->set_message('valid_email', 'The :label is not format');\n return $val;\n }", "abstract function validator();", "protected function getValidateRequestListenerService()\n {\n return $this->services['validate_request_listener'] = new \\Symfony\\Component\\HttpKernel\\EventListener\\ValidateRequestListener();\n }", "protected function getValidateRequestListenerService()\n {\n return $this->services['validate_request_listener'] = new \\Symfony\\Component\\HttpKernel\\EventListener\\ValidateRequestListener();\n }", "public function getValidator($validator)\n {\n $instance = null;\n\n if (strpos($validator, 'iPhorm_Validator_') === false) {\n $validator = 'iPhorm_Validator_' . ucfirst($validator);\n }\n\n $validators = $this->getValidators();\n if (array_key_exists($validator, $validators)) {\n $instance = $validators[$validator];\n }\n\n return $instance;\n }", "protected function validator(array $data)\n {\n return self::getValidator($data);\n }", "protected function makeValidator()\n {\n $rules = $this->expandUniqueRules($this->rules);\n\n $validator = static::$validator->make($this->getAttributes(), $rules);\n\n event(new ModelValidator($this, $validator));\n\n return $validator;\n }", "public function make($validator)\n\t{\n\t\tif ($validator instanceof Closure)\n\t\t{\n\t\t\t$validator = new ClosureValidator($validator, $this->request, $this->validatorFactory, $this->router);\n\n\t\t\treturn array($validator->getInput(), $validator->getRules(), $validator->getFailedMessages());\n\t\t}\n\n\t\tif (is_string($validator) AND ! isset($this->validators[$validator]))\n\t\t{\n\t\t\t$this->validators[$validator] = $validator;\n\t\t}\n\n\t\tif (isset($this->validators[$validator]))\n\t\t{\n\t\t\tif ($this->validators[$validator] instanceof Closure)\n\t\t\t{\n\t\t\t\treturn new ClosureValidator($this->validators[$validator], $this->request, $this->validatorFactory);\n\t\t\t}\n\n\t\t\treturn new $this->validators[$validator]($this->request, $this->validatorFactory);\n\t\t}\n\n\t\tthrow new \\InvalidArgumentException('Invalid input validator.');\n\t}", "public function validator()\n {\n return ZhuanTiValidator::class;\n }", "protected function validator(Request $request)\n {\n return Validator::make($request->all(), [\n 'rol' => 'required',\n 'name' => 'required|max:255',\n 'lastname' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users',\n 'password' => 'required|min:6|same:confirmpass',\n 'confirmpass' => 'required|min:6',\n 'phone' => 'required',\n 'cubicle' => 'required_if:rol,2'\n ]);\n }", "public function validator()\n {\n return NotificationValidator::class;\n }", "public function getValidator()\n {\n if (!isset($this->customValidator)) {\n throw new CertaintyException('Custom class not defined');\n }\n return $this->customValidator;\n }", "protected function getValidationFactory()\n {\n return app('Illuminate\\Contracts\\Validation\\Factory');\n }", "protected function registerHttpValidation()\n {\n $this->app->singleton('api.http.validator', static function ($app) {\n return new RequestValidator($app);\n });\n\n $this->app->singleton(Domain::class, function ($app) {\n return new Validation\\Domain($this->config('domain'));\n });\n\n $this->app->singleton(Prefix::class, function ($app) {\n return new Validation\\Prefix($this->config('prefix'));\n });\n\n $this->app->singleton(Accept::class, function ($app) {\n return new Validation\\Accept(\n $app[AcceptParser::class], $this->config('strict')\n );\n });\n }", "final public static function register()\n {\n $ruleName = self::getRuleName();\n ValidatorValidator::extend($ruleName, static::class . '@performValidation');\n\n if (method_exists(static::class, 'replacer')) {\n ValidatorValidator::replacer($ruleName, static::class . '@replacer');\n }\n }", "protected static function validator() {\n\t\tif (empty(self::$validate)) {\n\t\t\tself::$validate = new MpoValidator();\n\t\t}\n\t\treturn self::$validate;\n\t}", "public function initValidator()\n {\n if (!is_null($this->_validator)) {\n return $this->_validator;\n }\n $this->_validator = new SurveyManager_Entity_Validator_Survey($this);\n \n return $this->_validator;\n }", "public function validator()\n {\n\n return EmpreValidator::class;\n }", "public function validator()\n {\n\n return ProducerValidator::class;\n }", "function register()\n {\n //Create the validators\n $tickerValidator = Validator::regex('/[A-Z]{2,4}[:][A-Z]{2,10}/')\n ->noWhitespace()->length(1, 14);\n $validators = array('ticker' => $tickerValidator);\n $middleware = new \\DavidePastore\\Slim\\Validation\\Validation($validators);\n return $middleware;\n }", "public function validator()\n {\n\n return GrupoServicosValidator::class;\n }", "public function getValidator()\n {\n if ($this->_validator === null) {\n\n if (class_exists('\\Atezate\\\\Validator\\Mensajes')) {\n\n $this->setValidator(new \\Atezate\\Validator\\Mensajes);\n }\n }\n\n return $this->_validator;\n }", "public function validator()\n {\n\n return ScheduleValidator::class;\n }", "public function validator()\n {\n\n return OccupationValidator::class;\n }", "public function validator()\n {\n\n return DistribuidorValidator::class;\n }", "public static function getRequestValidators()\n {\n if (isset(static::$validators)) {\n return static::$validators;\n }\n\n // To match the route, we will use a chain of responsibility pattern with the\n // validator implementations. We will spin through each one making sure it\n // passes and then we will know if the route as a whole matches request.\n return static::$validators = [\n new ValidateAgainstUri(),\n new ValidateAgainstHost(),\n new ValidateAgainstScheme(),\n new ValidateAgainstMethod()\n ];\n }", "public function register()\n\t{\n\t\t$this->registerPresenceVerifier();\n\n\t\t$this->app->bindShared('validator', function($app) {\n\t\t\t$validator = new Factory($app['translator'], $app);\n\n\t\t\tif (isset($app['validation.presence'])) {\n\t\t\t\t$validator->setPresenceVerifier($app['validation.presence']);\n\t\t\t}\n\n\t\t\tif ($app['config']['auth.captcha']) {\n\t\t\t\t$this->registerCaptcha($validator);\n\t\t\t}\n\n\t\t\treturn $validator;\n\t\t});\n\t}" ]
[ "0.7236793", "0.7153518", "0.7153518", "0.6759554", "0.6757391", "0.6757391", "0.6757391", "0.6751585", "0.66884476", "0.66494477", "0.659307", "0.65540045", "0.65411377", "0.65344745", "0.653198", "0.65059125", "0.64969593", "0.64923614", "0.64696395", "0.6465143", "0.64559656", "0.6420419", "0.6316751", "0.63035494", "0.6270181", "0.6215484", "0.6209383", "0.6200659", "0.6188471", "0.6187428", "0.6155707", "0.614223", "0.61060685", "0.60928464", "0.6084697", "0.60809827", "0.60809827", "0.60809827", "0.60809827", "0.60809827", "0.6060866", "0.6048596", "0.6048596", "0.6048596", "0.60197294", "0.6017335", "0.6016904", "0.59605837", "0.5960559", "0.59483504", "0.5944083", "0.59373784", "0.59332186", "0.5925311", "0.59213316", "0.5914236", "0.5892738", "0.58788705", "0.5874684", "0.58311445", "0.582388", "0.5816647", "0.5800899", "0.5799517", "0.5782933", "0.57799965", "0.5776302", "0.5773158", "0.5764036", "0.5761652", "0.5753404", "0.57491785", "0.5737373", "0.5734274", "0.57187796", "0.57177514", "0.56873757", "0.56873757", "0.5684812", "0.56766534", "0.567356", "0.5672996", "0.5660273", "0.5645106", "0.56339353", "0.5630628", "0.5626666", "0.5614917", "0.5607638", "0.56070226", "0.5601684", "0.55835706", "0.5567744", "0.5563256", "0.55616415", "0.5549443", "0.55464065", "0.553196", "0.55297303", "0.5528813", "0.5521471" ]
0.0
-1
Function used to set the base uri
public function setBaseUri($base_uri) { $this->baseUri = $base_uri; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setBaseUri($uri) {}", "public function set_base_uri($uri)\r\n\t{\r\n\t\t$this->base_uri = $uri;\r\n\t}", "public function setBaseUri($base)\n\t{\n\t\t$this->baseUri = $base;\n\t\treturn $this;\n\t}", "public function baseUri()\n {\n return $this->baseUri;\n }", "function set_base_url($url) {\n if($url[strlen($url)-1] != '/') {\n $url .= '/'; \n }\n \n $this->base_url = $url;\n }", "public function getBaseUri() {}", "public function getBaseUri() {}", "private function setBaseUrl()\n {\n if (config(\"redx.sandbox\") == true) {\n $this->baseUrl = \"https://sandbox.redx.com.bd\";\n } else {\n $this->baseUrl = \"https://openapi.redx.com.bd\";\n }\n }", "function setUri() {\n\t\tif (env('HTTP_X_REWRITE_URL')) {\n\t\t\t$uri = env('HTTP_X_REWRITE_URL');\n\t\t} elseif(env('REQUEST_URI')) {\n\t\t\t$uri = env('REQUEST_URI');\n\t\t} else {\n\t\t\tif (env('argv')) {\n\t\t\t\t$uri = env('argv');\n\n\t\t\t\tif (defined('SERVER_IIS')) {\n\t\t\t\t\t$uri = BASE_URL . $uri[0];\n\t\t\t\t} else {\n\t\t\t\t\t$uri = env('PHP_SELF') . '/' . $uri[0];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$uri = env('PHP_SELF') . '/' . env('QUERY_STRING');\n\t\t\t}\n\t\t}\n\t\treturn $uri;\n\t}", "private function setBaseUrl()\n {\n $this->baseUrl = config('gladepay.endpoint');\n }", "public function getBaseUri()\n {\n //return self::BASE_INT_URI\n return self::BASE_URI;\n }", "private static function setUristr() {\n $uri_request = HttpHelper::getUri();\n if(WEB_DIR != \"/\") {\n self::$uri = str_replace(WEB_DIR, \"\", $uri_request);\n } else {\n self::$uri = substr($uri_request, 1);\n }\n }", "function set_base_url()\n{\n $s = &$_SERVER;\n $ssl = (!empty($s['HTTPS']) && $s['HTTPS'] == 'on') ? true : false;\n $sp = strtolower($s['SERVER_PROTOCOL']);\n $protocol = substr($sp, 0, strpos($sp, '/')) . (($ssl) ? 's' : '');\n $port = $s['SERVER_PORT'];\n $port = ((!$ssl && $port == '80') || ($ssl && $port == '443')) ? '' : ':' . $port;\n $host = isset($s['HTTP_X_FORWARDED_HOST']) ? $s['HTTP_X_FORWARDED_HOST'] : isset($s['HTTP_HOST']) ? $s['HTTP_HOST'] : $s['SERVER_NAME'];\n $uri = $protocol . '://' . $host . $port . dirname($_SERVER['SCRIPT_NAME']);\n define('BASE_URL', rtrim($uri, '/') . '/');\n}", "public function getBaseUri()\n {\n return $this->baseUri;\n }", "function base_url($uri=null){\n\t$base_url = 'http://localhost/KoperasiSimpanPinjam/';\n\tif($uri == null){\n\t\treturn $base_url;\n\t}else{\n\t\treturn $base_url.$uri;\n\t}\n}", "abstract public function setPlatformUri(string $baseUri);", "function set_base_url($url)\n\t{\n\t\t$this->base_url = $url;\n\t}", "function base_url(){\n return BASE_URL;\n }", "public function getBaseUri(): string;", "public function url_base($url_base = null)\n\t{\n\t\t$this->url_base = $url_base;\n\t\treturn $this;\n\t}", "protected function _getBaseuri()\n {\n if (!$this->_baseUri instanceof UriHttp) {\n $simplexml = $this->readResource();\n $headBase = new \\Diggin\\Scraper\\Helper\\Simplexml\\HeadBaseHref($simplexml);\n $headBase->setOption(array('baseUrl' => $this->_baseUri));\n $this->_baseUri = new UriHttp($headBase->getBaseUrl());\n }\n\n return $this->_baseUri;\n }", "private static function getUrlBase() {\n\t\tif(!isset(self::$usrBbase)) {\n\t\t\tself::$urlBase =\n\t\t\t\tself::getScheme()\n\t\t\t\t. '://'\n\t\t\t\t. self::getHost()\n\t\t\t\t. ((self::getPort() == 80 || self::getPort() == 443)\n\t\t\t\t\t? ''\n\t\t\t\t\t: ':'.self::getPort())\n\t\t\t\t. self::getBasePath();\n\t\t}\n\t\treturn self::$urlBase;\n\t}", "private function setBaseURL($url){\n\t\t$this->baseURL = $url;\n\t}", "public function base_url($uri = '')\n\t{\n\t\treturn $this->slash_item('base_url').ltrim($this->_uri_string($uri),'/');\n\t}", "protected function base()\n {\n return $this->use_production\n ? self::PRODUCTION_URI\n : self::DEVELOPMENT_URI;\n }", "function get_base_url() {\n return $this->base_url;\n }", "protected function determineBaseUrl() {}", "private function buildBaseUrl()\n {\n return $this->scheme() . $this->host;\n }", "protected function setBaseUrl()\n {\n $this->baseUrl = 'https://api.paystack.co';\n }", "protected function getUri()\n {\n $uri = $this->request['REQUEST_URI'];\n $prefix = config('router', 'base_uri');\n if (substr($uri, 0, strlen($prefix)) == $prefix) {\n $uri = substr($uri, strlen($prefix));\n }\n\n $this->uri = rtrim($uri, \"/\");\n }", "public static function setBaseUrl(): void\n\t{\n\t\tstatic::$scriptDirectory = str_replace('\\\\', '/', dirname(Server::get('SCRIPT_NAME')));\n\t\t$protocol = Server::get('REQUEST_SCHEME') . '://';\n\t\t$hostname = Server::get('HTTP_HOST');\n\t\tstatic::$baseUrl = $protocol . $hostname . static::$scriptDirectory;\n\t}", "function base_path($uri = '', $protocol = NULL)\n\t{\n\t\treturn get_instance()->config->base_path($uri, $protocol);\n\t}", "function get_base_url() {\n $fin_string = '';\n $parts = explode('/', $this->request_uri);\n if (count($parts) > 2) {\n $subparts = array_slice($parts, 2);\n foreach ($subparts as $p)\n $fin_string .= $p . '/';\n return substr($fin_string, 0, -1);\n }\n return $fin_string;\n }", "public function setBaseURI($baseURI)\r\n {\r\n $baseURI .= (substr($baseURI, -1) === '/' ? '' : '/');\r\n $this->baseURI = $baseURI;\r\n }", "private function base_uri( $localizable = TRUE ) {\r\n\t\treturn implode ( '/', array (\r\n\t\t\t\t$this->host,\r\n\t\t\t\tself::API_VERSION \r\n\t\t) );\r\n\t}", "public function base_url()\n\t{\n\t\treturn URL::base();\n\t}", "public function getBaseUrl() {}", "public function setBaseUri($baseUri)\n {\n $this->baseUri = $baseUri;\n }", "public function setBaseUrl($base = null) {\r\n\t\t$this->_baseUrl = $base;\r\n\t\tif ((null !== ($request = $this->getRequest())) && (method_exists($request, 'setBaseUrl'))) {\r\n\t\t\t$request->setBaseUrl($base);\r\n\t\t}\r\n\t\treturn $this;\r\n\t}", "protected function urlBase()\n {\n return \"/bibs/{$this->bib->mms_id}/representations/{$this->representation_id}\";\n }", "public static function getBaseURL(){\n return self::$baseURL;\n }", "public function get_base_uri()\r\n\t{\r\n\t\tif($this->base_uri != null)\r\n\t\t\treturn $this->base_uri;\r\n\t\t\r\n\t\treturn htmlentities(dirname($_SERVER['PHP_SELF']), ENT_QUOTES | ENT_IGNORE, \"UTF-8\") . '/';\r\n\t}", "public function get_base_url()\r\n\t\t{\r\n\t\t\t$url = \"http\";\r\n \t\t\tif ( isset( $_SERVER[ 'HTTPS' ] ) && $_SERVER[ 'HTTPS' ] == \"on\" ) $url .= \"s\";\r\n\t\t\t$url .= \"://\";\r\n \t\t\tif ( $_SERVER[ 'SERVER_PORT' ] != \"80\" )\r\n\t\t\t\t$url .= $_SERVER[ 'SERVER_NAME' ]. \":\" . $_SERVER[ 'SERVER_PORT' ] . $_SERVER[ 'REQUEST_URI' ];\r\n\t\t\telse\r\n\t\t\t\t$url .= $_SERVER[ 'SERVER_NAME' ] . \"/\";\r\n\t\t\t\r\n\t\t\treturn $url . self::HOME_DIR;\r\n\t\t}", "protected function detectResourcesBaseUri()\n {\n $this->resourcesBaseUri = 'http://baseuri/_Resources/';\n }", "private function set_base_url()\n\t{\n\t\t// We completely kill the site URL value. It's now blank.\n\t\t// This enables us to use only the \"index.php\" part of the URL.\n\t\t// Since we do not know where the CP access file is being loaded from\n\t\t// we need to use only the relative URL\n\t\t$this->config->set_item('site_url', '');\n\n\t\t// We set the index page to the SELF value.\n\t\t// but it might have been renamed by the user\n\t\t$this->config->set_item('index_page', SELF);\n\t\t$this->config->set_item('site_index', SELF); // Same with the CI site_index\n\t}", "public static function setBaseURL($baseURL){\n self::$baseURL = $baseURL;\n }", "function base_url(){\n $url = BASE_URL;\n return $url;\n }", "public function getBaseUrl ()\n {\n return $this->base_url;\n }", "protected function initiateUrl()\n\t{\n\t\t// base url\n\t\tif($this->app->config->has('app.url'))\n\t\t\t$this->setBase($this->app->config->get('app.url'));\n\n\t\t// asset url\n\t\tif($this->app->config->has('asset.url'))\n\t\t\t$this->setAsset($this->app->config->get('asset.url'));\n\t}", "protected function getBaseUrl()\n {\n return self::BASE_URL;\n }", "public function getBaseUrl();", "public function getBaseUrl();", "public function getBaseUrl();", "public function getBaseUrl();", "public function getBaseUrl();", "public function setBaseUrl($baseUrl);", "private static function base_url($path=NULL)\n {\n\t\tglobal $url;\n $fullurl=$url.$path;\n return $fullurl;\n\t}", "private function setUri(): void\n {\n $this->uri = strtok($_SERVER['REQUEST_URI'],'?');\n }", "function set_base_url( $url = '' )\n {\n if ( empty($url) ) {\n $this->url = 'http://' . $_SERVER['HTTP_HOST'];\n } else {\n // Strip any trailing slashes for consistency (relative\n // URLs may already start with a slash like \"/file.html\")\n if ( substr($url, -1) == '/' ) {\n $url = substr($url, 0, -1);\n }\n $this->url = $url;\n }\n }", "public function setBaseUrl($value)\n\t{\n\t\t$this->baseUrl = rtrim($value, '/');\n\t}", "private function detectBaseUrl() {\n $this->baseurl = empty($this->subdir) ? '/' : \"/{$this->subdir}/\";\n }", "public function getBaseUrl() : string\n {\n return $this->base;\n }", "protected static function baseurl($path=NULL)\n {\n\t\t$res=self::base_url($path);\n\t\treturn $res;\n }", "function base_url() {\n return Micro::get(Config::class)->get('app.base_url');\n }", "private function getBaseUrl(): string\n {\n return $this->agentUrl . self::OPA_API_VER . \"/\";\n }", "public function getBaseUrl() {\r\n\t\treturn home_url();\r\n\t}", "public static function setBaseUrl($url) {\n\t if($parts = parse_url($url)) {\n\t if(isset($parts['scheme'])) self::$scheme = $parts['scheme'];\n\t if(isset($parts['host'])) self::$host = $parts['host'];\n\t if(isset($parts['port'])) self::$port = $parts['port'];\n\t if(isset($parts['path'])) self::$basePath = $parts['path'];\n\t }\n\t}", "public function baseOn(Uri $base) {\n $uri = null;\n if($base->isRelativeUri()) {\n throw new UriException(\"Can't base $this against $base. Invalid base URI\");\n }\n if($this->isAbsoluteUri()) {\n $uri = clone $this;\n }\n else {\n $uri = clone $base;\n $path = $this->get('path');\n $query = $this->get('query');\n if(empty($path)) {\n if(isset($query)) {\n $uri->set('query', $query);\n }\n }\n else if(strpos($path, '/') === 0) {\n $uri->set('path', $path);\n $uri->set('query', $query);\n }\n else {\n $basePath = preg_replace('#/[^/]*$#', \"\", $uri->get('path'));\n $uri->set('path', $basePath . \"/\" . $path);\n $uri->set('query', $query);\n }\n $uri->set('fragment', $this->get('fragment'));\n }\n return $uri;\n }", "public static function getBaseUrl() {\n return \"http://localhost:8888/Tutkit_OOP_mit_PHP/Gallery/\";\n }", "protected static function generate_base_url()\n\t{\n\t\t$base_url = parent::generate_base_url();\n\t\treturn str_replace('htdocs/novius-os/', '', $base_url);\n\t}", "protected function get_uri()\n {\n }", "public function setBaseUrl($base_url)\n {\n $this->base_url = $base_url;\n }", "protected function getBaseUrl(): string\n {\n return \"\";\n }", "public function __construct()\n {\n $this->base_url = url('/').'/';\n }", "public static function fullBaseUrl($base = null)\n {\n if ($base !== null) {\n static::$_fullBaseUrl = $base;\n Configure::write('App.fullBaseUrl', $base);\n }\n if (empty(static::$_fullBaseUrl)) {\n static::$_fullBaseUrl = Configure::read('App.fullBaseUrl');\n }\n\n return static::$_fullBaseUrl;\n }", "public function base_url($base_url = NULL)\n\t{\n\t\tif ($base_url !== NULL)\n\t\t{\n\t\t\t$this->_base_url = (string) $base_url;\n\t\t\treturn $this;\n\t\t}\n\t\treturn $this->_base_url;\n\t}", "protected function defaultUri() {\n global $base_url;\n $multisite = multisite_load($this->msid);\n $scheme = parse_url($base_url, PHP_URL_SCHEME);\n return array(\n 'path' => \"$scheme://$multisite->hostname/node/$this->entity_id\",\n 'options' => array('external' => TRUE),\n );\n }", "public function setBaseURL($base_url)\n\t{\n\t\t//URL can't end with PHP file (for compatibility with $controller_as_query = false) and can't contain any query parameters\n\t\t$to_remove = basename(parse_url($base_url, PHP_URL_PATH));\n\n\t\t$to_remove_pos = false;\n\t\tif (strlen($to_remove) > 0 && stripos($to_remove, '.php')) {\n\t\t\t$to_remove_pos = stripos($base_url, $to_remove);\n\t\t}\n\n\t\tif ($to_remove_pos !== false) {\n\t\t\t$base_url = substr($base_url, 0, $to_remove_pos);\n\t\t}\n\n\t\t$this->base_url = rtrim($base_url, '/').'/';\n\n\t\treturn $this;\n\t}", "public function getBaseUrl()\n {\n return $this->base_url;\n }", "public function getBaseUrl()\n {\n return $this->base_url;\n }", "public function getBaseUrl()\n\t\t{\n\t\t\treturn $this->base_url;\n\t\t}", "public static function setFullUrl(): void\n\t{\n\t\t$requestUri = urldecode(Server::get('REQUEST_URI'));\n\t\tstatic::$fullUrl = rtrim(preg_replace('#^' . static::$scriptDirectory . '#', '', $requestUri), '/');\n\t}", "public function buildBackendUri() {}", "public function getBaseURL()\n\t{\n\t\treturn $this->base_url;\n\t}", "private function somebody_set_us_up_the_base()\n\t{\n\t\tdefine('BASE', SELF.'?S='.ee()->session->session_id().'&amp;D=cp'); // cp url\n\t}", "public function getFullRequestUri() {\n return $GLOBALS['base_url'] . request_uri();\n }", "public function setBase($base = null): object\n\t{\n\t\tif (null !== $base && !($base instanceof FHIRUri)) {\n\t\t\t$base = new FHIRUri($base);\n\t\t}\n\t\t$this->_trackValueSet($this->base, $base);\n\t\t$this->base = $base;\n\t\treturn $this;\n\t}", "public function getBaseUrl(){\n $uri = self::getCurrentUri();\n $url = self::getCurrentPage();\n\n if ($uri !== '/') {\n $url = trim(str_replace($uri, '', $url), '/');\n }\n\n return self::addBackSlash($url);\n }", "public function getBaseUrl()\n {\n return $this->getScheme() . $this->getBasicAuth() . $this->getHost() . \":\" . $this->getPort() . $this->getEndpoint();\n }", "public static function baseURI($mnt)\n{\nreturn 'phk://'.$mnt.'/';\n}", "protected function urlBase()\n {\n return sprintf('/users/%s', rawurlencode($this->id));\n }", "public function base_url()\n {\n if (isset($_SERVER['HTTP_HOST']) && preg_match('/^((\\[[0-9a-f:]+\\])|(\\d{1,3}(\\.\\d{1,3}){3})|[a-z0-9\\-\\.]+)(:\\d+)?$/i', $_SERVER['HTTP_HOST']))\n {\n $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? \"https://\" : \"http://\";\n $baseurl = $protocol.$_SERVER['HTTP_HOST'].substr($_SERVER['SCRIPT_NAME'], 0, strpos($_SERVER['SCRIPT_NAME'], basename($_SERVER['SCRIPT_FILENAME'])));\n }\n else\n {\n $baseurl = 'http://localhost/';\n }\n\n return $baseurl;\n }", "public function baseUrl()\n {\n return \\yii\\helpers\\Url::base(true);\n }", "public function getBaseUrl()\n {\n return self::BASE_URL;\n }", "public function setBase($baseUrl) {\n\t\t\n\t\t\t$this->_base = $baseUrl;\n\t\t\n\t\t}", "public function getBaseUrl()\n {\n // Current Request URI\n $this->currentUrl = $_SERVER['REQUEST_URI'];\n\n // Remove rewrite base path (= allows one to run the router in a sub folder)\n $basePath = implode('/', array_slice(explode('/', $_SERVER['SCRIPT_NAME']), 0, -1)) . '/';\n\n return $basePath;\n\n }", "public static function getBaseUri()\n {\n $server = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME'];\n return rtrim(self::getProtocol() . '://' . $server, '/');\n }", "public function get_uri()\n {\n }", "static function getURI() {\n return '/';\n }", "public function getBaseUrl() {\r\n\t\treturn $this->_storeManager->getStore()->getBaseUrl();\r\n\t}" ]
[ "0.83502823", "0.78339136", "0.7774056", "0.7520374", "0.7472812", "0.74548686", "0.7454033", "0.74168545", "0.74130416", "0.7380912", "0.7350721", "0.7344986", "0.7314316", "0.7309853", "0.72963035", "0.7279295", "0.71429044", "0.71320844", "0.71198934", "0.71045905", "0.70703596", "0.706651", "0.7064857", "0.705827", "0.7055053", "0.7043145", "0.7031021", "0.70254636", "0.7023173", "0.7013877", "0.70115936", "0.7007658", "0.6989826", "0.6984379", "0.6973879", "0.6970882", "0.69652355", "0.6951849", "0.69463587", "0.69432724", "0.69428456", "0.6922136", "0.6917509", "0.69149756", "0.68839526", "0.6880525", "0.68745244", "0.687296", "0.68679184", "0.6860014", "0.68564856", "0.68564856", "0.68564856", "0.68564856", "0.68564856", "0.6827056", "0.68087584", "0.67867315", "0.677821", "0.67757565", "0.6774095", "0.6772879", "0.6769078", "0.67650247", "0.6757819", "0.67536587", "0.6738892", "0.67276967", "0.6717007", "0.67117804", "0.67024636", "0.6700328", "0.6698933", "0.6696278", "0.6694007", "0.66893834", "0.66800493", "0.66766685", "0.66598004", "0.66598004", "0.66533136", "0.6648025", "0.664429", "0.66408086", "0.66156864", "0.661152", "0.6604725", "0.66014946", "0.66004187", "0.65989965", "0.65968883", "0.6578709", "0.65780467", "0.65615034", "0.6554679", "0.65377533", "0.65367115", "0.6526831", "0.6525939", "0.65240365" ]
0.7342878
12
Function used to get response from API (GET Method)
public function doGet($slug, $params) { $get_parameters = http_build_query($params); $url = $this->baseUri . $slug; $parsed_url = parse_url($url); if (isset($parsed_url['query']) && !empty($parsed_url['query'])) { $url .= "&{$get_parameters}"; } else { $url .= "?{$get_parameters}"; } \curl_setopt($this->handle, \CURLOPT_CUSTOMREQUEST, null); \curl_setopt($this->handle, \CURLOPT_HTTPGET, true); \curl_setopt($this->handle, \CURLOPT_URL, $url); $this->response = curl_exec($this->handle); $this->response_code = curl_getinfo($this->handle, \CURLINFO_HTTP_CODE); $response = $this->jsonToArray($this->response)->response; if (600 == $response->status_code) { return $this->jsonToArray($this->response); } if (601 == $response->status_code) { throw new InvalidArgumentException($response->status_message, $response->status_code); } if (602 == $response->status_code) { throw new QuotaExceededException($response->status_message, $response->status_code); } if (603 == $response->status_code) { throw new RateLimitExceededException($response->status_message, $response->status_code); } throw new \Exception($response->status_message, $response->status_code); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getResponse();", "public function getResponse();", "public function getResponse();", "public function getResponse();", "public function getResponse();", "public function getResponse();", "public function getResponse();", "public function getResponse();", "public function getResponse();", "public function getResponse();", "public function getResponse();", "public function & GetResponse ();", "public function getResponse() {}", "public function getResponse() {}", "function getResponse();", "function getResponse();", "public function getResponse() {\n }", "public function getResponse()\n {\n }", "public function getResponse() {\n\t}", "public function getResponse() {\n $url = self::API_URL . $this->urlPath;\n \ttry {\n \t $client = \\Drupal::httpClient();\n $request = $client->get($url, array('headers' => array('Content-Type' => 'application/json', 'Authorization' => self::API_KEY)));\n $data = json_decode((string) $request->getBody(), true);\n if (empty($data)) {\n return FALSE;\n }\n }\n catch (RequestException $e) {\n return FALSE;\n }\n return $data;\n }", "public function requestFromApi() \n {\n $clientApi = new \\GuzzleHttp\\Client([\n \"base_uri\" => \"https://services.mysublime.net/st4ts/data/get/type/\",\n \"timeout\" => 4.0]);\n \n try { \n $response = $clientApi->request(\"GET\", $this->_urlEndPoint);\n if ($response->getStatusCode() == \"200\") {\n $body = $response->getBody();\n $this->_jsonRequestedArr = json_decode($body); \n }\n else { \n $this->_error .= \"Bad status code: . \" . $response->getStatusCode(); \n }\n }\n catch (Exception $exc) {\n $this->_error .= $exc->getMessage();\n }\n\n }", "public function getme(){\n return $this->make_http_request(__FUNCTION__);\n }", "public function getResponse(): array;", "public function getResponse() : array;", "public function getHttpResponse();", "protected function getApiResult()\n {\n return Singleton::class('ZN\\Services\\Restful')->get($this->address);\n }", "private function GET() {\n global $_GET;\n $getData = array();\n foreach($_GET as $key => $value) {\n $getData[$key] = $value;\n }\n $this -> response[\"response\"] = $getData;\n return;\n }", "public function get()\n {\n #HTTP method in uppercase (ie: GET, POST, PATCH, DELETE)\n $sMethod = 'GET';\n $sTimeStamp = gmdate('c');\n\n #Creating the hash\n\t\t$oHash = new Hash($this->getSecretKey());\n\t\t$oHash->addData($this->getPublicKey());\n\t\t$oHash->addData($sMethod);\n\t\t$oHash->addData($this->getApiResource());\n\t\t$oHash->addData('');\n\t\t$oHash->addData($sTimeStamp);\n\n\t\t$sHash = $oHash->hash();\n\n $rCurlHandler = curl_init();\n curl_setopt($rCurlHandler, CURLOPT_URL, $this->getApiRoot() . $this->getApiResource());\n curl_setopt($rCurlHandler, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($rCurlHandler, CURLOPT_CUSTOMREQUEST, $sMethod);\n curl_setopt($rCurlHandler, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($rCurlHandler, CURLOPT_SSL_VERIFYHOST, 0);\n\n curl_setopt($rCurlHandler, CURLOPT_HTTPHEADER, [\n \"x-date: \" . $sTimeStamp,\n \"x-hash: \" . $sHash,\n \"x-public: \" . $this->getPublicKey(),\n \"Content-Type: text/json\",\n ]);\n\n $sOutput = curl_exec($rCurlHandler);\n $iHTTPCode = curl_getinfo($rCurlHandler, CURLINFO_HTTP_CODE);\n curl_close($rCurlHandler);\n\n Log::write('WebRequest', 'GET::REQUEST', $this->getApiRoot() . $this->getApiResource());\n Log::write('WebRequest', 'GET::HTTPCODE', $iHTTPCode);\n Log::write('WebRequest', 'GET::RESPONSE', $sOutput);\n\n if ($iHTTPCode !== 200) {\n throw new InvalidApiResponse('HttpCode was ' . $iHTTPCode . '. Expected 200');\n }\n\n return $sOutput;\n }", "public function Info_Get()\n\t{\n\t\t$Data = $this -> HTTPRequest($this -> APIURL.'Info:Get');\n\t\treturn $this -> ParseResponse($Data);\n\t}", "public function requestData() {\n\t\t// Set up cURL \n\t\t$curl = curl_init($this->query); \n\t\tcurl_setopt($curl, CURLOPT_POST, false); \n\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\t\t$response = curl_exec($curl);\n\t\tcurl_close($curl);\n\t\t\t\n\t\treturn $this->parseAPIResponse($response);\n\t}", "public function getResponse()\n {\n // TODO: Implement getResponse() method.\n }", "public function getResponseData();", "abstract function parse_api_response();", "public function getResponse($input);", "function getrequest($url){\n\t// gets cURL resource\n\t$curl = curl_init();\n\t// Set some options - we are passing in a useragent too here\n\tcurl_setopt_array($curl, array(\n\t\tCURLOPT_RETURNTRANSFER => 1,\n\t\tCURLOPT_URL => $url,\n\t\tCURLOPT_USERAGENT => 'BenGreenlineApp'\n\t));\n\t// Send the request & save response to $resp\n\t$resp = curl_exec($curl);\n\t// Close request to clear up some resources\n\tcurl_close($curl);\n\t//returns the json encoded response\n\t\n\t\n\t$httpCode = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\tif($httpCode == 404) {\n $resp[0]= \"MetroTransit API gave 404\" ;\n\t};\n\t\n\t\n\treturn json_decode($resp);\n}", "public function get_response()\n {\n return $this->response; \n }", "public static function get() {\n return self::call(\"GET\");\n }", "function get_response() {\n return $this->response;\n }", "function callRemitaApiGet($endPoint) {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $endPoint);\n curl_setopt($ch, CURLOPT_ENCODING, \"\");\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_MAXREDIRS, 10);\n curl_setopt($ch, CURLOPT_TIMEOUT, 30);\n curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n 'Cache-Control: no-cache',\n 'Content-Type: application/json')\n );\n $output = curl_exec($ch);\n return $output;\n}", "public function response();", "public function saySomething()\n\t{\n\t\t$response = json_decode(file_get_contents(self::API_URL));\n\t\t$result = isset($response[0])?$response[0]:'';\n\t\treturn $result;\n\t}", "public static function getApiResponse($url){\n\n $ch = curl_init();\n curl_setopt($ch,CURLOPT_URL,$url);\n curl_setopt($ch,CURLOPT_POST, 1);\n curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch,CURLOPT_CONNECTTIMEOUT ,3);\n curl_setopt($ch,CURLOPT_TIMEOUT, 20);\n\n $response = curl_exec($ch);\n\n return strval($response);\n }", "public function getResponse(){\n switch($this->format){\n case 'json':\n $this->response_type = 'application/json';\n return $this -> getJSON();\n break;\n case 'xml':\n $this->response_type = 'text/xml';\n return $this -> getXML();\n break;\n default:\n $this->response_type = 'application/json';\n return $this -> getJSON();\n break;\n }\n }", "function get(Request &$request, Response &$response);", "public function response ();", "public static function apiRequest($url){\n $handle = curl_init();\n curl_setopt($handle, CURLOPT_URL, $url);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, $url);\n curl_setopt($handle, CURLOPT_CONNECTTIMEOUT, 5);\n\n $output = curl_exec($handle);\n $status = curl_getinfo($handle,CURLINFO_HTTP_CODE);\n curl_close($handle);\n\n if($status != 200){\n return json_encode(\"RESOURCE NOT FOUND\");\n }\n\n return $output;\n\n }", "function getInfo($string){\n $sym = $string;\n try {\n //Create a request but don't send it immediately\n $client = new Client();\n\n //$Client is server we are using to connect server API\n $client = new GuzzleHttp\\Client(['base_url' => '192.168.1.109']);\n\n //This 'page' is the one we use to gather Stock Information\n $response = $client->get('192.168.1.109:9090/stocks?sym='.$sym);\n \n $getInfo = $response->getBody();\n } catch (Exception $e) {\n echo \"ay, caught exception \", $e->getMessage();\n }\n return $getInfo;\n}", "public function getResponse()\n {\n $url = $this->_url;\n\n if (count($this->_params)) {\n $query_string = http_build_query($this->_params);\n $url .= '?' . $query_string;\n }\n\n $ch = curl_init();\n\n // set some default values\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 1);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n curl_setopt($ch, CURLOPT_TIMEOUT, 30);\n\n // set user generated values\n foreach ($this->_options as $key => $value) {\n curl_setopt($ch, $key, $value);\n }\n\n curl_setopt($ch, CURLOPT_URL, $url);\n\n $result = curl_exec($ch);\n\n curl_close($ch);\n\n return $result;\n }", "public function getResponseAsString(): string;", "abstract public function response();", "public function get()\n {\n return $this->apiCall('get', '', [], ['auto-fill' => true]);\n }", "public function get()\n {\n return $this->apiCall('get', '', [], ['auto-fill' => true]);\n }", "public function get()\n {\n return $this->apiCall('get', '', [], ['auto-fill' => true]);\n }", "private function getResponse() {\n $this->response['status_code'] = $this->status->getStatusCode();\n $this->response['reason_phrase'] = $this->status->getReasonPhrase();\n \n $this->readHeaders();\n }", "public function process()\n {\n \t$client = $this->client->getClient();\n\n \ttry {\n $response = $client->get($this->buildUrl());\n return new ResponseJson((string)$response->getBody(), true);\n } catch (RequestException $e) {\n return new ResponseJson((string)$e->getResponse()->getBody(), false);\n }\n }", "public function get() {\n // $this->isAdmin();\n\n $data = \"This is a test\";\n\n $this->sendHeaders();\n \n $resBody = (object) array();\n $resBody->status = \"200\";\n $resBody->message = \"valid request\";\n $resBody->data = \"This is the data\";\n echo json_encode($resBody);\n\n }", "public function testResponseGet()\n {\n $result = json_decode($this->body, true);\n\n $this->assertEquals($this->response->get('Model'), $result['Model']);\n $this->assertEquals($this->response->get('RequestId'), $result['RequestId']);\n $this->assertEquals($this->response->get('Inexistence'), null);\n $this->assertEquals($this->response->get('Inexistence', 'Inexistence'), 'Inexistence');\n }", "private function getAPIResponse() {\n $query = self::$BASE_URL . $this->city . \",\" . $this->country . self::$KEY . self::$MODE . self::$UNITS;\n $file_content = file_get_contents($query);\n\n return ($file_content[0] != '<') ? null : new SimpleXMLElement($file_content);\n }", "function make_get_call($mid_url) {\n global $base_url, $end_url;\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $base_url . $mid_url . $end_url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);\n curl_setopt($curl, CURLOPT_HEADER, false);\n \n $output = json_decode(curl_exec($curl));\n curl_close($curl);\n \n return $output;\n }", "public function get() {\n try {\n\n /**\n * Set up request method\n */\n $this->method = 'GET';\n /**\n * Process request and call for response\n */\n return $this->requestProcessor();\n\n\n } catch (\\Throwable $t) {\n new ErrorTracer($t);\n }\n }", "function km200_GetData( $REST_URL ) \n{ \n $options = array( \n 'http' => array( \n 'method' => \"GET\", \n 'header' => \"Accept: application/json\\r\\n\" .\n \"User-Agent: TeleHeater/2.2.3\\r\\n\" \n ) \n ); \n $context = stream_context_create( $options ); \n $content = @file_get_contents( \n 'http://' . km200_gateway_host . ':' . km200_gateway_port . $REST_URL, \n false, \n $context \n );\n\n if ( false === $content ) \n return false; \n return json_decode( \n km200_Decrypt( \n $content \n ) \n ); \n}", "abstract function getPairsFromAPI();", "public function getResponseCallFunc(): string;", "function GetAPIResponse($url, $jsonbody) {\n\t$ch = curl_init();\n\tcurl_setopt($ch,CURLOPT_URL, $url);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); \n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\n\tcurl_setopt($ch,CURLOPT_RETURNTRANSFER, true);\n\tcurl_setopt($ch,CURLOPT_CONNECTTIMEOUT, 10);\n\tcurl_setopt($ch,CURLOPT_TIMEOUT, 20);\n\n\tif($jsonbody) {\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $jsonbody);\n\t}\n\n\t$response = curl_exec($ch);\n\tcurl_close ($ch);\n\treturn $response;\n}", "public function index()\n {\n $client = new Client();\n $kirim = $client->get(env('API_URL').'/rangkumannilai');\n return $kirim->getBody(); \n }", "function api_status()\n{\n $result;\n return _do_api_call('GET', '/api/v1/status', null, $result);\n}", "public function getResponse(){\n \n return $this->response;\n \n }", "public function getResponse($response) {\r\n\r\n\r\n }", "private function getData(){\n if($this->type == \"auto\"){\n \n \n $result = $this->get_from_link( self::AUTO_STRING.http_build_query($this->data));\n $array_names = json_decode($result, true); \n //var_dump($array_names); \n if(!isset($array_names)){\n $this->serverSideError(); \n }\n $ans = array(); \n \n foreach($array_names[\"predictions\"] as $key => $value){\n array_push($ans, $value[\"description\"]); \n }\n \n $response['status_code_header'] = 'HTTP/1.1 200 OK'; \n $response['body'] = json_encode($ans); \n \n return $response; \n }\n\n else if($this->type == \"geocode\"){\n \n\n //echo() $this->data); \n $result = $this->get_from_link( self::GEOCODE_STRING.http_build_query($this->data));\n // echo $result; \n $array = json_decode($result, true); \n if(!isset($array)){\n $this->serverSideError(); \n }\n \n $response['status_code_header'] = 'HTTP/1.1 200 OK'; \n $response['body'] = json_encode( $array[\"results\"][0][\"geometry\"][\"location\"]); \n \n return $response; \n }\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}", "public function getRawResponse();", "public function getResponse(): ResponseInterface;", "public function getResponse(): ResponseInterface;", "public function getResponse(): string\n {\n return $this->response;\n }", "public function get_response()\n\t{\n\t\treturn $this->response;\n\t}", "public function get_response()\n\t{\n\t\treturn $this->response;\n\t}", "public function getrequest()\n {\n $request = User::getrequest();\n return result::repsonse(true,$request);\n }", "public function getResponse()\n {\n return $this->get('response');\n }", "public function getResponse()\n {\n return $this->get('response');\n }", "function getProducts() {\n\techo \"Getting Products </br>\";\n\t$response = getRequest('/api/product');\n\tprintInfo($response);\n}", "function get_cities()\n{\n $url = set_url('cities');\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 = curl_exec($cURLConnection);\n curl_close($cURLConnection);\n print_r($apiResponse);\n exit;\n}", "public static function _call_get($url){\n $curl = curl_init();\n // Set curl opt as array\n curl_setopt_array($curl, array(\n CURLOPT_URL => $url,\n // No more than 30 sec on a website\n CURLOPT_TIMEOUT=>10,\n CURLOPT_FOLLOWLOCATION => true,\n CURLOPT_RETURNTRANSFER => true,\n ));\n // Run curl\n $response = curl_exec($curl);\n //Check for errors \n if(curl_errno($curl)){\n $errorMessage = curl_error($curl);\n $statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n // Log error message .\n $return = array('success'=>FALSE,'error'=>$errorMessage,'status'=>$statusCode);\n } else {\n $statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n // Log success\n $return = array('success'=>TRUE,'response'=>$response,'status'=>$statusCode);\n }\n //close request\n curl_close($curl);\n //Return\n return $return;\n }", "public function getApiCall(string $url) {\n // Guzzle request.\n try {\n $call = $this->httpClient->request('GET', $url);\n $code = $call->getStatusCode();\n if ($code == 200) {\n $content = $call->getBody()->getContents();\n $content = mb_convert_encoding($content, 'UTF-8', 'UTF-16LE');\n if (!empty($content)) {\n $content = json_decode($content, TRUE);\n return $content;\n }\n else {\n drupal_set_message(t('no content found'), 'error', FALSE);\n return FALSE;\n }\n }\n }\n catch (Exception $e) {\n drupal_set_message(t('SERVICE ERROR'), 'error', FALSE);\n return FALSE;\n }\n\n }", "public function fetchData()\n {\n // TODO Build URI and add PARAMS, METHODS, API TOKEN etc...\n // TODO Handle POST, GET requests using curl\n // TODO Authentication\n $path = $this->endpoint;\n return json_decode(file_get_contents($path, true));\n }", "function tfnm_call_api( $api_key, $api_url ){\n\n\t$header_args = array();\n\n\tif( !empty( $api_key ) ){\n\t\t$header_args = array(\n\t\t\t'user-agent' => '',\n\t\t\t'headers' => array(\n\t\t\t\t'authorization' => 'Bearer ' . $api_key\n\t\t\t)\n\t\t);\n\t}\n\n\t$response = wp_safe_remote_get( $api_url, $header_args );\n\n\t// Error proofing\n\tif ( is_wp_error( $response ) ) {\n\t\treturn 'There was an error in response. Please contact the administrator.';\n\t}\n\n\t// Doing some data clean up before returning.\n\tif( !empty( $response['body'] ) ){\n\t\t$response = json_decode( $response['body'] );\n\t}\n\n\treturn $response;\n}", "public function getInnerResponse();", "function get_response($url, $headers) {\r\n $ch = curl_init();\r\n curl_setopt($ch, CURLOPT_URL, $url);\r\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\r\n curl_setopt($ch, CURLOPT_HEADER, false);\r\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n $response = curl_exec($ch);\r\n curl_close($ch);\r\n return $response;\r\n }", "function get_api_info() {\n $response = $this->api_query(array('mode' => 'api_info'));\n\n if ($response['error']) {\n return false;\n }\n return ($response['data']);\n }", "public function get()\n\t{\n\t\t$response = $this->builder->get( $this->buildParameters(), $this->buildUrlAdditions() );\n\n\t\treturn $response;\n\t}", "function get_rest_api($api_url = '')\n{\n try {\n // url\n $url = $api_url;\n\n // init\n $curl = curl_init();\n // execute rest\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n \n // save data \n $response = curl_exec($curl); \n\n // close connection\n curl_close($curl);\n\n return $response;\n\n } catch (\\Throwable $th) {\n //throw $th;\n }\n}", "public function getApiResponse($queryString)\n {\n \\error_log('CallGoogleApi:: getApiResponse($queryString)');\n return \\json_decode(\\json_encode(\\json_decode(\\file_get_contents($queryString))), true);\n }", "protected function getResponse()\n {\n return $this->response;\n }", "function getRequest($url) {\n // url to GET info for this table\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n $output = curl_exec($ch);\n if (curl_errno($ch)) { // Check if any error occurred\n echo 'Curl error: ' . curl_error($ch);\n }\n curl_close($ch); // close curl resource to free up system resources\n $res = json_decode($output, true); // json to array\n return $res;\n }", "public function index()\n {\n $client = new Client(['base_uri' => 'http://127.0.0.1:8000/api/skorpoint']);\n $request = $client->request('GET');\n // $response = json_decode($request->getBody());\n // echo $response[0]->id;\n $response = $request->getBody();\n return $response;\n }", "function callJsonApi($url) {\n $response = callApi($url);\n $jsonResponse = false;\n if ($response === false) {\n echo \"Failed to \".$action.\" : \" . curl_error ( $ch );\n } else {\n $jsonResponse = json_decode ( $response );\n if (! isset ( $jsonResponse->success )) {\n echo \"Failed to $url : $response\";\n } else if (! $jsonResponse->success) {\n echo \"Failed to $url : $jsonResponse->code - $jsonResponse->message\";\n }\n }\n return $jsonResponse;\n}", "function responseApi(Array $req)\n{\n\treturn json_encode(callApiRequest($req));\n}", "public function getApiData();", "public static function getUserAPI();", "function get($url, $parameters = array()) {\n\t\t$response = $this->oAuthRequest($url, 'GET', $parameters);\n\t\tif ($this->type == 'json' && $this->decode_json) {\n\t\t\treturn json_decode($response);\n\t\t}elseif($this->type == 'xml' && function_exists('simplexml_load_string')){\n\t\t\treturn simplexml_load_string($response);\n\t\t}\n\t\treturn $response;\n\t}", "private function call_api_get($api_url) {\n set_time_limit(30);\n $urlrequest = $api_url;\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $urlrequest);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_TIMEOUT, 15);\n $result = curl_exec($ch);\n $err_msg = \"\";\n\n if ($result === false)\n $err_msg = curl_error($ch);\n\n //var_dump($result);\n //die;\n curl_close($ch);\n return $result;\n }", "private function call_api_get($api_url) {\n set_time_limit(30);\n $urlrequest = $api_url;\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $urlrequest);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_TIMEOUT, 15);\n $result = curl_exec($ch);\n $err_msg = \"\";\n\n if ($result === false)\n $err_msg = curl_error($ch);\n\n //var_dump($result);\n //die;\n curl_close($ch);\n return $result;\n }" ]
[ "0.7934904", "0.7934904", "0.7934904", "0.7934904", "0.7934904", "0.7934904", "0.7934904", "0.7934904", "0.7934904", "0.7934904", "0.7934904", "0.79156154", "0.78306293", "0.78306293", "0.77079874", "0.77079874", "0.74272263", "0.7319441", "0.7278643", "0.72320795", "0.7122635", "0.7071417", "0.70009255", "0.69681275", "0.69633865", "0.69581455", "0.6951443", "0.6941548", "0.6933603", "0.6926244", "0.68994546", "0.68923396", "0.68810564", "0.6833789", "0.68024117", "0.67718244", "0.67559224", "0.675125", "0.67502415", "0.67156476", "0.67103785", "0.66841733", "0.66649395", "0.6657747", "0.6655613", "0.6649731", "0.6648376", "0.6642885", "0.6628602", "0.6622005", "0.66142464", "0.66142464", "0.66142464", "0.6612896", "0.658902", "0.658093", "0.65613383", "0.65467393", "0.6538173", "0.6517749", "0.6514554", "0.65079784", "0.650163", "0.64988315", "0.6491815", "0.6490066", "0.6480916", "0.6477019", "0.64732945", "0.64730424", "0.6470734", "0.64704496", "0.64704496", "0.64604205", "0.64470357", "0.64470357", "0.6440479", "0.6436739", "0.6436739", "0.64237744", "0.6422287", "0.6415556", "0.63970745", "0.6388119", "0.63872796", "0.63683164", "0.63664746", "0.63664424", "0.6350022", "0.63448274", "0.6340608", "0.63401747", "0.6329328", "0.63213617", "0.6321186", "0.6321033", "0.6310234", "0.63055146", "0.6297737", "0.6287969", "0.6287969" ]
0.0
-1
Function used to get response code
public function getResponseCode() { return $this->response_code; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getResponseCode();", "public function getResponseCode();", "function getStatusCode();", "public static function getStatusCode(): int;", "public function getResponseCode(){\n\t\treturn $this->response->getCode();\n\t}", "public function get_response_code() {\n return $this->response_code;\n }", "public function getResponseCode()\n {\n }", "function http_headers_get_response_code() {\n\t\treturn $this->http_response_code;\n\t}", "public function getResponseCode()\r\n {\r\n return $this->responseCode;\r\n }", "public function getStatusCode(): int;", "public function getStatusCode(): int;", "public function getStatusCode(): int;", "public function getStatusCode(): int;", "public function getResponseCode()\r\n {\r\n return $this->getData('response_code');\r\n }", "public function getStatusCode();", "public function getStatusCode();", "public function getStatusCode();", "public function getStatusCode();", "public function getStatusCode();", "public function getStatusCode();", "public function getStatusCode();", "public function getStatusCode();", "public function getStatusCode();", "public function getStatusCode();", "public function getResponseCode() {\n return $this->response_code;\n }", "public function getResponseCode()\n {\n return $this->responseCode;\n }", "public function getCode()\n {\n return $this->response_code;\n }", "function get_http_response_code()\n\t{\n\t\t//最后一个收到的HTTP代码\n\t\treturn curl_getinfo($this->ch, CURLINFO_HTTP_CODE);\n\t}", "protected function _getCode()\n {\n // filter code from response\n return (int)substr($this->_getServerResponse(), 0, 3);\n }", "function responseCode() {\n return $this->responseCode;\n }", "function getHttpCode();", "public function getStatusCode() {}", "function get_response_code($header) {\r\n\t$parts = explode(\"\\r\\n\", $header);\r\n\treturn $part[0];\r\n}", "function getStatusCode($response){\n\tif(preg_match(\"~HTTP/1\\.1 (\\d+)~\", $response, $match)){\n\t\treturn $match[1];\n\t}\n\n\t_log(\"getStatusCode: invalid response from server\", true);\n\treturn false;\n}", "public function getResponseCode() {\n return $this->response->getResponseCode();\n }", "protected final function responseCode(): int\n {\n return $this->responseCode;\n }", "public function getStatusCode(){\n return $this->httpResponseCode;\n }", "public function getCode()\n {\n return curl_getinfo($this->handler)['http_code'];\n }", "public function getStatusCode(): int\n {\n return $this->code ;\n }", "public function getCode()\n\t{\n\t\treturn (int)$this->statusCode;\n\t}", "public function code() {\n return $this->info['http_code'];\n }", "public function getResponseHTTPCode()\n {\n return $this->httpCode;\n }", "function get_http_response_code($url) {\n $headers = get_headers($url);\n return substr($headers[0], 9, 3);\n\t}", "public function getStatusCode()\n {\n }", "public function getResponseStatusCode()\n {\n return $this->responseCode;\n }", "public function getCode()\n\t{\n\t\t$matches = array();\n\t\tif (isset($this->headers) && isset($this->headers[0]))\n\t\t\tpreg_match('|HTTP/\\d\\.\\d\\s+(\\d+)\\s+.*|', $this->headers[0], $matches);\n\t\treturn isset($matches[1]) ? (int)$matches[1] : 0;\n\t}", "public function getResponseCode() {\n return nullInt($this->settings['status'], 200);\n }", "function get_http_response_code($url) {\n $headers = get_headers($url);\n return substr($headers[0], 9, 3);\n}", "#[Pure]\n public function getResponseCode() {}", "#[Pure]\n public function getResponseCode() {}", "public static function getStatus() {\n\t\treturn http_response_code();\n\t}", "function http_response_code($response_code = 0) { \r\n \r\n if($response_code)\r\n Pancake\\vars::$Pancake_request->answerCode = $response_code;\r\n return Pancake\\vars::$Pancake_request->answerCode;\r\n }", "public function getResponseStatusCode()\r\n\t{\r\n\t\treturn (int) $this->statusCode;\r\n\t}", "public function getStatusCode()\n {\n return \\http_response_code();\n }", "public function getResponseCode() {\n return $this->client->getHttpStatusCode();\n }", "function statusCode()\n {\n }", "public function getStatusCode()\n {\n return (int) $this->getReturnVal();\n }", "public function getStatusCode(): int\n {\n return (int) $this->response->getStatusCode();\n }", "public function getStatusCode()\r\n\t{\r\n\t\treturn $this->m_code;\r\n\t}", "public function getStatusCode(): int\n {\n return $this->response->getStatusCode();\n }", "public function getStatusCode()\n {\n \treturn $this->statusCode;\n }", "public function getStatusCode(): int\n {\n return $this->meta['status_code'];\n }", "public static function http__request__get_response_code($url ){\n return static::http__request( $url, array(), 'get_code');\n }", "function curl_code($curl) {\n return curl_info($curl, CURLINFO_HTTP_CODE);\n}", "public function getStatusCode() {\n\t\treturn $this->status['code'];\n\t}", "public function getStatusCode() {\n return $this->getResponse()->statuscode;\n }", "public function getStatusCode() {\n\n return $this->result->status_code;\n }", "public function getStatusCode()\n {\n return curl_getinfo($this->ch, CURLINFO_HTTP_CODE);\n }", "public function getHttpResponseCode()\n {\n return $this->_httpResponseCode;\n }", "private function getStatusCode()\n {\n return $this->statusCode;\n }", "function http_response_code($newcode = NULL)\n\t\t{\n\t\t\tstatic $code = 200;\n\t\t\tif($newcode !== NULL)\n\t\t\t{\n\t\t\t\theader('X-PHP-Response-Code: '.$newcode, true, $newcode);\n\t\t\t\tif(!headers_sent())\n\t\t\t\t\t$code = $newcode;\n\t\t\t}\n\t\t\treturn $code;\n\t }", "private function get_http_response_code($url)\n {\n $headers = get_headers($url);\n return substr($headers[0], 9, 3);\n }", "public function getHttpCode()\n {\n return $this->information[ self::INFORMATION_HTTP_CODE ];\n }", "public function getHttpStatus(): int\n {\n\n return http_response_code();\n\n }", "public function code()\n {\n // API Response Code\n return $this->agent->code();\n }", "public function getStatusCode()\n {\n return isset($this->headers['statusCode']) ? $this->headers['statusCode']: 500;\n }", "public function statusCode()\n {\n return $this->code;\n }", "public function getRespStatusCode()\n {\n return curl_getinfo($this->res, CURLINFO_HTTP_CODE);\n }", "public function statusCode()\n {\n return $this->meta['http_code'];\n }", "public function getStatusCode(): int\n {\n return $this->statusCode;\n }", "public function getStatusCode(): int\n {\n return $this->statusCode;\n }", "public function getStatusCode(): int\n {\n return $this->statusCode;\n }", "public function getStatusCode(): int\n {\n return $this->statusCode;\n }", "public function getStatusCode(): int\n {\n return $this->statusCode;\n }", "public function getStatusCode(): int\r\n {\r\n return $this->_statusCode;\r\n }", "public function getStatusCode()\n {\n preg_match(\"/(\\d\\d\\d)/\", $this->_status, $matches);\n return isset($matches[1]) ? (int) $matches[1] : 0;\n }", "public function getResponseStatusCode()\n {\n return $this->response_status_code;\n }", "public function getStatusCode(): int {\n\t\treturn $this->statusCode;\n\t}", "public function getStatusCode(): int {\n\t\treturn $this->statusCode;\n\t}", "public function getResponseCode()\n {\n return 200;\n }", "public function getLastResponseCode() {\n $last = $this->getLastResponse();\n if (!empty($last['code'])) {\n return $last['code'];\n }\n }", "public function getResponseStatusCode()\n {\n return $this->get('ResponseStatusCode');\n }", "public function getResponseStatusCode()\n {\n return $this->get('ResponseStatusCode');\n }", "public function getResponseStatusCode()\n {\n return $this->get('ResponseStatusCode');\n }", "public function getStatusCode() : int\n {\n return $this->statusCode;\n }", "public function getStatusCode() : int\n {\n return $this->statusCode;\n }", "public function getResponseStatusCode()\n {\n return $this->get('ResponseStatusCode');\n }", "public function getResponseStatusCode()\n {\n return $this->get('ResponseStatusCode');\n }", "public function getHttpCode()\n {\n return $this->code;\n }", "public function getStatusCode()\n {\n return $this->statusCode;\n }" ]
[ "0.91054493", "0.91054493", "0.8570893", "0.85599715", "0.8551254", "0.8487022", "0.846667", "0.842631", "0.8386322", "0.8380571", "0.8380571", "0.8380571", "0.8380571", "0.8356005", "0.83552754", "0.83552754", "0.83552754", "0.83552754", "0.83552754", "0.83552754", "0.83552754", "0.83552754", "0.83552754", "0.83552754", "0.8351313", "0.83471406", "0.8336121", "0.82547987", "0.82536227", "0.8212295", "0.814954", "0.8138735", "0.8105718", "0.8103086", "0.80920106", "0.80633605", "0.79548806", "0.7940741", "0.7939668", "0.7931159", "0.7903961", "0.7897587", "0.78936523", "0.78936046", "0.78848565", "0.7881967", "0.78788346", "0.7857769", "0.77918565", "0.77918565", "0.77902025", "0.7783309", "0.7733143", "0.7725925", "0.7704436", "0.7701001", "0.7640814", "0.76158196", "0.7606419", "0.76057005", "0.76024604", "0.7569084", "0.75673133", "0.7567258", "0.756298", "0.7558121", "0.75500196", "0.75436467", "0.75395143", "0.75341564", "0.75291187", "0.75107175", "0.75006026", "0.7498885", "0.7495267", "0.7458569", "0.74557066", "0.7436042", "0.7433954", "0.74310696", "0.74310696", "0.74310696", "0.74310696", "0.74310696", "0.74282867", "0.742632", "0.7422564", "0.7412979", "0.7412979", "0.7404563", "0.7386396", "0.73773324", "0.7376941", "0.7376941", "0.7376438", "0.7376438", "0.73756725", "0.73756725", "0.73656285", "0.7357229" ]
0.8409789
8